From b9ea238dd7e8a56b1d171cdc76e405bb2a8584dd Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 21 Feb 2018 12:18:32 +0000 Subject: Improve i3 status --- vim/.vimrc | 69 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 26 deletions(-) (limited to 'vim/.vimrc') diff --git a/vim/.vimrc b/vim/.vimrc index b8d494b..5c9d42a 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -293,13 +293,15 @@ nnoremap w :update nnoremap q :q nnoremap d :bd! -nnoremap tn :tabnew -nnoremap te :tabedit -nnoremap tl :+tabmove -nnoremap th :-tabmove -nnoremap tm :tabmove -nnoremap t0 :tabmove 0 -nnoremap t$ :tabmove +nnoremap ,bd :ls:bd + +nnoremap ,tn :tabnew +nnoremap ,te :tabedit +nnoremap ,tl :+tabmove +nnoremap ,th :-tabmove +nnoremap ,tm :tabmove +nnoremap ,t0 :tabmove 0 +nnoremap ,t$ :tabmove nnoremap c :!rm ~/.vim/swap/\%* @@ -311,7 +313,7 @@ nnoremap goT :call system('urxvt -cd '.expand("%:p:h").' &') nnoremap gof :call system('urxvt -e vifm '.getcwd().' '.getcwd().' &') nnoremap goF :call system('urxvt -e vifm '.expand("%:p:h").' '.expand("%:p:h").' &') -nnoremap h :e %:p:s,.hpp$,.X123X,:s,.cpp$,.hpp,:s,.X123X$,.cpp, +nnoremap h :e %:p:s,.hpp$,.X123X,:s,.cpp$,.hpp,:s,.X123X$,.cpp, nnoremap Y y$ nnoremap fw :%s/\s\+$// @@ -322,12 +324,11 @@ cnoremap cnoremap cnoremap -nnoremap -nnoremap >b :BufSurfForward -nnoremap :bd! # -nnoremap >B :BufSurfForward:bd! # -nnoremap [B [b:bd! # -nnoremap ]B ]b:bd! # +" Overwrite unimpaired mappings +nnoremap [b :BufSurfBack +nnoremap ]b :BufSurfForward +nnoremap [B :BufSurfBack:bd! # +nnoremap ]B :BufSurfForward:bd! # " }}} "" Colorscheme {{{ @@ -337,30 +338,32 @@ function! SaveColo(...) execute 'AirlineTheme' a:3 execute 'colorscheme' a:2 endif - execute 'silent !echo "set background='.a:1.'" > ~/.color.vim' - execute 'silent !echo "colorscheme '.a:2.'" >> ~/.color.vim' - execute 'silent !echo "let g:airline_theme=\"'.a:3.'\"" >> ~/.color.vim' + execute 'silent !echo "set background='.a:1.'" > ~/.local/colors.vim' + execute 'silent !echo "colorscheme '.a:2.'" >> ~/.local/colors.vim' + execute 'silent !echo "let g:airline_theme=\"'.a:3.'\"" >> ~/.local/colors.vim' endfunction function! MyColo(colorscheme) - if a:colorscheme == "solarized" + if a:colorscheme == "solarized-light" call SaveColo("light","solarized","solarized") + elseif a:colorscheme == "solarized-dark" + call SaveColo("dark","solarized","solarized") elseif a:colorscheme == "seoul" call SaveColo("dark","seoul256","deus") endif endfunction -if filereadable($HOME."/.color.vim") - source ~/.color.vim -else - call MyColo("seoul") +if filereadable($HOME."/.local/colors.vim") + source ~/.local/colors.vim endif nnoremap ,c :call MyColo("") -nnoremap ,cl :call MyColo("solarized") +nnoremap ,cl :call MyColo("solarized-light") +nnoremap ,cd :call MyColo("solarized-dark") nnoremap ,cs :call MyColo("seoul") " }}} "" Autocommands {{{ augroup vimrc autocmd! - autocmd BufWritePost *vimrc,*exrc :source % + autocmd BufWritePost *vimrc,*exrc :call feedkeys(":source %\") + " autocmd BufWritePost *vimrc,*exrc :source % autocmd BufNewFile,Bufread /tmp/mutt-* setlocal tw=72 autocmd BufWritePre * \ if !isdirectory(expand(':p:h')) | @@ -377,6 +380,7 @@ augroup vimrc autocmd FileType gnuplot setlocal makeprg=gnuplot\ % autocmd FileType gnuplot setlocal commentstring=#%s autocmd FileType cpp setlocal commentstring=//%s + autocmd FileType cmake setlocal commentstring=#%s autocmd FileType freefem comp freefem autocmd FileType dirvish setlocal relativenumber autocmd FileType dirvish setlocal errorformat=%f @@ -440,11 +444,24 @@ nnoremap cog :let g:my_searchprg=(g:my_searchprg+1)%len(g:my_searchprgs nnoremap cof :let g:my_findprg=(g:my_findprg+1)%len(g:my_findprgs):echom g:my_findprgs[g:my_findprg] " }}} -"" Neovim terminal {{{ +"" Neovim {{{ if has("nvim") nnoremap goh :let @a=getcwd() \| lcd %:h \| terminal:execute 'lcd '.@aA tnoremap :bd! # nnoremap :b # \| norm A tnoremap + + tnoremap h + tnoremap j + tnoremap k + tnoremap l + inoremap h + inoremap j + inoremap k + inoremap l + nnoremap h + nnoremap j + nnoremap k + nnoremap l endif -" }}} +" }}} \ No newline at end of file -- cgit v1.2.3