-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
98 lines (78 loc) · 2.2 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
"===== Style configurations
syntax on
set ruler
set matchpairs+=<:>
set number
set tabstop=4
"===== Fix Caret
set cursorline
set guicursor+=n-v-c:blinkon1-ver20
"===== Added File name on status line
set laststatus=2
set statusline=%f
"===== Fixing broken backspace
set backspace=2
set backspace=indent,eol,start
inoremap <C-d> <Del>
"===== Move through buffers like a pro
map gn :bn<cr>
map gp :bp<cr>
map gd :bd<cr>
"===== Minimalistic tab usage, note: an specific language syntax file could override these settings, ie $HOME/.vim/syntax/C.vim
set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab
"===== Show command as it is entered
set showcmd
" Search for selected text, forwards or backwards.
vnoremap <silent> * :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy/<C-R><C-R>=substitute(
\escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
vnoremap <silent> # :<C-U>
\let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
\gvy?<C-R><C-R>=substitute(
\escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
\gV:call setreg('"', old_reg, old_regtype)<CR>
map <C-n> :NERDTreeToggle<CR>
"====== Enable mouse support
set mouse=a
set tags=$HOME/.ctags
nmap t :tag
nmap - <C-]>
"======= Center Searches
nnoremap n nzz
nnoremap N Nzz
nnoremap <C-o> <C-o>zz
nnoremap <C-i> <C-i>zz
"====== Relative numbers
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
"======= copy paste to/from clipboard
vnoremap <A-y> "+y
nnoremap <A-Y> "+yg
nnoremap <A-y> "+y
nnoremap <A-yy> "+yy
nnoremap <A-p> "+p
nnoremap <A-P> "+P
vnoremap <A-p> "+p
vnoremap <A-P> "+P
"======= removed delay of escape
set ttimeout
set ttimeoutlen=100
" vim-plug
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'itchyny/lightline.vim'
call plug#end()
" NERDTree config
let g:NERDTreeDirArrowExpandable = '>'
let g:NERDTreeDirArrowCollapsible = '^'
" Pale Night
set background=dark
colorscheme palenight
highlight Visual term=reverse cterm=reverse guibg=Grey