|
@@ -17,7 +17,6 @@ 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 'itchyny/lightline.vim'
|
|
Plug 'itchyny/lightline.vim'
|
|
|
Plug 'dikiaap/minimalist'
|
|
Plug 'dikiaap/minimalist'
|
|
|
Plug 'morhetz/gruvbox'
|
|
Plug 'morhetz/gruvbox'
|
|
@@ -27,6 +26,8 @@ Plug 'preservim/tagbar'
|
|
|
Plug 'vim-php/tagbar-phpctags.vim'
|
|
Plug 'vim-php/tagbar-phpctags.vim'
|
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
|
Plug 'junegunn/fzf.vim'
|
|
Plug 'junegunn/fzf.vim'
|
|
|
|
|
+Plug 'arcticicestudio/nord-vim'
|
|
|
|
|
+Plug 'airblade/vim-gitgutter'
|
|
|
call plug#end()
|
|
call plug#end()
|
|
|
|
|
|
|
|
filetype plugin indent on
|
|
filetype plugin indent on
|
|
@@ -54,6 +55,7 @@ set showcmd
|
|
|
set showmatch
|
|
set showmatch
|
|
|
set smartindent
|
|
set smartindent
|
|
|
set smarttab
|
|
set smarttab
|
|
|
|
|
+set splitright
|
|
|
set tabstop=2
|
|
set tabstop=2
|
|
|
set whichwrap+=<,>,[,],h,l
|
|
set whichwrap+=<,>,[,],h,l
|
|
|
set undofile
|
|
set undofile
|
|
@@ -63,7 +65,7 @@ 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
|
|
|
-let g:gruvbox_transparent_bg = 1
|
|
|
|
|
|
|
+let g:gruvbox_transaprent_bg = 1
|
|
|
colorscheme gruvbox
|
|
colorscheme gruvbox
|
|
|
|
|
|
|
|
" ALE completion
|
|
" ALE completion
|
|
@@ -167,19 +169,56 @@ function! Toggle_transparent()
|
|
|
endfunction
|
|
endfunction
|
|
|
nnoremap <Space>T :call Toggle_transparent()<CR>
|
|
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"
|
|
|
|
|
|
|
+" Location list
|
|
|
|
|
+autocmd BufEnter * if !exists("b:location_list") | let b:location_list = 0 | endif
|
|
|
|
|
+let b:location_list = 0
|
|
|
|
|
+function! Toggle_location_list()
|
|
|
|
|
+ if b:location_list == 0
|
|
|
|
|
+ lopen
|
|
|
|
|
+ let b:location_list = 1
|
|
|
|
|
+ else
|
|
|
|
|
+ lclose
|
|
|
|
|
+ let b:location_list = 0
|
|
|
|
|
+ endif
|
|
|
|
|
+endfunction
|
|
|
|
|
+nnoremap <Space>l :call Toggle_location_list()<CR>
|
|
|
|
|
+
|
|
|
|
|
+" Location list
|
|
|
|
|
+autocmd BufEnter * if !exists("b:quick_list") | let b:quick_list = 0 | endif
|
|
|
|
|
+let b:quick_list = 0
|
|
|
|
|
+function! Toggle_quick_list()
|
|
|
|
|
+ if b:quick_list == 0
|
|
|
|
|
+ copen
|
|
|
|
|
+ let b:quick_list = 1
|
|
|
|
|
+ else
|
|
|
|
|
+ cclose
|
|
|
|
|
+ let b:quick_list = 0
|
|
|
|
|
+ endif
|
|
|
|
|
+endfunction
|
|
|
|
|
+nnoremap <Space>c :call Toggle_quick_list()<CR>
|
|
|
|
|
+
|
|
|
|
|
+" Git blame
|
|
|
|
|
+autocmd BufEnter * if !exists("b:git_blame") | let b:git_blame = 0 | endif
|
|
|
|
|
+function! Toggle_git_blame()
|
|
|
|
|
+ if b:git_blame == 0
|
|
|
|
|
+ :Git blame
|
|
|
|
|
+ let b:git_blame = 1
|
|
|
|
|
+ else
|
|
|
|
|
+ let winIndex = 1
|
|
|
|
|
+ let winCnt = winnr('$')
|
|
|
|
|
+ while winIndex <= winCnt
|
|
|
|
|
+ if expand('%:e') == "fugitiveblame"
|
|
|
|
|
+ :close
|
|
|
|
|
+ else
|
|
|
|
|
+ :wincmd w
|
|
|
|
|
+ endif
|
|
|
|
|
+ let winIndex += 1
|
|
|
|
|
+ endwhile
|
|
|
|
|
+ let b:git_blame = 0
|
|
|
|
|
+ endif
|
|
|
|
|
|
|
|
-map <C-g>v :GoVet<CR>
|
|
|
|
|
-map <C-g>r :GoRun<CR>
|
|
|
|
|
-map <C-g>b :GoBuild<CR>
|
|
|
|
|
|
|
+endfunction
|
|
|
|
|
+nnoremap <Space>b :call Toggle_git_blame()<CR>
|
|
|
|
|
|
|
|
" Key mappings
|
|
" Key mappings
|
|
|
map <C-l>n :cnext<CR>
|
|
map <C-l>n :cnext<CR>
|
|
@@ -190,6 +229,15 @@ nmap <Space>t :TagbarToggle<CR>
|
|
|
nmap <Space>f :Files<CR>
|
|
nmap <Space>f :Files<CR>
|
|
|
nmap <Space>r :Rg<CR>
|
|
nmap <Space>r :Rg<CR>
|
|
|
|
|
|
|
|
|
|
+nmap <Space>n :GitGutterNextHunk<CR>
|
|
|
|
|
+nmap <Space>p :GitGutterPrevHunk<CR>
|
|
|
|
|
+
|
|
|
|
|
+" Setting title to enable better tmux titling
|
|
|
|
|
+if exists('$TMUX')
|
|
|
|
|
+ autocmd BufReadPost,FileReadPost,BufNewFile,BufEnter * call system("tmux rename-window 'vim | " . expand("%:t") . "'")
|
|
|
|
|
+ autocmd VimLeave * call system("tmux setw automatic-rename")
|
|
|
|
|
+endif
|
|
|
|
|
+
|
|
|
function! PrettyXML()
|
|
function! PrettyXML()
|
|
|
set filetype=xml
|
|
set filetype=xml
|
|
|
silent %!xmllint --format --encode UTF-8 --recover - 2>/dev/null
|
|
silent %!xmllint --format --encode UTF-8 --recover - 2>/dev/null
|
|
@@ -202,3 +250,6 @@ endfunction
|
|
|
|
|
|
|
|
command! PrettyXml call PrettyXML()
|
|
command! PrettyXml call PrettyXML()
|
|
|
command! PrettyJson call PrettyJSON()
|
|
command! PrettyJson call PrettyJSON()
|
|
|
|
|
+
|
|
|
|
|
+nmap <Space>j call PrettyXml()
|
|
|
|
|
+nmap <Space>x call PrettyJSON()
|