Presentacion vim

12
The best text editor ever USING VIM

description

 

Transcript of Presentacion vim

Page 1: Presentacion vim

The best text editor everUSING VIM

Page 2: Presentacion vim

• Color syntax highlighting• Very customizable• Highly portable• Highly active community• Plug-ins

• Suuuuuuper fast

WHY USE VIM?

Page 3: Presentacion vim

VIM’s effectiveness comes from not using the arrow keys or the mouse

BEFORE WE BEGIN REMEMBER…

Page 4: Presentacion vim

Vim has many modes, but the most used ones are:

• Normal mode (aka Command Mode): you can enter all the normal editor commands. If you start the editor you are in this mode.

• Insert mode: the text you type is inserted into the buffer.

• Visual mode: This is like Normal mode, but the movement commands extend a highlighted area. When a non-movement command is used, it is executed for the highlighted area.

THE BASICS

Page 5: Presentacion vim

Main mode to make all the movement of the cursor

• h j k l: moves the cursor left down up right respectively• w: jump to the start of the next word• e: jump to the end of the word• b: jump backward by words• 0: start of the line• $: end of the line• ^: first non-blank character of the line• gg: top of the buffer• G: bottom of the buffer• #G: go to line #

Note: Prefix a cursor movement command with a number to repeat i t . For example, 4j moves down 4 l ines.

NORMAL MODE

Page 6: Presentacion vim

x: delete character under the cursor r: replace the character under the cursorR: replace everything you type until you press <ESC>cw: change wordc$: change to the end of the linecc: change entire line f: find characterp: paste from buffery: copy selected text . : repeat last commandu: undo

And many more…

MORE NORMAL MODE COMMANDS

Page 7: Presentacion vim

i: Enter insert mode at cursor I: Enter insert mode at the start of the linea: Enter insert mode after the cursorA: Enter insert mode at the end of the lineo: open a new line below the cursorO: open a new line above the cursor<ESC>: exit insert mode

INSERT MODE

Page 8: Presentacion vim

v: start visual modeV: linewise visual mode<Ctrl> + v: block visual mode i: select the inner stuff of things (i.e. vit, vi{, vi(, etc)<Esc>: exit visual mode

VISUAL MODE

Page 9: Presentacion vim

Command-line mode is used to enter Ex commands (":"), search patterns ("/" and "?”)

i.e. saving(:w), quitting (:q), running terminal commands (: !), finding and replacing: (:s)

Searching: /pattern – searches for the pattern in the document ?pattern – searches for the pattern backwards n – looks for the next ocurrence of the search N – looks for the previous ocurrence of the search :%s/old/new/g - replaces all old with new throughout file

OTHER STUFF

Page 10: Presentacion vim

pathogen - https://github.com/tpope/vim-pathogenrails.vim - https://github.com/tpope/vim-railsNERD-tree - https://github.com/scrooloose/nerdtreeNERD-commenter -

https://github.com/scrooloose/nerdcommenterCtrl-P - https://github.com/kien/ctrlp.vimSnipmate -

https://github.com/msanders/snipmate.vimSurround - https://github.com/tpope/vim-surroundZen-coding - https://github.com/mattn/zencoding-vim

And many more…

SOME PLUGINS

Page 11: Presentacion vim

Derek Wyatt’s tutorials - http://www.derekwyatt.org/vim/Vimcasts – http://vimcasts.orgUse vim like a Pro - https://leanpub.com/VimLikeAProVIM’s Documentation -

http://vimdoc.sourceforge.net/htmldoc/ usr_toc.htmlCoderwall’s VIM network - https://coderwall.co m/n/vimCheatsheet -

http://cloud.github.com/downloads/ahrencode/Miscellaneous/vim-cheatsheet.pdf

VIM tutorial - http://blog.interlinked.org/tutorials/vim_tutorial.html

Vimtweets - http://www.vimtweets.com/ || @vimtipsMy VIM config - https://github.com/rkrdo/vimfiles

RESOURCES

Page 12: Presentacion vim

THANK YOU!