Skip to content

Commit bbf15c1

Browse files
author
notEvil
committed
update
1 parent 78fda82 commit bbf15c1

File tree

2 files changed

+52
-41
lines changed

2 files changed

+52
-41
lines changed

.vimrc

+22-22
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ set relativenumber
8585
set encoding=utf-8
8686
set nowrap
8787
syntax on
88+
" - input
89+
set backspace=indent,eol
90+
" - indent
91+
set expandtab
92+
set softtabstop=4
93+
set shiftwidth=4
94+
set autoindent
8895
" - search
8996
set ignorecase
9097
set smartcase
@@ -97,12 +104,6 @@ set incsearch
97104
" - buffer
98105
set splitbelow
99106
set splitright
100-
" - indent
101-
set expandtab
102-
set softtabstop=4
103-
set shiftwidth=4
104-
set autoindent
105-
set backspace=indent,eol
106107
" - folds
107108
set foldmethod=indent
108109
aug _maxfoldlevel
@@ -128,10 +129,6 @@ nnoremap <left> 5<c-w><
128129
nnoremap <right> 5<c-w>>
129130
" - navigation
130131
" . inside buffer
131-
nnoremap <space> <c-d>
132-
xnoremap <space> <c-d>
133-
nnoremap <s-space> <c-u>
134-
xnoremap <s-space> <c-u>
135132
nnoremap <a-h> h
136133
xnoremap <a-h> h
137134
nnoremap <a-n> j
@@ -142,6 +139,10 @@ nnoremap <a-i> l
142139
xnoremap <a-i> l
143140
nnoremap # ^
144141
xnoremap # ^
142+
nnoremap <space> <c-d>
143+
xnoremap <space> <c-d>
144+
nnoremap <s-space> <c-u>
145+
xnoremap <s-space> <c-u>
145146
nnoremap <c-i> <c-o>
146147
nnoremap <c-o> <c-i>
147148
" . between buffer
@@ -150,17 +151,17 @@ nnoremap <c-n> <c-w>j
150151
nnoremap <c-e> <c-w>k
151152
nnoremap <c-k> <c-w>l
152153
" - search
154+
nnoremap - #
155+
nnoremap = *
156+
xnoremap - ""y?\V<c-r>=escape(@", '\/')<cr><cr>gn
157+
xnoremap = ""y/\V<c-r>=escape(@", '\/')<cr><cr>gn
153158
nnoremap / /\v
154159
xnoremap / /\v
155160
nnoremap ? ?\v
156161
xnoremap ? ?\v
157162
nnoremap // :nohlsearch<cr>
158163
nnoremap R :%s///g<left><left>
159164
xnoremap R :s///g<left><left>
160-
nnoremap - #
161-
nnoremap = *
162-
xnoremap - ""y?\V<c-r>=escape(@", '\/')<cr><cr>gn
163-
xnoremap = ""y/\V<c-r>=escape(@", '\/')<cr><cr>gn
164165
" - tabs
165166
nnoremap <c-t> :tab split<cr>
166167
nnoremap <a-1> 1gt
@@ -174,17 +175,16 @@ nnoremap <a-8> 8gt
174175
nnoremap <a-9> :tabmove -1<cr>
175176
nnoremap <a-0> :tabmove +1<cr>
176177
" - copy paste
177-
nnoremap <cr> "+yyj
178-
nnoremap <s-cr> m`0"+y$``
179178
nnoremap p gP| " insert before cursor, cursor moves to the end
180-
cnoremap <c-p> <c-r>"
181179
nnoremap P $p`[| " insert at the end of line, cursor moves to the entry point of the insertion
180+
cnoremap <c-p> <c-r>"
181+
nnoremap <cr> "+yyj
182+
nnoremap <s-cr> m`0"+y$``
182183
xnoremap <c-c> "+ygv| " copy to clipboard, stay in visual mode
183-
xnoremap <c-x> "+ygvd| " move to clipboard
184-
nnoremap <c-v> "+gP| " insert clipboard and move to the end
185-
" insert clipboard at the end of line, cursor moves to the entry point of the insertion
186-
"nnoremap <c-s-v> $"+p`[ " doesnt work because c-s-v is equal to c-v
187-
inoremap <c-v> <c-r>+| " insert clipboard, move to the end, stay in insert mode
184+
xnoremap <c-x> "+ygvd| " cut to clipboard
185+
nnoremap <c-v> "+gP| " paste from clipboard and move to the end
186+
"nnoremap <c-s-v> $"+p`[| " paste from clipboard at the end of line, cursor moves to the entry point of the insertion; doesnt work because c-s-v is equal to c-v
187+
inoremap <c-v> <c-r>+| " paste from clipboard, move to the end, stay in insert mode
188188
xnoremap <c-v> d"+gP| " replace selection, move to the end
189189
cnoremap <c-v> <c-r>+
190190
" - visual mode

cheatsheet

+30-19
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1+
12
general
23

34
c-q: close
45
c-s: save
5-
vv: blockwise visual mode
6+
up,down,left,right: resize buffer/split
67
-,=: search word under cursor backward,forward
78
//: disable search highlights
89
R: replace all matches by
10+
(cmd)c-p: paste
911
enter: copy line with linebreak to clipboard
1012
s-enter: copy line without linebreak to clipboard
1113
c-c,x: copy,cut to clipboard
1214
c-v: paste from clipboard
13-
(cmd)c-p: paste
14-
s,S: my sneak
15-
cs<key><key>: change surround
16-
ds<key>: delete surround
17-
(visual)is<key>: insert surround
18-
up,down,left,right: resize buffer/split
19-
zf: fold/unfold inner most
20-
zF: fold/unfold outer most
21-
zc: increase fold level
22-
zo: decrease fold level
23-
zC: close all folds
24-
zO: open all folds
15+
vv: blockwise visual mode
2516
(visual).: apply last operation on each line
26-
;ss: open startify
27-
;sq: save session as "temp" and close vim
28-
nerd commenter: ;cc: comment
29-
;cu: uncomment
3017

3118
navigation
3219

33-
space: page down
34-
s-space: page up
3520
a-h,n,e,i: move cursor by 1
3621
#,$: move cursor to start,end of line
22+
s,S: my sneak
23+
space: page down
24+
s-space: page up
3725
c-i,o: jump backward,forward in jump history
3826
c-h,n,e,k: jump to buffer to the left,bottom,top,right
3927

@@ -44,6 +32,29 @@ a-1,2,3,4,5,6,7,8: jump to tab 1,2,3,4,5,6,7,8
4432
a-9: move tab to the left
4533
a-0: move tab to the right
4634

35+
folds
36+
37+
zf: fold/unfold inner most
38+
zF: fold/unfold outer most
39+
zc: increase fold level
40+
zo: decrease fold level
41+
zC: close all folds
42+
zO: open all folds
43+
44+
plugins
45+
46+
startify: ;ss: open startify
47+
;sq: save session as "temp" and close vim
48+
49+
nerd commenter: ;cc: comment
50+
;cu: uncomment
51+
52+
surround: cs<key><key>: change surround
53+
ds<key>: delete surround
54+
(visual)is<key>: insert surround
55+
4756
vim base
4857

58+
gd: goto definition
4959
zd: delete fold
60+

0 commit comments

Comments
 (0)