Vim “show my last command” command?
Hit the colon (:) and then use the up arrow to start going back through previous commands. You can use the up/down arrows too to move around the list.
Hit the colon (:) and then use the up arrow to start going back through previous commands. You can use the up/down arrows too to move around the list.
Adding to Greg Hewgill’s answer, you can use q: to open the command-line window, where you have any Vim editing power at your hand.
Sorry, I’m trying to convince you to use vim built-in features. To make the copy/paste easy, you can open files in another Tabpages: :tabe /path/to/another/file Use gt or gT to switch Tabpages. Or split the window to edit another file: :sp /path/to/another/file Use Ctrl-ww to switch Windows. To split the window vertically, please use :vsp … Read more
You could issue zt after opening the file, so something like: vim +500 filename -c ‘normal zt’.
^? is the delete character; the backspace character is ^H. Only one of these is recognized by your terminal as “erase”, and this is determined by the terminal settings, stty. (bash and other shells understand this as a problem and do special things to recognize both) If your terminal emulator (ssh, putty, xterm, whatever) disagrees … Read more
It is perhaps a good idea not to use tabs at all. :set expandtab If you want to replace all the tabs in your file to 3 spaces (which will look pretty similar to tabstop=3): :%s/^I/ / (where ^I is the TAB character) From the VIM online help: ‘tabstop’ ‘ts’ number (default 8) local to … Read more
To edit a column, follow these steps: Stand on the beginning of the column Press Ctrl+v, then mark across the column you want to edit. Press Shift+i to insert text at the beginning of the column, Shift+a to append text, r to replace highlighted text, d to delete, c to change… etc. Hit ESC when … Read more
Yes. You can use “ in order to jump between the last two positions. Otherwise, Ctrl+O and Ctrl+I can help you. See :help CTRL-I.
By default you can press Control + f (or otherwise see set cedit) when on the Vim command-line, which opens the command-line window where you can edit the command using normal-mode Vim editing keys. Enter will run the command or Control + c will return you to the standard command-line. So in your specific example, … Read more
Starting with Vim 7.4.754 one can use g Ctrl-a, see :help v_g_CTRL-A Go to line #4, use Ctrl-v to blockwise select the first character, go down 4 lines, press Shift i, enter 0 (this is 0, followed by Space) and Esc to exit insert mode. Now use gv to re-select the previously selected area. Press … Read more