summaryrefslogtreecommitdiff
path: root/.vim/feat/term_scroll.vim
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2024-08-08 08:08:28 +0300
committerSyndamia <kamen@syndamia.com>2024-08-08 08:08:28 +0300
commitedbcd138dc5d68762e7e4fe26a1b73534d4e75e6 (patch)
tree3d002598e36b98dc749ed4f3f25e33dab7cb9577 /.vim/feat/term_scroll.vim
parenta6e96b572371a9da9f133f81e268befcae7d5fd8 (diff)
downloaddotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.tar
dotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.tar.gz
dotfiles-edbcd138dc5d68762e7e4fe26a1b73534d4e75e6.zip
feat(vim): Final vimrc edits
Diffstat (limited to '.vim/feat/term_scroll.vim')
-rw-r--r--.vim/feat/term_scroll.vim10
1 files changed, 5 insertions, 5 deletions
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