New Sudosave dedicated command

This commit is contained in:
Jeremy Gardais 2023-02-01 10:55:05 +01:00
parent f8f50b4745
commit 11ecf1c17c
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 5 additions and 3 deletions

8
vimrc
View File

@ -136,8 +136,9 @@ map <leader>k <C-w>k
map <leader>l <C-w>l
" Save with sudo permissions
nmap <leader>s :w !sudo tee %<cr>
imap <leader>s <esc>:w !sudo tee %<cr>
command! Sudosave :execute ':silent w !sudo tee % > /dev/null' | :edit!
nmap <leader>s :Sudosave<cr>
imap <leader>s <esc>:Sudosave<cr>
""""""""""""""""""""""""""""""""""""""""""""""""
" UN PEU D'EXERCICE
@ -945,7 +946,8 @@ au BufWritePost * call ModeChange()
" Display '␠' to mark extra white space at the end of a line
" Display '⎵' to mark nbsp (fixed spaces,…)
set list
set listchars=eol:⏎,nbsp:⎵,tab:▸·,extends:>,precedes:<,trail:␠
"set listchars=eol:⏎,nbsp:⎵,tab:▸·,extends:>,precedes:<,trail:␠
set listchars=nbsp:⎵,tab:▸·,extends:>,precedes:<,trail:␠
" Afficher les espaces superflus en gris clair
highlight ExtraWhitespace ctermbg=darkgray guibg=lightred
match ExtraWhitespace /\s\+$/