cleanup: [nvim] statusline config + update buffer mappings

This commit is contained in:
swy7ch 2020-05-13 15:54:07 +02:00
parent e7dd076a68
commit 0dad71d5b7
2 changed files with 33 additions and 34 deletions

View File

@ -106,20 +106,6 @@ set termguicolors
" Colorscheme " Colorscheme
colorscheme polyjuice colorscheme polyjuice
" Statusline
set noshowmode
source $XDG_CONFIG_HOME/nvim/statusline.vim
augroup statusline
autocmd!
autocmd VimEnter *
\ call UpdateInactiveWindows()
autocmd VimEnter,WinEnter,BufWinEnter *
\ call RefreshStatusLine('active')
autocmd WinLeave *
\ call RefreshStatusLine('inactive')
augroup END
"" Text, tab and indent "" Text, tab and indent
"""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""
" Do not use spaces instead of tabs " Do not use spaces instead of tabs
@ -153,6 +139,19 @@ autocmd BufWritePre * %s/\s\+$//e
""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""
"Always show the status line "Always show the status line
set laststatus=2 set laststatus=2
set noshowmode
source $XDG_CONFIG_HOME/nvim/statusline.vim
augroup statusline
autocmd!
autocmd VimEnter *
\ call UpdateInactiveWindows()
autocmd VimEnter,WinEnter,BufWinEnter *
\ call RefreshStatusLine('active')
autocmd WinLeave *
\ call RefreshStatusLine('inactive')
augroup END
"" Macros "" Macros
"""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""
@ -160,8 +159,8 @@ set laststatus=2
noremap <leader>s :source ~/.config/nvim/init.vim <CR> noremap <leader>s :source ~/.config/nvim/init.vim <CR>
" Circle through buffers " Circle through buffers
noremap <leader>n :bn noremap <leader>n :bn<CR>
noremap <leader>p :bp noremap <leader>p :bp<CR>
" Clear the search highlight " Clear the search highlight
noremap <leader>q :nohl<CR> noremap <leader>q :nohl<CR>

View File

@ -1,14 +1,14 @@
function! CurrentMode() function! CurrentMode()
let g:currentmode={ let g:currentmode={
\ 'n' : '[ NORMAL ]', \ 'n' : '[ NORMAL ]',
\ 'v' : '[ VISUAL ]', \ 'v' : '[ VISUAL ]',
\ 'V' : '[ V·LINE ]', \ 'V' : '[ V·LINE ]',
\ '' : '[ V·BLOCK ]', \ '' : '[ V·BLOCK ]',
\ 'i' : '[ INSERT ]', \ 'i' : '[ INSERT ]',
\ 'R' : '[ REPLACE ]', \ 'R' : '[ REPLACE ]',
\ 'Rv' : '[ V·REPLACE ]', \ 'Rv' : '[ V·REPLACE ]',
\ 'c' : '[ COMMAND ]', \ 'c' : '[ COMMAND ]',
\} \}
return g:currentmode[mode()] return g:currentmode[mode()]
endfunction endfunction
@ -16,15 +16,15 @@ endfunction
function! ModeColor() function! ModeColor()
let g:modecolor={ let g:modecolor={
\ 'n' : '%#NormalMode#', \ 'n' : '%#NormalMode#',
\ 'v' : '%#VisualMode#', \ 'v' : '%#VisualMode#',
\ 'V' : '%#VisualMode#', \ 'V' : '%#VisualMode#',
\ '' : '%#VisualMode#', \ '' : '%#VisualMode#',
\ 'i' : '%#InsertMode#', \ 'i' : '%#InsertMode#',
\ 'R' : '%#ReplaceMode#', \ 'R' : '%#ReplaceMode#',
\ 'Rv' : '%#ReplaceMode#', \ 'Rv' : '%#ReplaceMode#',
\ 'c' : '%#CommandMode#', \ 'c' : '%#CommandMode#',
\} \}
return g:modecolor[mode()] return g:modecolor[mode()]
endfunction endfunction