Skip to content

Commit

Permalink
✨feat: gn, gpでterminalをスキップするように
Browse files Browse the repository at this point in the history
  • Loading branch information
utubo committed Dec 20, 2024
1 parent c6c4228 commit 1772c76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .vim/autoload/vimrc/lazyload.vim
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ Each X=t,T nmap gX <SID>(tab)X|nm <SID>(tab)X <ScriptCmd>F('X')<CR><SID>(tab)
def G(a: string)
set tabline=%!vimrc#bufline#MyBufline()
set showtabline=2
const b = bufnr()
while true
exe $'b{a}'
if &buftype !=# 'terminal' || bufnr() ==# b
break
endif
endwhile
au SafeState * ++once au CursorMoved * ++once set showtabline=0
enddef
Each X=n,p nmap gX <SID>(buf)X|nm <SID>(buf)X <ScriptCmd>G('X')<CR><SID>(buf)
Expand Down
9 changes: 8 additions & 1 deletion src/.vim/autoload/vimrc/lazyload.src.vim
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,14 @@ Each X=t,T nmap gX <SID>(tab)X | nmap <SID>(tab)X <ScriptCmd>ShowTab('X')<CR><SI
def ShowBuf(a: string)
set tabline=%!vimrc#bufline#MyBufline()
set showtabline=2
execute $'b{a}'
const b = bufnr()
while true
execute $'b{a}'
# terminalに移動すると混乱するのでスキップする || 無限ループ防止
if &buftype !=# 'terminal' || bufnr() ==# b
break
endif
endwhile
au SafeState * ++once au CursorMoved * ++once set showtabline=0
enddef
Each X=n,p nmap gX <SID>(buf)X | nmap <SID>(buf)X <ScriptCmd>ShowBuf('X')<CR><SID>(buf)
Expand Down

0 comments on commit 1772c76

Please sign in to comment.