We are still actively working on the spam issue.

Difference between revisions of "Vim"

From InstallGentoo Wiki
Jump to: navigation, search
(External Links)
m (Cleaned up a little)
Line 4: Line 4:
 
[[File:Vim cheat sheet.png|200px|thumb|right|Vim Cheat Sheet for programmers]]
 
[[File:Vim cheat sheet.png|200px|thumb|right|Vim Cheat Sheet for programmers]]
  
==Learning Vim==
+
== Learning Vim ==
  
===General Advice===
+
=== General Advice ===
  
 
* If you're interested in learning Vim, it is likely for the purpose of programming or markup. In this case, it is recommended to look up online exercises of a language you're familiar with, and write them with Vim.
 
* If you're interested in learning Vim, it is likely for the purpose of programming or markup. In this case, it is recommended to look up online exercises of a language you're familiar with, and write them with Vim.
Line 13: Line 13:
 
* Keep a cheat sheet, write down new commands you want to learn, keep only several or so commands at a time until you've learned them.
 
* Keep a cheat sheet, write down new commands you want to learn, keep only several or so commands at a time until you've learned them.
  
===For Beginners===
+
=== For Beginners ===
  
 
* http://vim-adventures.com/
 
* http://vim-adventures.com/
* Use vimtutor
+
* Type vimtutor in a terminal to get started
 
* If you're partial to books, try Practical Vim
 
* If you're partial to books, try Practical Vim
 
* :h
 
* :h
  
==Configuration==
+
== Configuration ==
  
 
All configuration is kept in the <code>~/.vimrc</code> file, <code>~</code> being your home directory. It is advisable to look up existing online <code>vimrc</code>'s but do not just copy them. In Vim, <code>:h</code> each entry, read the description and decide for yourself if you want them.
 
All configuration is kept in the <code>~/.vimrc</code> file, <code>~</code> being your home directory. It is advisable to look up existing online <code>vimrc</code>'s but do not just copy them. In Vim, <code>:h</code> each entry, read the description and decide for yourself if you want them.
Line 26: Line 26:
 
Well documented base to start out with: https://github.com/timss/vimconf
 
Well documented base to start out with: https://github.com/timss/vimconf
  
==Plugins==
+
== Plugins ==
  
===Buffer Navigation===
+
=== Buffer Navigation ===
  
 
[https://github.com/Lokaltog/vim-easymotion EasyMotion] - Spatial navigation, saves a lot of keystrokes.
 
[https://github.com/Lokaltog/vim-easymotion EasyMotion] - Spatial navigation, saves a lot of keystrokes.
Line 38: Line 38:
 
[https://github.com/koron/minimap-vim Minimap] - Minimap implementation similar to the one found in Sublime Text
 
[https://github.com/koron/minimap-vim Minimap] - Minimap implementation similar to the one found in Sublime Text
  
===File Navigation===
+
=== File Navigation ===
  
 
[https://github.com/scrooloose/nerdtree NERDTree] - Tree explorer plugin.
 
[https://github.com/scrooloose/nerdtree NERDTree] - Tree explorer plugin.
Line 44: Line 44:
 
[https://github.com/kien/ctrlp.vim CtrlP] - Fuzzy file, buffer, mru, tag, etc finder.
 
[https://github.com/kien/ctrlp.vim CtrlP] - Fuzzy file, buffer, mru, tag, etc finder.
  
===Task Automation===
+
=== Task Automation ===
  
 
[https://github.com/Raimondi/delimitMate DelimitMate] - Auto-completes surroundings and provides bindings for navigating through them.
 
[https://github.com/Raimondi/delimitMate DelimitMate] - Auto-completes surroundings and provides bindings for navigating through them.
Line 54: Line 54:
 
[https://github.com/othree/vim-autocomplpop AutoComplPop] - Basic pop-up keyword-based completion.
 
[https://github.com/othree/vim-autocomplpop AutoComplPop] - Basic pop-up keyword-based completion.
  
===Code Insertion/Completion===
+
=== Code Insertion/Completion ===
  
 
[https://github.com/SirVer/ultisnips UltiSnips] - Customizable snippet engine for boilerplate code time-saving.
 
[https://github.com/SirVer/ultisnips UltiSnips] - Customizable snippet engine for boilerplate code time-saving.
Line 64: Line 64:
 
[http://eclim.org/ Eclim] - Code completion making use of Eclipse's engine.
 
[http://eclim.org/ Eclim] - Code completion making use of Eclipse's engine.
  
===Miscellaneous===
+
=== Miscellaneous ===
  
 
[https://github.com/chrisbra/SudoEdit.vim SudoEdit] - Edit files using sudo or su or any other tool.
 
[https://github.com/chrisbra/SudoEdit.vim SudoEdit] - Edit files using sudo or su or any other tool.
Line 70: Line 70:
 
[https://github.com/terryma/vim-multiple-cursors Multiple Cursors] - Sublime Text style multiple selections
 
[https://github.com/terryma/vim-multiple-cursors Multiple Cursors] - Sublime Text style multiple selections
  
===Ricing===
+
=== Ricing ===
  
 
[https://github.com/itchyny/lightline.vim LightLine] -  Light and configurable statusline/tabline
 
[https://github.com/itchyny/lightline.vim LightLine] -  Light and configurable statusline/tabline
Line 76: Line 76:
 
[http://bytefluent.com/vivify/ Vivify] - Color scheme editor for Vim
 
[http://bytefluent.com/vivify/ Vivify] - Color scheme editor for Vim
  
==External Links==
+
== External Links ==
  
[http://robots.thoughtbot.com/the-vim-learning-curve-is-a-myth The Vim Learning Curve is a Myth]
+
* [http://robots.thoughtbot.com/the-vim-learning-curve-is-a-myth The Vim Learning Curve is a Myth]
 
+
* [http://www.danielmiessler.com/study/vim/ A Vim Tutorial and Primer]
[http://www.danielmiessler.com/study/vim/ A Vim Tutorial and Primer]
+
* [http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ Learn Vim Progressively]
 
+
* [http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/ Learn to speak vim – verbs, nouns, and modifiers!]
[http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ Learn Vim Progressively]
+
* [https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim Vim tips and tricks - StackOverflow]
 
+
* [https://www.youtube.com/watch?v=SkdrYWhh-8s Write code faster: expert-level Vim (Railsberry 2012) - YouTube]
[http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/ Learn to speak vim – verbs, nouns, and modifiers!]
 
 
 
[https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim Vim tips and tricks - StackOverflow]
 
 
 
[https://www.youtube.com/watch?v=SkdrYWhh-8s Write code faster: expert-level Vim (Railsberry 2012) - YouTube]
 
  
 
[[Category:GNU/Linux]]
 
[[Category:GNU/Linux]]
 
[[Category:Productivity]]
 
[[Category:Productivity]]
 
[[Category:Software]]
 
[[Category:Software]]

Revision as of 02:45, 14 February 2014

Vim logo.

Vim (Vi IMproved) is a text editor based on the standard UNIX editor Vi. Its main feature is modal editing, which minimizes the amount of keystrokes needed for performing tasks, thus greatly reducing strain.

Vim Cheat Sheet for programmers

Learning Vim

General Advice

  • If you're interested in learning Vim, it is likely for the purpose of programming or markup. In this case, it is recommended to look up online exercises of a language you're familiar with, and write them with Vim.
  • It may be tempting to use the arrow, delete, backspace, home, pageup, pagedown, and end keys, but do not.
  • When performing a task, always think about how to minimize the amount of keystrokes for it. Research online.
  • Keep a cheat sheet, write down new commands you want to learn, keep only several or so commands at a time until you've learned them.

For Beginners

Configuration

All configuration is kept in the ~/.vimrc file, ~ being your home directory. It is advisable to look up existing online vimrc's but do not just copy them. In Vim, :h each entry, read the description and decide for yourself if you want them.

Well documented base to start out with: https://github.com/timss/vimconf

Plugins

Buffer Navigation

EasyMotion - Spatial navigation, saves a lot of keystrokes.

Tagbar - Tag navigation, requires a ctags package.

CtrlP - Fuzzy file, buffer, mru, tag, etc finder.

Minimap - Minimap implementation similar to the one found in Sublime Text

File Navigation

NERDTree - Tree explorer plugin.

CtrlP - Fuzzy file, buffer, mru, tag, etc finder.

Task Automation

DelimitMate - Auto-completes surroundings and provides bindings for navigating through them.

Vim-Surround - Manipulates (insert, change, delete) pairs of surroundings.

NERDCommenter - Manipulates code comments according to the file type.

AutoComplPop - Basic pop-up keyword-based completion.

Code Insertion/Completion

UltiSnips - Customizable snippet engine for boilerplate code time-saving.

Syntastic - Syntax checking.

YouCompleteMe - Advanced semantic code completion engine.

Eclim - Code completion making use of Eclipse's engine.

Miscellaneous

SudoEdit - Edit files using sudo or su or any other tool.

Multiple Cursors - Sublime Text style multiple selections

Ricing

LightLine - Light and configurable statusline/tabline

Vivify - Color scheme editor for Vim

External Links