SlideShare une entreprise Scribd logo
1  sur  48
VIM For The PHP Developer
    Anything you can do, I can do faster.
WHY VIM?
WHY VIM?

    Simple
Server/Remote
WHY VIM?

    Simple
                       Development Speed
Server/Remote
WHY VIM?

    Simple
                        Development Speed
Server/Remote



Cross Platform
WHY VIM?

    Simple
                        Development Speed
Server/Remote



                        Same Environment
Cross Platform
                           Everywhere
VIM MODES
Normal   Insert      Bottom Line
VIM MODES
Normal                   Insert      Bottom Line

Should be used most
of the time. Move
around document,
cut/copy/paste,
search/replace, etc...
VIM MODES
Normal                   Insert                 Bottom Line

Should be used most      Typing mode, used to
of the time. Move        enter new text.
around document,         Noobs spend too
cut/copy/paste,          much time here.
search/replace, etc...
VIM MODES
Normal                   Insert                 Bottom Line

Should be used most      Typing mode, used to   Used to change the
of the time. Move        enter new text.        vim environment,
around document,         Noobs spend too        open/close buffers,
cut/copy/paste,          much time here.        and so much more.
search/replace, etc...
SIMPLEST EDITING


vi <filename>

i - go into insert mode

edit text

<esc> - exit insert mode

:x,:wq - save and exit
SIMPLEST EDITING


vi <filename>

i - go into insert mode

edit text

<esc> - exit insert mode

:x,:wq - save and exit
MOVING AROUND A DOCUMENT
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
(,) = beginning / end of sentence
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
(,) = beginning / end of sentence
{,} = beginning / end of paragraph
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
(,) = beginning / end of sentence
{,} = beginning / end of paragraph
G = end of file (1G goes to top, nG goes to line n)
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
(,) = beginning / end of sentence
{,} = beginning / end of paragraph
G = end of file (1G goes to top, nG goes to line n)
% = go to matching bracket
MOVING AROUND A DOCUMENT

h,j,k,l = left, up, down, right
w,b = forward/backward one word
0,$ = beginning/end of line
(,) = beginning / end of sentence
{,} = beginning / end of paragraph
G = end of file (1G goes to top, nG goes to line n)
% = go to matching bracket
zt,zz,zb = move current line to top/center/bottom of viewport
ENTERING INSERT MODE
ENTERING INSERT MODE



i,a = insert text before/after cursor
ENTERING INSERT MODE



i,a = insert text before/after cursor

I,A = insert text at the beginning/end of line
ENTERING INSERT MODE



i,a = insert text before/after cursor

I,A = insert text at the beginning/end of line

o,O = open a new line after/before current one
SEARCH AND REPLACE
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
  g=all occurrences on a line
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
  g=all occurrences on a line
  i=case insensitive
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
  g=all occurrences on a line
  i=case insensitive
  c=confirm
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
  g=all occurrences on a line
  i=case insensitive
  c=confirm
ctrl-a, ctrl-x = increment/decrement next number on line
SEARCH AND REPLACE

/string, ?string = search for string forwards / backwards
n,N = find next/previous occurrence
:%s/find/replace/[ g | i |c ] =
  g=all occurrences on a line
  i=case insensitive
  c=confirm
ctrl-a, ctrl-x = increment/decrement next number on line
:bufdo /search/ = search all open buffers
EDITING TEXT

x = delete single character             w = word
d = delete (cut)                          dw = delete word
y = yank (copy)                           yw = yank word
p,P = paste after/before                examples
u = undo                                  dd, yy, <n>dd, <n>yy
J = join lines, current and next line     <n>p, <n>u
<,> = reduce, increase indentation        d$, yG, <n>cc, <n>cw, c$
. = repeat last command
c = change
BUFFERS
BUFFERS
The contents of a file are loaded into memory (buffer)
BUFFERS
The contents of a file are loaded into memory (buffer)

:buffers, :ls = list buffers
:e <file> = edit/open a file into a new buffer
:bn, :bp = next/previous buffer
:bd = delete buffer
:buffer <n> = jump to buffer <n>
:sbuffer <file> = split buffer, open in another window
WINDOWS

:hsplit,:vsplit = split horizonal/vertical
ctrl-w = start a window command (cw)
cw<hjkl> = move left,up,down,right one window
cwcw = cycle windows
cw_ = maximize current window
cw= = make all windows equal size
10cw+ = increase window by 10 lines (- would decrease)
:only = make this the only window
TABS

:tabs = list all tabs
:tabnext = next tab
:tabdo %s/2.5.2/2.6.0/gc
:tabnew
:tabedit
:tabfirst
:tablast
:tabm <n> = move tab to position
MARKERS


m<a-z> = set mark, labeled a-z

‘<a-z> = go to mark

d’<a-z> = delete from here to mark

y’<a-z> = yank from here to mark
CONFIGURATION

Mainly ~/.vimrc
Directories
  ~/.vim/plugin
  ~/.vim/syntax
  ~/.vim/autoload
Used to define your environment
INDENTING COMMANDS


:set tabstop=4

:set shifttab=4

:set softtabstop=4

:set expandtab, :set noexpandtab

:retab = Change tabs to spaces and vice versa, depending on expandtab
PLUGINS



vim.org - currently over 4,000 plugins
NERDtree
phpcomplete
spf13-vim
THEMES

Tons built in

:colorscheme <tab>
SELFISH PLUG

HeadNorth helps local people from San Diego with Spinal Cord Injuries

Spinal Cord Injuries are crippling, HeadNorth tries to help in the transition

They go far beyond, and help with chairs, even remodeling homes.

Donate Here

Long version:
  www.kintera.org/faf/r.asp?t=4&i=1035746&u=1035746-369694704

www.headnorthevents.org
THANK YOU!



Please rate my talk (GOOD & BAD)

  https://joind.in/event/view/1105

Try vimtutor, vimdiff, mvimdiff

Contenu connexe

Similaire à VIM for the PHP Developer

Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.VimLin Yo-An
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaLin Yo-An
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchinaguestcf9240
 
Mission vim possible-full
Mission vim possible-fullMission vim possible-full
Mission vim possible-fullSam Gottfried
 
Rubizza #1 | Special Lecture. Vim
Rubizza #1 | Special Lecture. Vim Rubizza #1 | Special Lecture. Vim
Rubizza #1 | Special Lecture. Vim Rubizza
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vimsambismo
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con RailsSvet Ivantchev
 
Mission vim possible
Mission vim possibleMission vim possible
Mission vim possibleSam Gottfried
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsAbhay Sapru
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Introduction to programming - class 3
Introduction to programming - class 3Introduction to programming - class 3
Introduction to programming - class 3Paul Brebner
 
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Arc & Codementor
 

Similaire à VIM for the PHP Developer (20)

Perl.Hacks.On.Vim
Perl.Hacks.On.VimPerl.Hacks.On.Vim
Perl.Hacks.On.Vim
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchina
 
Perl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim PerlchinaPerl.Hacks.On.Vim Perlchina
Perl.Hacks.On.Vim Perlchina
 
Mission vim possible-full
Mission vim possible-fullMission vim possible-full
Mission vim possible-full
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Rubizza #1 | Special Lecture. Vim
Rubizza #1 | Special Lecture. Vim Rubizza #1 | Special Lecture. Vim
Rubizza #1 | Special Lecture. Vim
 
Vim and Python
Vim and PythonVim and Python
Vim and Python
 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vim
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
 
Vim
VimVim
Vim
 
Mission vim possible
Mission vim possibleMission vim possible
Mission vim possible
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Vim For Php
Vim For PhpVim For Php
Vim For Php
 
Introduction to programming - class 3
Introduction to programming - class 3Introduction to programming - class 3
Introduction to programming - class 3
 
vim - Tips and_tricks
vim - Tips and_tricksvim - Tips and_tricks
vim - Tips and_tricks
 
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
Codementor Office Hours with Eric Chiang: Stdin, Stdout: pup, Go, and life at...
 
VIM for Programmers
VIM for ProgrammersVIM for Programmers
VIM for Programmers
 

Dernier

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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...Zilliz
 
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 businesspanagenda
 
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.pdfOrbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
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 FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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 educationjfdjdjcjdnsjd
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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 2024Victor Rentea
 

Dernier (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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...
 
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
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 

VIM for the PHP Developer

  • 1. VIM For The PHP Developer Anything you can do, I can do faster.
  • 2.
  • 4. WHY VIM? Simple Server/Remote
  • 5. WHY VIM? Simple Development Speed Server/Remote
  • 6. WHY VIM? Simple Development Speed Server/Remote Cross Platform
  • 7. WHY VIM? Simple Development Speed Server/Remote Same Environment Cross Platform Everywhere
  • 8. VIM MODES Normal Insert Bottom Line
  • 9. VIM MODES Normal Insert Bottom Line Should be used most of the time. Move around document, cut/copy/paste, search/replace, etc...
  • 10. VIM MODES Normal Insert Bottom Line Should be used most Typing mode, used to of the time. Move enter new text. around document, Noobs spend too cut/copy/paste, much time here. search/replace, etc...
  • 11. VIM MODES Normal Insert Bottom Line Should be used most Typing mode, used to Used to change the of the time. Move enter new text. vim environment, around document, Noobs spend too open/close buffers, cut/copy/paste, much time here. and so much more. search/replace, etc...
  • 12. SIMPLEST EDITING vi <filename> i - go into insert mode edit text <esc> - exit insert mode :x,:wq - save and exit
  • 13. SIMPLEST EDITING vi <filename> i - go into insert mode edit text <esc> - exit insert mode :x,:wq - save and exit
  • 14. MOVING AROUND A DOCUMENT
  • 15. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right
  • 16. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word
  • 17. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line
  • 18. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line (,) = beginning / end of sentence
  • 19. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line (,) = beginning / end of sentence {,} = beginning / end of paragraph
  • 20. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line (,) = beginning / end of sentence {,} = beginning / end of paragraph G = end of file (1G goes to top, nG goes to line n)
  • 21. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line (,) = beginning / end of sentence {,} = beginning / end of paragraph G = end of file (1G goes to top, nG goes to line n) % = go to matching bracket
  • 22. MOVING AROUND A DOCUMENT h,j,k,l = left, up, down, right w,b = forward/backward one word 0,$ = beginning/end of line (,) = beginning / end of sentence {,} = beginning / end of paragraph G = end of file (1G goes to top, nG goes to line n) % = go to matching bracket zt,zz,zb = move current line to top/center/bottom of viewport
  • 24. ENTERING INSERT MODE i,a = insert text before/after cursor
  • 25. ENTERING INSERT MODE i,a = insert text before/after cursor I,A = insert text at the beginning/end of line
  • 26. ENTERING INSERT MODE i,a = insert text before/after cursor I,A = insert text at the beginning/end of line o,O = open a new line after/before current one
  • 28. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards
  • 29. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence
  • 30. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] =
  • 31. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] = g=all occurrences on a line
  • 32. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] = g=all occurrences on a line i=case insensitive
  • 33. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] = g=all occurrences on a line i=case insensitive c=confirm
  • 34. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] = g=all occurrences on a line i=case insensitive c=confirm ctrl-a, ctrl-x = increment/decrement next number on line
  • 35. SEARCH AND REPLACE /string, ?string = search for string forwards / backwards n,N = find next/previous occurrence :%s/find/replace/[ g | i |c ] = g=all occurrences on a line i=case insensitive c=confirm ctrl-a, ctrl-x = increment/decrement next number on line :bufdo /search/ = search all open buffers
  • 36. EDITING TEXT x = delete single character w = word d = delete (cut) dw = delete word y = yank (copy) yw = yank word p,P = paste after/before examples u = undo dd, yy, <n>dd, <n>yy J = join lines, current and next line <n>p, <n>u <,> = reduce, increase indentation d$, yG, <n>cc, <n>cw, c$ . = repeat last command c = change
  • 38. BUFFERS The contents of a file are loaded into memory (buffer)
  • 39. BUFFERS The contents of a file are loaded into memory (buffer) :buffers, :ls = list buffers :e <file> = edit/open a file into a new buffer :bn, :bp = next/previous buffer :bd = delete buffer :buffer <n> = jump to buffer <n> :sbuffer <file> = split buffer, open in another window
  • 40. WINDOWS :hsplit,:vsplit = split horizonal/vertical ctrl-w = start a window command (cw) cw<hjkl> = move left,up,down,right one window cwcw = cycle windows cw_ = maximize current window cw= = make all windows equal size 10cw+ = increase window by 10 lines (- would decrease) :only = make this the only window
  • 41. TABS :tabs = list all tabs :tabnext = next tab :tabdo %s/2.5.2/2.6.0/gc :tabnew :tabedit :tabfirst :tablast :tabm <n> = move tab to position
  • 42. MARKERS m<a-z> = set mark, labeled a-z ‘<a-z> = go to mark d’<a-z> = delete from here to mark y’<a-z> = yank from here to mark
  • 43. CONFIGURATION Mainly ~/.vimrc Directories ~/.vim/plugin ~/.vim/syntax ~/.vim/autoload Used to define your environment
  • 44. INDENTING COMMANDS :set tabstop=4 :set shifttab=4 :set softtabstop=4 :set expandtab, :set noexpandtab :retab = Change tabs to spaces and vice versa, depending on expandtab
  • 45. PLUGINS vim.org - currently over 4,000 plugins NERDtree phpcomplete spf13-vim
  • 47. SELFISH PLUG HeadNorth helps local people from San Diego with Spinal Cord Injuries Spinal Cord Injuries are crippling, HeadNorth tries to help in the transition They go far beyond, and help with chairs, even remodeling homes. Donate Here Long version: www.kintera.org/faf/r.asp?t=4&i=1035746&u=1035746-369694704 www.headnorthevents.org
  • 48. THANK YOU! Please rate my talk (GOOD & BAD) https://joind.in/event/view/1105 Try vimtutor, vimdiff, mvimdiff

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n