Add separate file for git settings

This commit is contained in:
2021-10-20 18:13:26 +03:00
parent 5ad043a15a
commit 6c065da12d
4 changed files with 13 additions and 14 deletions

9
config/nvim/git.vim Normal file
View File

@@ -0,0 +1,9 @@
" Remap to toggle gitsigns as linehl
nnoremap <leader>sg :Gitsigns toggle_linehl<CR>
" Open Gitabra
nnoremap <leader>gg :G<CR>
nnoremap <leader>gs :Gitsigns stage_hunk<CR>
nnoremap <leader>gu :Gitsigns undo_stage_hunk<CR>
nnoremap <leader>gc :!git commit<CR>

View File

@@ -6,6 +6,7 @@ source $HOME/.config/nvim/terminal.vim
source $HOME/.config/nvim/file-tree.vim
source $HOME/.config/nvim/coc.vim
source $HOME/.config/nvim/tabs.vim
source $HOME/.config/nvim/git.vim
" Filetypes for markdown extension
let g:mkdp_filetypes = ['md', 'mdx', 'markdown']
@@ -24,18 +25,14 @@ let g:closetag_regions = {
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
lua << EOF
require("gitabra").setup {}
require("gitsigns").setup {
signcolumn = false,
current_line_blame = true,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 500,
},
signcolumn = false,
linehl = false,
current_line_blame_formatter_opts = {
relative_time = false
}
}
require("gitabra").setup {}
EOF

View File

@@ -22,6 +22,5 @@ Plug 'yuezk/vim-js'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'lewis6991/gitsigns.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'Odie/gitabra'
call plug#end()

View File

@@ -25,7 +25,7 @@ tnoremap <A-k> <C-\><C-n><C-w>k
tnoremap <A-l> <C-\><C-n><C-w>l
" Remove search highlighting
noremap <leader>nh :nohl<CR>
noremap <leader>h :nohl<CR>
" Use Ctrl+A to select the whole file
nnoremap <C-a> ggVG
@@ -37,9 +37,6 @@ endfunction
" Open terminal
nnoremap <leader>t :call OpenTerminal()<CR>
" Open Gitabra
nnoremap <leader>g :Gitabra<CR>
" Open splits
nnoremap <leader>v :vs<CR>
nnoremap <leader>vv :sp<CR>
@@ -47,6 +44,3 @@ nnoremap <leader>vv :sp<CR>
" Use Ctrl+Shift+jk to resize panes
nnoremap <C-j> :resize -2<CR>
nnoremap <C-k> :resize +2<CR>
" Remap to toggle gitsigns as linehl
nnoremap <leader>sg :Gitsigns toggle_linehl<CR>