-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathold-vimrc
98 lines (78 loc) · 2.56 KB
/
old-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
silent! if plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/vim-easy-align', { 'on': ['<Plug>(EasyAlign)', 'EasyAlign'] }
Plug 'luochen1990/rainbow'
Plug 'liuchengxu/eleline.vim'
Plug 'liuchengxu/space-vim-dark'
Plug 'liuchengxu/vim-better-default'
" Edit
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-commentary', { 'on': '<Plug>Commentary' }
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
Plug 'AndrewRadev/splitjoin.vim'
Plug 'sgur/vim-editorconfig'
" Browsing
Plug 'Yggdroot/indentLine', { 'on': 'IndentLinesEnable' }
autocmd! User indentLine doautocmd indentLine Syntax
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
augroup nerdLoader
autocmd!
autocmd VimEnter * silent! autocmd! FileExplorer
autocmd BufEnter,BufNew *
\ if isdirectory(expand('<amatch>'))
\| call plug#load('nerdtree')
\| execute 'autocmd! nerdLoader'
\| endif
augroup END
if v:version >= 703
Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
endif
" Git
Plug 'tpope/vim-fugitive'
if v:version >= 703
Plug 'mhinz/vim-signify'
endif
" Lang
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'rust-lang/rust.vim'
Plug 'derekwyatt/vim-scala'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'lyuts/vim-rtags', { 'for': ['c', 'cpp'] }
" Lint
Plug 'w0rp/ale'
if has('nvim')
Plug 'roxma/nvim-completion-manager'
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
endif
call plug#end()
endif
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
color space-vim-dark
" Reload .vimrc
nnoremap <Leader>fR :source $MYVIMRC<CR>
" Use Tab to switch buffer
nnoremap <Tab> :bn<CR>
nnoremap <S-Tab> :bp<CR>
" <Leader>[1-9] move to window [1-9]
for s:i in range(1, 9)
execute 'nnoremap <Leader>' . s:i . ' :' . s:i . 'wincmd w<CR>'
endfor
" <Leader><leader>[1-9] move to tab [1-9]
for s:i in range(1, 9)
execute 'nnoremap <Leader><Leader>' . s:i . ' ' . s:i . 'gt'
endfor
" <Leader>b[1-9] move to buffer [1-9]
for s:i in range(1, 9)
execute 'nnoremap <Leader>b' . s:i . ' :b' . s:i . '<CR>'
endfor
nnoremap <Leader>ff :FZF ~<CR>
nnoremap <Leader>ft :NERDTreeToggle<CR>
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>