diff --git a/init.vim b/init.vim index a605d48..0e95454 100644 --- a/init.vim +++ b/init.vim @@ -1,132 +1,124 @@ -if !exists('g:vscode') - " set the directory where my vimrc git project is located - source ~/.config/nvim/local.vim +" set the directory where vimrc git project is located +let vimrc_git=$HOME . "/src/vimrc" - " it is a big fat key, after all - " N.B. should come before plugins and plugin specific settings - let mapleader = "\" +" it is a big fat key, after all +" N.B. should come before plugins and plugin specific settings +let mapleader = "\" - " source aux files also under git control - let oldwd = getcwd() - exec "cd " . vimrc_git - source plug.vim - source ncm2.vim - source airline.vim - source syntastic.vim - source fzf.vim - source mapping.vim - source jsonnet.vim - source racer.vim - source lsp.vim - source autoformat.vim - source nerdtree.vim - exec "cd " . oldwd +" source aux files also under git control +let oldwd = getcwd() +exec "cd " . vimrc_git +source plug.vim +source ncm2.vim +source airline.vim +source syntastic.vim +source fzf.vim +source mapping.vim +source jsonnet.vim +source racer.vim +source lsp.vim +source autoformat.vim +source nerdtree.vim +exec "cd " . oldwd - " set up a line number on the current line but relative above and below to help - " with motion commands - set number - set relativenumber +" set up a line number on the current line but relative above and below to help +" with motion commands +set number +set relativenumber - " even with the nice space/tab autodetect, prefer 4 for tab stops - " but let file type specifics override (for instance a setting of 2 for markdown - set tabstop=4 - " default to folding on syntax - set foldmethod=syntax - " disable automatic line breaks, rely on visual wrapping instead - set textwidth=0 - " make white space visible, where that matters - set list! - " except for help - autocmd FileType help setlocal nolist - " set up folding preferences - set fde=1 - " vim's spelling is smart enough for code, to only check comments - set spell - " add a hint for long lines - set colorcolumn=120 - " default to expanding tabs, I'm not insane - set expandtab +" even with the nice space/tab autodetect, prefer 4 for tab stops +" but let file type specifics override (for instance a setting of 2 for markdown +set tabstop=4 +" default to folding on syntax +set foldmethod=syntax +" disable automatic line breaks, rely on visual wrapping instead +set textwidth=0 +" make white space visible, where that matters +set list! +" except for help +autocmd FileType help setlocal nolist +" set up folding preferences +set fde=1 +" vim's spelling is smart enough for code, to only check comments +set spell +" add a hint for long lines +set colorcolumn=120 +" default to expanding tabs, I'm not insane +set expandtab - " change buffer behaviors to no longer require changes when hiding a buffer - set hidden +" change buffer behaviors to no longer require changes when hiding a buffer +set hidden - " look for vimrc in the current director as well as $MYVIMRC - set exrc - " make looking for local changes secure - set secure - " more secure - set modelines=0 - " preserve some context - set scrolloff=3 - " make the cursor a bit easier to follows - set cursorline - " make search work a bit more like tab completion in bash - set incsearch - set wildmode=longest:full - set wildmenu - " line break handling - set linebreak - set showbreak=+ - " always on status line - set laststatus=2 +" look for vimrc in the current director as well as $MYVIMRC +set exrc +" make looking for local changes secure +set secure +" more secure +set modelines=0 +" preserve some context +set scrolloff=3 +" make the cursor a bit easier to follows +set cursorline +" make search work a bit more like tab completion in bash +set incsearch +set wildmode=longest:full +set wildmenu +" line break handling +set linebreak +set showbreak=+ +" always on status line +set laststatus=2 - " let backspace work more naturally - set backspace=start,indent,eol - " favor modern encoding - set enc=utf-8 - " more readable config for list mode - set listchars+=nbsp:¬,tab:»·,trail:· - set listchars-=eol:$ - " smarter handling of case during search - set ignorecase - set smartcase - " disable outdated data loss protections - " set nobackup - " set noswapfile - set directory=$HOME/.var/nvim/swp// - " make pastemode more accessible - set pastetoggle= - " save when moving away - au FocusLost * :wa +" let backspace work more naturally +set backspace=start,indent,eol +" favor modern encoding +set enc=utf-8 +" more readable config for list mode +set listchars+=nbsp:¬,tab:»·,trail:· +set listchars-=eol:$ +" smarter handling of case during search +set ignorecase +set smartcase +" centralize swap to have backup without clutter +set directory=$HOME/.var/nvim/swp// +" make pastemode more accessible +set pastetoggle= +" save when moving away +au FocusLost * :wa - " make sure to set TERM to xterm-256color in terminal program or app - colorscheme breezy - set background=light - set termguicolors +" make sure to set TERM to xterm-256color in terminal program or app +colorscheme breezy +set background=light +set termguicolors - " ensure autoread works, to detect file changes outside the editor - set autoread - au CursorHold * checktime +" ensure autoread works, to detect file changes outside the editor +set autoread +au CursorHold * checktime - " for gui, make it easier to tell different instances apart - set title +" for gui, make it easier to tell different instances apart +set title - " keep nvim from resetting font back to default from terminal config - set guicursor= +" keep nvim from resetting font back to default from terminal config +set guicursor= - set guioptions-=r - set guioptions-=b - set guioptions-=T - set guioptions-=m +set guioptions-=r +set guioptions-=b +set guioptions-=T +set guioptions-=m - set gfn=DejaVu\ Sans\ Mono\ for\ Powerline:h13 - " from https://stackoverflow.com/a/51424640 - let s:fontsize = 13 - function! AdjustFontSize(amount) - let s:fontsize = s:fontsize+a:amount - :execute "set gfn=DejaVu\\ Sans\\ Mono\\ for\\ Powerline:h" . s:fontsize - endfunction +set gfn=DejaVu\ Sans\ Mono\ for\ Powerline:h13 +" from https://stackoverflow.com/a/51424640 +let s:fontsize = 13 +function! AdjustFontSize(amount) + let s:fontsize = s:fontsize+a:amount + :execute "set gfn=DejaVu\\ Sans\\ Mono\\ for\\ Powerline:h" . s:fontsize +endfunction - noremap :call AdjustFontSize(1) - noremap :call AdjustFontSize(-1) - inoremap :call AdjustFontSize(1)a - inoremap :call AdjustFontSize(-1)a +noremap :call AdjustFontSize(1) +noremap :call AdjustFontSize(-1) +inoremap :call AdjustFontSize(1)a +inoremap :call AdjustFontSize(-1)a - " widen the default display of the taskwarrior plugin to make the description - " wrap less - let g:task_rc_override = 'rc.defaultwidth=120' - - " override the default location of vimwiki and change to markdown - let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}] - let g:vimwiki_dir_link = 'index' -endif +" override the default location of vimwiki and change to markdown +let g:vimwiki_list = [{'path': '~/Documents/Wiki', 'syntax': 'markdown', 'ext': '.md'}] +let g:vimwiki_dir_link = 'index'