SlideShare a Scribd company logo
LOGO 
Vi iMproved入门
Contents 
1 Basics 
2 Vim as notepad 
3 Advanced concepts 
4 Vim as IDE 
5 miscellaneous
Contents 
1 Basics
Basic – background info 
Vim means Vi Improved 
first released publicly in 1991 
license is compatible with GPL 
Popular with GNU/Linux
Basic – give up it 
Learning vim is difficult
Basic – version 
Latest release: 7.4 
Please update to latest version 
 Plugins 
 Tab edit mode 
 :help version7
Basic – platform 
gVim
Basic – mode 
Normal 
I/O/A… 
Esc/Ctrl+C Q/: 
Visual/Esc 
Insert Command
Contents 
2 Vim as notepad
Vim as notepad – Insert 
Ctrl-y/e: 
copy chars from prev/next line 
Ctrl-n/p: 
auto complete word
Vim as notepad – Normal 
Begin to Insert: 
I: insert at the beginning of line 
A: insert at the end of line 
a: insert after cursor 
O: start new line upon current line 
o: start new line below
Vim as notepad – Normal 
Move within line: 
$: move to the end 
0: move to the beginning of line 
w: move a word forward 
b: move a word backward 
f+char: move to next char 
F+char: move to prev char
Vim as notepad – Normal 
Move within page: 
H: high / on top 
M: middle / in them middle 
L: low / at bottom 
Move within file: 
Ctrl-f: forward by page 
Ctrl-b: backward by page
Vim as notepad – Normal 
Move globally: 
G: to the end of file 
gg: to the start of tile 
number+gg: to specified line 
% on {[()]}: the mapping bracket
Vim as notepad – Normal 
Find word when cursor on word: 
*: forward 
#: backward 
Find word with input word: 
/: forward 
?: backward 
n to repeat and N to reverse repeat
Vim as notepad – Normal 
selection(also visual) 
shift+v: select line 
ctrl+v: select block 
v: select char sequences 
And then? 
y: copy 
p: paste 
d:delete
Vim as notepad – command 
set nu 
set hlsearch 
set ignorecase 
set tabstop=4 
set wrap 
……
Vim as notepad – window 
:edit filename 
:tabedit filename 
:split filename 
:vsplit filename 
Ctrl-w + Ctrl-w/hjkl: 
jump between windows
Contents 
3 Advanced concepts
Advanced – get help 
use :help xxx 
Just google it
Advanced – encoding 
:set fileencodings? 
:set encoding? 
:set fileencoding?
Advanced – scripts 
Put the commands into a file then 
we get a script: 
Script can: 
customize vim 
enhance functions
Advanced – scripts 
Customize: 
File location: 
File Name:
Advanced – scripts 
:scriptnames<CR> 
A bundle of script(s) set up a plugin
Advanced – buffer 
:buffers 
Window: 
Tab:
Advanced – buffer 
buffers and tab: 
Eclpse: (Ctrl-e) 
vim buffexplorer:
Advanced – register 
Registers: 
Use “ to call them
Advanced – record/macros 
q start record, q again to stop 
It’s programmer’s way of thinking! 
But there is no ‘if’ 
Use @ to loop
Contents 
4 Vim as IDE
Vim as IDE – preview 
What IDE provides us with: 
1, project management 
2, file explorer 
3, multiple file editor 
4, auto-completion 
5, reference/jump to definition 
6, project compilation
Vim as IDE – preview 
Project Mangement: Project
Vim as IDE – preview 
File explorer: NERDTree
Vim as IDE – preview 
Multiple file edit: 
bufexplorer/airline
Vim as IDE – preview 
Auto-completion: 
omnicppcomplete
Vim as IDE – preview 
reference/jump to definition: 
Taglist/Ctags
Vim as IDE – preview 
Compilation: 
make: compile 
cc: show you current info 
cl: show you info list 
cw: open info window 
cn: bring you to next err/warning 
cp: brin gyou to previous
Vim as IDE – scripts 
Scripts used: 
Project 
Bufexplorer 
NERDTree 
Omnicppcomplete 
Taglist 
Airline 
Kolor.vim 
andrew’s vim – mine vimrc …
Vim as IDE – give it up 
Too much labor work 
Not as fast as you may expect 
Not so intelligent 
How to debug?
Vim as IDE – give it up 
Life is short, 
use python. 
Life is short, 
use an IDE.
Contents 
5 miscellaneous
Miscellaneous – websites 
Official: 
http://www.vim.org/ 
Wiki: 
http://vim.wikia.com/wiki/Vim_T 
ips_Wiki
Miscellaneous – downloads 
Download: 
http://www.vim.org/download.php 
Sources: 
ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 
For windows: 
ftp://ftp.vim.org/pub/vim/pc/gvim74.exe
Miscellaneous – build 
1, mkdir ${HOME}/personal_tools 
2, cd ${HOME}/personal_tools 
3, wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 
4, tar xf vim-74.tar.bz2 
5, cd vim74 && ./configure --with-features=huge -- 
prefix=${home}/personal_tools && make && make 
install 
6, export PATH=${HOME}/personal_tools/bin:${PATH} 
7, vim
Miscellaneous – andrew
LOGO

More Related Content

Viewers also liked (20)

ODT
Adjectives
Tere Brito Gutiérrez
 
PDF
20071124 hinterlaces reforma constitucional-1
Liderazgo y Visión
 
RTF
Glenn Dowling CV
Glenn Dowling
 
PPS
世界美景106幅
 
PPT
Reklama na blogach - adlog.pl
EastCamp Białystok
 
PPT
How to improve your e mail open rates in two simple ways
Richard Larcombe
 
PDF
Ruukki yritysvastuuraportti 2013
Ruukki
 
PDF
QT111 Cold Shrink Silicone Rubber 3M Cable Terminations For MV HV Cables
Thorne & Derrick International
 
PPT
ISA PARDO METGES SENSE FRONTERES
jotaemapemarina
 
PDF
El libro amarillo
Andres Zuluaga
 
PPTX
Suncoast familia
miguelortega24
 
PPTX
ARCS Presentation - Trial Candidate Acquisition with Social Media
The Sponge
 
PDF
WiseFish Value Chain
Jón Heiðar Pálsson
 
PPTX
Silvita y Plata Nativa.
JaviRoma
 
DOC
Rolando Lopez CV
Rolando Lopez Feliz
 
PDF
Securing Your Financial Base Module 4 of Family Financial Freedom
Floyd Saunders
 
PPT
Preterite Verbs
davidsoj
 
PPTX
Aguaymanto. comercio-ex.
Laydy Mena Chacón
 
PPT
Presentacion Excel 2
Roberto Muñoz Soto
 
20071124 hinterlaces reforma constitucional-1
Liderazgo y Visión
 
Glenn Dowling CV
Glenn Dowling
 
世界美景106幅
 
Reklama na blogach - adlog.pl
EastCamp Białystok
 
How to improve your e mail open rates in two simple ways
Richard Larcombe
 
Ruukki yritysvastuuraportti 2013
Ruukki
 
QT111 Cold Shrink Silicone Rubber 3M Cable Terminations For MV HV Cables
Thorne & Derrick International
 
ISA PARDO METGES SENSE FRONTERES
jotaemapemarina
 
El libro amarillo
Andres Zuluaga
 
Suncoast familia
miguelortega24
 
ARCS Presentation - Trial Candidate Acquisition with Social Media
The Sponge
 
WiseFish Value Chain
Jón Heiðar Pálsson
 
Silvita y Plata Nativa.
JaviRoma
 
Rolando Lopez CV
Rolando Lopez Feliz
 
Securing Your Financial Base Module 4 of Family Financial Freedom
Floyd Saunders
 
Preterite Verbs
davidsoj
 
Aguaymanto. comercio-ex.
Laydy Mena Chacón
 
Presentacion Excel 2
Roberto Muñoz Soto
 

Similar to andrew's guide to vim (20)

KEY
Vim week
RookieOne
 
ODP
Vim and Python
majmcdonald
 
PDF
Vim
Eddie Kao
 
PPTX
Vim - for newbies, by Roy Osherove
Roy Osherove
 
KEY
VIM for the PHP Developer
John Congdon
 
PDF
Tuffarsi in vim
sambismo
 
PDF
Coding with Vim
Enzo Wang
 
PDF
Vim and Python
Python Ireland
 
PDF
Linux text editors
InfoExcavator
 
PDF
Linux text editors Vim nano
Md Meherab Hossen
 
PDF
vim-cheatsheet.pdf
AnkitPangasa1
 
PDF
Unit 5 vim an advanced text editor
root_fibo
 
KEY
How to become a practical Vim user
Kana Natsuno
 
PPT
Vim
Samir Faci
 
ODP
Augusta Linux User Group - Vim Introduction
Keith Pickett
 
PDF
Introduction to vim
Vysakh Sreenivasan
 
PDF
vim brownbag - Richard forth
EdwardElric59
 
PDF
Vim Basics
parkerwightman
 
PPTX
Vi editor
Ramakrishna kapa
 
PPT
VI Editors
Deivanai
 
Vim week
RookieOne
 
Vim and Python
majmcdonald
 
Vim - for newbies, by Roy Osherove
Roy Osherove
 
VIM for the PHP Developer
John Congdon
 
Tuffarsi in vim
sambismo
 
Coding with Vim
Enzo Wang
 
Vim and Python
Python Ireland
 
Linux text editors
InfoExcavator
 
Linux text editors Vim nano
Md Meherab Hossen
 
vim-cheatsheet.pdf
AnkitPangasa1
 
Unit 5 vim an advanced text editor
root_fibo
 
How to become a practical Vim user
Kana Natsuno
 
Augusta Linux User Group - Vim Introduction
Keith Pickett
 
Introduction to vim
Vysakh Sreenivasan
 
vim brownbag - Richard forth
EdwardElric59
 
Vim Basics
parkerwightman
 
Vi editor
Ramakrishna kapa
 
VI Editors
Deivanai
 
Ad

Recently uploaded (20)

PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Ad

andrew's guide to vim

  • 2. Contents 1 Basics 2 Vim as notepad 3 Advanced concepts 4 Vim as IDE 5 miscellaneous
  • 4. Basic – background info Vim means Vi Improved first released publicly in 1991 license is compatible with GPL Popular with GNU/Linux
  • 5. Basic – give up it Learning vim is difficult
  • 6. Basic – version Latest release: 7.4 Please update to latest version  Plugins  Tab edit mode  :help version7
  • 8. Basic – mode Normal I/O/A… Esc/Ctrl+C Q/: Visual/Esc Insert Command
  • 9. Contents 2 Vim as notepad
  • 10. Vim as notepad – Insert Ctrl-y/e: copy chars from prev/next line Ctrl-n/p: auto complete word
  • 11. Vim as notepad – Normal Begin to Insert: I: insert at the beginning of line A: insert at the end of line a: insert after cursor O: start new line upon current line o: start new line below
  • 12. Vim as notepad – Normal Move within line: $: move to the end 0: move to the beginning of line w: move a word forward b: move a word backward f+char: move to next char F+char: move to prev char
  • 13. Vim as notepad – Normal Move within page: H: high / on top M: middle / in them middle L: low / at bottom Move within file: Ctrl-f: forward by page Ctrl-b: backward by page
  • 14. Vim as notepad – Normal Move globally: G: to the end of file gg: to the start of tile number+gg: to specified line % on {[()]}: the mapping bracket
  • 15. Vim as notepad – Normal Find word when cursor on word: *: forward #: backward Find word with input word: /: forward ?: backward n to repeat and N to reverse repeat
  • 16. Vim as notepad – Normal selection(also visual) shift+v: select line ctrl+v: select block v: select char sequences And then? y: copy p: paste d:delete
  • 17. Vim as notepad – command set nu set hlsearch set ignorecase set tabstop=4 set wrap ……
  • 18. Vim as notepad – window :edit filename :tabedit filename :split filename :vsplit filename Ctrl-w + Ctrl-w/hjkl: jump between windows
  • 20. Advanced – get help use :help xxx Just google it
  • 21. Advanced – encoding :set fileencodings? :set encoding? :set fileencoding?
  • 22. Advanced – scripts Put the commands into a file then we get a script: Script can: customize vim enhance functions
  • 23. Advanced – scripts Customize: File location: File Name:
  • 24. Advanced – scripts :scriptnames<CR> A bundle of script(s) set up a plugin
  • 25. Advanced – buffer :buffers Window: Tab:
  • 26. Advanced – buffer buffers and tab: Eclpse: (Ctrl-e) vim buffexplorer:
  • 27. Advanced – register Registers: Use “ to call them
  • 28. Advanced – record/macros q start record, q again to stop It’s programmer’s way of thinking! But there is no ‘if’ Use @ to loop
  • 29. Contents 4 Vim as IDE
  • 30. Vim as IDE – preview What IDE provides us with: 1, project management 2, file explorer 3, multiple file editor 4, auto-completion 5, reference/jump to definition 6, project compilation
  • 31. Vim as IDE – preview Project Mangement: Project
  • 32. Vim as IDE – preview File explorer: NERDTree
  • 33. Vim as IDE – preview Multiple file edit: bufexplorer/airline
  • 34. Vim as IDE – preview Auto-completion: omnicppcomplete
  • 35. Vim as IDE – preview reference/jump to definition: Taglist/Ctags
  • 36. Vim as IDE – preview Compilation: make: compile cc: show you current info cl: show you info list cw: open info window cn: bring you to next err/warning cp: brin gyou to previous
  • 37. Vim as IDE – scripts Scripts used: Project Bufexplorer NERDTree Omnicppcomplete Taglist Airline Kolor.vim andrew’s vim – mine vimrc …
  • 38. Vim as IDE – give it up Too much labor work Not as fast as you may expect Not so intelligent How to debug?
  • 39. Vim as IDE – give it up Life is short, use python. Life is short, use an IDE.
  • 41. Miscellaneous – websites Official: http://www.vim.org/ Wiki: http://vim.wikia.com/wiki/Vim_T ips_Wiki
  • 42. Miscellaneous – downloads Download: http://www.vim.org/download.php Sources: ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 For windows: ftp://ftp.vim.org/pub/vim/pc/gvim74.exe
  • 43. Miscellaneous – build 1, mkdir ${HOME}/personal_tools 2, cd ${HOME}/personal_tools 3, wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2 4, tar xf vim-74.tar.bz2 5, cd vim74 && ./configure --with-features=huge -- prefix=${home}/personal_tools && make && make install 6, export PATH=${HOME}/personal_tools/bin:${PATH} 7, vim
  • 45. LOGO