Posts Tagged 'vim'

Save File With Sudo Permissions In VIM

A lot of time I open a file, make changes and when the time comes to save it realize that I hadn’t sudo’ed it. Learnt that the following command helps:

:w ! sudo tee %

Here’s the reason:

:w tells the vi to save modification of the file

! sudo tee executes the tee command with sudo permissions taking it’s input from :w

% here ...

Continue Reading ?
0

Am Lovin' vi

I have fallen in love with vi. I have started usign vi only recently. The concept was a bit difficult at first, but now I think I have got used to it. I still sometimes forget to enter the insert mode before typing, but that’ll come with practise. Also I have now learnt how to yank text, paste it and yeah also used the search and replace feature.

Below is a screen shot of ...

Continue Reading ?
0

My .vimrc File

Spurred on by my recent experiences with the vi editor, I havedecided to shift from gedit to vi. The insert, command and visual notion was a bit difficult to get hang of at the beginning, but with some practice I am getting the hang of it. There’s so many more features in it than I have used till now. It needs a bit of getting used to.

The first thing I did was to customize my .vimrc file to ...

Continue Reading ?
3