Browse Source

Cleaning up and adjusting Airline

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

30
nvim/init.vim

@ -3,8 +3,13 @@ color molokai
let g:rehash256 = 1
" }}}
" Mappings {{{
nnoremap - :Ex<CR>
" Functions {{{
" Removes trailing spaces {{{{
function TrimWhiteSpace()
%s/\s+$//
''
endfunction
" }}}}
" }}}
" Settings for all files {{{
@ -13,13 +18,20 @@ 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
let mapleader = " " " Leader (special character for plugins) is Space
" }}}
" Mappings {{{
nnoremap - :Ex<CR>
map <Leader>c <silent> :call TrimWhiteSpace()<CR>
" }}}
" 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'
" }}}}
" }}}
@ -41,6 +53,7 @@ augroup python
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 <buffer> %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 {{{{

Loading…
Cancel
Save