-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
183 lines (162 loc) · 5.85 KB
/
.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
"leader"
let mapleader=" "
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
runtime! debian.vim
" Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc.
" This happens after /etc/vim/vimrc(.local) are loaded, so it will override
" any settings in these files.
" If you don't want that to happen, uncomment the below line to prevent
" defaults.vim from being loaded.
" let g:skip_defaults_vim = 1
" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible
set nocompatible
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
"au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
filetype plugin indent on
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :makb
set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)
set number
set relativenumber
set wildmenu
set laststatus=2
set autochdir
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" The backspace key has slightly unintuitive behavior by default. For example,
" by default, you can't backspace before the insertion point set with 'i'.
" This configuration makes backspace behave more reasonably, in that you can
" backspace over anything.
set backspace=indent,eol,start
" Unbind some useless/annoying default key bindings.
nmap Q <Nop> " 'Q' in normal mode enters Ex mode. You almost never want this.
" Disable audible bell because it's annoying.
set noerrorbells visualbell t_vb=
"movement"
noremap J 5j
noremap K 5k
noremap = nzz
noremap - Nzz
noremap W b
noremap E ge
"quit"
map Q :q<CR>
"history
noremap <c-q> q:
"split"
map sl :set splitright<CR>:vsplit<CR>
map sh :set nosplitright<CR>:vsplit<CR>
map sk :set nosplitbelow<CR>:split<CR>
map sj :set splitbelow<CR>:split<CR>
map <LEADER>l <C-w>l
map <LEADER>k <C-w>k
map <LEADER>h <C-w>h
map <LEADER>j <C-w>j
map sr <C-w>R
nnoremap <C-Up> :res +5<CR>
nnoremap <C-Down> :res -5<CR>
nnoremap <C-Left> :vertical resize-5<CR>
nnoremap <C-Right> :vertical resize+5<CR>
map sv <C-w>t<C-w>H
map sp <C-w>t<C-w>K
map tn :tabe<CR>
map th :-tabnext<CR>
map tl :+tabnext<CR>
"NERDTree"
nnoremap <F2> :NERDTree<CR>
nnoremap <leader>f :NERDTreeFind<CR>
autocmd FileType nerdtree nnoremap <buffer> J 5j
autocmd FileType nerdtree nnoremap <buffer> K 5k
let NERDTreeMapOpenSplit = 'sk'
let NERDTreeMapOpenVSplit = 'sh'
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' :'✹',
\ 'Staged' :'✚',
\ 'Untracked' :'✭',
\ 'Renamed' :'➜',
\ 'Unmerged' :'═',
\ 'Deleted' :'✖',
\ 'Dirty' :'✗',
\ 'Ignored' :'☒',
\ 'Clean' :'✔︎',
\ 'Unknown' :'?',
\ }
"bookmark
let g:SignatureMap = {
\ 'Leader' : "m",
\ 'PlaceNextMark' : "m,",
\ 'ToggleMarkAtLine' : "m.",
\ 'PurgeMarksAtLine' : "dm-",
\ 'DeleteMark' : "dm",
\ 'PurgeMarks' : "dm/",
\ 'PurgeMarkers' : "dm?",
\ 'GotoNextLineAlpha' : "m<LEADER>",
\ 'GotoPrevLineAlpha' : "",
\ 'GotoNextSpotAlpha' : "m<LEADER>",
\ 'GotoPrevSpotAlpha' : "",
\ 'GotoNextLineByPos' : "",
\ 'GotoPrevLineByPos' : "",
\ 'GotoNextSpotByPos' : "m=",
\ 'GotoPrevSpotByPos' : "m-",
\ 'GotoNextMarker' : "",
\ 'GotoPrevMarker' : "",
\ 'GotoNextMarkerAny' : "",
\ 'GotoPrevMarkerAny' : "",
\ 'ListLocalMarks' : "m/",
\ 'ListLocalMarkers' : "m?"
\ }
"fzf-vim"
set rtp+=~/.fzf
noremap <C-f> :FZF<CR>
noremap <C-g> :Ag<CR>
noremap <C-h> :History<CR>
"ctrlp(custom)"
noremap <c-p> :FZF ~/<CR>
"vim-plug"
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'morhetz/gruvbox'
Plug 'junegunn/fzf.vim'
call plug#end()
"color"
autocmd vimenter * nested colorscheme gruvbox
set termguicolors
let g:gruvbox_italic=1
colorscheme gruvbox
set background=dark
nnoremap <silent> [oh :call gruvbox#hls_show()<CR>
nnoremap <silent> ]oh :call gruvbox#hls_hide()<CR>
nnoremap <silent> coh :call gruvbox#hls_toggle()<CR>
nnoremap * :let @/ = ""<CR>:call gruvbox#hls_show()<CR>*
nnoremap / :let @/ = ""<CR>:call gruvbox#hls_show()<CR>/
nnoremap ? :let @/ = ""<CR>:call gruvbox#hls_show()<CR>?
noremap <silent> <Leader><CR> :call gruvbox#hls_hide()<CR>
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif