From a77a213ccf81231b3c3572fa37f315ba11cb4af0 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 10 Apr 2022 13:09:05 +0200 Subject: nvim: some extra functionality --- nvim/nvim/init.vim | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'nvim') diff --git a/nvim/nvim/init.vim b/nvim/nvim/init.vim index f8a0938..9ecea93 100644 --- a/nvim/nvim/init.vim +++ b/nvim/nvim/init.vim @@ -64,7 +64,8 @@ call vundle#end() " required syntax on " Keep 10 lines of space from the cursor to the window corners -set scrolloff=10 +" I don't like this, prefer to use zz +" set scrolloff=10 " Show completion in a menu set wildmenu @@ -113,7 +114,6 @@ set foldlevelstart=99 " EDITION: """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - " Completion set complete=.,w,b,u,t,i,kspell @@ -131,9 +131,22 @@ function TrimWhiteSpace() %s/\s*$// '' :endfunction +function TrimWhiteSpaceVisual() + '<,'>s/\s*$// + '' +:endfunction " Whitexpace trimmer available in normal and edit mode nnoremap :call TrimWhiteSpace() inoremap :call TrimWhiteSpace() +vnoremap :call TrimWhiteSpaceVisual() + +" Scissors +" TODO: improve this +function AddScissors() + execute "normal i--8<---------------cut here---------------start------------->8---\n" + execute "normal i--8<---------------cut here---------------end--------------->8---\n" +:endfunction +command! Scissors execute 'call AddScissors()' " Default tabs set tabstop=4 softtabstop=0 expandtab shiftwidth=4 -- cgit v1.2.3