diff --git a/.config/nvim/init/general.vim b/.config/nvim/init/general.vim index 09305ca..9efbb1b 100644 --- a/.config/nvim/init/general.vim +++ b/.config/nvim/init/general.vim @@ -52,7 +52,7 @@ autocmd BufRead $XDG_CONFIG_HOME/yadm/bootstrap setlocal filetype=sh " shebang shortcut - https://www.reddit.com/r/vim/comments/4z7z7s/add_shebang_lines_to_your_vim_files_automatically/d6v7op8 and https://stackoverflow.com/a/52135425 inoreabbrev #!! "#!/usr/bin/env" . (empty(&filetype) ? '' : ' '.&filetype) -autocmd BufNewFile *.sh,$HOME/.local/bin/* execute 'silent! 1s/.*/#!\/bin\/sh\r# '| setlocal filetype=sh | :startinsert +autocmd BufNewFile *.sh,$HOME/.local/bin/* execute 'silent! 1s/.*/#!\/bin\/sh -e\r# '| setlocal filetype=sh | :startinsert "autocmd BufNewFile * if !empty(&filetype) | execute 'silent! 1s/.*/#!\/usr\/bin\/' . &filetype . '\r\r'| :startinsert | endif set spelllang=en_us,de_de diff --git a/.config/nvim/init/keys.vim b/.config/nvim/init/keys.vim index 35d4b90..3ed7263 100644 --- a/.config/nvim/init/keys.vim +++ b/.config/nvim/init/keys.vim @@ -21,6 +21,16 @@ noremap q: " Alias replace all to S nnoremap S :%s//gI +" TODO first only open current one +function FoldCycle() + if &foldlevel + :normal zm + else + :normal zR + endif +endfunction +nnoremap :call FoldCycle() + " Jump around without shift nnoremap gl $ nnoremap gh 0