Showing posts with label last. Show all posts
Showing posts with label last. Show all posts
Monday, November 16, 2009
Last Insert
Hitting gi in normal mode will take you to the last location where you were in insert mode. This is great for bouncing back to where you were editing after browsing the current buffer from normal mode.
Friday, November 13, 2009
Last Directory Visited
From the shell, typing "cd -" will take you to the last directory visited. This is useful from a command-line navigation perspective and from inside of shell scripts as well.
Thursday, November 12, 2009
Last Command
Hitting "fc" from a Bash shell invokes your default editor (hopefully Vim) on your last shell command and executes it after Vim exits. This is great for command-line history editing after the fact.
-e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, then vi.
-e ENAME selects which editor to use. Default is FCEDIT, then EDITOR, then vi.
Thursday, January 15, 2009
Last Changed Text
Here are two helpful commands to get to the last changed or yanked text.
`[ - First character of previously changed or yanked text
`] - Last character of previously changed or yanked text
`[ - First character of previously changed or yanked text
`] - Last character of previously changed or yanked text
Friday, September 5, 2008
Repeat Last Command Line
To repeat the last command-line given in ex mode, you can simply enter a count followed by "@:".
Wednesday, April 30, 2008
Repeat Last Macro
There are times I want to repeat a macro just a few times. I know you can do count@{0-9a-z":*} but sometimes I don't feel like counting. You can use @@ to repeat the last macro, and it's an easy command to type very quickly, so it fits the bill.
Friday, April 11, 2008
Last Jump Location
This technique was used in the "quick uncomment" tip I posted recently, but I figured I would mention it explicitly. A lot of times when I'm editing a file, I'll set a mark at my current location because I need to do something like jump to the bottom of the file and change something, and I anticipate needing to return to the current line. If you know you're going to quickly return to the current position, there's no need to set a mark. Just hit `` and it will return you to the position you were at before the last jump.
Friday, February 15, 2008
Home Middle Last
Vim provides a lot of ways to get around the screen to where you want to go. Sometimes you may want to quickly put your cursor at the top, middle, or bottom of the screen. In normal mode, just do the following:
H = Home (top of screen)
M = Middle (middle of screen)
L = Last (bottom of screen)
H = Home (top of screen)
M = Middle (middle of screen)
L = Last (bottom of screen)
Wednesday, February 13, 2008
Last File Location
Some Linux distributions set this up by default and some don't. I like Vim to open a file I'm working on to the last location I was in before exiting. This can be accomplished by adding the following to your .vimrc.
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
Subscribe to:
Posts (Atom)