vim-choosewin


Ⅰ. 插件描述

Land on window you chose like tmux's 'display-pane'

Ⅱ. 基本信息

创建日期:  2013-12-21
使用用户:  446
Github星:  390
插件作者:  t9md

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 't9md/vim-choosewin'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 't9md/vim-choosewin'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 't9md/vim-choosewin'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/t9md/vim-choosewin

Ⅳ. 文档说明

日本語はこちら

Animated GIF

gif

Navigate to the window you choose

This plugin aims to mimic tmux's display-pane feature, which enables you to choose a window interactively.

This plugin should be especially useful when working on high resolution displays since with wide displays you are likely to open multiple windows and moving around windows with vim is cumbersome.

This plugin simplifies window navigation with the following functionality:

  1. Displays window label on statusline or middle of each window (overlay).
  2. Accepts window selection from user.
  3. Navigates to the specified window.

Example configuration:

" invoke with '-'
nmap  -  <Plug>(choosewin)

Optional configuration:

" if you want to use overlay feature
let g:choosewin_overlay_enable = 1

More configuration options are explained in the help file. See :help choosewin.

Default keymapings in choosewin mode

KeyActionDescription
0tab_firstSelect FIRST tab
[tab_prevSelect PREVIOUS tab
]tab_nextSelect NEXT tab
$tab_lastSelect LAST tab
xtab_closeClose current tab
;win_landNavigate to current window
-previousNaviage to previous window
sswapSwap windows #1
Sswap_staySwap windows but stay #1
<CR>win_landNavigate to current window
<NOP>Disable predefined keymap

*1 If you select 'swap' again, you will swap with the previous window's buffer ex) using the default keymap, typing double 's'(ss) swaps with the previous window.

Operational examples

Map - to invoke choosewin with the following command:

nmap - <Plug>(choosewin)

Move around tabs, and choose windows

First of all, open multiple windows and tabs.
Invoke choosewin by typing - in normal mode.
Then you can move around tabs by ] and [, or you cand choose the target tab directly by typing the number labeled in the tabline.
After you chose a target tab, you can choose a target window by typing the letter which is labeled in the statusline and in the middle of each window (if you have enabled the overlay feature).

Choose the previous window

Type - again to invoke choosewin, then input - again to choose the previous window. The previous window you were on before you choose the current window.

Swap windows

Type - to invoke choosewin, then type s to swap windows.
Then type the label of a window to swap content(=buffer) of that window with your current window.
After you chose, the current window's buffer is swapped with the buffer shown in the window you chose.
By combining "swap" and "previous window" features, you can easily swap any window with the previous window like so: -s-, invoking choosewin itself(-) then entering swapping mode(s), then instructing choosewin to swap the target window with the previous(-) window. Congratulations!

NERDTree open file

If working with several windows, it is useful to be able to select a specific window when open a file from inside NERDTree. As default behavior NERDTree use Vims last window, that is often not the favored one. The NERDTree_choosewin-plugin provide this feature to select a window. Furthermore if the user has installed this Choosewin plugin as well, it is able to detect this and use it instead of the default behavior.

添加新评论