SlideShare a Scribd company logo
1 of 75
Download to read offline
VIM for (PHP)
Programmers
        Andrei Zmievski
         Outspark, Inc

ZendCon ā“ September 17, 2008
help

~   learn how to get help effectively
~   :help is your friend
~   use CTRL-V before a CTRL sequence command
~   use i_ and v_ preļ¬xes to get help for CTRL
    sequences in Insert and Visual modes
~   use CTRL-] (jump to tag) and CTRL-T (go back)
    in help window
intro
~   how well do you know vimā€™s language?
~   what is the alphabet?
~   look at your keyboard
~   can you name what every key does?
~   modes - what are they?
~   how many do you know?
~   how many do you use?
intro
if you donā€™t like the language, change it
example: how do you quit vim quickly?
  ZZ (exit with saving)
  ZQ (exit without save)
  or
  :nmap ,w :x<CR>
  :nmap ,q :q!<CR>
tip: set showcmd to see partial commands as
you type them
where am i?

How do you tell where you are?
~   simple - CTRL-G
~   detailed - gCTRL-G
~   do yourself a favor and set ruler
~   shows line, column, and percentage in status line
~   or conļ¬gure it however you want with
    ā€˜rulerformatā€™
moving

~   do you us h/j/k/l for moving?
~   or are you stuck in GUIarrowy world?
~   if you are, re-learn
~   save yourself countless miles of movement
    between home row and arrows
moving

How do you move to:
~   start/end of buffer? gg and G
~   line n? nG or ngg
~   n% into the ļ¬le? n%
~   the ļ¬rst non-blank character in the line? ^
~   ļ¬rst non-blank character on next line? <CR>
~   ļ¬rst non-blank character on previous line? -
marks
~   we can bookmark locations in the buffer
~   m<letter> sets mark named <letter> at
    current location
~   `<letter> jumps precisely to that mark
~   ā€˜<letter> jumps to the line with the mark
~   lowercase letter: mark is local to the buffer
~   uppercase letter: mark is global, your buffer will
    be switched to the ļ¬le with the mark
~   :marks shows you your current marks
marks

~   marks are very handy for changing text
~   set a mark (letā€™s say ma)
~   then you can do:
    ~   c`a - change text from cursor to mark a
    ~   d`a - delete text from cursor to mark a
    ~   =ā€™a - reformat lines from current one to the one
        with mark a
marks
~   letā€™s say you jump somewhere
~   how do you go back?
~   `` moves you between the last two locations
~   you can set ` (the context mark) explicitly:
    ~   m`, jump elsewhere, then come back with ``
    tip: CTRL-O and CTRL-I move between
    positions in the full jump history, but canā€™t be
    used as motions
    ā€˜. and `. - jump to the line or exact location of
    the last modiļ¬cation
insert


~   gi - incredibly handy
~   goes to Insert mode where you left it last time
~   scenario: edit something, exit Insert, go look at
    something else, then gi back to restart editing
insert
Some more goodies:
~   CTRL-Y and CTRL-E (avoid work if you can)
    ~   inserts chars from above or below the cursor
~   CTRL-A (oops, i want to do that again)
    ~   inserts previously inserted text
~   CTRL-R=<expr> (built-in calculator)
    ~   inserts anything vim can calculate
~   CTRL-T and CTRL-D (tab and de-tab)
    ~   inserts or deletes one shiftwidth of indent at the start of
        the line
delete


set your <Backspace> free
:set backspace=start,indent,eol
lets you backspace past the start of edit, auto-
indenting, and even start of the line
search

~   searching is essential
~   movement and information
~   how do you search?
~   f/F/t/T anyone?
~   how about * and #?
search
Search within the line:
~   f/F<char> jumps to the ļ¬rst <char> to the
    right/left and places cursor on it
~   t/T<char> jumps does the same, but stops
    one character short of it
~   df; - delete text from cursor to the ļ¬rst ; to
    the right
~   cT$ - change text from cursor up to the ļ¬rst
    $ to the left
search
~   often you want to ļ¬nd other instances of word
    under the cursor
    ~   */# - ļ¬nd next/previous instance of whole word
    ~   g*/g# - ļ¬nd next/previous instance of partial word
~   or ļ¬nd lines with a certain word:
    ~   [I and ]I - list lines with word under the cursor
    ~   more convenient to use a mapping to jump to a line:
         :map ,f [I:let nr = input(quot;Which one: quot;)<Bar>exe
         quot;normal quot; . nr .quot;[tquot;<CR>
search

~   of course, thereā€™s always regexp search
~   /<pattern> - search forward for <pattern>
~   ?<pattern> - search backward for <pattern>
~   n repeats the last search
~   N repeats it in the opposite direction
~   vim regexp language is too sophisticated to be
    covered here
search

Control your search options
~   :set wrapscan - to make search wrap around
~   :set incsearch - incremental search, <Enter>
    accepts, <Esc> cancels
~   :set ignorecase - case-insensitive search, or use
    this within the pattern:
    ~   c - force case-insensitive search
    ~   C - force case-sensitive search
search

~   remember that every search/jump can be used
    as a motion argument
~   d/^# - delete everything up to the next
    comment
~   y/^class/;?function - copy everything from
    current point to the ļ¬rst function before the
    ļ¬rst class
replace
~   :[range]s/<pattern>/<replace>/{flags}
    is the substitute command
~   used mainly with range addresses
~   range addresses are very powerful (read the
    manual)
~   but who wants to count out lines and do
    something like :-23,ā€™ts/foo/bar/
~   in reality you almost always use a couple of
    shortcuts and Visual mode for the rest
replace
~   useful range addresses:
    ~   % - equal to 1,$ (the entire ļ¬le)
    ~   . - current line
    ~   /<pattern>/ or ?<pattern>? - line where
        <pattern> matches
~   :%s/foo/bar/   - replace ļ¬rst foo in each
    matching line with bar in the entire ļ¬le
~   :.,/</body>/s,<br>,<br/>,gc        - ļ¬x br tags
    from current line until the one with </body> in
    it, asking for conļ¬rmation (c - ā€˜cautiousā€™ mode)
replace


~   & - repeat last substitution on current line
~   :&& - repeat it with the ļ¬‚ags that were used
~   g& - repeat substitution globally, with ļ¬‚ags
text objects

~   better know what they are
~   since they are fantastically handy
~   can be used after an operator or in Visual mode
~   come in ā€œinnerā€ and ā€œambientā€ ļ¬‚avors
~   inner ones always select less text than ambient
    ones
text objects
~   aw, aW - ambient word or WORD (see docs)
~   iw, iW - inner word or WORD (see docs)
~   as, is - ambient or inner sentence
~   ap, ip - ambient or inner paragraph
~   a{, i{ - whole {..} block or text inside it
~   a(, i( - whole (..) block or just text inside it
~   a<, i< - whole <..> block or just text inside it
text objects
~   there are some cooler ones
~   aā€™, iā€™    - single-quoted string or just the text
    inside
~   aā€, iā€    - double-quoted string or just the text
    inside
    ~   note that these are smart about escaped quotes
        inside strings
~   at, it- whole tag block or just text inside
    (HTML and XML tags)
text objects

examples:
 das - delete the sentence, including whitespace after
 ci( - change text inside (..) block
 yat - copy the entire closest tag block the cursor is
 inside
 gUiā€™ - uppercase text inside the single-quoted string
 vip - select the paragraph in Visual mode, without
 whitespace after
copy/delete/paste
~   you should already know these
~   y - yank (copy), d - delete, p - paste after, P -
    paste before
~   ]p, ]P - paste after/before but adjust the
    indent
~   Useful mappings to paste and reformat/reindent
     :nnoremap <Esc>P        P'[v']=
     :nnoremap <Esc>p        p'[v']=
registers

~   registers: your multi-purpose clipboard
~   you use them without even knowing
~   every y or d command copies to a register
~   unnamed or named
~   ā€œ<char> before a copy/delete/paste speciļ¬es
    register named <char>
registers
~   copying to uppercase registers append to their
    contents
    ~   useful for picking out bits from the buffers and
        pasting as a chunk
~   ā€œwyy - copy current line into register w
~   ā€œWD - cut the rest of the line and append it to
    the contents of register W
~   ā€œwp - paste the contents of register w
~   CTRL-Rw - insert the contents of register w (in
    Insert mode)
registers

~   you can record macros into registers
    ~   q<char> - start recording typed text into register
        <char>
    ~   next q stops recording
    ~   @<char> executes macro <char>
    ~   @@ repeats last executed macro
~   use :reg to see whatā€™s in your registers
undo

~   original vi had only one level of undo
~   yikes!
~   vim has unlimited (limited only by memory)
~   set ā€˜undolevelsā€™ to what you need (1000
    default)
undo

~   simple case: u - undo, CTRL-R - redo
~   vim 7 introduces branched undo
~   if you undo something, and make a change, a
    new branch is created
~   g-, g+ - go to older/newer text state (through
    branches)
undo

~   you can travel through time
    ~   :earlier Ns,m,h - go to text state as it was N
        seconds, minutes, hours ago
    ~   :later Ns,m,h - go to a later text state similarly
~   :earlier 10m   - go back 10 minutes, before I
    drank a can of Red Bull and made all these crazy
    changes. Whew.
visual mode
~   use it, it's much easier than remembering
    obscure range or motion commands
~   start selection with:
    ~   v - characterwise,
    ~   V - linewise
    ~   CTRL-V - blockwise
~   use any motion command to change selection
~   can execute any normal or : command on the
    selection
visual mode
~   Visual block mode is awesome
~   especially for table-like text
    tip: o switches cursor to the other corner,
    continue selection from there
~   Once you are in block mode:
    ~   I<text><Esc> - insert <text> before block on every
        line
    ~   A<text><Esc> - append <text> after block on every line
    ~   c<text><Esc> - change every line in block to <text>
    ~   r<char><Esc> - replace every character with <char>
abbreviations

~   Real-time string replacement
~   Expanded when a non-keyword character is
    typed
    ~   :ab tempalte template - ļ¬x misspellings
    ~   more complicated expansion:
    ~   :iab techo <?php echo ?><Left><Left><Left>
windows

~   learn how to manipulate windows
~   learn how to move between them
~   :new, :sp should be at your ļ¬ngertips
~   CTRL-W commands - learn essential ones for
    resizing and moving between windows
tab pages

~   vim 7 supports tab pages
~   :tabe <file> to edit ļ¬le in a new tab
~   :tabc to close
~   :tabn, :tabp (or gt, gT to switch)
~   probably want to map these for easier
    navigation (if gt, gT are too difļ¬cult)
completion
~   vim is very completion friendly
~   just use <Tab> on command line
    ~   for ļ¬lenames, set ā€˜wildmenuā€™ and ā€˜wildmodeā€™ (I
        like quot;list:longest,fullquot;)
    ~   :new ~/dev/fo<Tab> - complete ļ¬lename
    ~   :help ā€˜comp<Tab> - complete option name
    ~   :re<Tab> - complete command
    ~   hit <Tab> again to cycle, CTRL-N for next match,
        CTRL-P for previous
completion

~   CTRL-X starts completion mode in Insert mode
~   follow with CTRL- combos (:help ins-
    completion)
~   i mostly use ļ¬lename, identiļ¬er, and omni
    completion
~   when there are multiple matches, a nice
    completion windows pops up
completion
~   CTRL-X CTRL-F     to complete ļ¬lenames
~   CTRL-X CTRL-N     to complete identiļ¬ers
~   hey, thatā€™s so useful Iā€™ll remap <Tab>

      ā€œ Insert <Tab> or complete identifier
      ā€œ if the cursor is after a keyword character
      function MyTabOrComplete()
          let col = col('.')-1
          if !col || getline('.')[col-1] !~ 'k'
               return quot;<tab>quot;
          else
               return quot;<C-N>quot;
          endif
      endfunction

      inoremap <Tab> <C-R>=MyTabOrComplete()<CR>
completion


~   omni completion is heuristics-based
~   guesses what you want to complete
~   speciļ¬c to the ļ¬le type youā€™re editing
~   more on it later
maps
~   maps for every mode and then some
~   tired of changing text inside quotes?
     :nmap X ciquot;
~   make vim more browser-like?
     :nmap <Space> <PageDown>
~   insert your email quickly?
     :imap ;EM me@mydomain.com
~   make <Backspace> act as <Delete> in Visual
    mode?
     :vmap <BS> x
options

~   vim has hundreds of options
~   learn to control the ones you need
~   :options lets you change options interactively
~   :options | resize is better (since there are
    so many)
sessions
~   a session keeps the views for all windows, plus
    the global settings
~   you can save a session and when you restore it
    later, the window layout looks the same.
~   :mksession <file> to write out session to a
    ļ¬le
~   :source <file> to load session from a ļ¬le
~   vim -S <file> to start editing a session
miscellaneous
~   gf - go to ļ¬le under cursor (CTRL-W CTRL-F
    for new window)
~   :read in contents of ļ¬le or process
    ~   :read foo.txt - read in foo.txt
    ~   :read !wc %:h - run wc on current ļ¬le and insert
        result into the text
~   ļ¬lter text: :%!sort, :%!grep, or use :! in visual
    mode
    ~   i like sorting lists like this: vip:!sort
miscellaneous

~   use command-line history
~   : and / followed by up/down arrows move
    through history
~   : and / followed by preļ¬x and arrows restrict
    history to that preļ¬x
~   q: and q/ for editable history (<Enter>
    executes, CTRL-C copies to command line)
miscellaneous
~   CTRL-A and CTRL-X to increment/decrement
    numbers under the cursor (hex and octal too)
~   ga   - what is this character under my cursor?
~   :set number to turn line numbers on
~   or use this to toggle line numbers:
     :nmap <silent> <F6> set number!<CR>
~   :set autowrite - stop vim asking if you want
    to write the ļ¬le before leaving buffer
~   CTRL-E/CTRL-Y - scroll window down/up
    without moving cursor
miscellaneous
~   :set scroloff=N to start scrolling when
    cursor is N lines from the top/bottom edge
~   :set updatecount=50 to write swap ļ¬le to
    disk after 50 keystrokes
~   :set showmatch matchtime=3 - when
    bracket is inserted, brieļ¬‚y jump to the matching
    one
~   in shell: fc invokes vim on last command, and
    runs it after vim exits (or fc N to edit
    command N in history)
~   vimdiff in shell (:help vimdiff)
miscellaneous


~   map CTRL-L to piece-wise copying of the line
    above the current one
     imap <C-L> @@@<ESC>hhkywjl?@@@<CR>P/@@@<CR>3s
customization
~   customize vim by placing ļ¬les in you ~/.vim dir
~   filetype plugin on, filetype indent on
.vimrc - global settings
.vim/
	

 after/	

            	

 	

 - files that are loaded at the very end
	

 	

 ftplugin/
	

 	

 plugin/
	

 	

 syntax/
	

 	

 ...
	

 autoload/	

	

 - automatically loaded scripts
	

 colors/ 	

 	

 - custom color schemes
	

 doc/	

 	

 	

 - plugin documentation
	

 ftdetect/	

	

 - filetype detection scripts
	

 ftplugin/	

	

 - filetype plugins
	

 indent/	

 	

 - indent scripts
	

 plugin/	

 	

 - plugins
	

 syntax/	

 	

 - syntax scripts
php: linting
~   vim supports arbitrary build/lint commands
~   if we set 'makeprg' and 'errorformat'
    appropriately..
     :set makeprg=php -l %
     :set errorformat=%m in %f on line %l
~   now we just type :make (and <Enter> a couple
    of times)
~   cursor jumps to line with syntax error
php: match pairs
~   you should be familiar with % command (moves
    cursor to matching item)
~   used with (), {}, [], etc
~   but can also be used to jump between PHP and
    HTML tags
~   use matchit.vim plugin
~   but syntax/php.vim has bugs and typos in the
    matching rule
~   i provide my own
php: block objects
~   similar to vim's built-in objects
    ~   aP - PHP block including tags
    ~   iP - text inside PHP block
    examples:
    ~   vaP - select current PHP block (with tags)
    ~   ciP - change text inside current PHP block
    ~   yaP - copy entire PHP block (with tags)
~   provided in my .vim/ftplugin/php.vim ļ¬le
php: syntax options
~   vim comes with a very capable syntax plugin for
    PHP
~   provides a number of options
    ~   let php_sql_query=1 to highlight SQL syntax in
        strings
    ~   let php_htmlInStrings=1 to highlight HTML in
        string
    ~   let php_noShortTags = 1 to disable short tags
    ~   let php_folding = 1 to enable folding for
        classes and functions
php: folding

~   learn to control folding
    ~   zo - open fold (if the cursor is on the fold line)
    ~   zc - close closest fold
    ~   zR - open all folds
    ~   zM - close all folds
    ~   zj - move to the start of the next fold
    ~   zk - move to the end of the previous fold
php: tags
~   for vim purposes, tags are PHP identiļ¬ers
    (classes, functions, constants)
~   you can quickly jump to the deļ¬nition of each
    tag, if you have a tags ļ¬le
~   install Exuberant Ctags
~   it can scan your scripts and output tags ļ¬le,
    containing identiļ¬er info
~   currently does not support class membership
    info (outputs methods as functions)
~   have to apply a third-party patch to ļ¬x
php: tags

~   use mapping to re-build tags ļ¬le after editing
     nmap <silent> <F4>
              :!ctags-ex -f ./tags
              --langmap=quot;php:+.incquot;
              -h quot;.php.incquot; -R --totals=yes
              --tag-relative=yes --PHP-kinds=+cf-v .<CR>

     set tags=./tags,tags

~   all PHP ļ¬les in current directory and under it
    recursively will be scanned
php: tags
~   CTRL-] - jump to tag under cursor
~   CTRL-W CTRL-] - jump to tag in a new window
~   :tag <ident> - jump to an arbitrary tag
~   :tag /<regexp> - jump to or list tags matching
    <regexp>
~   if multiple matches - select one from a list
~   :tselect <ident> or /<regexp> - list tags instead
    of jumping
~   CTRL-T - return to where you were
~   See also taglist.vim plugin
php: completion

~   vim 7 introduces powerful heuristics-based
    omni completion
~   CTRL-X CTRL-O starts the completion (i map it
    to CTRL-F)
~   completes classes, variables, methods in a smart
    manner, based on context
php: completion

~   completes built-in functions too
~   function completion shows prototype preview
    ~   array_<CTRL-X><CTRL-O> shows list of array
        functions
    ~   select one from the list, and the prototype shows in
        a preview window
    ~   CTRL-W CTRL-Z to close preview window
php: completion

~   switches to HTML/CSS/Javascript completion
    outside PHP blocks
~   see more:
    ~   :help ins-completion
    ~   :help popupmenu-completion
    ~   :help popupmenu-keys
plugins

~   vim can be inļ¬nitely customized and expanded
    via plugins
~   there are thousands already written
~   installation is very easy, usually just drop them
    into .vim/plugin
~   read instructions ļ¬rst though
netrw
~   makes it possible to read, write, and browse remote
    directories and ļ¬les
~   i usually use it over ssh connections via scp
~   need to run ssh-agent to avoid continuous prompts for
    passphrase
~   don't use passphrase-less keys!
~   once set up:
    ~   vim scp://hostname/path/to/file
    ~   :new scp://hostname/path/to/dir/
NERDTree


~   similar to netrw browser but looks more like a
    hierarchical explorer
~   does not support remote ļ¬le operations
    ~   :nmap <silent> <F7> :NERDTreeToggle<CR>
taglist

~   provides an overview of the source code
~   provides quick access to classes, functions,
    constants
~   automatically updates window when switching
    buffers
~   can display prototype and scope of a tag
~   requires Exuberant Ctags
taglist
~   stick this in ~/.vim/after/plugin/general.vim
let Tlist_Ctags_Cmd = quot;/usr/local/bin/ctags-exquot;
let Tlist_Inc_Winwidth = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Process_File_Always = 1
let Tlist_Enable_Fold_Column = 0
let tlist_php_settings = 'php;c:class;d:constant;f:function'
if exists('loaded_taglist')
    nmap <silent> <F8> :TlistToggle<CR>
endif
snippetsEmu
~   emulates some of the functionality of TextMate
    snippets
~   supports many languages, including PHP/HTML/
    CSS/Javascript
~   by default binds to <Tab> but that's annoying
~   need to remap the key after it's loaded
~   put this in ~/.vim/after/plugin/general.vim
      if exists('loaded_snippet')
          imap <C-B> <Plug>Jumper
      endif
      inoremap <Tab> <C-R>=MyTabOrComplete()<CR>
php documentor
~   inserts PHP Documentor blocks automatically
~   works in single or multi-line mode
~   doesnā€™t provide mappings by default
~   read documentation to set up default variables
    for copyright, package, etc
~   put this in ~/.vim/ftplugin/php.vim
inoremap <buffer> <C-P> <Esc>:call PhpDocSingle()<CR>i
nnoremap <buffer> <C-P> :call PhpDocSingle()<CR>
vnoremap <buffer> <C-P> :call PhpDocRange()<CR>
let g:pdv_cfg_Uses = 1
xdebug-ger

~   allows debugging with xdebug through DBGp
    protocol
~   fairly basic, but does the job
~   vim needs to be compiled with +python feature
~   see resources section for documentation links
vcscommand



~   provides interface to CVS/SVN
~   install it, then :help vcscommand
conclusion

~   vim rules
~   this has been only a partial glimpse
~   from my very subjective point of view
~   donā€™t be stuck in an editor rut
~   keep reading and trying things out
resources
~   vim tips: http://www.vim.org/tips/
~   vim scripts: http://www.vim.org/scripts/index.php
~   Exuberant Ctags: http://ctags.sourceforge.net
~   PHP patch for ctags: http://www.live-emotion.com/memo/index.php?
    plugin=attach&refer=%CA%AA%C3%D6&openļ¬le=ctags-5.6j-php.zip
~   article on xdebug and vim: http://2bits.com/articles/using-vim-and-
    xdebug-dbgp-for-debugging-drupal-or-any-php-application.html
~   more cool plugins:
    ~   Surround: http://www.vim.org/scripts/script.php?script_id=1697
    ~   ShowMarks: http://www.vim.org/scripts/script.php?script_id=152
    ~   Vim Outliner: http://www.vim.org/scripts/script.php?script_id=517
    ~   Tetris: http://www.vim.org/scripts/script.php?script_id=172
quot;As with everything, best not to
  look too deeply into this.quot;
Thank You!


  http://outspark.com/

http://gravitonic.com/talks/

More Related Content

What's hot

Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
Ā 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsDivye Kapoor
Ā 
Linux training
Linux trainingLinux training
Linux trainingParker Fong
Ā 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?Pradeep Kumar
Ā 
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...Linaro
Ā 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loaderiamumr
Ā 
Motherboard
MotherboardMotherboard
MotherboardAMZAD KHAN
Ā 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessHardeep Bhurji
Ā 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???Dinesh Damodar
Ā 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linuxVandana Salve
Ā 
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•Kohei Tokunaga
Ā 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntuSim Janghoon
Ā 
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, Intel
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, IntelXPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, Intel
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, IntelThe Linux Foundation
Ā 
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„wata2ki
Ā 
Reverse eningeering
Reverse eningeeringReverse eningeering
Reverse eningeeringKent Huang
Ā 
Arduino ļ¼‹ rcs620sć§éŠć¼ć†
Arduino ļ¼‹ rcs620sć§éŠć¼ć†Arduino ļ¼‹ rcs620sć§éŠć¼ć†
Arduino ļ¼‹ rcs620sć§éŠć¼ć†treby
Ā 
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤Takashi Hoshino
Ā 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modulesdibyajyotig
Ā 

What's hot (20)

Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
Ā 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOs
Ā 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
Ā 
Linux training
Linux trainingLinux training
Linux training
Ā 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
Ā 
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems ā€“ Building a complete Chain of Trust upon existing...
Ā 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loader
Ā 
Motherboard
MotherboardMotherboard
Motherboard
Ā 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting Process
Ā 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
Ā 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linux
Ā 
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•
eStargzć‚¤ćƒ”ćƒ¼ć‚øćØlazy pullingć«ć‚ˆć‚‹é«˜é€ŸćŖć‚³ćƒ³ćƒ†ćƒŠčµ·å‹•
Ā 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
Ā 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
Ā 
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, Intel
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, IntelXPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, Intel
XPDDS18: EPT-Based Sub-page Write Protection On Xenc - Yi Zhang, Intel
Ā 
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„
ARM Linux恮ļ¼­ļ¼­ļ¼µćÆć‚ć‹ć‚Šć«ćć„
Ā 
Reverse eningeering
Reverse eningeeringReverse eningeering
Reverse eningeering
Ā 
Arduino ļ¼‹ rcs620sć§éŠć¼ć†
Arduino ļ¼‹ rcs620sć§éŠć¼ć†Arduino ļ¼‹ rcs620sć§éŠć¼ć†
Arduino ļ¼‹ rcs620sć§éŠć¼ć†
Ā 
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤
10åˆ†ć§åˆ†ć‹ć‚‹Linux惖惭惃ć‚Æćƒ¬ć‚¤ćƒ¤
Ā 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
Ā 

Viewers also liked

Habits 2007
Habits 2007Habits 2007
Habits 2007Dang Tan
Ā 
Code analysis tools (for PHP)
Code analysis tools (for PHP)Code analysis tools (for PHP)
Code analysis tools (for PHP)Karlen Kishmiryan
Ā 
8080 8085 assembly language_programming manual programando
8080 8085 assembly  language_programming manual programando 8080 8085 assembly  language_programming manual programando
8080 8085 assembly language_programming manual programando Universidad de Tarapaca
Ā 
Vim Rocks!
Vim Rocks!Vim Rocks!
Vim Rocks!Kent Chen
Ā 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were PossibleLukas Eder
Ā 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Vikas Chauhan
Ā 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksPhill Sparks
Ā 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
Ā 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
Ā 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
Ā 

Viewers also liked (11)

Habits 2007
Habits 2007Habits 2007
Habits 2007
Ā 
Code analysis tools (for PHP)
Code analysis tools (for PHP)Code analysis tools (for PHP)
Code analysis tools (for PHP)
Ā 
8080 8085 assembly language_programming manual programando
8080 8085 assembly  language_programming manual programando 8080 8085 assembly  language_programming manual programando
8080 8085 assembly language_programming manual programando
Ā 
Vim Rocks!
Vim Rocks!Vim Rocks!
Vim Rocks!
Ā 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
Ā 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
Ā 
Software Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill SparksSoftware Design Patterns in Laravel by Phill Sparks
Software Design Patterns in Laravel by Phill Sparks
Ā 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
Ā 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Ā 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
Ā 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Ā 

Similar to VIM for (PHP) Programmers

Vim For Php
Vim For PhpVim For Php
Vim For PhpLiu Lizhi
Ā 
VIM for Programmers
VIM for ProgrammersVIM for Programmers
VIM for ProgrammersAkash Agrawal
Ā 
Vim and Python
Vim and PythonVim and Python
Vim and Pythonmajmcdonald
Ā 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foobrian_dailey
Ā 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editorJose Pla
Ā 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vimsambismo
Ā 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxKenny (netman)
Ā 
101 3.8.2 vim reference card
101 3.8.2 vim reference card101 3.8.2 vim reference card
101 3.8.2 vim reference cardAcƔcio Oliveira
Ā 
Vim Hacks
Vim HacksVim Hacks
Vim HacksLin Yo-An
Ā 
How To VIM
How To  VIMHow To  VIM
How To VIMDiversido
Ā 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdfAdelinaBronda1
Ā 
VI Editors
VI EditorsVI Editors
VI EditorsDeivanai
Ā 
Perl Presentation
Perl PresentationPerl Presentation
Perl PresentationSopan Shewale
Ā 
Cheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regexCheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regexKasper de Waard
Ā 
Hex file and regex cheat sheet
Hex file and regex cheat sheetHex file and regex cheat sheet
Hex file and regex cheat sheetMartin Cabrera
Ā 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdfAnkitPangasa1
Ā 

Similar to VIM for (PHP) Programmers (20)

Vim For Php
Vim For PhpVim For Php
Vim For Php
Ā 
VIM for Programmers
VIM for ProgrammersVIM for Programmers
VIM for Programmers
Ā 
Vim and Python
Vim and PythonVim and Python
Vim and Python
Ā 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
Ā 
n
nn
n
Ā 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
Ā 
Tuffarsi in vim
Tuffarsi in vimTuffarsi in vim
Tuffarsi in vim
Ā 
Linux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regxLinux fundamental - Chap 06 regx
Linux fundamental - Chap 06 regx
Ā 
Vim
VimVim
Vim
Ā 
101 3.8.2 vim reference card
101 3.8.2 vim reference card101 3.8.2 vim reference card
101 3.8.2 vim reference card
Ā 
3.8.b vim reference card
3.8.b vim reference card3.8.b vim reference card
3.8.b vim reference card
Ā 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
Ā 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
Ā 
How To VIM
How To  VIMHow To  VIM
How To VIM
Ā 
Vim Cheat Sheet.pdf
Vim Cheat Sheet.pdfVim Cheat Sheet.pdf
Vim Cheat Sheet.pdf
Ā 
VI Editors
VI EditorsVI Editors
VI Editors
Ā 
Perl Presentation
Perl PresentationPerl Presentation
Perl Presentation
Ā 
Cheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regexCheatsheet: Hex file headers and regex
Cheatsheet: Hex file headers and regex
Ā 
Hex file and regex cheat sheet
Hex file and regex cheat sheetHex file and regex cheat sheet
Hex file and regex cheat sheet
Ā 
vim-cheatsheet.pdf
vim-cheatsheet.pdfvim-cheatsheet.pdf
vim-cheatsheet.pdf
Ā 

More from ZendCon

Framework Shootout
Framework ShootoutFramework Shootout
Framework ShootoutZendCon
Ā 
Zend_Tool: Practical use and Extending
Zend_Tool: Practical use and ExtendingZend_Tool: Practical use and Extending
Zend_Tool: Practical use and ExtendingZendCon
Ā 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i TutorialZendCon
Ā 
PHP on Windows - What's New
PHP on Windows - What's NewPHP on Windows - What's New
PHP on Windows - What's NewZendCon
Ā 
PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudZendCon
Ā 
I18n with PHP 5.3
I18n with PHP 5.3I18n with PHP 5.3
I18n with PHP 5.3ZendCon
Ā 
Cloud Computing: The Hard Problems Never Go Away
Cloud Computing: The Hard Problems Never Go AwayCloud Computing: The Hard Problems Never Go Away
Cloud Computing: The Hard Problems Never Go AwayZendCon
Ā 
Planning for Synchronization with Browser-Local Databases
Planning for Synchronization with Browser-Local DatabasesPlanning for Synchronization with Browser-Local Databases
Planning for Synchronization with Browser-Local DatabasesZendCon
Ā 
Magento - a Zend Framework Application
Magento - a Zend Framework ApplicationMagento - a Zend Framework Application
Magento - a Zend Framework ApplicationZendCon
Ā 
Enterprise-Class PHP Security
Enterprise-Class PHP SecurityEnterprise-Class PHP Security
Enterprise-Class PHP SecurityZendCon
Ā 
PHP and IBM i - Database Alternatives
PHP and IBM i - Database AlternativesPHP and IBM i - Database Alternatives
PHP and IBM i - Database AlternativesZendCon
Ā 
Zend Core on IBM i - Security Considerations
Zend Core on IBM i - Security ConsiderationsZend Core on IBM i - Security Considerations
Zend Core on IBM i - Security ConsiderationsZendCon
Ā 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingZendCon
Ā 
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...ZendCon
Ā 
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilitySolving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilityZendCon
Ā 
Joe Staner Zend Con 2008
Joe Staner Zend Con 2008Joe Staner Zend Con 2008
Joe Staner Zend Con 2008ZendCon
Ā 
Tiery Eyed
Tiery EyedTiery Eyed
Tiery EyedZendCon
Ā 
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...ZendCon
Ā 
DB2 Storage Engine for MySQL and Open Source Applications Session
DB2 Storage Engine for MySQL and Open Source Applications SessionDB2 Storage Engine for MySQL and Open Source Applications Session
DB2 Storage Engine for MySQL and Open Source Applications SessionZendCon
Ā 
Digital Identity
Digital IdentityDigital Identity
Digital IdentityZendCon
Ā 

More from ZendCon (20)

Framework Shootout
Framework ShootoutFramework Shootout
Framework Shootout
Ā 
Zend_Tool: Practical use and Extending
Zend_Tool: Practical use and ExtendingZend_Tool: Practical use and Extending
Zend_Tool: Practical use and Extending
Ā 
PHP on IBM i Tutorial
PHP on IBM i TutorialPHP on IBM i Tutorial
PHP on IBM i Tutorial
Ā 
PHP on Windows - What's New
PHP on Windows - What's NewPHP on Windows - What's New
PHP on Windows - What's New
Ā 
PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the Cloud
Ā 
I18n with PHP 5.3
I18n with PHP 5.3I18n with PHP 5.3
I18n with PHP 5.3
Ā 
Cloud Computing: The Hard Problems Never Go Away
Cloud Computing: The Hard Problems Never Go AwayCloud Computing: The Hard Problems Never Go Away
Cloud Computing: The Hard Problems Never Go Away
Ā 
Planning for Synchronization with Browser-Local Databases
Planning for Synchronization with Browser-Local DatabasesPlanning for Synchronization with Browser-Local Databases
Planning for Synchronization with Browser-Local Databases
Ā 
Magento - a Zend Framework Application
Magento - a Zend Framework ApplicationMagento - a Zend Framework Application
Magento - a Zend Framework Application
Ā 
Enterprise-Class PHP Security
Enterprise-Class PHP SecurityEnterprise-Class PHP Security
Enterprise-Class PHP Security
Ā 
PHP and IBM i - Database Alternatives
PHP and IBM i - Database AlternativesPHP and IBM i - Database Alternatives
PHP and IBM i - Database Alternatives
Ā 
Zend Core on IBM i - Security Considerations
Zend Core on IBM i - Security ConsiderationsZend Core on IBM i - Security Considerations
Zend Core on IBM i - Security Considerations
Ā 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server Tracing
Ā 
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Insights from the Experts: How PHP Leaders Are Transforming High-Impact PHP A...
Ā 
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and ScalabilitySolving the C20K problem: Raising the bar in PHP Performance and Scalability
Solving the C20K problem: Raising the bar in PHP Performance and Scalability
Ā 
Joe Staner Zend Con 2008
Joe Staner Zend Con 2008Joe Staner Zend Con 2008
Joe Staner Zend Con 2008
Ā 
Tiery Eyed
Tiery EyedTiery Eyed
Tiery Eyed
Ā 
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...
Make your PHP Application Software-as-a-Service (SaaS) Ready with the Paralle...
Ā 
DB2 Storage Engine for MySQL and Open Source Applications Session
DB2 Storage Engine for MySQL and Open Source Applications SessionDB2 Storage Engine for MySQL and Open Source Applications Session
DB2 Storage Engine for MySQL and Open Source Applications Session
Ā 
Digital Identity
Digital IdentityDigital Identity
Digital Identity
Ā 

Recently uploaded

Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
Ā 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...Any kyc Account
Ā 
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...amitlee9823
Ā 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
Ā 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
Ā 
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangaloreamitlee9823
Ā 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayNZSG
Ā 
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...amitlee9823
Ā 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
Ā 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
Ā 
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...lizamodels9
Ā 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
Ā 
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...rajveerescorts2022
Ā 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
Ā 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
Ā 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxWorkforce Group
Ā 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
Ā 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
Ā 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...Aggregage
Ā 

Recently uploaded (20)

Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow šŸ’‹ Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Ā 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
Ā 
VVVIP Call Girls In Greater Kailash āž”ļø Delhi āž”ļø 9999965857 šŸš€ No Advance 24HRS...
VVVIP Call Girls In Greater Kailash āž”ļø Delhi āž”ļø 9999965857 šŸš€ No Advance 24HRS...VVVIP Call Girls In Greater Kailash āž”ļø Delhi āž”ļø 9999965857 šŸš€ No Advance 24HRS...
VVVIP Call Girls In Greater Kailash āž”ļø Delhi āž”ļø 9999965857 šŸš€ No Advance 24HRS...
Ā 
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...
Call Girls Electronic City Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Servi...
Ā 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
Ā 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
Ā 
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bangalore
Ā 
It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
Ā 
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call šŸ‘— 7737669865 šŸ‘— Top Class Call Girl Service Bang...
Ā 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
Ā 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ā 
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ā¤ļø8448577510 āŠ¹Best Escorts Service In 24/7 Delh...
Ā 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
Ā 
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...
šŸ‘‰Chandigarh Call Girls šŸ‘‰9878799926šŸ‘‰Just CallšŸ‘‰Chandigarh Call Girl In Chandiga...
Ā 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
Ā 
HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
Ā 
Cracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptxCracking the Cultural Competence Code.pptx
Cracking the Cultural Competence Code.pptx
Ā 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Ā 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
Ā 
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
The Path to Product Excellence: Avoiding Common Pitfalls and Enhancing Commun...
Ā 

VIM for (PHP) Programmers

  • 1. VIM for (PHP) Programmers Andrei Zmievski Outspark, Inc ZendCon ā“ September 17, 2008
  • 2. help ~ learn how to get help effectively ~ :help is your friend ~ use CTRL-V before a CTRL sequence command ~ use i_ and v_ preļ¬xes to get help for CTRL sequences in Insert and Visual modes ~ use CTRL-] (jump to tag) and CTRL-T (go back) in help window
  • 3. intro ~ how well do you know vimā€™s language? ~ what is the alphabet? ~ look at your keyboard ~ can you name what every key does? ~ modes - what are they? ~ how many do you know? ~ how many do you use?
  • 4. intro if you donā€™t like the language, change it example: how do you quit vim quickly? ZZ (exit with saving) ZQ (exit without save) or :nmap ,w :x<CR> :nmap ,q :q!<CR> tip: set showcmd to see partial commands as you type them
  • 5. where am i? How do you tell where you are? ~ simple - CTRL-G ~ detailed - gCTRL-G ~ do yourself a favor and set ruler ~ shows line, column, and percentage in status line ~ or conļ¬gure it however you want with ā€˜rulerformatā€™
  • 6. moving ~ do you us h/j/k/l for moving? ~ or are you stuck in GUIarrowy world? ~ if you are, re-learn ~ save yourself countless miles of movement between home row and arrows
  • 7. moving How do you move to: ~ start/end of buffer? gg and G ~ line n? nG or ngg ~ n% into the ļ¬le? n% ~ the ļ¬rst non-blank character in the line? ^ ~ ļ¬rst non-blank character on next line? <CR> ~ ļ¬rst non-blank character on previous line? -
  • 8. marks ~ we can bookmark locations in the buffer ~ m<letter> sets mark named <letter> at current location ~ `<letter> jumps precisely to that mark ~ ā€˜<letter> jumps to the line with the mark ~ lowercase letter: mark is local to the buffer ~ uppercase letter: mark is global, your buffer will be switched to the ļ¬le with the mark ~ :marks shows you your current marks
  • 9. marks ~ marks are very handy for changing text ~ set a mark (letā€™s say ma) ~ then you can do: ~ c`a - change text from cursor to mark a ~ d`a - delete text from cursor to mark a ~ =ā€™a - reformat lines from current one to the one with mark a
  • 10. marks ~ letā€™s say you jump somewhere ~ how do you go back? ~ `` moves you between the last two locations ~ you can set ` (the context mark) explicitly: ~ m`, jump elsewhere, then come back with `` tip: CTRL-O and CTRL-I move between positions in the full jump history, but canā€™t be used as motions ā€˜. and `. - jump to the line or exact location of the last modiļ¬cation
  • 11. insert ~ gi - incredibly handy ~ goes to Insert mode where you left it last time ~ scenario: edit something, exit Insert, go look at something else, then gi back to restart editing
  • 12. insert Some more goodies: ~ CTRL-Y and CTRL-E (avoid work if you can) ~ inserts chars from above or below the cursor ~ CTRL-A (oops, i want to do that again) ~ inserts previously inserted text ~ CTRL-R=<expr> (built-in calculator) ~ inserts anything vim can calculate ~ CTRL-T and CTRL-D (tab and de-tab) ~ inserts or deletes one shiftwidth of indent at the start of the line
  • 13. delete set your <Backspace> free :set backspace=start,indent,eol lets you backspace past the start of edit, auto- indenting, and even start of the line
  • 14. search ~ searching is essential ~ movement and information ~ how do you search? ~ f/F/t/T anyone? ~ how about * and #?
  • 15. search Search within the line: ~ f/F<char> jumps to the ļ¬rst <char> to the right/left and places cursor on it ~ t/T<char> jumps does the same, but stops one character short of it ~ df; - delete text from cursor to the ļ¬rst ; to the right ~ cT$ - change text from cursor up to the ļ¬rst $ to the left
  • 16. search ~ often you want to ļ¬nd other instances of word under the cursor ~ */# - ļ¬nd next/previous instance of whole word ~ g*/g# - ļ¬nd next/previous instance of partial word ~ or ļ¬nd lines with a certain word: ~ [I and ]I - list lines with word under the cursor ~ more convenient to use a mapping to jump to a line: :map ,f [I:let nr = input(quot;Which one: quot;)<Bar>exe quot;normal quot; . nr .quot;[tquot;<CR>
  • 17. search ~ of course, thereā€™s always regexp search ~ /<pattern> - search forward for <pattern> ~ ?<pattern> - search backward for <pattern> ~ n repeats the last search ~ N repeats it in the opposite direction ~ vim regexp language is too sophisticated to be covered here
  • 18. search Control your search options ~ :set wrapscan - to make search wrap around ~ :set incsearch - incremental search, <Enter> accepts, <Esc> cancels ~ :set ignorecase - case-insensitive search, or use this within the pattern: ~ c - force case-insensitive search ~ C - force case-sensitive search
  • 19. search ~ remember that every search/jump can be used as a motion argument ~ d/^# - delete everything up to the next comment ~ y/^class/;?function - copy everything from current point to the ļ¬rst function before the ļ¬rst class
  • 20. replace ~ :[range]s/<pattern>/<replace>/{flags} is the substitute command ~ used mainly with range addresses ~ range addresses are very powerful (read the manual) ~ but who wants to count out lines and do something like :-23,ā€™ts/foo/bar/ ~ in reality you almost always use a couple of shortcuts and Visual mode for the rest
  • 21. replace ~ useful range addresses: ~ % - equal to 1,$ (the entire ļ¬le) ~ . - current line ~ /<pattern>/ or ?<pattern>? - line where <pattern> matches ~ :%s/foo/bar/ - replace ļ¬rst foo in each matching line with bar in the entire ļ¬le ~ :.,/</body>/s,<br>,<br/>,gc - ļ¬x br tags from current line until the one with </body> in it, asking for conļ¬rmation (c - ā€˜cautiousā€™ mode)
  • 22. replace ~ & - repeat last substitution on current line ~ :&& - repeat it with the ļ¬‚ags that were used ~ g& - repeat substitution globally, with ļ¬‚ags
  • 23. text objects ~ better know what they are ~ since they are fantastically handy ~ can be used after an operator or in Visual mode ~ come in ā€œinnerā€ and ā€œambientā€ ļ¬‚avors ~ inner ones always select less text than ambient ones
  • 24. text objects ~ aw, aW - ambient word or WORD (see docs) ~ iw, iW - inner word or WORD (see docs) ~ as, is - ambient or inner sentence ~ ap, ip - ambient or inner paragraph ~ a{, i{ - whole {..} block or text inside it ~ a(, i( - whole (..) block or just text inside it ~ a<, i< - whole <..> block or just text inside it
  • 25. text objects ~ there are some cooler ones ~ aā€™, iā€™ - single-quoted string or just the text inside ~ aā€, iā€ - double-quoted string or just the text inside ~ note that these are smart about escaped quotes inside strings ~ at, it- whole tag block or just text inside (HTML and XML tags)
  • 26. text objects examples: das - delete the sentence, including whitespace after ci( - change text inside (..) block yat - copy the entire closest tag block the cursor is inside gUiā€™ - uppercase text inside the single-quoted string vip - select the paragraph in Visual mode, without whitespace after
  • 27. copy/delete/paste ~ you should already know these ~ y - yank (copy), d - delete, p - paste after, P - paste before ~ ]p, ]P - paste after/before but adjust the indent ~ Useful mappings to paste and reformat/reindent :nnoremap <Esc>P P'[v']= :nnoremap <Esc>p p'[v']=
  • 28. registers ~ registers: your multi-purpose clipboard ~ you use them without even knowing ~ every y or d command copies to a register ~ unnamed or named ~ ā€œ<char> before a copy/delete/paste speciļ¬es register named <char>
  • 29. registers ~ copying to uppercase registers append to their contents ~ useful for picking out bits from the buffers and pasting as a chunk ~ ā€œwyy - copy current line into register w ~ ā€œWD - cut the rest of the line and append it to the contents of register W ~ ā€œwp - paste the contents of register w ~ CTRL-Rw - insert the contents of register w (in Insert mode)
  • 30. registers ~ you can record macros into registers ~ q<char> - start recording typed text into register <char> ~ next q stops recording ~ @<char> executes macro <char> ~ @@ repeats last executed macro ~ use :reg to see whatā€™s in your registers
  • 31. undo ~ original vi had only one level of undo ~ yikes! ~ vim has unlimited (limited only by memory) ~ set ā€˜undolevelsā€™ to what you need (1000 default)
  • 32. undo ~ simple case: u - undo, CTRL-R - redo ~ vim 7 introduces branched undo ~ if you undo something, and make a change, a new branch is created ~ g-, g+ - go to older/newer text state (through branches)
  • 33. undo ~ you can travel through time ~ :earlier Ns,m,h - go to text state as it was N seconds, minutes, hours ago ~ :later Ns,m,h - go to a later text state similarly ~ :earlier 10m - go back 10 minutes, before I drank a can of Red Bull and made all these crazy changes. Whew.
  • 34. visual mode ~ use it, it's much easier than remembering obscure range or motion commands ~ start selection with: ~ v - characterwise, ~ V - linewise ~ CTRL-V - blockwise ~ use any motion command to change selection ~ can execute any normal or : command on the selection
  • 35. visual mode ~ Visual block mode is awesome ~ especially for table-like text tip: o switches cursor to the other corner, continue selection from there ~ Once you are in block mode: ~ I<text><Esc> - insert <text> before block on every line ~ A<text><Esc> - append <text> after block on every line ~ c<text><Esc> - change every line in block to <text> ~ r<char><Esc> - replace every character with <char>
  • 36. abbreviations ~ Real-time string replacement ~ Expanded when a non-keyword character is typed ~ :ab tempalte template - ļ¬x misspellings ~ more complicated expansion: ~ :iab techo <?php echo ?><Left><Left><Left>
  • 37. windows ~ learn how to manipulate windows ~ learn how to move between them ~ :new, :sp should be at your ļ¬ngertips ~ CTRL-W commands - learn essential ones for resizing and moving between windows
  • 38. tab pages ~ vim 7 supports tab pages ~ :tabe <file> to edit ļ¬le in a new tab ~ :tabc to close ~ :tabn, :tabp (or gt, gT to switch) ~ probably want to map these for easier navigation (if gt, gT are too difļ¬cult)
  • 39. completion ~ vim is very completion friendly ~ just use <Tab> on command line ~ for ļ¬lenames, set ā€˜wildmenuā€™ and ā€˜wildmodeā€™ (I like quot;list:longest,fullquot;) ~ :new ~/dev/fo<Tab> - complete ļ¬lename ~ :help ā€˜comp<Tab> - complete option name ~ :re<Tab> - complete command ~ hit <Tab> again to cycle, CTRL-N for next match, CTRL-P for previous
  • 40. completion ~ CTRL-X starts completion mode in Insert mode ~ follow with CTRL- combos (:help ins- completion) ~ i mostly use ļ¬lename, identiļ¬er, and omni completion ~ when there are multiple matches, a nice completion windows pops up
  • 41. completion ~ CTRL-X CTRL-F to complete ļ¬lenames ~ CTRL-X CTRL-N to complete identiļ¬ers ~ hey, thatā€™s so useful Iā€™ll remap <Tab> ā€œ Insert <Tab> or complete identifier ā€œ if the cursor is after a keyword character function MyTabOrComplete() let col = col('.')-1 if !col || getline('.')[col-1] !~ 'k' return quot;<tab>quot; else return quot;<C-N>quot; endif endfunction inoremap <Tab> <C-R>=MyTabOrComplete()<CR>
  • 42. completion ~ omni completion is heuristics-based ~ guesses what you want to complete ~ speciļ¬c to the ļ¬le type youā€™re editing ~ more on it later
  • 43. maps ~ maps for every mode and then some ~ tired of changing text inside quotes? :nmap X ciquot; ~ make vim more browser-like? :nmap <Space> <PageDown> ~ insert your email quickly? :imap ;EM me@mydomain.com ~ make <Backspace> act as <Delete> in Visual mode? :vmap <BS> x
  • 44. options ~ vim has hundreds of options ~ learn to control the ones you need ~ :options lets you change options interactively ~ :options | resize is better (since there are so many)
  • 45. sessions ~ a session keeps the views for all windows, plus the global settings ~ you can save a session and when you restore it later, the window layout looks the same. ~ :mksession <file> to write out session to a ļ¬le ~ :source <file> to load session from a ļ¬le ~ vim -S <file> to start editing a session
  • 46. miscellaneous ~ gf - go to ļ¬le under cursor (CTRL-W CTRL-F for new window) ~ :read in contents of ļ¬le or process ~ :read foo.txt - read in foo.txt ~ :read !wc %:h - run wc on current ļ¬le and insert result into the text ~ ļ¬lter text: :%!sort, :%!grep, or use :! in visual mode ~ i like sorting lists like this: vip:!sort
  • 47. miscellaneous ~ use command-line history ~ : and / followed by up/down arrows move through history ~ : and / followed by preļ¬x and arrows restrict history to that preļ¬x ~ q: and q/ for editable history (<Enter> executes, CTRL-C copies to command line)
  • 48. miscellaneous ~ CTRL-A and CTRL-X to increment/decrement numbers under the cursor (hex and octal too) ~ ga - what is this character under my cursor? ~ :set number to turn line numbers on ~ or use this to toggle line numbers: :nmap <silent> <F6> set number!<CR> ~ :set autowrite - stop vim asking if you want to write the ļ¬le before leaving buffer ~ CTRL-E/CTRL-Y - scroll window down/up without moving cursor
  • 49. miscellaneous ~ :set scroloff=N to start scrolling when cursor is N lines from the top/bottom edge ~ :set updatecount=50 to write swap ļ¬le to disk after 50 keystrokes ~ :set showmatch matchtime=3 - when bracket is inserted, brieļ¬‚y jump to the matching one ~ in shell: fc invokes vim on last command, and runs it after vim exits (or fc N to edit command N in history) ~ vimdiff in shell (:help vimdiff)
  • 50. miscellaneous ~ map CTRL-L to piece-wise copying of the line above the current one imap <C-L> @@@<ESC>hhkywjl?@@@<CR>P/@@@<CR>3s
  • 51. customization ~ customize vim by placing ļ¬les in you ~/.vim dir ~ filetype plugin on, filetype indent on .vimrc - global settings .vim/ after/ - files that are loaded at the very end ftplugin/ plugin/ syntax/ ... autoload/ - automatically loaded scripts colors/ - custom color schemes doc/ - plugin documentation ftdetect/ - filetype detection scripts ftplugin/ - filetype plugins indent/ - indent scripts plugin/ - plugins syntax/ - syntax scripts
  • 52. php: linting ~ vim supports arbitrary build/lint commands ~ if we set 'makeprg' and 'errorformat' appropriately.. :set makeprg=php -l % :set errorformat=%m in %f on line %l ~ now we just type :make (and <Enter> a couple of times) ~ cursor jumps to line with syntax error
  • 53. php: match pairs ~ you should be familiar with % command (moves cursor to matching item) ~ used with (), {}, [], etc ~ but can also be used to jump between PHP and HTML tags ~ use matchit.vim plugin ~ but syntax/php.vim has bugs and typos in the matching rule ~ i provide my own
  • 54. php: block objects ~ similar to vim's built-in objects ~ aP - PHP block including tags ~ iP - text inside PHP block examples: ~ vaP - select current PHP block (with tags) ~ ciP - change text inside current PHP block ~ yaP - copy entire PHP block (with tags) ~ provided in my .vim/ftplugin/php.vim ļ¬le
  • 55. php: syntax options ~ vim comes with a very capable syntax plugin for PHP ~ provides a number of options ~ let php_sql_query=1 to highlight SQL syntax in strings ~ let php_htmlInStrings=1 to highlight HTML in string ~ let php_noShortTags = 1 to disable short tags ~ let php_folding = 1 to enable folding for classes and functions
  • 56. php: folding ~ learn to control folding ~ zo - open fold (if the cursor is on the fold line) ~ zc - close closest fold ~ zR - open all folds ~ zM - close all folds ~ zj - move to the start of the next fold ~ zk - move to the end of the previous fold
  • 57. php: tags ~ for vim purposes, tags are PHP identiļ¬ers (classes, functions, constants) ~ you can quickly jump to the deļ¬nition of each tag, if you have a tags ļ¬le ~ install Exuberant Ctags ~ it can scan your scripts and output tags ļ¬le, containing identiļ¬er info ~ currently does not support class membership info (outputs methods as functions) ~ have to apply a third-party patch to ļ¬x
  • 58. php: tags ~ use mapping to re-build tags ļ¬le after editing nmap <silent> <F4> :!ctags-ex -f ./tags --langmap=quot;php:+.incquot; -h quot;.php.incquot; -R --totals=yes --tag-relative=yes --PHP-kinds=+cf-v .<CR> set tags=./tags,tags ~ all PHP ļ¬les in current directory and under it recursively will be scanned
  • 59. php: tags ~ CTRL-] - jump to tag under cursor ~ CTRL-W CTRL-] - jump to tag in a new window ~ :tag <ident> - jump to an arbitrary tag ~ :tag /<regexp> - jump to or list tags matching <regexp> ~ if multiple matches - select one from a list ~ :tselect <ident> or /<regexp> - list tags instead of jumping ~ CTRL-T - return to where you were ~ See also taglist.vim plugin
  • 60. php: completion ~ vim 7 introduces powerful heuristics-based omni completion ~ CTRL-X CTRL-O starts the completion (i map it to CTRL-F) ~ completes classes, variables, methods in a smart manner, based on context
  • 61. php: completion ~ completes built-in functions too ~ function completion shows prototype preview ~ array_<CTRL-X><CTRL-O> shows list of array functions ~ select one from the list, and the prototype shows in a preview window ~ CTRL-W CTRL-Z to close preview window
  • 62. php: completion ~ switches to HTML/CSS/Javascript completion outside PHP blocks ~ see more: ~ :help ins-completion ~ :help popupmenu-completion ~ :help popupmenu-keys
  • 63. plugins ~ vim can be inļ¬nitely customized and expanded via plugins ~ there are thousands already written ~ installation is very easy, usually just drop them into .vim/plugin ~ read instructions ļ¬rst though
  • 64. netrw ~ makes it possible to read, write, and browse remote directories and ļ¬les ~ i usually use it over ssh connections via scp ~ need to run ssh-agent to avoid continuous prompts for passphrase ~ don't use passphrase-less keys! ~ once set up: ~ vim scp://hostname/path/to/file ~ :new scp://hostname/path/to/dir/
  • 65. NERDTree ~ similar to netrw browser but looks more like a hierarchical explorer ~ does not support remote ļ¬le operations ~ :nmap <silent> <F7> :NERDTreeToggle<CR>
  • 66. taglist ~ provides an overview of the source code ~ provides quick access to classes, functions, constants ~ automatically updates window when switching buffers ~ can display prototype and scope of a tag ~ requires Exuberant Ctags
  • 67. taglist ~ stick this in ~/.vim/after/plugin/general.vim let Tlist_Ctags_Cmd = quot;/usr/local/bin/ctags-exquot; let Tlist_Inc_Winwidth = 1 let Tlist_Exit_OnlyWindow = 1 let Tlist_File_Fold_Auto_Close = 1 let Tlist_Process_File_Always = 1 let Tlist_Enable_Fold_Column = 0 let tlist_php_settings = 'php;c:class;d:constant;f:function' if exists('loaded_taglist') nmap <silent> <F8> :TlistToggle<CR> endif
  • 68. snippetsEmu ~ emulates some of the functionality of TextMate snippets ~ supports many languages, including PHP/HTML/ CSS/Javascript ~ by default binds to <Tab> but that's annoying ~ need to remap the key after it's loaded ~ put this in ~/.vim/after/plugin/general.vim if exists('loaded_snippet') imap <C-B> <Plug>Jumper endif inoremap <Tab> <C-R>=MyTabOrComplete()<CR>
  • 69. php documentor ~ inserts PHP Documentor blocks automatically ~ works in single or multi-line mode ~ doesnā€™t provide mappings by default ~ read documentation to set up default variables for copyright, package, etc ~ put this in ~/.vim/ftplugin/php.vim inoremap <buffer> <C-P> <Esc>:call PhpDocSingle()<CR>i nnoremap <buffer> <C-P> :call PhpDocSingle()<CR> vnoremap <buffer> <C-P> :call PhpDocRange()<CR> let g:pdv_cfg_Uses = 1
  • 70. xdebug-ger ~ allows debugging with xdebug through DBGp protocol ~ fairly basic, but does the job ~ vim needs to be compiled with +python feature ~ see resources section for documentation links
  • 71. vcscommand ~ provides interface to CVS/SVN ~ install it, then :help vcscommand
  • 72. conclusion ~ vim rules ~ this has been only a partial glimpse ~ from my very subjective point of view ~ donā€™t be stuck in an editor rut ~ keep reading and trying things out
  • 73. resources ~ vim tips: http://www.vim.org/tips/ ~ vim scripts: http://www.vim.org/scripts/index.php ~ Exuberant Ctags: http://ctags.sourceforge.net ~ PHP patch for ctags: http://www.live-emotion.com/memo/index.php? plugin=attach&refer=%CA%AA%C3%D6&openļ¬le=ctags-5.6j-php.zip ~ article on xdebug and vim: http://2bits.com/articles/using-vim-and- xdebug-dbgp-for-debugging-drupal-or-any-php-application.html ~ more cool plugins: ~ Surround: http://www.vim.org/scripts/script.php?script_id=1697 ~ ShowMarks: http://www.vim.org/scripts/script.php?script_id=152 ~ Vim Outliner: http://www.vim.org/scripts/script.php?script_id=517 ~ Tetris: http://www.vim.org/scripts/script.php?script_id=172
  • 74. quot;As with everything, best not to look too deeply into this.quot;
  • 75. Thank You! http://outspark.com/ http://gravitonic.com/talks/