Vim Basic
@wingyplus
About me
Software Engineer
Osdev Sriracha
Manager
Google Developers Group Chonburi
Installation
●

Mac OS X
–

Bundle (not lastest version)

–

Brew
●

–
●

MacVim

Linux
–

Bundle
●

–
●

$ brew install v...
Mode
●

Command Mode (default)

●

Insert Mode

●

Visual Mode
Basic Movement

hjkl
Insert mode
i
Inserting before current cursor
I
Inserting @ first char of line
a
Appending after current cursor
A
Appendin...
Exit Insert mode

Esc
Move word

w
Word
e
Word
Delete character

x
Delete count character

[n]x
Delete line
dd
Delete line
cc
Delete line and change to Insert mode
Delete count line
<number>dd
Delete <number> line
<number>cc
Delete <number> line and change to Insert mode
Go to line

:<number>
Copy (Yank)

yy
<number>y
Paste

p,P
Visual mode

v,V,<C-v>
Highlight text
Write

:w [filename]
Quit

:q
Force quit

:q!
Edit

:e [filename]
Save and quit

:x [filename]
Replace

:%s/<regex>/<text>/[g][c][i][I]
Find

/pattern
?pattern
Window

:sp,:vs
Tab

:tabnew [filename]
Tab (continue)

:tabnext
Tab (continue)

:tabprevious
Tab (continue)

:tabprevious
Tab (continue)

:tabclose
Omni Completion
●

filetype plugin on

●

Use
–

i <C-x><C-o>
Vimrc
●

Path
–

Linux & OS X
●

–

$HOME/.vimrc

Windows
●

$HOME/_vimrc
Simple conf
●

Enable syntax highlight
–

●

Set indent
–

●

set tabstop=<number>

Convert tab to space
–

●

syntax on

...
Plugins
●

Pathogen

●

Nerd Tree

●

Nerd Commenter

●

Ctrlp.vim

●

Syntastic
Upcoming SlideShare
Loading in …5
×

Vim basic

474 views
373 views

Published on

Vim basic

Published in: Education, Technology

Vim basic

  1. 1. Vim Basic @wingyplus
  2. 2. About me Software Engineer Osdev Sriracha Manager Google Developers Group Chonburi
  3. 3. Installation ● Mac OS X – Bundle (not lastest version) – Brew ● – ● MacVim Linux – Bundle ● – ● $ brew install vim $ apt-get install vim GVim Windows – GVim
  4. 4. Mode ● Command Mode (default) ● Insert Mode ● Visual Mode
  5. 5. Basic Movement hjkl
  6. 6. Insert mode i Inserting before current cursor I Inserting @ first char of line a Appending after current cursor A Appending @ last char of line
  7. 7. Exit Insert mode Esc
  8. 8. Move word w Word e Word
  9. 9. Delete character x
  10. 10. Delete count character [n]x
  11. 11. Delete line dd Delete line cc Delete line and change to Insert mode
  12. 12. Delete count line <number>dd Delete <number> line <number>cc Delete <number> line and change to Insert mode
  13. 13. Go to line :<number>
  14. 14. Copy (Yank) yy <number>y
  15. 15. Paste p,P
  16. 16. Visual mode v,V,<C-v> Highlight text
  17. 17. Write :w [filename]
  18. 18. Quit :q
  19. 19. Force quit :q!
  20. 20. Edit :e [filename]
  21. 21. Save and quit :x [filename]
  22. 22. Replace :%s/<regex>/<text>/[g][c][i][I]
  23. 23. Find /pattern ?pattern
  24. 24. Window :sp,:vs
  25. 25. Tab :tabnew [filename]
  26. 26. Tab (continue) :tabnext
  27. 27. Tab (continue) :tabprevious
  28. 28. Tab (continue) :tabprevious
  29. 29. Tab (continue) :tabclose
  30. 30. Omni Completion ● filetype plugin on ● Use – i <C-x><C-o>
  31. 31. Vimrc ● Path – Linux & OS X ● – $HOME/.vimrc Windows ● $HOME/_vimrc
  32. 32. Simple conf ● Enable syntax highlight – ● Set indent – ● set tabstop=<number> Convert tab to space – ● syntax on set expandtab Detect filetype – filetype on – filetype plugin on – filetype indent on
  33. 33. Plugins ● Pathogen ● Nerd Tree ● Nerd Commenter ● Ctrlp.vim ● Syntastic

×