rain1024 / gVim-Pathogen

My Coding Life
http://rain1024.github.io/gVim-Pathogen
2 stars 0 forks source link

Vim #38

Open rain1024 opened 10 years ago

rain1024 commented 10 years ago
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)

1. Movement {Normal Mode}

Text: h j k l

image

Word: e w 3w b 3b iw B W

Line: $ 0 ^

Sentence: ( )

Paragraph: } {

Screen: H M L

File: G 1G 50G

Back to last move: '' ``

Corresponding item: %

Move the cursor to positions where there isn't any text [2]

set virtualedit=all

2. Basic Edit

Put: <p>, <P>

Buffer

Working with many files

7. Splitting: windows and tabs

New tab

':tabe'

New window

':new filename.txt'

Move between two window:

C-H, C-J C-K C-L C-W h, C-W j C-W k C-W l

Search and Replace

*:%s//x&x<CR>ZZ
:%s/<C-R><C-W>/x&x
:%s/aaa/x&x/g

input aaa aab output xaaax aab

8. Command {Command Mode}

Put

put=range(1,100)

Run system command

:! python shell.py

Repeat previous command

:!!

References

  1. Vim Tips Wiki, (2014). Moving around. [online] Available at: http://vim.wikia.com/wiki/Moving_around [Accessed 11 Jul. 2014].
  2. 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].
rain1024 commented 10 years ago

Plugins

<NERDTree> <Ctrlp> <surround> <emmet> (RU: Zen coding) <numbers>

NerdTree

image

Show NerdTree

:NERDTree

Create folder

m a <folder_name> / y

Create file

m a <file_name> y

Bookmark

$ Bookmark
# show bookmark
$ B
# delete bookmark
Shift-D

Ctrlp

image

:CtrlP
Ctrl-p

Surround

image

Emmet

image

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>

Numbers

image image

rain1024 commented 9 years ago

Share you work