You are not logged in.
Hi,
I have just starting using map leaders in vim and I'm love it.
Here are my shortcuts but this method allow to open /etc/rc.conf only in readonly mode.
So how can I open this file to edit like su (when I open vim without sudo)? I have configured sudo to works without password.
" Fast editing
map <leader>v :e! ~/.vimrc<cr>
map <leader>b :e! ~/.bashrc<cr>
map <leader>r :e! /etc/rc.conf<cr>
Last edited by chmurli (2011-02-04 21:40:08)
Offline
I use
map ss :w !sudo tee % > /dev/null<CR>
when I open a file that needs 'sudo' for editing.
For some files I have aliases:
[karol@black ~]$ type rc
rc is aliased to `sudo vim /etc/rc.conf'
Last edited by karol (2011-02-03 21:45:57)
Offline
thx It's one way but I have found better one.
plugin vim-sudo is what i had need exactly
http://www.vim.org/scripts/script.php?script_id=729
Offline