Recently switched from Vim to Neovim, this is now out of date
vim +PluginUpdate +qall
:set paste
:qall
$ end of the line
^ start of the line
w word
e end of word
CTRL-D show list of commands using autocompletion
TAB autocompletion of commands
d Delete
p Put line BELOW cursor
u Undo last command
U Undo line
r Replace char
R Replace more chars
c Change
o Open new line BELOW cursor
O Open new line ABOVE cursor
v visual mode
y yank highlighed text
:!ls EXTERNAL command with pause
:r FILENAME INSERT file BELOW cursor
:r !ls INSERT output below cursor
CTRL-G Location in file
G Bottom of file
g Begining of file
number+G Goto line number
:set hls highlight
:set is show partial matches
:set ic ignore case
:set noic no ignore case
/ Forward search
/WORD\c forward search for WORD ignoring CASE
? Backwards search
n Next in direction
N Next in OPPOSiTE direction
CTRL-O Go back to where came from (Repeat to go futher)
% Matching Parentheses search (Closing/Begining () {} etc tags)
:s/old/new/ Replace FIRST instance old with new on current line
:s/old/new/g Globally in the LINE
:#,#s/old/new/g RANGE of lines
:%s/old/new/g every occurrence in the whole FILE
:%s/old/new/gc with PROMPT
:s/old/new/ Replace FIRST instance old with new on current line
:s/old/new/ Replace FIRST instance old with new on current line
CTRL-W jump window
"~/.vim/plugin/soa.vim
"--- .../plugins/named.vim ----
function! UPDSERIAL(date, num)
if (strftime("%Y%m%d") == a:date)
return a:date . a:num+1
endif
return strftime("%Y%m%d") . '01'
endfunction
"command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UPDSERIAL(submatch(1), submatch(2)) . submatch(3)/gc
command Soa :%s/\(2[0-9]\{7}\)\([0-9]\{2}\)\(\s*;\s*serial\)/\=UPDSERIAL(submatch(1), submatch(2)) . submatch(3)/g
"---- eof ---------------------Last modified: Sun Jul 14 23:19:33 2024