From b24720c4a3fd021bee1810b556ea8825fd21170b Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Wed, 16 Sep 2020 16:02:31 -0300 Subject: [PATCH] Cleaning up and adjusting Airline --- nvim/init.vim | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index f8340cb..51e18e1 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -3,8 +3,13 @@ color molokai let g:rehash256 = 1 " }}} -" Mappings {{{ -nnoremap - :Ex +" Functions {{{ +" Removes trailing spaces {{{{ +function TrimWhiteSpace() + %s/\s+$// + '' +endfunction +" }}}} " }}} " Settings for all files {{{ @@ -12,14 +17,21 @@ set cursorline " highlight the line in which the cursor is set foldmethod=marker " folding will use markers set nowrap " instead of wrapping the text to the next line, scroll left and right set laststatus=2 " Always display the status line -set showtabline=2 " Always display the tab bar +set showtabline=2 " Always display the tab bar +let mapleader = " " " Leader (special character for plugins) is Space +" }}} + +" Mappings {{{ +nnoremap - :Ex +map c :call TrimWhiteSpace() " }}} " Plugin configuration {{{ " Airline {{{{ -let g:airline#extensions#tabline#formatter = 'unique_tail' -let g:airline#extensions#tabline#enabled = 1 let g:airline_theme='minimalist' +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#show_buffers = 0 +let g:airline#extensions#tabline#formatter = 'unique_tail' " }}}} " }}} @@ -34,13 +46,14 @@ augroup END " Python {{{{ augroup python - au FileType python setlocal number " show line numbers - au FileType python setlocal expandtab " use spaces instead of tabs - au FileType python setlocal tabstop=4 " number of spaces to use for indentation - au FileType python setlocal shiftwidth=4 " number of spaces to use for auto-indentation - au FileType python setlocal softtabstop=4 " when deleting characters, consider 4 spaces as a tab - au FileType python setlocal textwidth=79 " max line size - au FileType python setlocal colorcolumn=80 " put a margin indicator + au FileType python setlocal number " show line numbers + au FileType python setlocal expandtab " use spaces instead of tabs + au FileType python setlocal tabstop=4 " number of spaces to use for indentation + au FileType python setlocal shiftwidth=4 " number of spaces to use for auto-indentation + au FileType python setlocal softtabstop=4 " when deleting characters, consider 4 spaces as a tab + au FileType python setlocal textwidth=79 " max line size + au FileType python setlocal colorcolumn=80 " put a margin indicator + au FileType python au BufWritePre %s/\s\+$//e " When saving a Python file, remove tailing spaces " Shortcut to add pylint disables au FileType python iab pylint # pylint: disable @@ -54,12 +67,9 @@ augroup END " }}}} " Rust {{{{ -let g:rustfmt_autosave = 1 " Apply `rustfmt` when saving the file. - " Because this is related to - " the syntax file and not - " something on the buffer - " itself, we can set it - " globally. +" Apply `rustfmt` when saving the file. Because this is related to the syntax +" file and not something on the buffer itself, we can set it globally. +let g:rustfmt_autosave = 1 " }}}} " Markdown {{{{