|
@@ -9,19 +9,22 @@ endif
|
|
|
|
|
|
|
|
" Pre-plugin calls
|
|
" Pre-plugin calls
|
|
|
let g:ale_completion_enabled = 1
|
|
let g:ale_completion_enabled = 1
|
|
|
-let g:ale_set_balloons = 1
|
|
|
|
|
|
|
+let g:ale_hover_to_floating_preview = 1
|
|
|
|
|
+let g:ale_floating_preview = 1
|
|
|
|
|
|
|
|
" Plugins
|
|
" Plugins
|
|
|
call plug#begin('~/.vim/plugged')
|
|
call plug#begin('~/.vim/plugged')
|
|
|
Plug 'preservim/nerdtree'
|
|
Plug 'preservim/nerdtree'
|
|
|
Plug 'tpope/vim-fugitive'
|
|
Plug 'tpope/vim-fugitive'
|
|
|
Plug 'tpope/vim-commentary'
|
|
Plug 'tpope/vim-commentary'
|
|
|
-" Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
|
|
|
|
|
|
+Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
|
|
Plug 'itchyny/lightline.vim'
|
|
Plug 'itchyny/lightline.vim'
|
|
|
Plug 'dikiaap/minimalist'
|
|
Plug 'dikiaap/minimalist'
|
|
|
Plug 'morhetz/gruvbox'
|
|
Plug 'morhetz/gruvbox'
|
|
|
Plug 'dense-analysis/ale'
|
|
Plug 'dense-analysis/ale'
|
|
|
Plug 'maximbaz/lightline-ale'
|
|
Plug 'maximbaz/lightline-ale'
|
|
|
|
|
+Plug 'preservim/tagbar'
|
|
|
|
|
+Plug 'vim-php/tagbar-phpctags.vim'
|
|
|
call plug#end()
|
|
call plug#end()
|
|
|
|
|
|
|
|
filetype plugin indent on
|
|
filetype plugin indent on
|
|
@@ -54,6 +57,7 @@ set whichwrap+=<,>,[,],h,l
|
|
|
set undofile
|
|
set undofile
|
|
|
set undodir=~/.vim/undo
|
|
set undodir=~/.vim/undo
|
|
|
|
|
|
|
|
|
|
+
|
|
|
" Gruvbox
|
|
" Gruvbox
|
|
|
let g:gruvbox_italic = 1
|
|
let g:gruvbox_italic = 1
|
|
|
let g:gruvbox_bold = 1
|
|
let g:gruvbox_bold = 1
|
|
@@ -61,8 +65,14 @@ let g:gruvbox_transparent_bg = 1
|
|
|
colorscheme gruvbox
|
|
colorscheme gruvbox
|
|
|
|
|
|
|
|
" ALE completion
|
|
" ALE completion
|
|
|
-set omnifunc=ale#completion#OmniFunc
|
|
|
|
|
let g:ale_completion_autoimport = 1
|
|
let g:ale_completion_autoimport = 1
|
|
|
|
|
+set omnifunc=ale#completion#OmniFunc
|
|
|
|
|
+
|
|
|
|
|
+" Ale keymaps
|
|
|
|
|
+nnoremap <C-a>g :ALEGoToDefinition -tab<CR>
|
|
|
|
|
+nnoremap <C-a>G :ALEGoToDefinition<CR>
|
|
|
|
|
+nnoremap <C-a>h :ALEHover<CR>
|
|
|
|
|
+nnoremap <C-a>f :ALEFindReferences<CR>
|
|
|
|
|
|
|
|
" ALE navigation
|
|
" ALE navigation
|
|
|
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
|
|
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
|
|
@@ -76,7 +86,7 @@ let g:lightline = {
|
|
|
\ 'active': {
|
|
\ 'active': {
|
|
|
\ 'left': [
|
|
\ 'left': [
|
|
|
\ [ 'mode', 'paste' ],
|
|
\ [ 'mode', 'paste' ],
|
|
|
- \ [ 'gitbranch', 'readonly', 'filename', 'modified' ]
|
|
|
|
|
|
|
+ \ [ 'gitbranch', 'readonly', 'filename', 'tagbar', 'modified' ]
|
|
|
\ ],
|
|
\ ],
|
|
|
\ 'right': [
|
|
\ 'right': [
|
|
|
\ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ],
|
|
\ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok' ],
|
|
@@ -84,6 +94,9 @@ let g:lightline = {
|
|
|
\ [ 'fileformat', 'fileencoding', 'filetype' ]
|
|
\ [ 'fileformat', 'fileencoding', 'filetype' ]
|
|
|
\ ]
|
|
\ ]
|
|
|
\ },
|
|
\ },
|
|
|
|
|
+ \ 'component': {
|
|
|
|
|
+ \ 'tagbar': '%{tagbar#currenttag("%s", "", "f", "nearest-stl")}',
|
|
|
|
|
+ \ },
|
|
|
\ 'component_function': {
|
|
\ 'component_function': {
|
|
|
\ 'gitbranch': 'FugitiveHead',
|
|
\ 'gitbranch': 'FugitiveHead',
|
|
|
\ 'offset': 'FileOffset'
|
|
\ 'offset': 'FileOffset'
|
|
@@ -111,30 +124,64 @@ endfunction
|
|
|
" NERDtree
|
|
" NERDtree
|
|
|
" Start NERDTree if no file was specified
|
|
" Start NERDTree if no file was specified
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
-autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
|
|
|
|
|
|
+" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | call NERDTreeToggleCustom() | endif
|
|
|
" Close NERDTree on opening file
|
|
" Close NERDTree on opening file
|
|
|
let NERDTreeQuitOnOpen=1
|
|
let NERDTreeQuitOnOpen=1
|
|
|
" Show hidden files
|
|
" Show hidden files
|
|
|
let NERDTreeShowHidden=1
|
|
let NERDTreeShowHidden=1
|
|
|
|
|
+
|
|
|
|
|
+function! NERDTreeToggleCustom()
|
|
|
|
|
+
|
|
|
|
|
+ " If NERDTree is open in the current buffer
|
|
|
|
|
+ if (exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1)
|
|
|
|
|
+ exe ":NERDTreeClose"
|
|
|
|
|
+ elseif bufname('%') != ""
|
|
|
|
|
+ exe ":NERDTreeFind"
|
|
|
|
|
+ else
|
|
|
|
|
+ exe ":NERDTreeCWD"
|
|
|
|
|
+ endif
|
|
|
|
|
+
|
|
|
|
|
+endfunction
|
|
|
|
|
+
|
|
|
" Toggle NERDTree on <space>-o
|
|
" Toggle NERDTree on <space>-o
|
|
|
-map <Space>o :NERDTreeToggle<CR>
|
|
|
|
|
-
|
|
|
|
|
-" " vim-go
|
|
|
|
|
-" let g:go_highlight_types = 1
|
|
|
|
|
-" let g:go_highlight_fields = 1
|
|
|
|
|
-" let g:go_highlight_functions = 1
|
|
|
|
|
-" let g:go_highlight_function_calls = 1
|
|
|
|
|
-" let g:go_highlight_operators = 1
|
|
|
|
|
-" let g:go_auto_type_info = 1
|
|
|
|
|
-" let g:go_fmt_command = "goimports"
|
|
|
|
|
|
|
+map <Space>o :call NERDTreeToggleCustom()<CR>
|
|
|
|
|
+
|
|
|
|
|
+" Tagbar
|
|
|
|
|
+let g:tagbar_autoclose = 1
|
|
|
|
|
+let g:tagbar_autofocus = 1
|
|
|
|
|
+let g:tagbar_map_showproto = ''
|
|
|
|
|
+
|
|
|
|
|
+" Toggle transparent background
|
|
|
|
|
+let g:is_transparent = 0
|
|
|
|
|
+function! Toggle_transparent()
|
|
|
|
|
+ echo g:is_transparent
|
|
|
|
|
+ if g:is_transparent == 0
|
|
|
|
|
+ hi Normal guibg=NONE ctermbg=NONE
|
|
|
|
|
+ let g:is_transparent = 1
|
|
|
|
|
+ else
|
|
|
|
|
+ set background=dark
|
|
|
|
|
+ let g:is_transparent = 0
|
|
|
|
|
+ endif
|
|
|
|
|
+endfunction
|
|
|
|
|
+nnoremap <Space>T :call Toggle_transparent()<CR>
|
|
|
|
|
+
|
|
|
|
|
+" vim-go
|
|
|
|
|
+let g:go_highlight_types = 1
|
|
|
|
|
+let g:go_highlight_fields = 1
|
|
|
|
|
+let g:go_highlight_functions = 1
|
|
|
|
|
+let g:go_highlight_function_calls = 1
|
|
|
|
|
+let g:go_highlight_operators = 1
|
|
|
|
|
+let g:go_auto_type_info = 1
|
|
|
|
|
+let g:go_fmt_command = "goimports"
|
|
|
" let g:go_list_type = "quickfix"
|
|
" let g:go_list_type = "quickfix"
|
|
|
|
|
|
|
|
-" map <C-g>v :GoVet<CR>
|
|
|
|
|
-" map <C-g>r :GoRun<CR>
|
|
|
|
|
-" map <C-g>b :GoBuild<CR>
|
|
|
|
|
|
|
+map <C-g>v :GoVet<CR>
|
|
|
|
|
+map <C-g>r :GoRun<CR>
|
|
|
|
|
+map <C-g>b :GoBuild<CR>
|
|
|
|
|
|
|
|
" Key mappings
|
|
" Key mappings
|
|
|
map <C-l>n :cnext<CR>
|
|
map <C-l>n :cnext<CR>
|
|
|
map <C-l>p :cprevious<CR>
|
|
map <C-l>p :cprevious<CR>
|
|
|
nnoremap <C-l>c :cclose<CR>
|
|
nnoremap <C-l>c :cclose<CR>
|
|
|
|
|
|
|
|
|
|
+nmap <Space>t :TagbarToggle<CR>
|