Last active
January 30, 2025 07:58
-
-
Save delorenj/46d331622f56fcbe63144004ff6ae622 to your computer and use it in GitHub Desktop.
Gruvbox theme Vim configuration with auto-installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Auto-install vim-plug if not present | |
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' | |
if empty(glob(data_dir . '/autoload/plug.vim')) | |
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
" Initialize plugin system with explicit directory | |
call plug#begin('~/.vim/plugged') | |
" Install Gruvbox theme | |
Plug 'morhetz/gruvbox' | |
" Add gptme.vim plugin | |
Plug '[email protected]:ErikBjare/gptme.vim' | |
" Initialize plugin system | |
call plug#end() | |
" Enable syntax highlighting | |
syntax on | |
" Enable file type detection | |
filetype plugin indent on | |
" Set basic vim options | |
set autoindent | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab | |
set ruler | |
set laststatus=2 | |
" Enable true color support if available | |
if exists('+termguicolors') | |
set termguicolors | |
endif | |
" Set color scheme settings | |
set background=dark | |
let g:gruvbox_contrast_dark = 'light' | |
" Try to set colorscheme, fail silently if not installed yet | |
try | |
colorscheme gruvbox | |
catch | |
" Colorscheme not found, will be installed on first run | |
endtry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment