切换到 VIM 中的最后一个活动选项卡 [英] Switch to last-active tab in VIM

查看:18
本文介绍了切换到 VIM 中的最后一个活动选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Vim 中,有没有办法在当前选项卡和最后一个活动选项卡之间快速切换?'' 在当前行和最后一个活动行之间切换的方式排序.插件/键盘映射/巫毒都可以接受.

In Vim, is there a way to quickly toggle between the current tab and the last-active tab? Sort of the way '' toggles between the current line and the last-active line. Plugins / keyboard mappings / voodoo all acceptable.

推荐答案

把这个放到你的.vimrc中:

Put this in your .vimrc:

if !exists('g:lasttab')
  let g:lasttab = 1
endif
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()

然后,在正常模式下,键入 l 以切换到您上次查看的选项卡.

Then, in normal mode, type l to swap to the tab you viewed last.

这篇关于切换到 VIM 中的最后一个活动选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆