2024-05-07 16:38:40 -06:00
|
|
|
|
2022-01-03 12:46:34 -07:00
|
|
|
function Sudowrite()
|
|
|
|
|
execute 'w !sudo tee "%"'
|
|
|
|
|
endfunction
|
|
|
|
|
|
2024-05-07 16:38:40 -06:00
|
|
|
nnoremap <Leader><Leader>w :call Sudowrite()<CR>
|
|
|
|
|
|
2022-08-09 17:56:06 -06:00
|
|
|
function MakeFileExecutable(sudo = 0)
|
|
|
|
|
if a:sudo
|
|
|
|
|
execute '! sudo chmod +x "%"'
|
|
|
|
|
else
|
|
|
|
|
execute '! chmod +x "%"'
|
|
|
|
|
endif
|
2022-01-10 06:36:34 -07:00
|
|
|
endfunction
|
2024-05-07 16:38:40 -06:00
|
|
|
|
|
|
|
|
nnoremap <Leader><Leader>x :call MakeFileExecutable(0)<CR>
|
|
|
|
|
nnoremap <Leader><Leader>xx :call MakeFileExecutable(1)<CR>
|