Browse Source

Cleaning up and adjusting Airline

master
Julio Biason 4 years ago
parent
commit
b24720c4a3
  1. 46
      nvim/init.vim

46
nvim/init.vim

@ -3,8 +3,13 @@ color molokai
let g:rehash256 = 1 let g:rehash256 = 1
" }}} " }}}
" Mappings {{{ " Functions {{{
nnoremap - :Ex<CR> " Removes trailing spaces {{{{
function TrimWhiteSpace()
%s/\s+$//
''
endfunction
" }}}}
" }}} " }}}
" Settings for all files {{{ " 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 foldmethod=marker " folding will use markers
set nowrap " instead of wrapping the text to the next line, scroll left and right set nowrap " instead of wrapping the text to the next line, scroll left and right
set laststatus=2 " Always display the status line 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<CR>
map <Leader>c <silent> :call TrimWhiteSpace()<CR>
" }}} " }}}
" Plugin configuration {{{ " Plugin configuration {{{
" Airline {{{{ " Airline {{{{
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='minimalist' 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 {{{{ " Python {{{{
augroup python augroup python
au FileType python setlocal number " show line numbers au FileType python setlocal number " show line numbers
au FileType python setlocal expandtab " use spaces instead of tabs 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 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 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 softtabstop=4 " when deleting characters, consider 4 spaces as a tab
au FileType python setlocal textwidth=79 " max line size au FileType python setlocal textwidth=79 " max line size
au FileType python setlocal colorcolumn=80 " put a margin indicator au FileType python setlocal colorcolumn=80 " put a margin indicator
au FileType python au BufWritePre <buffer> %s/\s\+$//e " When saving a Python file, remove tailing spaces
" Shortcut to add pylint disables " Shortcut to add pylint disables
au FileType python iab pylint # pylint: disable au FileType python iab pylint # pylint: disable
@ -54,12 +67,9 @@ augroup END
" }}}} " }}}}
" Rust {{{{ " Rust {{{{
let g:rustfmt_autosave = 1 " Apply `rustfmt` when saving the file. " Apply `rustfmt` when saving the file. Because this is related to the syntax
" Because this is related to " file and not something on the buffer itself, we can set it globally.
" the syntax file and not let g:rustfmt_autosave = 1
" something on the buffer
" itself, we can set it
" globally.
" }}}} " }}}}
" Markdown {{{{ " Markdown {{{{

Loading…
Cancel
Save