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
" }}}
" Mappings {{{
nnoremap - :Ex<CR>
" 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<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'
" }}}}
" }}}
@ -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 <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