vim插件之MiniBufExplorer
2017-09-07 10:00
369 查看
当只编辑一个buffer的时候MiniBufExplorer不起作用, 当打开第二个buffer的时候, MiniBufExplorer窗口就自动弹出来了, 见下图:
上面最左侧的窗口就是MiniBufExplorer窗口, 其中列出了当前所有已经打开的buffer, 当你把光标置于这个窗口时, 有下面几个快捷键可以用:
<Tab> 向前循环切换到每个buffer名上
<S-Tab> 向后循环切换到每个buffer名上
<Enter> 在打开光标所在的buffer
d 删除光标所在的buffer
以下的两个功能需要在~/.vimrc中增加:
let g:miniBufExplMapCTabSwitchBufs = 1
<C-Tab> 向前循环切换到每个buffer上,并在当前窗口打开
<C-S-Tab> 向后循环切换到每个buffer上,并在当前窗口打开;
注:MiniBufExplore默认是这两个快捷键,可是在ubuntu10.04中不能使用,原因可能是bash中已经定义了ctrl+tab快捷键。所以我们可以更换此快捷键在~/.vim/plugin/minibufexpl.vim中找到:
noremap <C-TAB> :call <SID>CycleBuffer(1)<CR>:<BS>
noremap <C-S-TAB> :call <SID>CycleBuffer(0)<CR>:<BS>
重新定义成自己的map即可。
在~/.vimrc中设置:
let g:miniBufExplMapWindowNavVim = 1
则可以用<C-h,j,k,l>切换到上下左右的窗口中去。
在~/.vimrc中设置:
let g:miniBufExplMapWindowNavArrows = 1
是用<C-箭头键>切换到上下左右窗口中去
以下是MiniBufExplorer的几个命令:
:MiniBufExplorer " Open and/or goto Explorer
:CMiniBufExplorer " Close the Explorer if it's open
:UMiniBufExplorer " Update Explorer without naviting
:TMiniBufExplorer " Toggle the Explorer window open and closed
如果在.vimrc中配置了mapleader,如
let mapleader = "," "Set mapleader
就可以在normal模式下用,mbc代替 :CMiniBufExplorer命令
其他命令为:
:MiniBufExplorer ,mbe
:CMiniBufExplorer ,mbc
:UMiniBufExplorer ,mbu
:TMiniBufExplorer ,mbt
相关设置:
""""""""""""""""""""""""""""""
" miniBufexplorer Config
""""""""""""""""""""""""""""""
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapCTabSwitchWindows = 1
"let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
"解决FileExplorer窗口变小问题
let g:miniBufExplForceSyntaxEnable = 1
let g:miniBufExplorerMoreThanOne=2
在命令模式下:
:bn 打开当前buffer的下一个buffer
:bp 打开当前buffer的前一个buffer
:b"num" 打开指定的buffer,"num"指的是buffer开始的那个数字,比如上图,我想打开list_audit.erb,输入:b7就ok了
上面最左侧的窗口就是MiniBufExplorer窗口, 其中列出了当前所有已经打开的buffer, 当你把光标置于这个窗口时, 有下面几个快捷键可以用:
<Tab> 向前循环切换到每个buffer名上
<S-Tab> 向后循环切换到每个buffer名上
<Enter> 在打开光标所在的buffer
d 删除光标所在的buffer
以下的两个功能需要在~/.vimrc中增加:
let g:miniBufExplMapCTabSwitchBufs = 1
<C-Tab> 向前循环切换到每个buffer上,并在当前窗口打开
<C-S-Tab> 向后循环切换到每个buffer上,并在当前窗口打开;
注:MiniBufExplore默认是这两个快捷键,可是在ubuntu10.04中不能使用,原因可能是bash中已经定义了ctrl+tab快捷键。所以我们可以更换此快捷键在~/.vim/plugin/minibufexpl.vim中找到:
noremap <C-TAB> :call <SID>CycleBuffer(1)<CR>:<BS>
noremap <C-S-TAB> :call <SID>CycleBuffer(0)<CR>:<BS>
重新定义成自己的map即可。
在~/.vimrc中设置:
let g:miniBufExplMapWindowNavVim = 1
则可以用<C-h,j,k,l>切换到上下左右的窗口中去。
在~/.vimrc中设置:
let g:miniBufExplMapWindowNavArrows = 1
是用<C-箭头键>切换到上下左右窗口中去
以下是MiniBufExplorer的几个命令:
:MiniBufExplorer " Open and/or goto Explorer
:CMiniBufExplorer " Close the Explorer if it's open
:UMiniBufExplorer " Update Explorer without naviting
:TMiniBufExplorer " Toggle the Explorer window open and closed
如果在.vimrc中配置了mapleader,如
let mapleader = "," "Set mapleader
就可以在normal模式下用,mbc代替 :CMiniBufExplorer命令
其他命令为:
:MiniBufExplorer ,mbe
:CMiniBufExplorer ,mbc
:UMiniBufExplorer ,mbu
:TMiniBufExplorer ,mbt
相关设置:
""""""""""""""""""""""""""""""
" miniBufexplorer Config
""""""""""""""""""""""""""""""
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapCTabSwitchWindows = 1
"let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
"解决FileExplorer窗口变小问题
let g:miniBufExplForceSyntaxEnable = 1
let g:miniBufExplorerMoreThanOne=2
在命令模式下:
:bn 打开当前buffer的下一个buffer
:bp 打开当前buffer的前一个buffer
:b"num" 打开指定的buffer,"num"指的是buffer开始的那个数字,比如上图,我想打开list_audit.erb,输入:b7就ok了
相关文章推荐
- vim MiniBufExplorer 插件
- vim 插件之bufexplorer
- vim插件之bufexplorer
- vim bufexplorer插件安装
- 最近为 VIM 社区(vim.org) 贡献了 Source Explorer 插件
- vim插件bufexplorer安装与使用
- Linux VIM自动提示插件安装配置
- vim插件配置及安装
- vim的常用插件
- 贴一段eclipse插件开发中获取当前package explorer中选中的目录代码
- Linux系统Vim编辑器如何安装YouCompleteMe插件?
- VIM中使用tab键自动完成(vim tab键自动补全 )插件supertab
- vim 插件
- ubuntu 下vim安装、配置和插件的添加使用
- vim插件的插件——YCM-Generator
- VIM: C程序员插件C.vim
- Vim 分屏功能+无插件Vim编程技巧
- 安装vim 插件 彩虹括号
- 玩转vim之vim插件Ctags
- 插件版vim的常用命令