Summary Files CommitsBranches @commit@diff
path: root/.vim/feat/term_scroll.vim
diff options
context:
space:
mode:
Commitedbcd138dc5d68762e7e4fe26a1b73534d4e75e6 (patch )
AuthorSyndamia <kamen@syndamia.com>2024-08-08 08:08:28 +0300
CommitterSyndamia <kamen@syndamia.com>2024-08-08 08:08:28 +0300
Files3d002598e36b98dc749ed4f3f25e33dab7cb9577 /.vim/feat/term_scroll.vim
dotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.tar
dotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.tar.gz
dotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.zip
Parenta6e96b572371a9da9f133f81e268befcae7d5fd8 (diff)
feat(vim): Final vimrc edits
1 files changed, 5 insertions, 5 deletions
-rw-r--r--.vim/feat/term_scroll.vim10
diff --git a/.vim/feat/term_scroll.vim b/.vim/feat/term_scroll.vim
index d01fe4c..ef55017 100644
--- a/.vim/feat/term_scroll.vim
+++ b/.vim/feat/term_scroll.vim
@@ -1,19 +1,19 @@
" Scrolling (shows history) in terminal (except in lazygit)
" Scroll up to activate it, and press right mouse button to deactivate it
" Slightly modified version of: https://github.com/vim/vim/issues/2490#issuecomment-393973253
-tmap <silent> <ScrollWheelUp> <c-w>:call EnterNormalMode()<CR>
+tmap <silent> <buffer> <ScrollWheelUp> <c-w>:call EnterNormalMode()<CR>
function! ExitNormalMode()
- unmap <buffer> <silent> <RightMouse>
+ unmap <silent> <buffer> <RightMouse>
call feedkeys("a")
endfunction
function! EnterNormalMode()
- if @% == '!lazygit'
- tunmap <buffer> <silent> <ScrollWheelUp>
+ if bufname('%') =~ '!lazygit'
+ tunmap <buffer> <ScrollWheelUp>
elseif &buftype == 'terminal' && mode('') == 't'
call feedkeys("\<c-w>N")
call feedkeys("\<c-y>")
- map <buffer> <silent> <RightMouse> :call ExitNormalMode()<CR>
+ map <silent> <buffer> <RightMouse> :call ExitNormalMode()<CR>
endif
endfunction