vim: general tidying
This commit is contained in:
48
vimrc
48
vimrc
@@ -12,15 +12,16 @@ call plug#begin('~/.vim/plugged')
|
|||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||||
Plug 'junegunn/fzf.vim',
|
Plug 'junegunn/fzf.vim',
|
||||||
Plug 'pbogut/fzf-mru.vim',
|
Plug 'pbogut/fzf-mru.vim',
|
||||||
|
" Plug 'tpope/vim-fugitive'
|
||||||
Plug 'tpope/vim-fugitive'
|
|
||||||
Plug 'junegunn/gv.vim'
|
Plug 'junegunn/gv.vim'
|
||||||
|
Plug 'jreybert/vimagit'
|
||||||
|
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
|
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'wesQ3/vim-windowswap'
|
Plug 'wesQ3/vim-windowswap'
|
||||||
|
Plug 'majutsushi/tagbar'
|
||||||
|
|
||||||
" be sure to read full install instructions. this still needs
|
" be sure to read full install instructions. this still needs
|
||||||
" you to cd ~/.vim/plugged/YouCompleteMe
|
" you to cd ~/.vim/plugged/YouCompleteMe
|
||||||
@@ -78,7 +79,11 @@ set complete=.,b,u,]
|
|||||||
set wildignore+=deps/*,node_modules/*,*.sw?
|
set wildignore+=deps/*,node_modules/*,*.sw?
|
||||||
|
|
||||||
color desert
|
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
|
" enable syntax highlighting if it is supported
|
||||||
if has("syntax")
|
if has("syntax")
|
||||||
@@ -100,13 +105,7 @@ set lazyredraw
|
|||||||
set splitbelow
|
set splitbelow
|
||||||
set splitright
|
set splitright
|
||||||
|
|
||||||
let g:tmux_navigator_no_mappings = 1
|
map <C-T> :pop<CR>
|
||||||
|
|
||||||
nnoremap <silent> <c-left> :TmuxNavigateLeft<cr>
|
|
||||||
nnoremap <silent> <c-right> :TmuxNavigateDown<cr>
|
|
||||||
nnoremap <silent> <c-up> :TmuxNavigateUp<cr>
|
|
||||||
nnoremap <silent> <c-down> :TmuxNavigateRight<cr>
|
|
||||||
nnoremap <silent> <c-f2> :TmuxNavigatePrevious<cr>
|
|
||||||
|
|
||||||
" tabbing and indent options
|
" tabbing and indent options
|
||||||
function! TabSize (size)
|
function! TabSize (size)
|
||||||
@@ -132,8 +131,7 @@ augroup filetype
|
|||||||
au BufRead,BufNewFile *.[ch]@@.+ set filetype=c
|
au BufRead,BufNewFile *.[ch]@@.+ set filetype=c
|
||||||
au bufRead,BufNewFile *.cc set filetype=cpp
|
au bufRead,BufNewFile *.cc set filetype=cpp
|
||||||
au bufRead,BufNewFile *.cpp set filetype=cpp
|
au bufRead,BufNewFile *.cpp set filetype=cpp
|
||||||
" au BufRead,BufNewFile *.ex set filetype=elixir
|
au bufRead,BufNewFile *.inc set filetype=make
|
||||||
" au BufRead,BufNewFile *.exs set filetype=elixir
|
|
||||||
au BufRead,BufNewFile *.eex set filetype=html
|
au BufRead,BufNewFile *.eex set filetype=html
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
@@ -142,33 +140,22 @@ augroup cppprog
|
|||||||
au BufRead,BufNewFile *.h set cindent
|
au BufRead,BufNewFile *.h set cindent
|
||||||
au BufRead,BufNewFile *.cc set cindent
|
au BufRead,BufNewFile *.cc set cindent
|
||||||
au BufRead,BufNewFile *.cpp set cindent
|
au BufRead,BufNewFile *.cpp set cindent
|
||||||
|
call TabSize(4)
|
||||||
augroup END
|
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
|
augroup cprog
|
||||||
au!
|
au!
|
||||||
au BufRead,BufNewFile *.[ch] set cindent
|
au BufRead,BufNewFile *.[ch] set cindent
|
||||||
" simulate C++ comments (sort of) and provide a means to uncomment easily
|
" simulate C++ comments (sort of) and provide a means to uncomment easily
|
||||||
map // ^i/* <ESC>$a */<ESC>
|
map // ^i/* <ESC>$a */<ESC>
|
||||||
map \\ bhh/ *[*][/]<CR>d/[/]<CR>x?[/][*]<CR>dw
|
map \\ bhh/ *[*][/]<CR>d/[/]<CR>x?[/][*]<CR>dw
|
||||||
" Normal tabsizes
|
call TabSize(4)
|
||||||
" call TabSize(4)
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Apply the muttrc colouring to mutt setup files:
|
" Apply the muttrc colouring to mutt setup files:
|
||||||
au BufNewFile,BufRead .mutt.* set ft=muttrc
|
au BufNewFile,BufRead .mutt.* set ft=muttrc
|
||||||
|
|
||||||
" Automatic typo fixing
|
" Automatic typo fixing
|
||||||
iab Cunt Count
|
|
||||||
iab cunt count
|
|
||||||
iab LOG_LVL_NOTIFY LOG_LVL_NOTICE
|
|
||||||
iab KREN_EMERG KERN_EMERG
|
iab KREN_EMERG KERN_EMERG
|
||||||
|
|
||||||
" Disable the command 'K' (keyword lookup)
|
" Disable the command 'K' (keyword lookup)
|
||||||
@@ -219,7 +206,9 @@ map <C-CR> @a
|
|||||||
|
|
||||||
" Set swapsync to 'nothing' - potentially more data loss (no forced write to disk
|
" 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. :-)
|
" 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 {
|
" Set showmatch - this flashes the cursor briefly at the matching ( or {
|
||||||
" when ) or } is entered. (If user keeps typing, cursor just pops up very
|
" when ) or } is entered. (If user keeps typing, cursor just pops up very
|
||||||
@@ -315,10 +304,10 @@ map <F1> :!man <cword><CR>
|
|||||||
" Use fzf to find files
|
" Use fzf to find files
|
||||||
map <F2> :Files<CR>
|
map <F2> :Files<CR>
|
||||||
map <C-P> :Files<CR>
|
map <C-P> :Files<CR>
|
||||||
|
map <C-S-P> :Files <C-R>=expand("%:p:h")<CR>
|
||||||
|
|
||||||
nnoremap <silent> <leader>m :FZFMru<CR>
|
nnoremap <silent> <leader>m :FZFMru<CR>
|
||||||
|
|
||||||
|
|
||||||
map <F3> :Ag <C-R>=expand("<cword>")<CR><CR>
|
map <F3> :Ag <C-R>=expand("<cword>")<CR><CR>
|
||||||
nnoremap <leader>f :Ag <C-R>=expand("<cword>")<CR><CR>
|
nnoremap <leader>f :Ag <C-R>=expand("<cword>")<CR><CR>
|
||||||
|
|
||||||
@@ -336,6 +325,8 @@ map <F9> :only<CR>
|
|||||||
" map <F11> :cal SetSyn("c")<CR>
|
" map <F11> :cal SetSyn("c")<CR>
|
||||||
map <F11> :syntax sync fromstart<CR>
|
map <F11> :syntax sync fromstart<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>t :TagbarToggle<CR>
|
||||||
|
|
||||||
" repeat the last command on the next line (F12 is Again on Sun keyboards)
|
" repeat the last command on the next line (F12 is Again on Sun keyboards)
|
||||||
map <F12> j.
|
map <F12> j.
|
||||||
|
|
||||||
@@ -369,6 +360,7 @@ if has("cscope")
|
|||||||
set cscopepathcomp=2
|
set cscopepathcomp=2
|
||||||
endif
|
endif
|
||||||
set csverb
|
set csverb
|
||||||
|
map ,scs0 :cs add cscope.out<CR>
|
||||||
map ,fs :cs find s <C-R>=expand("<cword>")<CR><CR>
|
map ,fs :cs find s <C-R>=expand("<cword>")<CR><CR>
|
||||||
map ,fg :cs find g <C-R>=expand("<cword>")<CR><CR>
|
map ,fg :cs find g <C-R>=expand("<cword>")<CR><CR>
|
||||||
map ,fd :cs find d <C-R>=expand("<cword>")<CR><CR>
|
map ,fd :cs find d <C-R>=expand("<cword>")<CR><CR>
|
||||||
@@ -406,5 +398,5 @@ function! ToggleWindowHorizontalVerticalSplit()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap <silent> <leader>wt :call ToggleWindowHorizontalVerticalSplit()<cr>
|
nnoremap <silent> <leader>wst :call ToggleWindowHorizontalVerticalSplit()<cr>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user