mysql to mysqli conversion

If you used an older version of PHP and switched to PHP7, and now all your  msyql  commands are failing, you should be able to use the following to fix it. You’ll have to run it in every directory where you have php files, of course.

 

vim cheatsheet

As always, this is for my own reference, but hopefully it proves useful to someone out there!

All commands are listed as if they are typed from normal mode; commands that begin with “:” work in ex mode.

commanddescription
:wqsave and quit
:wsave
:qquit (unless there are unsaved changes)
:q!quit without saving
:wasave all
:xasave all and quit
:qaquit all (unless there are unsaved changes)
:qa!quit all without saving
:w {file.txt}save as {file.txt}
/searchfind "search" in current file
:%s/foo/bar/gfind all occurrences of "foo" (in current file) and replace with "bar"
:s/foo/bar/gIfind all occurrences of "foo" (in current line) and replace with "bar", case sensitive
:5,12s/foo/bar/gcfind all occurrences of "foo" (in lines 5-12) and replace with "bar", but ask for confirmation
:s/foo/bar/find first occurrence of "foo" (in current line) and replace with "bar"
:s/foo\c/bar/gfind all occurrences of "foo" (in current line) and replace with "bar", case insensitive
:s/foo\C/bar/gfind all occurrences of "foo" (in current line) and replace with "bar", case sensitive
:%s/Copyright \zs2009\ze J\. Classen/2017/gfind all occurrences of "Copyright 2009 J. Classen" (in current file) and replace only "2009" with "2017"
*find next occurrence of word under cursor
#find previous occurence of word under cursor
%find matching bracket to one under cursor
uundo
<C-R>redo
iinsert at current location
ainsert after current location
Iinsert at start of current line
Ainsert after end of current line
oinsert line below current line and enter insert mode
Oinsert line above current line and enter insert mode
sdelete current character and enter insert mode
Sdelete current line and enter insert mode
cwdelete current word and enter insert mode
ccdelete current line and enter insert mode
Cdelete from cursor to end of line and enter insert mode
.repeat previous operation made in normal mode
rxreplace current character with "x" (do not enter insert mode)
c3bchange previous three words
d4wdelete next four words
dddelete current line
yyyank current line
5dddelete five lines from cursor
5yyyank five lines from cursor
ggmove to first line
Gmove to last line
23Gmove to line 23
zzcenter line vertically in window
hmove left
lmove right
jmove down
kmove up
wmove one word forward
bmove one word backward
8hmove eight lines left
d3kdelete four lines up (three plus current line)
fxfind next "x" in line
Fxfind previous "x" in line
txfind next "x" in line
Txfind after next "x" in line
@:repeat previous operation made in ex mode
Jjoin next line to current line
Ycopy current line
ppaste after current line
Ppaste before current line
Vvisually select current line
v3wvisually select three words
:sp {file.txt}horizontal split with {file.txt}
:vs {file.txt}vertical split with {file.txt}
<C-W>ssplit horizontally (same file in both splits)
<C-W>vsplit vertically (same file in both splits)
<C-W>wswitch to next window
<C-W>Wswitch to previous window
<C-W>nnew window
<C-W>qclose current window
<C-W>oclose all other windows
<C-W>rrotate windows
<C-W>xswap windows
<C-W>Tmove window to new tab
<C-W><decrease window width
<C-W>>increase window width
<C-W>+increase window height
<C-W>-decrease window height
:drop {file.txt}edit {file.txt} in current window; if file is already open, switch to that window instead
:tab drop {file.txt}edit {file.txt} in new tab; if file is already open, switch to that window instead
:tabe {file.txt}edit {file.txt} in new tab
gtgo to next tab
gTgo to previous tab
:tab splitcopy current window to new tab
:tab ballshow all windows in own tab
:cd %:p:hchange to directory of currently open file
maset mark "a" to current line and column (lowercase letters are file-specific, uppercase letters are global)
'amove to line of mark "a"
`amove to line and column of mark "a"
`0jump to position in last file edited