Professional Documents
Culture Documents
Vim For PHP Programmers
Vim For PHP Programmers
Programmers
Andrei Zmievski
CodeWorks 2009
http://joind.in/764
Linguistics semi-master
Twitter: @a
help
~
intro
~
intro
if you dont 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>
where am i?
How do you tell where you are?
~
simple - CTRL-G
detailed - gCTRL-G
moving
~
moving
How do you move to:
~
line n? nG or ngg
marks
~
current location
~
marks
~
marks
~
insert
gi - incredibly handy
insert
Some more goodies:
~
delete
lets you backspace past the start of edit, autoindenting, and even start of the line
search
~
searching is essential
f/F/t/T anyone?
search
Search within the line:
~
the right
~
search
~
search
~
search
Control your search options
~
~
search
~
comment
~
replace
~
:[range]s/<pattern>/<replace>/{flags}
replace
~
. - current line
:%s/foo/bar/
:.,/<\/body>/s,<br>,<br/>,gc
- fix br tags
from current line until the one with </body> in
it, asking for confirmation (c - cautious mode)
replace
text objects
~
text objects
~
text objects
~
a, i
inside
~
a, i
inside
~
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
whitespace after
copy/delete/paste
~
paste before
~
indent
~
P'[v']=
:nnoremap <Esc>p
p'[v']=
registers
~
unnamed or named
registers
~
~
~
Insert mode)
registers
~
undo
~
yikes!
undo
~
branches)
undo
~
visual mode
~
~
~
v - characterwise,
V - linewise
CTRL-V - blockwise
visual mode
~
abbreviations
~
~
windows
~
tab pages
~
:tabc to close
completion
~
completion
~
completion
~
CTRL-X CTRL-F
to complete filenames
CTRL-X CTRL-N
to complete identifiers
completion
more on it later
maps
~
options
~
so many)
sessions
~
file
~
miscellaneous
~
miscellaneous
~
through history
~
miscellaneous
~
ga
miscellaneous
~
miscellaneous
customization
~
php: linting
~
~
~
~
~
~
examples:
strings
~
string
~
~
php: folding
~
php: tags
~
~
~
php: tags
~
php: tags
~
instead of jumping
~
php: completion
~
php: completion
~
functions
~
php: completion
~
:help ins-completion
:help popupmenu-completion
:help popupmenu-keys
:help ft-php-omni
plugins
~
~
~
netrw
~
~
~
vim scp://hostname/path/to/file
:new scp://hostname/path/to/dir/
NERDTree
taglist
~
~
taglist
~
snippetsEmu
~
php documentor
~
project
0scan
~
objects, methods
xdebug-ger
~
vcscommand
conclusion
~
vim rules
resources
~
Surround: http://www.vim.org/scripts/script.php?script_id=1697
ShowMarks: http://www.vim.org/scripts/script.php?script_id=152
Tetris: http://www.vim.org/scripts/script.php?script_id=172
Thank You!
http://joind.in/764
http://zmievski.org/talks/