summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2022-04-10 13:09:05 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2022-04-10 13:09:05 +0200
commita77a213ccf81231b3c3572fa37f315ba11cb4af0 (patch)
tree2f051405ce5f4d9d383bf201610dbe594ccb68a8
parentaecb8c8cab4583d656b65b46ede76b4c5e34359c (diff)
nvim: some extra functionality
-rw-r--r--nvim/nvim/init.vim17
1 files changed, 15 insertions, 2 deletions
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 <F2> :call TrimWhiteSpace()<CR>
inoremap <F2> <ESC>:call TrimWhiteSpace()<CR>
+vnoremap <F2> :call TrimWhiteSpaceVisual()<CR>
+
+" 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