Last active
May 10, 2023 05:15
-
-
Save rain1024/4594aa7264ff3ea65861 to your computer and use it in GitHub Desktop.
vim
Vim is awesome!
Vimgolf.com, (2014). VimGolf - real Vim ninjas count every keystroke!. [online] Available at: http://vimgolf.com/ [Accessed 11 Jul. 2014]. | Vim-adventures.com, (2014). VIM Adventures - Learn VIM while playing a game. [online] Available at: http://vim-adventures.com/ [Accessed 11 Jul. 2014]. |
- Derekwyatt.org, (2010). Vim Novice Tutorial Videos. [online] Available at: http://derekwyatt.org/vim/tutorials/novice/ [Accessed 7 Jul. 2014].
- Openvim.com, (2014). Interactive Vim tutorial. [online] Available at: http://www.openvim.com/tutorial.html [Accessed 11 Jul. 2014].
h l k j
=> character left, right; line up, down
b w
=> word/token left, right
ge e
=> end of word/token left, right
{ }
=> beginning of previous, next paragraph
( )
=> beginning of previous, next sentence
0 gm
=> beginning, middle of line
^ $
=> first, last character of line
nG ngg
=> line n, default the last, first
n%
=> percentage n of the file (n must be provided)
n|
=> column n of current line
%
=> match of next brace, bracket, comment, #define
nH nL
=> line n from start, bottom of window
M
=> middle line of window
- Tnerual.eriogerg.free.fr, (2014). VIM Quick Reference Card. [online] Available at: http://tnerual.eriogerg.free.fr/vimqrc.html [Accessed 30 Aug. 2014].
:set virtualedit
- vim, H. (2014). editor - How to do column editing in vim? - Stack Overflow. [online] Stackoverflow.com. Available at: http://stackoverflow.com/questions/6971903/how-to-do-column-editing-in-vim [Accessed 3 Sep. 2014].
- Vimdoc.sourceforge.net, (2014). Vim documentation: options. [online] Available at: http://vimdoc.sourceforge.net/htmldoc/options.html#'virtualedit' [Accessed 3 Sep. 2014].
<z>
creates a fold from the cursor down # lines.
=>zf#j
creates a fold from the cursor to string .
=> zf/string
zj moves the cursor to the next fold.
zk moves the cursor to the previous fold.
zo opens a fold at the cursor.
zO opens all folds at the cursor.
zm increases the foldlevel by one.
zM closes all open folds.
zr decreases the foldlevel by one.
zR decreases the foldlevel to zero -- all folds will be open.
zd deletes the fold at the cursor.
zE deletes all folds.
[z move to start of open fold.
]z move to end of open fold.
1. Movement
2. Editing (in progressing)
3. Finding (in progressing)
4. Repeating (in progressing)
5. Undo/Redo (in progressing)
6. Folding (in progressing)
7. Splitting: windows and tabs (in progressing)
8. Command (in progressing)
set virtualedit=all
':tabe' ####New window ':new filename.txt'
C-H
, C-J
C-K
C-L
C-W h
, C-W j
C-W k
C-W l
*:%s//x&x<CR>ZZ
:%s/<C-R><C-W>/x&x
:%s/aaa/x&x/g
input aaa aab output xaaax aab
put=range(1,100)
:! python shell.py
:!!
- Vim Tips Wiki, (2014). Moving around. [online] Available at: http://vim.wikia.com/wiki/Moving_around [Accessed 11 Jul. 2014].
- Vimdoc.sourceforge.net, (2014). Vim documentation: usr_25 Editing formatted text. [online] Available at: http://vimdoc.sourceforge.net/htmldoc/usr_25.html [Accessed 21 Jul. 2014].
<NERDTree> <Ctrlp> <surround> <emmet> (RU: Zen coding) <numbers>
- The Ultimate Vim Distribution http://vim.spf13.com/
:NERDTree
m a <folder_name> / y
m a <file_name> y
$ Bookmark
# show bookmark
$ B
# delete bookmark
Shift-D
:CtrlP
Ctrl-p
Type ("_" is the cursor position)
html:5_
Then type , (Ctrly,), and you should see:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
_
</body>
</html>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment