SlideShare a Scribd company logo
1 of 22
Download to read offline
:q!
[operator][count][motion]
(use text-objects)
      iw
                 iW
       i( / ib
beginning
   of line   I   before
                 cursor   i       after
                                 cursor    a          end
                                                   of line   A
 previous
      line   O    next
                   line   o   substitute
                               character   s   substitute
                                                      line   S
                                                      line
                                               from cursor   C
select
characters     v     select
                      lines   V      select
                                      block   ^v
swich cursor
   start/end   o     reselect
                   prev. area   gv   prepend
                                     each line   I
searching
substitutions

:%s/foo/bar                  „foor“ -> „bar“

:s/foo/bar/g                 on the line

:s/..k/ax/                   wildcards

:2,4s/foo/bar/g

:s/(.*):(.*)/2 : 1/

:g/foobar/d                  delete all lines containing „foobar“

c C – case (in)sensitive
:registers                         registers
:echo @r




             “a-“z         “a-“z

             qr   macro
                  record   @r     macro
                                playback
marks


set mark m
     In file   mm        set mark M
                         across files   mM
        jump to
          line m   ‘m   jump to exact
                                 char   `m
buffers

:buffers
:help :buffers
:badd file

:bnext
:bprev
:bdelete
windows
vim -o / -O filename filename2

split,vsplit: filename
:q - pokial je otvorenych viac okien,
vim sa nestara o ulozenie suboru

Ctrl + W + h,j,k,l / sipky - prepinanie okien
Ctrl + W + r,R - rotacia okien
Ctrl + W + x
Ctrl + [+] / [-]
Ctrl + W + <,>

Ctrl + W + _ , Ctrl + W + |, Ctrl + W + =
vimdiff


do      get changes
dp      put changes

]c      next change
[c
^W ^W   witch window
insert: ^p ^x, ^f

normal: ^a , ^x in/dekrement
       plugin Monday

command: ^r^w,^d
vimscript

•   Interny jazyk
•   .vimrc
•   Python, perl, ruby, ..
•   pluginy

                 let items=[1,2,3,4]
                 for item in items
                     echo item
                 endfor
plugins


git clone git://github.com/joonty/myvim.git ~/.vim
vim +BundleInstall +qall
syntax checking          :!php –l %
php QA tools

Tags auto-completion      ^x^o
NERDTree
Ctags
Codesniffer, mess detector
PHPUnit
Xdebug
Mapping
   map <F2> :NERDTreeToggle<CR>
   imap ,a <a href=""></a><Esc>F"i
   nmap
   vmap

Kostry
    autocmd BufNewFile *.php 0r ~/.vim/skeletons/skeleton.php

:filetype plugin on
:set nobomb
:syntax on
:set number
:set ignorecase, smartcase
:set incsearch hlsearch
>> <<
:retab! N
gu, gU, g~ - lower, uppercase
^R+= simplecalc
:sh
:r!cmd
zf (fold) - nasleduje pohybovy prikaz
       - kolko riadkov
       - prvy z nich
zfap

visual mode

zo (open)
zc, zd

zr, zm                              :set foldopen=all
zR, zM                              :set foldclose=all

More Related Content

What's hot

Chapter20 class-example-program
Chapter20 class-example-programChapter20 class-example-program
Chapter20 class-example-program
Deepak Singh
 
[NCTU] [CCCA] vim rocks
[NCTU] [CCCA] vim rocks[NCTU] [CCCA] vim rocks
[NCTU] [CCCA] vim rocks
Xatierlike Lee
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
jwjablonski
 
最近作ったN個のCPANモジュール Yokohama.pm #10
最近作ったN個のCPANモジュール Yokohama.pm #10最近作ったN個のCPANモジュール Yokohama.pm #10
最近作ったN個のCPANモジュール Yokohama.pm #10
Masahiro Nagano
 

What's hot (20)

ClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browserClojureScript - A functional Lisp for the browser
ClojureScript - A functional Lisp for the browser
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
user2015 keynote talk
user2015 keynote talkuser2015 keynote talk
user2015 keynote talk
 
Tour of Rust
Tour of RustTour of Rust
Tour of Rust
 
The Big Three
The Big ThreeThe Big Three
The Big Three
 
Chapter20 class-example-program
Chapter20 class-example-programChapter20 class-example-program
Chapter20 class-example-program
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
[NCTU] [CCCA] vim rocks
[NCTU] [CCCA] vim rocks[NCTU] [CCCA] vim rocks
[NCTU] [CCCA] vim rocks
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)BeepBeep 3: A declarative event stream query engine (EDOC 2015)
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
 
Java Code for Sample Projects Methods
Java Code for Sample Projects MethodsJava Code for Sample Projects Methods
Java Code for Sample Projects Methods
 
Ruby Code Optimizations (for beginners)
Ruby Code Optimizations (for beginners)Ruby Code Optimizations (for beginners)
Ruby Code Optimizations (for beginners)
 
D vs OWKN Language at LLnagoya
D vs OWKN Language at LLnagoyaD vs OWKN Language at LLnagoya
D vs OWKN Language at LLnagoya
 
Groovy
GroovyGroovy
Groovy
 
Reconstruction
ReconstructionReconstruction
Reconstruction
 
Golang Channels
Golang ChannelsGolang Channels
Golang Channels
 
Hot C++: New Style of Arguments Passing
Hot C++: New Style of Arguments PassingHot C++: New Style of Arguments Passing
Hot C++: New Style of Arguments Passing
 
Go Containers
Go ContainersGo Containers
Go Containers
 
最近作ったN個のCPANモジュール Yokohama.pm #10
最近作ったN個のCPANモジュール Yokohama.pm #10最近作ったN個のCPANモジュール Yokohama.pm #10
最近作ったN個のCPANモジュール Yokohama.pm #10
 
Function paint
Function paintFunction paint
Function paint
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 

Viewers also liked (9)

Tomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSHTomáš Čorej - OpenSSH
Tomáš Čorej - OpenSSH
 
Marek Lichtner - Používať alebo nepoužívať ORM vo webových aplikáciách?
Marek Lichtner - Používať alebo nepoužívať ORM vo webových aplikáciách?Marek Lichtner - Používať alebo nepoužívať ORM vo webových aplikáciách?
Marek Lichtner - Používať alebo nepoužívať ORM vo webových aplikáciách?
 
ActiveRecord is good enough
ActiveRecord is good enoughActiveRecord is good enough
ActiveRecord is good enough
 
Selenium prezentácia pre Webelement
Selenium prezentácia pre WebelementSelenium prezentácia pre Webelement
Selenium prezentácia pre Webelement
 
WebElement #20: Ondrej Svitek - Hacking Life With Git
WebElement #20: Ondrej Svitek - Hacking Life With GitWebElement #20: Ondrej Svitek - Hacking Life With Git
WebElement #20: Ondrej Svitek - Hacking Life With Git
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)
 
WebElement #22: Peter Slivka - Úvod do AWS
WebElement #22: Peter Slivka - Úvod do AWSWebElement #22: Peter Slivka - Úvod do AWS
WebElement #22: Peter Slivka - Úvod do AWS
 
Ján Kmeťko - NoSQL a distribuované databázy – pohľad zhora na konzistentnosť ...
Ján Kmeťko - NoSQL a distribuované databázy – pohľad zhora na konzistentnosť ...Ján Kmeťko - NoSQL a distribuované databázy – pohľad zhora na konzistentnosť ...
Ján Kmeťko - NoSQL a distribuované databázy – pohľad zhora na konzistentnosť ...
 
Hackovanie daní a odvodov pre web developerov
Hackovanie daní a odvodov pre web developerovHackovanie daní a odvodov pre web developerov
Hackovanie daní a odvodov pre web developerov
 

Similar to Lukáš Šabľa - Vim

Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
Lin Yo-An
 
06 -working_with_strings
06  -working_with_strings06  -working_with_strings
06 -working_with_strings
Hector Garzo
 
GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdf
SergioLoaiza11
 

Similar to Lukáš Šabľa - Vim (20)

Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Sdl Basic
Sdl BasicSdl Basic
Sdl Basic
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
 
Vim Eye for the Rails Guy - Cheatsheet
Vim Eye for the Rails Guy - CheatsheetVim Eye for the Rails Guy - Cheatsheet
Vim Eye for the Rails Guy - Cheatsheet
 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
 
06 -working_with_strings
06  -working_with_strings06  -working_with_strings
06 -working_with_strings
 
lldb – Debugger auf Abwegen
lldb – Debugger auf Abwegenlldb – Debugger auf Abwegen
lldb – Debugger auf Abwegen
 
VIM for (PHP) Programmers
VIM for (PHP) ProgrammersVIM for (PHP) Programmers
VIM for (PHP) Programmers
 
Vim Vi Improved
Vim Vi ImprovedVim Vi Improved
Vim Vi Improved
 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
 
GNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdfGNU Emacs Reference Card.pdf
GNU Emacs Reference Card.pdf
 
Vim For Php
Vim For PhpVim For Php
Vim For Php
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
C standard library functions
C standard library functionsC standard library functions
C standard library functions
 
VIM for Programmers
VIM for ProgrammersVIM for Programmers
VIM for Programmers
 
SVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generationSVGo: a Go Library for SVG generation
SVGo: a Go Library for SVG generation
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Lukáš Šabľa - Vim

  • 1. :q!
  • 2.
  • 3.
  • 5. (use text-objects) iw iW i( / ib
  • 6. beginning of line I before cursor i after cursor a end of line A previous line O next line o substitute character s substitute line S line from cursor C
  • 7. select characters v select lines V select block ^v swich cursor start/end o reselect prev. area gv prepend each line I
  • 9. substitutions :%s/foo/bar „foor“ -> „bar“ :s/foo/bar/g on the line :s/..k/ax/ wildcards :2,4s/foo/bar/g :s/(.*):(.*)/2 : 1/ :g/foobar/d delete all lines containing „foobar“ c C – case (in)sensitive
  • 10. :registers registers :echo @r “a-“z “a-“z qr macro record @r macro playback
  • 11. marks set mark m In file mm set mark M across files mM jump to line m ‘m jump to exact char `m
  • 13. windows vim -o / -O filename filename2 split,vsplit: filename :q - pokial je otvorenych viac okien, vim sa nestara o ulozenie suboru Ctrl + W + h,j,k,l / sipky - prepinanie okien Ctrl + W + r,R - rotacia okien Ctrl + W + x Ctrl + [+] / [-] Ctrl + W + <,> Ctrl + W + _ , Ctrl + W + |, Ctrl + W + =
  • 14. vimdiff do get changes dp put changes ]c next change [c ^W ^W witch window
  • 15. insert: ^p ^x, ^f normal: ^a , ^x in/dekrement plugin Monday command: ^r^w,^d
  • 16. vimscript • Interny jazyk • .vimrc • Python, perl, ruby, .. • pluginy let items=[1,2,3,4] for item in items echo item endfor
  • 17. plugins git clone git://github.com/joonty/myvim.git ~/.vim vim +BundleInstall +qall
  • 18. syntax checking :!php –l % php QA tools Tags auto-completion ^x^o NERDTree Ctags Codesniffer, mess detector PHPUnit Xdebug
  • 19. Mapping map <F2> :NERDTreeToggle<CR> imap ,a <a href=""></a><Esc>F"i nmap vmap Kostry autocmd BufNewFile *.php 0r ~/.vim/skeletons/skeleton.php :filetype plugin on
  • 20. :set nobomb :syntax on :set number :set ignorecase, smartcase :set incsearch hlsearch
  • 21. >> << :retab! N gu, gU, g~ - lower, uppercase ^R+= simplecalc :sh :r!cmd
  • 22. zf (fold) - nasleduje pohybovy prikaz - kolko riadkov - prvy z nich zfap visual mode zo (open) zc, zd zr, zm :set foldopen=all zR, zM :set foldclose=all