movewin.vim


Ⅰ. 插件描述

A Vim plugin for moving window without mouse.

Ⅱ. 基本信息

创建日期:  2013-07-15
使用用户:  1
Github星:  1
插件作者:  koturn

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

movewin.vim

This Vim plugin was forked from
http://www.vim.org/scripts/script.php?script_id=741

Move Vim window using the keyboard, for those who don't like to use the mouse.
After loading the script, call :MoveWin. Use hjkl and shift+hjkl keys to move the window, press any other key when done.
The original plugin could be used in GUI only. But this forked plugin can be used in Windows-CUI (Command-Prompt) also.

Screenshot (GIF animation)

In addition, comparing with the original plugin, there are some improvements.

First:

Original plugin doesn't distinguish between hjkl and HJKL (hjkl with Shift-key) when the option:ignorecase is set.
But this plugin distiguishes hjkl and HJKL when option:ignorecase is set.

Second:

This plugin provides interface for key-bind.
You can use it as follow.

nmap <Left>   <Plug>(movewin-left)
nmap <Down>   <Plug>(movewin-down)
nmap <Up>     <Plug>(movewin-up)
nmap <Right>  <Plug>(movewin-right)

If you want to change the amount of movement, set your favorite values to global variables as follow.

let g:movewin#move_x = 10  " the default value is 20.
let g:movewin#move_y = 10  " the default value is 20.

Third:

Separated the codes which should be written to "autoload/" directory from the script in "plugin/" directory.

Install

If you use NeoBundle for a plugin manager,
write following code in .vimrc and do command :NeoBundleInstall.

NeoBundleLazy 'koturn/movewin.vim', {
      \ 'autoload' : {
      \   'commands' : 'MoveWin',
      \   'mappings' : [
      \     '<Plug>(movewin-left)',
      \     '<Plug>(movewin-down)',
      \     '<Plug>(movewin-up)',
      \     '<Plug>(movewin-right)'
      \]}}

If you use other plugin manager or don't use it, I'm sorry, but please install this plugin on your own.

添加新评论