Vim Tips Wiki
(link to maximize window tip)
Line 30: Line 30:
 
I'd consider the <tt>:simalt ~x</tt> tip rather circumstancial. I don't think it belongs to a "beginner's tips category". :) ([[User:Spiiph|Spiiph]] 14:09, 28 July 2009 (UTC))
 
I'd consider the <tt>:simalt ~x</tt> tip rather circumstancial. I don't think it belongs to a "beginner's tips category". :) ([[User:Spiiph|Spiiph]] 14:09, 28 July 2009 (UTC))
 
:Possibly true, but it's information a beginner would find very useful, especially as a .vimrc addition (in an autocmd). I've linked to one of our tips on the subject, perhaps now it will be more useful. It does seem quite out of place though. --[[User:Fritzophrenic|Fritzophrenic]] 02:42, 29 July 2009 (UTC)
 
:Possibly true, but it's information a beginner would find very useful, especially as a .vimrc addition (in an autocmd). I've linked to one of our tips on the subject, perhaps now it will be more useful. It does seem quite out of place though. --[[User:Fritzophrenic|Fritzophrenic]] 02:42, 29 July 2009 (UTC)
  +
::There are quite a few of these "my best tips", "quick tips", "random tips" pages. Would it make sense to organize them in a "Random Tips" category, and at the same time change their titles to indicate that they contain a collection of rather unorganized tips? ([[User:Spiiph|Spiiph]] 09:47, 29 July 2009 (UTC))

Revision as of 09:47, 29 July 2009

Tip 1586 Printable Monobook Previous Next

created February 16, 2008 · complexity basic · author Metacosm · version 7.0


These are the best tips in the view of the #Vim users.

  • Using the '*' key searches for the word under the cursor, use '#' to do the same thing backwards. more
  • Using the '%' key on brackets {} () [] will find the matching one.
  • Using the '.' key will repeat last change.
  • Use 'u' to undo, and Ctrl-r to redo (reverse an undo).
  • Hitting 'gf' will open the file under the cursor.
  • bufdo ... will apply '...' to all open buffers.
  • (Insert Mode) Ctrl-n and Ctrl-p will autocomplete the current word by looking forward or backward in the currently open file(s). Can be bound to tab by using SuperTab. Check out the help for 'complete' to set where Vim will search for autocomplete words.
  • :g/this/d applies an Ex command to all lines that match 'this' -- if you are uncomfortable with Ex command, you can go into normal mode. :g/this/normal dd (just like hitting dd in normal mode on any line with 'this' in it). more
  • If you have really long lines and wrapping turned on, you can map j and k to move down/up to the next visible line by doing ':nmap j gj' and ':nmap k gk'.
  • To maximize a window, type :simalt ~x (MS Windows only).

Comments

 TO DO 

  • Have decided to keep this as the basis of a simple form of Best Vim Tips that is suitable for newcomers.
  • Need to add a link to relevant tips (but keep the quick summary here -- as in the '*' first line).

I'd consider the :simalt ~x tip rather circumstancial. I don't think it belongs to a "beginner's tips category". :) (Spiiph 14:09, 28 July 2009 (UTC))

Possibly true, but it's information a beginner would find very useful, especially as a .vimrc addition (in an autocmd). I've linked to one of our tips on the subject, perhaps now it will be more useful. It does seem quite out of place though. --Fritzophrenic 02:42, 29 July 2009 (UTC)
There are quite a few of these "my best tips", "quick tips", "random tips" pages. Would it make sense to organize them in a "Random Tips" category, and at the same time change their titles to indicate that they contain a collection of rather unorganized tips? (Spiiph 09:47, 29 July 2009 (UTC))