summaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rwxr-xr-xnvim/init.vim14
1 files changed, 10 insertions, 4 deletions
diff --git a/nvim/init.vim b/nvim/init.vim
index ab3a9d3..e017191 100755
--- a/nvim/init.vim
+++ b/nvim/init.vim
@@ -81,14 +81,20 @@ vnoremap . :normal .<CR>
cnoremap w!! execute 'silent! write !doas tee % >/dev/null' <bar> edit!
" Capitalize every word on the line
nmap gcc :s/\v<(.)(\w*)/\u\1\L\2/g<CR>
+nmap gCC :%s/\v<(.)(\w*)/\u\1\L\2/g<CR>
+" HTML shortcuts
+nmap gwp I<p><ESC>l4xA</p><ESC>
+nmap gwh1 I<h1><ESC>l5xA</h1><ESC>
+nmap gwh2 I<h2><ESC>l5xA</h2><ESC>
+nmap gwh3 I<h3><ESC>l5xA</h3><ESC>
"" Extra functionality
" Colorscheme for root and normal users (since vimrc is just symlinked to the root user's home)
if ($USER) == 'root'
- colorscheme zellner
+ colorscheme koehler
else
if empty($DISPLAY)
- colorscheme default
+ colorscheme koehler
else
set bg=dark
let g:gruvbox_contrast_dark = 'hard'
@@ -131,8 +137,8 @@ endif
" Automatically deletes all trailing whitespace on save
function DelWS()
- :norm m`
+ let l:save_view = winsaveview()
:%s/\s*$//e
- :norm g``
+ call winrestview(l:save_view)
endfunction
autocmd BufWritePre * call DelWS()