SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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...Martijn de Jong
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

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

Hinweis der Redaktion

  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