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 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
""""""""""""""""""""""""""""""""""""""""""""""""""
" Do not use spaces instead of tabs
@ -153,6 +139,19 @@ autocmd BufWritePre * %s/\s\+$//e
"""""""""""""""""""""""""""""""""""""""""""""""""""
"Always show the status line
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
""""""""""""""""""""""""""""""""""""""""""""""""""
@ -160,8 +159,8 @@ set laststatus=2
noremap <leader>s :source ~/.config/nvim/init.vim <CR>
" Circle through buffers
noremap <leader>n :bn
noremap <leader>p :bp
noremap <leader>n :bn<CR>
noremap <leader>p :bp<CR>
" Clear the search highlight
noremap <leader>q :nohl<CR>

View File

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