-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
209 lines (181 loc) · 4.67 KB
/
init.vim
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
"| \/ \ \ / / | \ | \ \ / /_ _| \/ | _ \ / ___|
"| |\/| |\ V / | \| |\ \ / / | || |\/| | |_) | |
"| | | | | | | |\ | \ V / | || | | | _ <| |___
"|_| |_| |_| |_| \_| \_/ |___|_| |_|_| \_\\____|
" ===
" === Auto load for first time uses
" ===
if empty(glob($HOME.'/.config/nvim/autoload/plug.vim'))
silent !curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
"load plugins
call plug#begin('$HOME/.config/nvim/plugins')
"Plug 'nvim-treesitter/nvim-treesitter-refactor'
"Plug 'nvim-treesitter/playground'
" autocomplete" {
" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Plug 'Shougo/deoplete-clangx'
" let g:deoplete#enable_at_startup = 1
" }
"Plug 'derekwyatt/vim-fswitch'
Plug 'tomasr/molokai'
Plug 'preservim/tagbar'
Plug 'neoclide/jsonc.vim'
Plug 'elzr/vim-json'
Plug 'fatih/vim-go'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'zeekay/vim-beautify'
Plug 'mbbill/undotree'
Plug 'RRethy/vim-hexokinase', { 'do': 'make hexokinase' }
Plug 'RRethy/vim-illuminate'
Plug 'airblade/vim-rooter'
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] }
Plug 'ziontee113/syntax-tree-surfer'
Plug 'junegunn/goyo.vim'
" show buffers {
Plug 'bling/vim-bufferline'
map <C-J> :bnext<CR>
map <C-K> :bprev<CR>
" }
" highlight {
Plug 'nvim-treesitter/nvim-treesitter'
au FileType go TSBufToggle highlight
" }
" vim-go {
Plug 'fatih/vim-go'
"let g:go_debug=['lsp']
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
au filetype go inoremap <buffer> . .<C-x><C-o>
"let g:go_gopls_options = ['-listen.timeout=0']
au FileType go nmap <leader>d <Plug>(go-def)
" }
" select the closest text object {
"<Enter>
Plug 'gcmt/wildfire.vim'
" }
" easy jump any where " {
Plug 'easymotion/vim-easymotion'
let g:EasyMotion_verbose = 0
let g:EasyMotion_startofline = 0
nmap s <Plug>(easymotion-overwin-f2)
" }
" jump to def and ref {
" <leader> j
Plug 'pechorin/any-jump.vim'
" }
" hightlight/strip whitespace" {
Plug 'ntpeters/vim-better-whitespace'
nnoremap <unique> <leader>w :StripWhitespace<CR>
" }
" fzf for fuzzy search {
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'Yggdroot/LeaderF'
" activate fzf by ctrl-p
nnoremap <silent> <C-p> :Files<CR>
" }
" mundo for navigate in undo-tree {
Plug 'simnalamburt/vim-mundo'
nnoremap <F5> :MundoToggle<CR>
" }
" tab align {
Plug 'godlygeek/tabular'
" }
call plug#end()
set t_Co=256
let g:rehash256 = 1
colorscheme molokai
"-------------------------------------------------------------------------------------------------
" Compile function
"noremap r :call CompileRunGcc()<CR>
"func! CompileRunGcc()
" exec "w"
" if &filetype == 'c'
" exec "!g++ % -o %<"
" exec "!time ./%<"
" elseif &filetype == 'cpp'
" set splitbelow
" exec "!g++ -std=c++11 % -Wall -o %<"
" :sp
" :res -15
" :term ./%<
" elseif &filetype == 'cc'
" set splitbelow
" exec "!g++ -std=c++11 % -Wall -o %<"
" :sp
" :res -15
" :term ./%<
" elseif &filetype == 'java'
" set splitbelow
" :sp
" :res -5
" term javac % && time java %<
" elseif &filetype == 'sh'
" :!time bash %
" elseif &filetype == 'python'
" set splitbelow
" :sp
" :term python3 %
" elseif &filetype == 'go'
" set splitbelow
" :sp
" :term go run .
" endif
"endfunc
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set number
set exrc
set secure
set hidden
set noexpandtab
set autoindent
"set list
"set listchars=tab:\|\ ,trail:▫
set scrolloff=4
set ttimeoutlen=0
set notimeout
set viewoptions=cursor,folds,slash,unix
set wrap
set tw=0
set indentexpr=
set foldmethod=indent
set foldlevel=99
set foldenable
set formatoptions-=tc
set splitright
set splitbelow
set noshowmode
set showcmd
set wildmenu
set ignorecase
set smartcase
set shortmess+=c
set inccommand=split
set completeopt=longest,noinsert,menuone,noselect,preview
set ttyfast "should make scrolling faster
set lazyredraw "same as above
set visualbell
silent !mkdir -p $HOME/.config/nvim/tmp/backup
silent !mkdir -p $HOME/.config/nvim/tmp/undo
silent !mkdir -p $HOME/.config/nvim/tmp/sessions
set backupdir=$HOME/.config/nvim/tmp/backup,.
set directory=$HOME/.config/nvim/tmp/backup,.
"if has('persistent_undo')
" set undofile
" set undodir=$HOME/.config/nvim/tmp/undo,.
"endif
set updatetime=100
set virtualedit=block
set autoindent
set cindent
set laststatus=2
let mapleader=" "
set mouse=""
let g:tagbar_ctags_bin = '/opt/homebrew/bin/ctags'
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
set statusline=%<%F\ %h%m%r%=%{tagbar#currenttag('%s\ ','','f')}%-.(%l,%c%V%)\ %P