From 2a41a89d903a179df8949c99c5778a565c9868e7 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 4 Nov 2019 13:05:54 +0000 Subject: [PATCH] vim: general tidying --- vimrc | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/vimrc b/vimrc index 7b0928d..0466ad7 100644 --- a/vimrc +++ b/vimrc @@ -12,15 +12,16 @@ call plug#begin('~/.vim/plugged') Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim', Plug 'pbogut/fzf-mru.vim', - - Plug 'tpope/vim-fugitive' + " Plug 'tpope/vim-fugitive' Plug 'junegunn/gv.vim' + Plug 'jreybert/vimagit' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'scrooloose/nerdtree' Plug 'wesQ3/vim-windowswap' + Plug 'majutsushi/tagbar' " be sure to read full install instructions. this still needs " you to cd ~/.vim/plugged/YouCompleteMe @@ -78,7 +79,11 @@ set complete=.,b,u,] set wildignore+=deps/*,node_modules/*,*.sw? color desert -let g:airline_theme="papercolor" +if has("AirlineTheme") + if has("gui_running") + let g:airline_theme="papercolor" + endif +endif " enable syntax highlighting if it is supported if has("syntax") @@ -100,13 +105,7 @@ set lazyredraw set splitbelow set splitright -let g:tmux_navigator_no_mappings = 1 - -nnoremap :TmuxNavigateLeft -nnoremap :TmuxNavigateDown -nnoremap :TmuxNavigateUp -nnoremap :TmuxNavigateRight -nnoremap :TmuxNavigatePrevious +map :pop " tabbing and indent options function! TabSize (size) @@ -132,8 +131,7 @@ augroup filetype au BufRead,BufNewFile *.[ch]@@.+ set filetype=c au bufRead,BufNewFile *.cc set filetype=cpp au bufRead,BufNewFile *.cpp set filetype=cpp - " au BufRead,BufNewFile *.ex set filetype=elixir - " au BufRead,BufNewFile *.exs set filetype=elixir + au bufRead,BufNewFile *.inc set filetype=make au BufRead,BufNewFile *.eex set filetype=html augroup END @@ -142,33 +140,22 @@ augroup cppprog au BufRead,BufNewFile *.h set cindent au BufRead,BufNewFile *.cc set cindent au BufRead,BufNewFile *.cpp set cindent + call TabSize(4) augroup END -augroup dropbox - au! - au BufRead,BufNewFile ~/Dropbox/* set directory=~/tmp,/var/tmp,/tmp - au BufRead,BufNewFile Dropbox/* set directory=~/tmp,/var/tmp,/tmp - au BufRead,BufNewFile /home/paul/Dropbox/* set directory=~/tmp,/var/tmp,/tmp -augroup END - -" Turn C syntax on for C and header files augroup cprog au! au BufRead,BufNewFile *.[ch] set cindent " simulate C++ comments (sort of) and provide a means to uncomment easily map // ^i/* $a */ map \\ bhh/ *[*][/]d/[/]x?[/][*]dw - " Normal tabsizes - " call TabSize(4) + call TabSize(4) augroup END " Apply the muttrc colouring to mutt setup files: au BufNewFile,BufRead .mutt.* set ft=muttrc " Automatic typo fixing -iab Cunt Count -iab cunt count -iab LOG_LVL_NOTIFY LOG_LVL_NOTICE iab KREN_EMERG KERN_EMERG " Disable the command 'K' (keyword lookup) @@ -219,7 +206,9 @@ map @a " Set swapsync to 'nothing' - potentially more data loss (no forced write to disk " on swap write), but makes writes faster. I'm willing to take the chance. :-) -set sws= +if !has("nvim") + set sws= +endif " Set showmatch - this flashes the cursor briefly at the matching ( or { " when ) or } is entered. (If user keeps typing, cursor just pops up very @@ -315,10 +304,10 @@ map :!man " Use fzf to find files map :Files map :Files +map :Files =expand("%:p:h") nnoremap m :FZFMru - map :Ag =expand("") nnoremap f :Ag =expand("") @@ -336,6 +325,8 @@ map :only " map :cal SetSyn("c") map :syntax sync fromstart +nnoremap t :TagbarToggle + " repeat the last command on the next line (F12 is Again on Sun keyboards) map j. @@ -369,6 +360,7 @@ if has("cscope") set cscopepathcomp=2 endif set csverb + map ,scs0 :cs add cscope.out map ,fs :cs find s =expand("") map ,fg :cs find g =expand("") map ,fd :cs find d =expand("") @@ -406,5 +398,5 @@ function! ToggleWindowHorizontalVerticalSplit() endif endfunction -nnoremap wt :call ToggleWindowHorizontalVerticalSplit() +nnoremap wst :call ToggleWindowHorizontalVerticalSplit()