-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
130 lines (114 loc) · 3.47 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
" Install vim-plug first:
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" The default plugin directory will be as follows:
" - Vim (Linux/macOS): '~/.vim/plugged'
" - Vim (Windows): '~/vimfiles/plugged'
" - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
" == Win32 Setting {{{
if has('win32')
let $LANG="zh_CN.UTF-8"
set langmenu=zh_cn.utf-8
set encoding=utf8
autocmd GUIEnter * simalt ~x
endif
" }}}
" == GUI Setting {{{
if has('gui_running') || exists("g:GuiLoaded")
set guifont=JetBrains\ Mono:h11
"set guioptions=aeMrL
set guioptions=aMrL
set lines=59 columns=237
endif
" }}}
" == Plugin Install {{{
call plug#begin()
Plug 'itchyny/lightline.vim'
Plug 'yggdroot/leaderf'
"Plug 'voldikss/LeaderF-everything'
"Plug 'lifepillar/vim-solarized8'
Plug 'easymotion/vim-easymotion'
Plug 'Yggdroot/indentLine'
Plug 'mbbill/undotree'
Plug 'sheerun/vim-polyglot'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'mhinz/vim-startify'
Plug 'preservim/nerdtree'
Plug 'joshdick/onedark.vim'
Plug 'azabiong/vim-highlighter'
call plug#end()
" }}}
" == Setting table {{{
set backspace=indent,eol,start
set tabstop=4
set shiftwidth=4
set expandtab
" }}}
" == Setting theme{{{
if exists('+termguicolors')
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
set background=dark
colorscheme onedark
" }}}
" == Setting lightline {{{
set laststatus=2
set noshowmode
let g:lightline = {
\ 'component': {
\ 'lineinfo': ' %3l:%-2c',
\ },
\ 'colorscheme': 'onedark',
\ 'component_function': {
\ 'readonly': 'LightlineReadonly',
\ 'fugitive': 'LightlineFugitive'
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\ }
function! LightlineReadonly()
return &readonly ? '' : ''
endfunction
function! LightlineFugitive()
if exists('*FugitiveHead')
let branch = FugitiveHead()
return branch !=# '' ? ''.branch : ''
endif
return ''
endfunction
" }}}
" == Setting nerdtree {{{
nnoremap <F9> :NERDTreeFind<CR>
" }}}
" == Setting easymotion {{{
let g:EasyMotion_do_mapping = 0
nmap <C-s> <Plug>(easymotion-s)
" }}}
" == Setting undotree {{{
nnoremap <F5> :UndotreeToggle<CR>
if has("persistent_undo")
if !isdirectory($HOME."/.undodir")
call mkdir($HOME."/.undodir", "p", 0700)
endif
set undodir=~/.undodir
set undofile
endif
" }}}
" == Setting leaderf {{{
let g:Lf_WindowPosition = 'popup'
let g:Lf_PopupColorscheme = 'onedark'
let g:Lf_PreviewInPopup = 1
let g:Lf_ShortcutF = '<c-p>'
let g:Lf_ShortcutB = '<c-n>'
let g:Lf_StlSeparator = { 'left': '', 'right': '' }
noremap <F7> :<C-U><C-R>=printf("Leaderf gtags")<CR><CR>
noremap <F8> :<C-U><C-R>=printf("Leaderf bufTag")<CR><CR>
noremap F :<C-U><C-R>=printf("Leaderf! rg --match-path -e %s ", expand("<cword>"))<CR>
noremap <leader>fr :<C-U><C-R>=printf("Leaderf! gtags -r %s --auto-jump", expand("<cword>"))<CR><CR>
noremap <leader>fd :<C-U><C-R>=printf("Leaderf! gtags -d %s --auto-jump", expand("<cword>"))<CR><CR>
noremap <leader>fs :<C-U><C-R>=printf("Leaderf! gtags -s %s", expand("<cword>"))<CR><CR>
noremap <space><space> :<C-U><C-R>=printf("Leaderf --recall")<CR><CR>
" }}}
" vim: fdm=marker:et:ts=4:sw=4:sts=4