-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvim.rc
25 lines (22 loc) · 1.03 KB
/
nvim.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
" This neovim config file could go here: ~/.config/nvim/init.vim
" Change color past 80 characters per line
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.\+/
" From Simon Howard at https://stackoverflow.com/questions/235439/vim-80-column-
" layout-concerns
" Show trailing blank space and remove it on write:
:highlight ExtraBlankspace ctermbg=red guibg=red
:match ExtraBlankspace /\s\+$/
:autocmd BufWinEnter * match ExtraBlankspace /\s\+$/
:autocmd InsertEnter * match ExtraBlankspace /\s\+\%#\@<!$/
:autocmd InsertLeave * match ExtraBlankspace /\s\+$/
:autocmd BufWinLeave * call clearmatches()
function! TrimTrailingBlankSpace()
%s/\s\+$//e
endfunction
:autocmd FileType txt,md,mdwn,c,cpp,java,php,ruby,python autocmd BufWritePre <buffer> :call TrimTrailingBlankSpace()
:nnoremap <silent> <F5> :call TrimTrailingBlankSpace()<CR>
" Based on Michael Durrant & l0b0 at https://stackoverflow.com/a/13795287
" and https://breezewiki.pussthecat.org/vim/wiki/Remove_unwanted_spaces
" Disable mouse.
set mouse=