vim: speichere als root

This commit is contained in:
Michael Grote 2021-12-07 09:49:15 +01:00
parent 775130e388
commit c0de4100bd

7
.vimrc
View file

@ -114,10 +114,6 @@ let g:lightline = {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
" https://shapeshed.com/vim-statuslines/
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
" ### vim startify
" returns all modified files of the current git repo
@ -173,6 +169,9 @@ nnoremap cp :cp<CR>
nnoremap <Leader>sc :ShellCheck!<CR>
" ### markdown-preview
nnoremap <Leader>m :MarkdownPreviewToggle<CR>
" speichere Datei als root mit :w!!
" https://unix.stackexchange.com/questions/71109/how-can-i-exit-from-read-only-mode-in-vim
cmap w!! w !sudo tee % > /dev/null
" ### Abbreviations