1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-22 15:21:30 +01:00

vim: update ale/gutentags config, add new git maps

Git maps:

- <leader>gp -> push
- <leader>gl -> log
- <leader>gc -> commit
- <leader>gpf -> push --force-with-lease
- <leader>gs -> stage hunk under cursor
- <leader>gu -> unstage hunk under cursor
This commit is contained in:
bretello 2022-08-12 15:52:55 +02:00
parent 827843d8bd
commit b0ae3d6e3d
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
3 changed files with 18 additions and 7 deletions

View File

@ -37,13 +37,15 @@ let g:ale_linters = {
\ 'bash': ['bash-language-server', 'bashlint', "shellcheck"],
\ 'dockerfile': ["hadolint"],
\ 'zsh': ['bashlint', "shellcheck"],
\ 'c': ['clangd'],
\ 'cpp': ['clangd'],
\ 'python': ['pylsp', 'pylint', 'bandit', "mypy"],
\ 'python': ['pylsp', 'pylint', 'bandit', "mypy", "flake8"],
\ 'go': ['gopls', 'gobuild'],
\ 'rust': ['analyzer'],
\ 'yaml': ['yamllint'],
\ 'javascript': ["yarn lint", "eslint", "vls"]
\}
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
let g:ale_yaml_yamllint_options = "--config .editorconfig"
@ -180,7 +182,7 @@ let g:gutentags_file_list_command = {
\ },
\ }
let g:gutentags_generate_on_empty_buffer = 1
let g:gutentags_ctags_exclude = ['build', 'dist', '*css', '*json', '*yaml', '*md']
let g:gutentags_ctags_exclude = ['build', 'dist', '*css', '*json', '*yaml', '*md', '.venv', '*rst']
let g:gutentags_ctags_extra_args = ['--tag-relative=always', ]
"" nerdtree
let NERDTreeIgnore=['__pycache__']

View File

@ -60,16 +60,18 @@ nnoremap <leader>/ :Git<CR>
nnoremap <leader>\ :0Git<CR>
nnoremap <leader>d :Gvdiffsplit<CR>
nnoremap <leader>b :Git blame<CR>
nnoremap <leader>Gp :Git push<CR>
nnoremap <leader>l :vert Git log %<CR>
nnoremap <leader>Gc :Git commit<CR>
nnoremap <leader>Gpf :Git push --force-with-lease<CR>
nnoremap <leader>gp :Git push<CR>
nnoremap <leader>gl :vert Git log %<CR>
nnoremap <leader>gc :Git commit<CR>
nnoremap <leader>gpf :Git push --force-with-lease<CR>
"" Gitutter
nnoremap <leader>u :GitGutterBufferToggle<CR>
nnoremap <leader>L :GitGutterLineHighlightsToggle<CR>
nnoremap <leader>gp :GitGutterPrevHunk<CR>
nnoremap <leader>gn :GitGutterNextHunk<CR>
nnoremap <leader>gs :GitGutterStageHunk<CR>
nnoremap <leader>gu :GitGutterUndoHunk<CR>
"" Coverage Highlight
@ -100,7 +102,7 @@ map <leader>J :Files<CR>
map <leader>f :History<CR>
map <leader>T :BTags<CR>
map <leader>t :Tags<CR>
" map <leader>l :Lines<CR>
map <leader>l :Lines<CR>
" FIXME: Not using CtrlP anymore, replace this with fzf
""map <leader>c :CtrlPQuickfix<CR>
map <leader>s :Snippets<CR>

View File

@ -79,6 +79,13 @@ au BufRead,BufNewFile */.github/*/*.y{,a}ml
\ let b:ale_linters = {'yaml': ['actionlint'] }
au BufRead,BufNewFile rules.v[46] *.rules setlocal filetype=iptables
autocmd! bufwritepost ~/.vimrc source ~/.vimrc
autocmd! bufwritepost $DOTFILES/vim/vimrc source ~/.vimrc
autocmd! bufwritepost $DOTFILES/vim/shortcuts.vim source ~/.vimrc
autocmd! bufwritepost $DOTFILES/vim/plugs.vim PlugInstall
autocmd! bufwritepost $DOTFILES/vim/plugs.vim PlugUpdate
if has('persistent_undo')
let undo_dir=$HOME . "/.vim/undo"
if !isdirectory(undo_dir)