-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsvimrc
144 lines (144 loc) · 3.41 KB
/
vsvimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
" #### VSVIMRC NOT VIMRC #### "
" GENERAL - basic settings {{{
set vsvim_useeditorindent " use editor indent logic
set vsvim_useeditortab " use editor tab settings
set autochdir " use file path as working directory
set confirm " ask to save instead of complaining
set title " rename terminal
set backspace=2 " backspace over everything
" }}}
" UI - how everything looks {{{
set background=dark " nightmode
set number " show line number
set cursorline
" }}}
" TOOLS - how tools behave {{{
" Folding {{{
set foldcolumn=5 " add column for fold information
set foldmethod=syntax " fold lines syntax-based
" custom foldfunction for syntaxfolding
set foldtext=CustomSyntaxFolding()
set foldlevelstart=5 " start with 5 open folds
" }}}
" Searching {{{
set incsearch " search as charcters are entered
set hlsearch " highlight matches
set ignorecase " ignore case when searching
set smartcase " only if there are no capital letters in querry
" }}}
" }}}
" MAPPINGS - commands for editing {{{
let mapleader=',' " set <leader> key
" insert single character with s/S
nnoremap s i<Space><Esc>r
nnoremap S a<Space><Esc>r
vnoremap s I<Space><Esc>gvr
vnoremap S A<Space><Esc>gvr
" shift + undo = redo
nnoremap U <C-R>
" copy from cursor to end of line with Y like D
nmap Y yE
" Cursor {{{
" map movement characters one to the right
nnoremap j h
nnoremap k j
nnoremap l k
nnoremap ö l
vnoremap j h
vnoremap k j
vnoremap l k
vnoremap ö l
onoremap j h
onoremap k j
onoremap l k
onoremap ö l
" move more lines/character when capital
nnoremap J 3h
nnoremap K 3j
nnoremap L 3k
nnoremap Ö 3l
vnoremap J 3h
vnoremap K 3j
vnoremap L 3k
vnoremap Ö 3l
onoremap J 3h
onoremap K 3j
onoremap L 3k
onoremap Ö 3l
" move in line
nnoremap B ^
nnoremap E $
vnoremap B ^
vnoremap E $
onoremap B ^
onoremap E $
" unmap $/^
nnoremap ^ <nop>
nnoremap $ <nop>
vnoremap ^ <nop>
vnoremap $ <nop>
onoremap ^ <nop>
onoremap $ <nop>
" }}}
" Page {{{
" scroll with <C-k/l>
nnoremap <C-l> <C-e>
nnoremap <C-k> <C-y>
vnoremap <C-l> <C-e>
vnoremap <C-k> <C-y>
inoremap <C-l> <C-o><C-e>
inoremap <C-k> <C-o><C-y>
" }}}
" Splits {{{
set splitright " open new splits on the right
" change spilt
nnoremap <leader>s <C-w>l
onoremap <leader>s <C-w>l
inoremap <leader>s <C-o><C-w>l
" }}}
" Tabs {{{
" cycle through tabs
nnoremap <silent> <leader>t :tabnext<CR>
onoremap <silent> <leader>t :tabnext<CR>
inoremap <silent> <leader>t <C-o>:tabnext<CR>
nnoremap <silent> <leader>Tn :tabnext<CR>
onoremap <silent> <leader>Tn :tabnext<CR>
inoremap <silent> <leader>Tn <C-o>:tabnext<CR>
nnoremap <silent> <leader>Tp :tabprevious<CR>
onoremap <silent> <leader>Tp :tabprevious<CR>
inoremap <silent> <leader>Tp <C-o>:tabprevious<CR>
" }}}
" Folding {{{
" toggle/open/close folds fast
nnoremap <leader>f za
nnoremap <leader>Fo zo
nnoremap <leader>Fc zc
nnoremap <leader>FO zR
nnoremap <leader>FC zM
" }}}
" Searching {{{
" turn off search highlight
nnoremap <silent> <leader>h :nohlsearch<CR>
" }}}
" }}}
" CHEATSHEET - important commands in one place {{{
" Movement {{{
" Normal: jklö
" Fast: JKLÖ
" End Of Word: e
" End Of Line: E
" Begin Of Word: b
" Begin Of Line: B
" Page Scroll: ctrl-kl
" }}}
" Tabs and Splits {{{
" Cycle Splits: leader-s
" Cycle Tabs: leader-t
" Other Split Commands: leader-S
" Other Tab Commands: leader-T
" }}}
" Undo and Redo {{{
" Undo: u
" Redo: U
" }}}
" }}}