[nvim] Add gitlens, scratchfile lua plugins
Added gitlens to show git blame for cursorline after short time. Added makescratch plugin to create a new scratch window via simple command.
This commit is contained in:
parent
e6e384270a
commit
00b15048df
4 changed files with 81 additions and 0 deletions
23
nvim/.config/nvim/plugin/personal/gitlens.vim
Normal file
23
nvim/.config/nvim/plugin/personal/gitlens.vim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
function s:setupGitLens()
|
||||
" -- disable gitlens unconditionally, and remove virtual text
|
||||
lua require('gitlens').clearBlameVirtText()
|
||||
augroup GitLens
|
||||
autocmd!
|
||||
augroup END
|
||||
|
||||
" -- if it is wanted enable gitlens on holding the cursor
|
||||
if g:gitlens_enable
|
||||
augroup GitLens
|
||||
autocmd! CursorHold * lua require('gitlens').blameVirtText()
|
||||
autocmd! CursorMoved * lua require('gitlens').clearBlameVirtText()
|
||||
autocmd! CursorMovedI * lua require('gitlens').clearBlameVirtText()
|
||||
augroup END
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:toggleGitLens()
|
||||
let g:gitlens_enable = !get(g:, 'gitlens_enable', 1)
|
||||
call s:setupGitLens()
|
||||
endfunction
|
||||
|
||||
command! GitLensToggle call s:toggleGitLens()
|
||||
5
nvim/.config/nvim/plugin/personal/makescratch.vim
Normal file
5
nvim/.config/nvim/plugin/personal/makescratch.vim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
function s:makeScratch()
|
||||
lua require('scratchpad').makeScratch()
|
||||
endfunction
|
||||
|
||||
command! ScratchPad call s:makeScratch()
|
||||
Loading…
Add table
Add a link
Reference in a new issue