Quite often I’ll open up several different file in the vim buffer to be edited.
~$ vim `grep -l v1.2r5 *.pl`
Commands like that can save you a lot of time searching through files looking for a single value or word.
How many files did that load into Vim’s buffer? Check with:
:ls
Let’s say grep found three files and [...]
I haven’t posted a trick in a while, so here’s a good one to know.
Ever start working on a file in command mode and then hit the caps key without realizing it. Wham! All sorts of un-expected things can happen before you know it. What do you do then? You could use q! to exit [...]
This is a pretty cool little feature. I am not sure how often it will come into play, but I like it and I thought I would share it.
To edit a file on a remote machine that you have ssh access to, do this:
vim scp://remote_host//filename
Simple as that. Supported protocols are: scp, sftp, ftp and http [...]
Repetitive tasks can be annoying and are easily mitigated using the macro functionality in VIM.
For our simple example, let’s count 1 to 10 with each number on a new line. This will make use of the Auto-increment functionality, discussed in a previous post entitled increment/decrement numbers in VIM, which is CTRL-a and yy, which yanks the [...]
Ever have a very long shell command that when you run you realize has a mistake right in the [...]
Selecting and writing out a portion of a file into another one, or acting on it in some other way is a very handy thing to know how to do in VIM. There are many actions that you can perform, which will save you loads of time, if you just know some basics about [...]
Visual block mode is a great tool when commenting out a section of code, large or small, all at once.
Look at this section of code from a script I am writing. Let’s say I wanted to comment out everything you see.
I start with my cursor on the “%” and enter visual [...]
This is a really nice little plugin that offers common SVN commands to the user from within [...]
I have been using the # for a while now but the * is a welcome [...]
Use this as a quick way to jump to the end of [...]
Recent Comments