A decent intro; I'd add to the movement section these: g$ - move cursor to last displayed character of line Tx - move cursor backward and to the right of the first occurrence of x (reverse of tx) And get started with split views: ^ws - horizontal split view ^wv - vertical split view ^w{h,j,k,l} - move to window in respective direction Some decent scripts to get started with: minibufexpl.vim: http://www.vim.org/script…
Another nice script I discovered recently is Nerd Tree : http://www.vim.org/scripts/script.php?script_id=1658
Efficient Editing With vim
81–90 of 125 posts
Re: Efficient Editing With vim
#82Re: Efficient Editing With vim
#83I feel silly for only recently discovering tabs in vim. :tabnew file Opens up a new tab, :tabn Goes to the next tab, and :tabp Goes to the previous tab. Works great in both gui and non-gui mode.
You can always open files as tabs at startup too with -p, like this: vim -p foo.c foo.h
Re: Efficient Editing With vim
#84I think it's the first time that I want to install vim to try it. As a Windows user, I always found NotePad++ and other text editor an easier choice but I can now see some powerfull utilities to vim now. Very clear article.
(I'm just throwing tips in comments where I see opportunities to help people who find any of the same niggles I've had over the years.) Users who want to run Windows vim with no titlebar, create a file _vimrc in your base vim directory (on my windows desktop it's C:\Program Files\Vim). In this, put this line: set guioptions-=T
Re: Efficient Editing With vim
#85Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.
By force of habit, when I wanted to close an IM window, I have typed :q Instead of switching to the mouse and hitting the "x". Then I had to explain to the person that I wasn't sticking my tongue out at them.
Re: Efficient Editing With vim
#86Earlier quoted context omitted.
I would kill for GMail to add vim-like text editing.
Have you heard of the "It's All Text" Firefox extension? It copies the content of any textarea to a tempfile and opens it up in an external editor of your choice. Writes to the tempfile are copied back to the textarea. It's not quite in-browser vim, but it's pretty close. https://addons.mozilla.org/en-US/firefox/addon/4125
Re: Efficient Editing With vim
#87Earlier quoted context omitted.
I once wrote ":tabnew something.js" in my IM window and sent it before I realized that the wrong window had focus. The person replied with, "bash: :tabnew: command not found." I told him, "I was hoping you were vim, actually".
HA! Also using vim will cause your escape key to be heavily hit constantly after typing anything especially if you are not sure what mode you are in, then only realizing you are not in vim period.
Re: Efficient Editing With vim
#88Earlier quoted context omitted.
I've found it easy to avoid misusing Ctrl-w because of the fact I use it so much to close tabs in Firefox. You just need to have two different uses for something, both of which you use very regularly, to get used to not accidentally misusing them, I've found.
Vimperator will break that habit, for sure.
Once I actually buckled down and started learning how to use it, I was surprised by how quickly and easily a natural feeling of "this is how it should be" developed while using Vimperator. Of course, there's a lot of positive transference of knowledge from my heavy use of Vim itself, but still -- I didn't expect to find it this easy.
I think part of the reason may be that every single keyboard-driven browser I have ever used before (Lynx, W3m, Links, et cetera, ad infinitum) was so awful as a Web interface that I became convinced Web browsers were a uniquely GUI-suited type of application. Vimperator is definitely changing my mind.
Thank goodness.
Re: Efficient Editing With vim
#89Earlier quoted context omitted.
I would kill for GMail to add vim-like text editing.
Try Vimperator. opens gvim for the currently-focused text box.
Thank you.
Re: Efficient Editing With vim
#90Earlier quoted context omitted.
Have you heard of the "It's All Text" Firefox extension? It copies the content of any textarea to a tempfile and opens it up in an external editor of your choice. Writes to the tempfile are copied back to the textarea. It's not quite in-browser vim, but it's pretty close. https://addons.mozilla.org/en-US/firefox/addon/4125
There is also ViewSourceWith which allows the use of different editors.