refresh --> master

This commit is contained in:
Emmanuel BENOîT 2023-06-24 18:23:14 +02:00
commit 41717879ae
No known key found for this signature in database
GPG key ID: 2356DC6956CF54EF
93 changed files with 368 additions and 177 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "neobundle-initial"]
path = neobundle-initial
url = https://github.com/Shougo/neobundle.vim.git

View file

View file

@ -1 +0,0 @@
NeoBundle 'prabirshrestha/async.vim'

View file

@ -1 +0,0 @@
NeoBundle 'prabirshrestha/asyncomplete-lsp.vim'

View file

@ -1 +0,0 @@
NeoBundle 'prabirshrestha/asyncomplete.vim'

View file

@ -1 +0,0 @@
NeoBundle 'skywind3000/asyncrun.vim'

View file

@ -1 +0,0 @@
NeoBundle 'ctrlpvim/ctrlp.vim'

View file

@ -1 +0,0 @@
NeoBundle 'Glench/Vim-Jinja2-Syntax'

View file

@ -1 +0,0 @@
NeoBundle 'neomake/neomake'

View file

@ -1,3 +0,0 @@
NeoBundle 'Xuyuanp/nerdtree-git-plugin' , {
\ 'depends' : 'scrooloose/nerdtree'
\ }

View file

@ -1 +0,0 @@
NeoBundle 'scrooloose/nerdtree'

View file

@ -1 +0,0 @@
let g:autofmt_autosave = 1

View file

@ -1 +0,0 @@
NeoBundle 'rust-lang/rust.vim'

View file

@ -1 +0,0 @@
NeoBundle 'mbbill/undotree'

View file

@ -1,3 +0,0 @@
NeoBundle 'vim-airline/vim-airline-themes' , {
\ 'depends' : [ 'bling/vim-airline' ]
\ }

View file

@ -1,6 +0,0 @@
let g:airline_powerline_fonts = 1 " Use really lovely patched fonts
let g:airline#extensions#tabline#enabled = 1 " Show buffers / tabs at the top
let g:airline#extensions#tabline#formatter = 'unique_tail_improved' " Buffer name formatter
let g:airline#extensions#tabline#show_buffers = 1
let g:airline#extensions#tabline#show_tabs = 1
set laststatus=2 " Always show status line

View file

@ -1,3 +0,0 @@
NeoBundle 'bling/vim-airline' , {
\ 'depends' : [ 'ctrlpvim/ctrlp.vim' ]
\ }

View file

@ -1 +0,0 @@
NeoBundle 'octol/vim-cpp-enhanced-highlight'

View file

@ -1,3 +0,0 @@
" Key mappings
nmap <leader>gL :Flog<cr>
nmap <leader>gl :Flogsplit<cr>

View file

@ -1 +0,0 @@
NeoBundle 'rbong/vim-flog'

View file

@ -1 +0,0 @@
NeoBundle 'tpope/vim-fugitive'

View file

@ -1 +0,0 @@
NeoBundle 'airblade/vim-gitgutter'

View file

@ -1 +0,0 @@
NeoBundle 'tikhomirov/vim-glsl'

View file

@ -1,4 +0,0 @@
" Terminal support
let g:go_term_enabled = 1
let g:go_term_mode = "split"
let g:go_term_height = 15

View file

@ -1 +0,0 @@
NeoBundle 'fatih/vim-go'

View file

@ -1,5 +0,0 @@
NeoBundleLazy 'jelera/vim-javascript-syntax', {
\ 'autoload': {
\ 'filetypes': [ 'javascript' ]
\ }
\ }

View file

@ -1 +0,0 @@
NeoBundle 'elzr/vim-json'

View file

@ -1 +0,0 @@
NeoBundle 'mattn/vim-lsp-settings'

View file

@ -1 +0,0 @@
NeoBundle 'prabirshrestha/vim-lsp'

View file

@ -1 +0,0 @@
NeoBundle 'vim-perl/vim-perl'

View file

@ -1 +0,0 @@
NeoBundle 'zigford/vim-powershell'

View file

@ -1 +0,0 @@
NeoBundle 'hashivim/vim-terraform'

View file

@ -1 +0,0 @@
NeoBundle 'vim-test/vim-test'

View file

@ -1 +0,0 @@
NeoBundle 'cespare/vim-toml'

View file

@ -1 +0,0 @@
NeoBundle 'tseeker/vim-which-key'

View file

@ -1,9 +0,0 @@
NeoBundle 'Shougo/vimproc.vim' , {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }

View file

@ -33,7 +33,7 @@ if exists( 'g:vim_vardata' )
elseif $VIM_DATA != "" elseif $VIM_DATA != ""
let s:vim_vardata_base = $VIM_DATA let s:vim_vardata_base = $VIM_DATA
else else
let s:vim_vardata_base = $HOME . '/.vimdata' let s:vim_vardata_base = $HOME . '/.cache/vim'
endif endif
" Remove trailing slash " Remove trailing slash

View file

@ -4,4 +4,3 @@
let mapleader = ' ' " Space as leader character let mapleader = ' ' " Space as leader character
let maplocalleader = ',' " Comma as local leader character let maplocalleader = ',' " Comma as local leader character

View file

@ -182,9 +182,11 @@ echo "Found local configuration in .vim.local ; validating..."
try try
call CheckSignature( ".vim.local/vimrc" , ".vim.local/signature" ) call CheckSignature( ".vim.local/vimrc" , ".vim.local/signature" )
catch /.*/ catch /.*/
echohl ErrorMsg
echo " " echo " "
echo " -> SIGNATURE VERIFICATION FAILED" echo " -> SIGNATURE VERIFICATION FAILED"
echo " " echo " "
echohl None
finish finish
endtry endtry
echo " -> Using local configuration." echo " -> Using local configuration."

74
cfg-pre/75-dein.vim Normal file
View file

@ -0,0 +1,74 @@
" Load and initialise Dein and plugins
if !exists( "g:bundles_dir" )
if exists( "g:vim_local['local_bundles']" )
if !exists( "g:vim_local['vardata']" )
echo "Local bundles requested, but local data directory is not set."
endif
let g:bundles_dir = GetVardataPath( "bundles" )
else
let g:bundles_dir = g:vim_vardata . "/bundles/"
endif
endif
if g:bundles_dir !~ "/$"
let g:bundles_dir = g:bundles_dir . "/"
endif
if !CreateDirectoryIfNecessary( g:bundles_dir )
unlet g:bundles_dir
function! CheckDeinInstall()
" Empty placeholder function
endfunction
finish
endif
if has( 'vim_starting' )
if &compatible
set nocompatible
endif
let s:dein_path = g:bundles_dir . "repos/github.com/Shougo/dein.vim"
if !isdirectory(s:dein_path)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_path
endif
let &g:runtimepath = &g:runtimepath . "," . s:dein_path
endif
" Function that sets a hook to be executed before or after a plugin is loaded.
function! LoadPluginHook(plugins_dir, pname, hook, file_ext)
let l:cfgfile = GetConfigFilePath( a:plugins_dir ,
\ s:pname . "." . a:file_ext . ".vim" )
if l:cfgfile != ""
call dein#set_hook(a:pname, "hook_" . a:hook,
\ join(readfile(l:cfgfile), "\n")
\ )
endif
endfunction
" Start initializing plugins
call dein#begin( g:bundles_dir )
call dein#options(#{
\ lazy_plugins: v:true,
\ install_progress_type: 'floating',
\ })
call dein#add(s:dein_path)
" Load all plugins from ${plugins directory}/*.load.vim
let s:plugins_dir = "plugins"
let s:binit_dir = g:vim_home . "/" . s:plugins_dir
let s:bundle_load_files = GetConfigFiles( s:plugins_dir , "*.load.vim" )
for s:plfn in values( s:bundle_load_files )
execute "source" s:plfn
let s:pname = fnamemodify( s:plfn , ":t:r:r" )
call LoadPluginHook(s:plugins_dir, s:pname, "source", "cfg")
call LoadPluginHook(s:plugins_dir, s:pname, "post_source", "post")
endfor
call dein#end()
function! CheckDeinInstall()
" Let Dein check for installations
if dein#check_install()
call dein#install()
endif
endfunction

View file

@ -1,71 +0,0 @@
" Load and initialise NeoBundle and plugins
if !exists( "g:bundles_dir" )
if exists( "g:vim_local['local_bundles']" )
if !exists( "g:vim_local['vardata']" )
echo "Local bundles requested, but local data directory is not set."
endif
let g:bundles_dir = GetVardataPath( "bundles" )
else
let g:bundles_dir = g:vim_vardata . "/bundles/"
endif
endif
if g:bundles_dir !~ "/$"
let g:bundles_dir = g:bundles_dir . "/"
endif
if !CreateDirectoryIfNecessary( g:bundles_dir )
unlet g:bundles_dir
function! DoNeoBundleCheck()
" Empty placeholder function
endfunction
finish
endif
if has( 'vim_starting' )
if &compatible
set nocompatible
endif
if isdirectory( g:bundles_dir . "neobundle.vim" )
let s:neobundle_path = g:bundles_dir . "neobundle.vim"
else
let s:neobundle_path = g:vim_home . "/neobundle-initial"
endif
let &g:runtimepath = &g:runtimepath . "," . s:neobundle_path
endif
call neobundle#begin( g:bundles_dir )
" Load NeoBundle itself, as well as VimProc
NeoBundleFetch 'Shougo/neobundle.vim'
" Load all plugins from bundles-init/*.load.vim
let s:binit_dir = g:vim_home . "/bundles-init"
let s:bundle_load_files = GetConfigFiles( "bundles-init" , "*.load.vim" )
for s:plfn in values( s:bundle_load_files )
execute "source" s:plfn
" Create configuration loading hooks
let s:pname = fnamemodify( s:plfn , ":t:r:r" )
let s:bundle = neobundle#get( s:pname )
if empty( s:bundle )
continue
endif
function! s:bundle.hooks.on_post_source( bundle )
let cfgfile = GetConfigFilePath( "bundles-init" ,
\ a:bundle.name . ".cfg.vim" )
if l:cfgfile != ""
execute "source" l:cfgfile
endif
endfunction
endfor
call neobundle#end()
function! DoNeoBundleCheck()
" Let NeoBundle check for installations
NeoBundleCheck
call neobundle#call_hook( "on_post_source" )
endfunction

View file

@ -1,2 +1,2 @@
" Map Ctrl+C to X-compatable copy " Map Ctrl+C to X-compatible copy
vnoremap <silent> <C-c> "+y vnoremap <silent> <C-c> "+y

View file

@ -10,3 +10,8 @@ endfunction
set cursorline number set cursorline number
nnoremap <silent> <Leader>oc :set cursorline! cursorcolumn!<CR> nnoremap <silent> <Leader>oc :set cursorline! cursorcolumn!<CR>
nnoremap <silent> <Leader>oC :call <SID>ToggleCursorMode()<CR> nnoremap <silent> <Leader>oC :call <SID>ToggleCursorMode()<CR>
" Use a bar-like cursor in insert mode, and a blinking block in replace mode
let &t_SI = "\e[6 q"
let &t_SR = "\e[0 q"
let &t_EI = "\e[2 q"

View file

@ -1,7 +0,0 @@
" Keys to control (actual) tabs
nnoremap <silent> <A-Insert> :tabnew<CR>
nnoremap <silent> <C-A-Insert> :tabclose<CR>
nnoremap <silent> <A-Left> :tabprevious<CR>
nnoremap <silent> <A-Right> :tabnext<CR>
nnoremap <silent> <A-Up> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
nnoremap <silent> <A-Down> :execute 'silent! tabmove ' . tabpagenr()<CR>

View file

@ -1,9 +1,5 @@
set hidden " Don't close buffers set hidden " Don't close buffers
" Buffer navigation
nnoremap <silent> <S-Left> :bprev<CR>
nnoremap <silent> <S-Right> :bnext<CR>
" Close buffer " Close buffer
function <SID>CloseCurrentBuffer( ) function <SID>CloseCurrentBuffer( )
let btarget = bufnr( '%' ) let btarget = bufnr( '%' )
@ -42,4 +38,14 @@ function <SID>CloseCurrentBuffer( )
execute l:wcurrent . 'wincmd w' execute l:wcurrent . 'wincmd w'
endfunction endfunction
" Buffer navigation (Ctrl, Shift, Arrows...)
nnoremap <silent> <S-Left> :bprev<CR>
nnoremap <silent> <S-Right> :bnext<CR>
nnoremap <silent> <C-S-Down> :call <SID>CloseCurrentBuffer()<CR> nnoremap <silent> <C-S-Down> :call <SID>CloseCurrentBuffer()<CR>
" Buffer navigation (Space sequences)
nnoremap <silent> <Leader>bz :enew<CR>
nnoremap <silent> <Leader>bq :bprev<CR>
nnoremap <silent> <Leader>bd :bnext<CR>
nnoremap <silent> <Leader>bw :call <SID>CloseCurrentBuffer()<CR>
nnoremap <silent> <Leader>bW :bufdo call <SID>CloseCurrentBuffer()<CR>

View file

@ -1,7 +1,2 @@
" Force NeoBundle to check the loaded plugins and install them " Force Dein to check the loaded plugins and install them
call CheckDeinInstall( )
call DoNeoBundleCheck( )
" Add key mappings for updates and installation
nnoremap <silent> <Leader>Pu :NeoBundleCheckUpdate<cr>
nnoremap <silent> <Leader>Pi :call DoNeoBundleCheck()<cr>

6
cfg/30-nerdtree-auto.vim Normal file
View file

@ -0,0 +1,6 @@
" Open automatically NERDTree if there are more than 150 columns and no file was
" specified
autocmd VimEnter * if argc() == 0 && &columns > 150
\ | call dein#source("nerdtree")
\ | NERDTree
\ | endif

View file

@ -1,3 +1,6 @@
" Toggle, open or close the quickfix window. The first argument is the size
" (0 for automatic), and the second argument, if present, determines which
" action to perform: 0 forces the window closed, 1 opens it, and 2 toggles it.
function! ToggleQuickfix(size, ...) function! ToggleQuickfix(size, ...)
let l:mode = (a:0 == 0)? 2 : (a:1) let l:mode = (a:0 == 0)? 2 : (a:1)
function! s:WindowCheck(mode) function! s:WindowCheck(mode)
@ -39,5 +42,9 @@ function! ToggleQuickfix(size, ...)
noautocmd silent! exec ''.l:winnr.'wincmd w' noautocmd silent! exec ''.l:winnr.'wincmd w'
endfunc endfunc
command! -bar QuickfixClose call ToggleQuickfix(0, 0)
command! -bar QuickfixOpen call ToggleQuickfix(0, 1)
command! -bar QuickfixToggle call ToggleQuickfix(0, 2)
nmap <silent> <F12> :call ToggleQuickfix(0)<CR> nmap <silent> <F12> :call ToggleQuickfix(0)<CR>
nmap <silent> <Leader>q :call ToggleQuickfix(0)<CR> nmap <silent> <Leader>q :call ToggleQuickfix(0)<CR>

@ -1 +0,0 @@
Subproject commit f5ace1d749382ab5e5a22670d57c61303a927b72

View file

@ -0,0 +1,3 @@
call dein#add('prabirshrestha/async.vim', #{
\ lazy: 1,
\ })

View file

@ -0,0 +1,4 @@
call dein#add('prabirshrestha/asyncomplete-lsp.vim', #{
\ lazy: 1,
\ on_event: 'VimEnter',
\ })

View file

@ -0,0 +1,4 @@
call dein#add('prabirshrestha/asyncomplete.vim', #{
\ lazy: 1,
\ on_event: 'VimEnter',
\ })

View file

@ -0,0 +1,5 @@
call dein#add('skywind3000/asyncrun.vim', #{
\ lazy: 1,
\ on_cmd: ['AsyncRun', 'AsyncStop'],
\ on_source: ['vim-test'],
\ })

View file

@ -1,6 +1,2 @@
let g:ctrlp_working_path_mode = '' " Disable CtrlP-controlled chdir let g:ctrlp_working_path_mode = '' " Disable CtrlP-controlled chdir
let g:ctrlp_map = '' " Disable default mapping let g:ctrlp_map = '' " Disable default mapping
nnoremap <Leader>pp :CtrlPBuffer<CR>
nnoremap <Leader>po :CtrlPMRUFiles<CR>
nnoremap <Leader>pi :CtrlP<CR>

View file

@ -0,0 +1,8 @@
call dein#add('ctrlpvim/ctrlp.vim', #{
\ lazy: 1,
\ on_cmd: ['CtrlPBuffer', 'CtrlPMRUFiles', 'CtrlP']
\ })
nnoremap <Leader>pp :CtrlPBuffer<CR>
nnoremap <Leader>po :CtrlPMRUFiles<CR>
nnoremap <Leader>pi :CtrlP<CR>

View file

@ -0,0 +1,3 @@
" Force vim-airline to load the CtrlP extension
let g:airline_extensions = ['ctrlp']
call airline#extensions#load()

View file

@ -0,0 +1,8 @@
call dein#add('wsdjeg/dein-ui.vim', #{
\ lazy: 1,
\ on_cmd: ['DeinUpdate'],
\ })
" Add key mappings for updates and installation
nnoremap <silent> <Leader>Pu :DeinUpdate<cr>
nnoremap <silent> <Leader>Pi :call CheckDeinInstall()<cr>

5
plugins/jinja2.load.vim Normal file
View file

@ -0,0 +1,5 @@
call dein#add('Glench/Vim-Jinja2-Syntax', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['jinja'],
\ })

View file

@ -0,0 +1,4 @@
call dein#add('Xuyuanp/nerdtree-git-plugin', #{
\ lazy: 1,
\ on_source: 'nerdtree',
\ })

View file

@ -1,9 +1,5 @@
" NERDTree: ' e' = toggle side bar " NERDTree: ' e' = toggle side bar
let g:NERDTreeGitStatusUpdateOnWrite = 1 let g:NERDTreeGitStatusUpdateOnWrite = 1
nnoremap <Leader>e :NERDTreeToggle<CR>
" Open automatically if there are more than 150 columns and no file was specified
autocmd VimEnter * if argc() == 0 && &columns > 150 | NERDTree | endif
" Set the bookmarks file's path " Set the bookmarks file's path
let g:NERDTreeBookmarksFile = GetVardataPath( 'NTBookmarks' ) let g:NERDTreeBookmarksFile = GetVardataPath( 'NTBookmarks' )

View file

@ -0,0 +1,6 @@
call dein#add('scrooloose/nerdtree', #{
\ lazy: 1,
\ on_cmd: [ 'NERDTree', 'NERDTreeToggle' ],
\ })
nnoremap <Leader>e :NERDTreeToggle<CR>

2
plugins/rust.vim.cfg.vim Normal file
View file

@ -0,0 +1,2 @@
" Format Rust code automatically
let g:rustfmt_autosave = 1

View file

@ -0,0 +1,6 @@
call dein#add('rust-lang/rust.vim', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['rust'],
\ on_cmd: ['Cargo', 'RustFmt', 'RustRun', 'RustExpand', 'RustTest']
\ })

View file

@ -1,5 +1,2 @@
" Keyboard shortcut
nnoremap <Leader>u :UndotreeToggle<CR>
" Hide the sign column " Hide the sign column
autocmd FileType undotree setlocal signcolumn=no autocmd FileType undotree setlocal signcolumn=no

View file

@ -0,0 +1,6 @@
call dein#add('mbbill/undotree', #{
\ lazy: 1 ,
\ on_cmd: [ 'UndotreeShow', 'UndotreeToggle' ],
\ })
nnoremap <Leader>u :UndotreeToggle<CR>

View file

@ -0,0 +1,4 @@
call dein#add('vim-airline/vim-airline-themes', #{
\ lazy: 1,
\ on_event: 'VimEnter',
\ })

View file

@ -0,0 +1,12 @@
" Use powerline fonts
let g:airline_powerline_fonts = 1
" Show buffers / tabs at the top
let g:airline#extensions#tabline#enabled = 1
" Buffer name formatter
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
" Show the list of buffers
let g:airline#extensions#tabline#show_buffers = 1
" Show the list of tabs
let g:airline#extensions#tabline#show_tabs = 1
" Always show status line
set laststatus=2

View file

@ -0,0 +1,3 @@
call dein#add('bling/vim-airline', #{
\ lazy: 1,
\ })

View file

@ -0,0 +1,4 @@
call dein#add('octol/vim-cpp-enhanced-highlight', #{
\ lazy: 1,
\ on_ft: ['cpp'],
\ })

View file

@ -0,0 +1,9 @@
call dein#add('rbong/vim-flog', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_cmd: ['Flog', 'Flogsplit'],
\ })
" Key mappings
nmap <leader>gL :Flog<cr>
nmap <leader>gl :Flogsplit<cr>

View file

@ -0,0 +1,16 @@
" Don't display useless columns in the Git status window
autocmd FileType fugitive setlocal signcolumn=no nonumber norelativenumber
" Timeouts need to be disabled in the Git status window. We need to switch
" them off when entering it, and on when leaving it.
let s:in_fugitive_buffer = v:false
autocmd BufEnter *
\ if &ft ==# 'fugitive'
\ | set notimeout
\ | let s:in_fugitive_buffer = v:true
\ | endif
autocmd BufLeave *
\ if s:in_fugitive_buffer
\ | let s:in_fugitive_buffer = v:false
\ | set timeout
\ | endif

View file

@ -1,3 +1,8 @@
call dein#add('tpope/vim-fugitive', #{
\ lazy: 1,
\ on_source: 'vim-airline',
\ })
" Fugitive commands that don't require interaction with GitGutter or NERDTree " Fugitive commands that don't require interaction with GitGutter or NERDTree
nnoremap <silent> <Leader>ga :Git add %:p<cr> nnoremap <silent> <Leader>ga :Git add %:p<cr>
nnoremap <silent> <Leader>gd :Gvdiffsplit<cr> nnoremap <silent> <Leader>gd :Gvdiffsplit<cr>
@ -5,6 +10,7 @@ nnoremap <silent> <Leader>gs :Git<cr>
nnoremap <silent> <Leader>gc :Git commit -q<cr> nnoremap <silent> <Leader>gc :Git commit -q<cr>
nnoremap <silent> <Leader>gz :Git reset %:p<cr> nnoremap <silent> <Leader>gz :Git reset %:p<cr>
nnoremap <Leader>gb :Git branch<space> nnoremap <Leader>gb :Git branch<space>
nnoremap <Leader>gP :Git! push<cr>
" Note: dangerous commands don't have a <cr>. Also commands that need " Note: dangerous commands don't have a <cr>. Also commands that need
" arguments, obviously. " arguments, obviously.
@ -12,6 +18,5 @@ nnoremap <Leader>gB :Git checkout -b<space>
nnoremap <Leader>gC :Git checkout<space> nnoremap <Leader>gC :Git checkout<space>
nnoremap <Leader>gM :GMove<space> nnoremap <Leader>gM :GMove<space>
nnoremap <Leader>gp :Git pull --recurse-submodules<space> nnoremap <Leader>gp :Git pull --recurse-submodules<space>
nnoremap <Leader>gP :Git push<space>
nnoremap <Leader>gr :GRename<space> nnoremap <Leader>gr :GRename<space>
nnoremap <Leader>gR :GRemove nnoremap <Leader>gR :GRemove

View file

@ -1,9 +1,28 @@
" Key maps " Function that generates the list of hunks and opens the quickfix window
function! ShowGitGutterQuickfix()
exe "GitGutterQuickFix"
call ToggleQuickfix(0, 1)
endfunction
" Function that toggles the hunk preview window.
function! ToggleHunkPreviewWindow()
if gitgutter#hunk#is_preview_window_open()
call gitgutter#hunk#close_hunk_preview_window()
else
exe "GitGutterPreviewHunk"
endif
endfunction
" Don't register default key mappings
let g:gitgutter_map_keys = 0 let g:gitgutter_map_keys = 0
" Keyboard mappings.
nnoremap <silent> <Leader>g< :GitGutterPrevHunk<cr> nnoremap <silent> <Leader>g< :GitGutterPrevHunk<cr>
nnoremap <silent> <Leader>g> :GitGutterNextHunk<cr> nnoremap <silent> <Leader>g> :GitGutterNextHunk<cr>
nnoremap <silent> <Leader>g+ :GitGutterStageHunk<cr> nnoremap <silent> <Leader>g+ :GitGutterStageHunk<cr>
nnoremap <Leader>g- :GitGutterRevertHunk nnoremap <silent> <Leader>g- :GitGutterUndoHunk<cr>
nnoremap <silent> <Leader>gq :call ShowGitGutterQuickfix()<cr>
nnoremap <silent> <Leader>g* :call ToggleHunkPreviewWindow()<cr>
" Symbols " Symbols
let g:gitgutter_sign_added = '+' let g:gitgutter_sign_added = '+'

View file

@ -0,0 +1,4 @@
call dein#add('airblade/vim-gitgutter', #{
\ lazy: 1,
\ on_source: 'vim-airline',
\ })

View file

@ -0,0 +1,5 @@
call dein#add('tikhomirov/vim-glsl', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['glsl', 'html'],
\ })

14
plugins/vim-go.cfg.vim Normal file
View file

@ -0,0 +1,14 @@
" Terminal support
let g:go_term_enabled = 1
let g:go_term_mode = "split"
let g:go_term_height = 15
" Highlighting
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" Formatting
let g:go_fmt_command = 'gopls'

32
plugins/vim-go.load.vim Normal file
View file

@ -0,0 +1,32 @@
call dein#add('fatih/vim-go', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['go', 'gohtmltmpl', 'gosum', 'gowork'],
\ on_cmd: [
\ 'GoReportGitHubIssue', 'GoPath', 'GoImport',
\ 'GoImportAs', 'GoDrop', 'GoLint', 'GoDoc',
\ 'GoDocBrowser', 'GoFmt', 'GoImports', 'GoPlay',
\ 'GoVet', 'GoDef', 'GoDefType', 'GoDefStack',
\ 'GoDefStackClear', 'GoDefPop', 'GoRun', 'GoBuild',
\ 'GoGenerate', 'GoInfo', 'GoInstall', 'GoTest',
\ 'GoTestFile', 'GoTestFunc', 'GoTestCompile',
\ 'GoCoverage', 'GoCoverageToggle', 'GoCoverageClear',
\ 'GoCoverageBrowser', 'GoCoverageOverlay',
\ 'GoErrCheck', 'GoFiles', 'GoDeps',
\ 'GoInstallBinaries', 'GoUpdateBinaries',
\ 'GoImplements', 'GoRename', 'GoGuruScope',
\ 'GoCallees', 'GoCallers', 'GoDescribe', 'GoCallstack',
\ 'GoFreevars', 'GoChannelPeers', 'GoReferrers',
\ 'GoSameIds', 'GoSameIdsClear', 'GoSameIdsToggle',
\ 'GoSameIdsAutoToggle', 'GoMetaLinter',
\ 'GoDiagnostics', 'GoBuildTags', 'AsmFmt',
\ 'GoAlternate', 'GoPointsTo', 'GoWhicherrs', 'GoDecls',
\ 'GoDeclsDir', 'GoImpl', 'GoAddTags', 'GoRemoveTags',
\ 'GoAutoTypeInfoToggle', 'GoFmtAutoSaveToggle',
\ 'GoModFmtAutoSaveToggle', 'GoAsmFmtAutoSaveToggle',
\ 'GoMetaLinterAutoSaveToggle',
\ 'GoTemplateAutoCreateToggle', 'GoKeyify',
\ 'GoFillStruct', 'GoIfErr', 'GoModFmt', 'GoModReload',
\ 'GoAddWorkspace', 'GoLSPDebugBrowser', 'GoExtract'
\ ],
\ })

View file

@ -0,0 +1,5 @@
call dein#add('elzr/vim-json', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['json'],
\ })

View file

@ -17,3 +17,5 @@ let g:lsp_settings = {
\ } \ }
\ }, \ },
\} \}
let g:lsp_settings['pylsp'] = g:lsp_settings['pylsp-all']

View file

@ -0,0 +1,4 @@
call dein#add('mattn/vim-lsp-settings', #{
\ lazy: 1,
\ on_event: 'VimEnter',
\ })

4
plugins/vim-lsp.load.vim Normal file
View file

@ -0,0 +1,4 @@
call dein#add('prabirshrestha/vim-lsp', #{
\ lazy: 1,
\ on_event: 'VimEnter',
\ })

View file

@ -0,0 +1,6 @@
call dein#add('vim-perl/vim-perl', #{
\ lazy: 1,
\ on_ft: ['perl'],
\ merged: 0,
\ build: 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny',
\ })

5
plugins/vim-ps1.load.vim Normal file
View file

@ -0,0 +1,5 @@
call dein#add('PProvost/vim-ps1', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['ps1', 'ps1xml'],
\ })

View file

@ -0,0 +1,2 @@
" Format Terraform files automatically
let g:terraform_fmt_on_save = 1

View file

@ -0,0 +1,6 @@
call dein#add('hashivim/vim-terraform', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['hcl', 'terraform'],
\ on_cmd: ['Terraform', 'TerraformFmt']
\ })

View file

@ -1,8 +1,17 @@
" Run tests in the background, send results to the quickfix window call dein#add('vim-test/vim-test', #{
let test#strategy = 'asyncrun_background' \ lazy: 1,
\ on_cmd: [
\ 'TestSuite', 'TestFile', 'TestNearest', 'TestLast',
\ 'TestVisit', 'TestClass',
\ ],
\ })
" Shortcuts " Shortcuts
nmap <silent> <Leader>Ta :TestSuite<CR> nmap <silent> <Leader>Ta :TestSuite<CR>
nmap <silent> <Leader>Tf :TestFile<CR> nmap <silent> <Leader>Tf :TestFile<CR>
nmap <silent> <Leader>Tc :TestNearest<CR> nmap <silent> <Leader>Tc :TestNearest<CR>
nmap <silent> <Leader>TT :TestLast<CR> nmap <silent> <Leader>TT :TestLast<CR>
" Run tests in the background, send results to the quickfix window
" NOTE: this must be set in this file, not in a .cfg / .post file
let test#strategy = 'asyncrun_background'

View file

@ -0,0 +1,5 @@
call dein#add('cespare/vim-toml', #{
\ lazy: 1,
\ merge_ftdetect: v:true,
\ on_ft: ['toml'],
\ })

View file

@ -0,0 +1,4 @@
call dein#add('liuchengxu/vim-which-key', #{
\ lazy: 1,
\ on_map: #{ n: '<Leader>' },
\ })

View file

@ -2,7 +2,6 @@
nnoremap <silent> <Space> :<c-u>WhichKey '<Space>'<CR> nnoremap <silent> <Space> :<c-u>WhichKey '<Space>'<CR>
let g:which_key_map = {} let g:which_key_map = {}
call which_key#register('<Space>', 'g:which_key_map') call which_key#register('<Space>', 'g:which_key_map')
let g:which_key_fallback_to_native_key = 1
" Direct commands " Direct commands
let g:which_key_map[' '] = [ 'call feedkeys(":nohlsearch\n")' , 'clear-search' ] let g:which_key_map[' '] = [ 'call feedkeys(":nohlsearch\n")' , 'clear-search' ]
@ -21,6 +20,14 @@ let g:which_key_map.o.p = 'paste'
let g:which_key_map.o.w = 'whitespace' let g:which_key_map.o.w = 'whitespace'
let g:which_key_map.o.s = 'sign-column' let g:which_key_map.o.s = 'sign-column'
" Buffers
let g:which_key_map.b = { 'name' : '+buffers' }
let g:which_key_map.b.W = 'close-all'
let g:which_key_map.b.d = 'next'
let g:which_key_map.b.q = 'previous'
let g:which_key_map.b.w = 'close'
let g:which_key_map.b.z = 'new'
" Fuzzy finder " Fuzzy finder
let g:which_key_map.p = { 'name' : '+fuzzy-finder' } let g:which_key_map.p = { 'name' : '+fuzzy-finder' }
let g:which_key_map.p.p = 'buffers' let g:which_key_map.p.p = 'buffers'
@ -29,8 +36,9 @@ let g:which_key_map.p.i = 'open-file'
" Git commands " Git commands
let g:which_key_map.g = { 'name' : '+git' } let g:which_key_map.g = { 'name' : '+git' }
let g:which_key_map.g['*'] = 'hunk-preview'
let g:which_key_map.g['+'] = 'add-hunk' let g:which_key_map.g['+'] = 'add-hunk'
let g:which_key_map.g['-'] = 'revert-hunk' let g:which_key_map.g['-'] = 'undo-hunk'
let g:which_key_map.g['<'] = 'previous-hunk' let g:which_key_map.g['<'] = 'previous-hunk'
let g:which_key_map.g['>'] = 'next-hunk' let g:which_key_map.g['>'] = 'next-hunk'
let g:which_key_map.g.a = 'add-file' let g:which_key_map.g.a = 'add-file'
@ -39,6 +47,7 @@ let g:which_key_map.g.B = 'new-branch'
let g:which_key_map.g.C = 'checkout-branch' let g:which_key_map.g.C = 'checkout-branch'
let g:which_key_map.g.c = 'commit' let g:which_key_map.g.c = 'commit'
let g:which_key_map.g.d = 'diff' let g:which_key_map.g.d = 'diff'
let g:which_key_map.g.q = 'show-hunks'
let g:which_key_map.g.L = 'log-full' let g:which_key_map.g.L = 'log-full'
let g:which_key_map.g.l = 'log-split' let g:which_key_map.g.l = 'log-split'
let g:which_key_map.g.M = 'move' let g:which_key_map.g.M = 'move'

2
vimrc
View file

@ -3,7 +3,7 @@
" If another runtime directory is specified, use it " If another runtime directory is specified, use it
let s:own_path = expand( '<sfile>:p:h' ) let s:own_path = expand( '<sfile>:p:h' )
let $VIM_HOME = $VIM_HOME == '' ? '' let $VIM_HOME = $VIM_HOME == '' ? ''
\ : fnamemodify( $VIM_HOME . '/x' , ':p:h' ) \ : fnamemodify( $VIM_HOME . '/x' , ':p:h' )
if $VIM_HOME == '' || $VIM_HOME == s:own_path if $VIM_HOME == '' || $VIM_HOME == s:own_path