Tips tagged vim


26

Tip #858   Making shell scripts executable via editor hooks

If you spend a lot of time creating new shell scripts then it can be very useful to make them executable by default. To do this in Vim add the following lines to the end of your ~/.vimrc file - creating it if necessary:

Read more »

8

Tip #840   Making vim oneliners

We can use vim to make changes to a file all in one command, for example

Read more »

1

Tip #835   Quickly empty a file in vi

A few quick ways to empty a file of text in vi (all of these are done in command mode):

Read more »

25

Tip #630   Sudo from vim to write file

I often open a file and start editing only to realize later that I don't have write permissions when I get the old "E212: Can't open file for writing" error.

The vim command below can be user to save the file without the need to save it to a temp file and then copy it back again.

Read more »