SlideShare a Scribd company logo
1 of 20
Download to read offline
Vim or not to Vim
by
github.com/anatoliliotych
All you need to know:
Note: you still don't need pedals to type
Vim modes: Normal/Insert/Visual/Nightmare
Movement is life
Operators
c change
d delete
y yank to register
gu make lowercase
gU make uppercase
d delete a symbol
D delete a line
* search by the word you're on
Left-Rigth motions
w next word including punctuation

W next word no punctuation

b beginning of word including punctuation

B beginning of word no punctuation

e end of word including punctuation

E end of word no punctuation

$ or g_ last char on line
h to the left on one symbol

l to the right on one symbol

^ or 0 - to the line start

f find

F previous find

t till

T previous till

; repeat latest f,t

, repeat latest f,t in opposite order
Up-Down motions
j,k - one line moving

gg - first line

G - last line

H - top of screen

M - middle of screen

L - bottom of screen

zz - current line to middle

zt - current line to top

zb - current line to bottom

zl - scroll to right

zh - scroll to left

ctrl + u or ctrl +d - scroll half page up and down

ctrl +b or ctrl + f - scroll page up and down
diw delete inner word
daw delete a word
diW delete inner WORD
daW delete a WORD
dd delete one line
dis delete inner sentence
das delete a sentence
dib delete inner '(' ')' block
dab delete a '(' ')' block
dip delete inner paragraph
dap delete a paragraph
diB delete inner '{' '}' block
daB delete a '{' '}' block
Text-Object operations
zi switch folding on or off
zv expand folds to reveal cursor
zj move down to top of next fold
zk move up to bottom of previous fold
zo open current fold
zO recursively open current fold
zc close current fold
zC recursively close current fold
za toggle current fold
zA recursively open/close current fold
zm reduce `foldlevel` by one
zM close all folds
zr increase `foldlevel` by one
zR open all folds
Folding
<< or >> moves one line in normal mode
5(>>,<<) moves 5 line in normal mode
>> or << moves selected lines in visual mode
gv(<,>) reselects last visual selections and move
Identing
ctrl + n - autocomplete all over
ctrl + p - autocomplete from pervious matches in this file
It could be sophisticated using CTAG...
Autocompletion
ctrl + r in insert mode to start using registers
" the default register
% the current file name
# the alternate file name
* the clipboard contents (X11: primary selection)
+ the clipboard contents
/ the last search pattern
: the last command-line
. the last inserted text
- the last small (less than a line) delete
Registers
:ls show the buffer list
:bn open the next buffer in the current window
:bp open the previous buffer in the current window
:b1 select buffer #1
Buffers
ctrl + ww switch windows in cycle
ctrl + w(l,h,j,k) switch to window right/left/down/up
ctrl + w5(-,+) makes window on 5 strings more|less
in horizontal split
ctrl + w5(>,<) makes window on 5 strings more|less
in vertical split
ctrl + wr change layout of windows
ctrl + w + (L,H) change layouts in horizontal
ctrl-w+| maximize current window
ctrl-w= make all equal size
:hide close current window
:only keep only this window open
set winwidth=80 set defaults minwidth for active window
Windows
:tabnew - open file/dir in a new tab

:tabf - search for file in open dir and open in a tab

gt -next, gT -previous - navigating through tabs

ctrl + wT - window to tab
Tabs
:e. at current working directory
:sp. in split at current working directory
:vs. in vertical split at current working directory
:E at directory of current file
:Se in split at directory of current file
:Vex in vertical split at directory of current file
File browsing in netrw: step 1
- up one directory
d Make a directory
D Attempt to remove the file/dir
gh Quick hide/unhide of dot-files
i Cycle between thin, long, wide, and tree listings
ctrl+l refresh the directory listing
o open file/dir under the cursor in a new split
R Rename the designed file/dir
t open file/dir under the cursor in a new tab
v open file/dir under the cursor in a new vsplit
% Open a new file in netrw's current directory
File browsing in netrw: step 2
How to start
•vimtutor
•https://vim-adventures.com/
•http://vimcasts.org/episodes/
•http://rayninfo.co.uk/vimtips.html
Try to use vim in real life...
set :questions

More Related Content

What's hot

Firefox shortcuts-win
Firefox shortcuts-winFirefox shortcuts-win
Firefox shortcuts-win
Rajat Bhatt
 
Easy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- CheatsheetEasy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- Cheatsheet
Dashamir Hoxha
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
mua99
 

What's hot (17)

vim
vimvim
vim
 
SLIME
SLIMESLIME
SLIME
 
Firefox shortcuts-win
Firefox shortcuts-winFirefox shortcuts-win
Firefox shortcuts-win
 
Vi CheatSheet
Vi CheatSheetVi CheatSheet
Vi CheatSheet
 
week-7x
week-7xweek-7x
week-7x
 
Sketch Plugin & Prototyping Tools
Sketch Plugin & Prototyping ToolsSketch Plugin & Prototyping Tools
Sketch Plugin & Prototyping Tools
 
Temp conversion
Temp conversionTemp conversion
Temp conversion
 
Linked list int_data_fdata
Linked list int_data_fdataLinked list int_data_fdata
Linked list int_data_fdata
 
R Data Visualization: Learn To Add Text Annotations To Plots
R Data Visualization: Learn To Add Text Annotations To PlotsR Data Visualization: Learn To Add Text Annotations To Plots
R Data Visualization: Learn To Add Text Annotations To Plots
 
Easy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- CheatsheetEasy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- Cheatsheet
 
Data Visualization With R: Learn To Modify Font Of Graphical Parameters
Data Visualization With R: Learn To Modify Font Of Graphical ParametersData Visualization With R: Learn To Modify Font Of Graphical Parameters
Data Visualization With R: Learn To Modify Font Of Graphical Parameters
 
Unix Basic Commands
Unix Basic CommandsUnix Basic Commands
Unix Basic Commands
 
week-6x
week-6xweek-6x
week-6x
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
 
Tower of HANOI
Tower of HANOITower of HANOI
Tower of HANOI
 

Similar to Rubizza #1 | Special Lecture. Vim

GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdf
SergioLoaiza11
 
Junos commands
Junos commandsJunos commands
Junos commands
myerfarez
 
Mission vim possible
Mission vim possibleMission vim possible
Mission vim possible
Sam Gottfried
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)
Lin Yo-An
 

Similar to Rubizza #1 | Special Lecture. Vim (20)

Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
 
Vi reference
Vi referenceVi reference
Vi reference
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdf
 
VIM for the PHP Developer
VIM for the PHP DeveloperVIM for the PHP Developer
VIM for the PHP Developer
 
Cheatsheet - tmux
Cheatsheet - tmuxCheatsheet - tmux
Cheatsheet - tmux
 
Vim
VimVim
Vim
 
Junos commands
Junos commandsJunos commands
Junos commands
 
vim - Tips and_tricks
vim - Tips and_tricksvim - Tips and_tricks
vim - Tips and_tricks
 
Vim cheat-sheet-en
Vim cheat-sheet-enVim cheat-sheet-en
Vim cheat-sheet-en
 
Vi Editor Cheat Sheet
Vi Editor Cheat SheetVi Editor Cheat Sheet
Vi Editor Cheat Sheet
 
Introduction to Vim, the text editor
Introduction to Vim, the text editorIntroduction to Vim, the text editor
Introduction to Vim, the text editor
 
Mission vim possible
Mission vim possibleMission vim possible
Mission vim possible
 
Vim Cards - Powerpoint Format
Vim Cards - Powerpoint FormatVim Cards - Powerpoint Format
Vim Cards - Powerpoint Format
 
Vi editor
Vi editorVi editor
Vi editor
 
Simple tricks to speed you up on the command line
Simple tricks to speed you up on the command lineSimple tricks to speed you up on the command line
Simple tricks to speed you up on the command line
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)
 
Vim Cards - Keynote Format
Vim Cards - Keynote FormatVim Cards - Keynote Format
Vim Cards - Keynote Format
 
Productive text editing with Vim
Productive text editing with VimProductive text editing with Vim
Productive text editing with Vim
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 

More from Rubizza (9)

Intoduction to React
Intoduction to ReactIntoduction to React
Intoduction to React
 
Linux commands-effectiveness
Linux commands-effectivenessLinux commands-effectiveness
Linux commands-effectiveness
 
Sinatra
SinatraSinatra
Sinatra
 
Catch and Throw in Ruby
Catch and Throw in RubyCatch and Throw in Ruby
Catch and Throw in Ruby
 
Variables, expressions, standard types
 Variables, expressions, standard types  Variables, expressions, standard types
Variables, expressions, standard types
 
Git
GitGit
Git
 
Hangout Utche #6. "Rambovidnaya problema"
Hangout Utche #6. "Rambovidnaya problema"Hangout Utche #6. "Rambovidnaya problema"
Hangout Utche #6. "Rambovidnaya problema"
 
Hangout Utche #6. Math Thinking
Hangout Utche #6. Math ThinkingHangout Utche #6. Math Thinking
Hangout Utche #6. Math Thinking
 
Rubizza #1 Lecture Ruby OOP
Rubizza #1 Lecture Ruby OOPRubizza #1 Lecture Ruby OOP
Rubizza #1 Lecture Ruby OOP
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

Rubizza #1 | Special Lecture. Vim

  • 1. Vim or not to Vim by github.com/anatoliliotych
  • 2. All you need to know:
  • 3. Note: you still don't need pedals to type
  • 6. Operators c change d delete y yank to register gu make lowercase gU make uppercase d delete a symbol D delete a line * search by the word you're on
  • 7. Left-Rigth motions w next word including punctuation W next word no punctuation b beginning of word including punctuation B beginning of word no punctuation e end of word including punctuation E end of word no punctuation $ or g_ last char on line h to the left on one symbol l to the right on one symbol ^ or 0 - to the line start f find F previous find t till T previous till ; repeat latest f,t , repeat latest f,t in opposite order
  • 8. Up-Down motions j,k - one line moving gg - first line G - last line H - top of screen M - middle of screen L - bottom of screen zz - current line to middle zt - current line to top zb - current line to bottom zl - scroll to right zh - scroll to left ctrl + u or ctrl +d - scroll half page up and down ctrl +b or ctrl + f - scroll page up and down
  • 9. diw delete inner word daw delete a word diW delete inner WORD daW delete a WORD dd delete one line dis delete inner sentence das delete a sentence dib delete inner '(' ')' block dab delete a '(' ')' block dip delete inner paragraph dap delete a paragraph diB delete inner '{' '}' block daB delete a '{' '}' block Text-Object operations
  • 10. zi switch folding on or off zv expand folds to reveal cursor zj move down to top of next fold zk move up to bottom of previous fold zo open current fold zO recursively open current fold zc close current fold zC recursively close current fold za toggle current fold zA recursively open/close current fold zm reduce `foldlevel` by one zM close all folds zr increase `foldlevel` by one zR open all folds Folding
  • 11. << or >> moves one line in normal mode 5(>>,<<) moves 5 line in normal mode >> or << moves selected lines in visual mode gv(<,>) reselects last visual selections and move Identing
  • 12. ctrl + n - autocomplete all over ctrl + p - autocomplete from pervious matches in this file It could be sophisticated using CTAG... Autocompletion
  • 13. ctrl + r in insert mode to start using registers " the default register % the current file name # the alternate file name * the clipboard contents (X11: primary selection) + the clipboard contents / the last search pattern : the last command-line . the last inserted text - the last small (less than a line) delete Registers
  • 14. :ls show the buffer list :bn open the next buffer in the current window :bp open the previous buffer in the current window :b1 select buffer #1 Buffers
  • 15. ctrl + ww switch windows in cycle ctrl + w(l,h,j,k) switch to window right/left/down/up ctrl + w5(-,+) makes window on 5 strings more|less in horizontal split ctrl + w5(>,<) makes window on 5 strings more|less in vertical split ctrl + wr change layout of windows ctrl + w + (L,H) change layouts in horizontal ctrl-w+| maximize current window ctrl-w= make all equal size :hide close current window :only keep only this window open set winwidth=80 set defaults minwidth for active window Windows
  • 16. :tabnew - open file/dir in a new tab :tabf - search for file in open dir and open in a tab gt -next, gT -previous - navigating through tabs ctrl + wT - window to tab Tabs
  • 17. :e. at current working directory :sp. in split at current working directory :vs. in vertical split at current working directory :E at directory of current file :Se in split at directory of current file :Vex in vertical split at directory of current file File browsing in netrw: step 1
  • 18. - up one directory d Make a directory D Attempt to remove the file/dir gh Quick hide/unhide of dot-files i Cycle between thin, long, wide, and tree listings ctrl+l refresh the directory listing o open file/dir under the cursor in a new split R Rename the designed file/dir t open file/dir under the cursor in a new tab v open file/dir under the cursor in a new vsplit % Open a new file in netrw's current directory File browsing in netrw: step 2
  • 20. Try to use vim in real life... set :questions