-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_vimrc
86 lines (66 loc) · 1.7 KB
/
dot_vimrc
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
" Use `space` as a leader key
let mapleader = " "
" Reject vi compatibility, accept modernity
set nocompatible
" TAB = 4 spaces
set tabstop=4
" Insert spaces when TAB pressed
set shiftwidth=4
set expandtab
" Show at least few lines around cursor
set scrolloff=5
" Show hybrid line numbers
" (absolute for current line, relative for others)
set nu rnu
" Show statusbar always
set laststatus=2
set statusline=\ \ %{toupper(mode())}%=%f\ %l/%L\ %y\ \
" Execute multicursor changes immediately
set ttimeoutlen=2
" Show visual limiters on 72,100,120 symbols
set colorcolumn=72,100,120
highlight ColorColumn ctermbg=lightgrey
" Search: respect case only if it has uppercase letter
set ignorecase
set smartcase
" Search: use incremental mode: jump to the next value while typing
set incsearch
" Search: highlight all search results
set hlsearch
" Enable syntax highlighting
syntax on
" Hide all highlights on ` hh`
nnoremap <leader>hh :noh<CR>
" Toggle line numbers
nmap <leader>hn :set rnu!<CR>
" Copy selection to system clipboard
nmap <leader><leader>yy "+yy
nmap <leader><leader>Y "+Y
vmap <leader><leader>y "+y
vmap <leader><leader>Y "+Y
" Paste from system clipboard
nmap <leader><leader>p "+p
nmap <leader><leader>P "+P
" Use `U` for Redo action
nnoremap U <C-R>
" Center cursor on long jumps
nmap <C-b> <C-b>zz
nmap <C-f> <C-f>zz
nmap <C-d> <C-d>zz
nmap <C-u> <C-u>zz
nmap <C-o> <C-o>zz
nmap <C-i> <C-i>zz
" Jump 5 lines
nmap J 5jzz
nmap K 5kzz
vmap J 5jzz
vmap K 5kzz
" One-shot command in insert mode
"inoremap <C-v> <C-o>
" Use Q for recording macros
nnoremap Q q
nnoremap q <Nop>
" Enter empty line before or after current line
" issue: needs `uu` instead of `u`
nmap <C-Enter> o<ESC>k
nmap <S-Enter> O<ESC>j