vim-husk


Ⅰ. 插件描述

Mappings that boost vim's command line.

Ⅱ. 基本信息

创建日期:  2014-08-22
使用用户:  16
Github星:  82
插件作者:  vim-utils

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'vim-utils/vim-husk-shouldve-said-no'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'vim-utils/vim-husk-shouldve-said-no'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'vim-utils/vim-husk-shouldve-said-no'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# husk.vim

Mappings that boost vim command line mode.

The goal is to have mappings similar to bash emacs mode.
You can read more about this idea in vim's docs
:h tcsh-style.

Plugin killer feature are convenient M-f and M-b CLI mappings that move one
"word" right or left (notice the lowercase "word").

This is an enhancement from vanilla vim that enables only "WORD" (uppercase)
left or right with<br/>
<S-Left> and <S-Right>.

Works in NeoVim too.

Mappings

All mappings work only in vim command line mode.

  • C-a go to the beginning of the line
  • C-f go one character right or fall back to
    c_CTRL-F

at the end of the line

  • C-b go one character left
  • C-d delete character or fall back to
    c_CTRL-D

at the end of the line

  • C-k clear line after the cursor, overrides
    c_CTRL-K

(if you're using C-k for digraphs check the docs how to disable)

  • C-x C-e open the command-line window, same as
    c_CTRL-f
  • M-f (Alt-f) go one "word" right
  • M-b (Alt-b) go one "word" left
  • M-d (Alt-d) delete "word" after the cursor
  • M-BS (Alt-Backspace) delete "word" before the cursor, same as
    c_CTRL-W
  • M-# (Alt-shift-3) insert comment at the beginning of the line and execute

    1. Useful for discarding the line, but still keeping it in the command-line
    2. for later retrieval.

Installation

  • Vundle<br/>
    Plugin 'vim-utils/vim-husk'
  • vim-plug<br/>
    Plug 'vim-utils/vim-husk'
  • Pathogen<br/>
    git clone git://github.com/vim-utils/vim-husk.git ~/.vim/bundle/vim-husk

Note: In order to enable alt mappings (M-f, M-b etc) Mac OS users using
Terminal.app may need to go to Preferences > Profiles > Keyboard and tick
"Use Option as Meta key".

About

vim-husk grew out from Tim Pope's vim-rsi

  1. C-f, C-d and M-BS mappings are directly copied.

Differences:

  • vim-husk has proper M-f, M-b and M-d mapping implementation
  • with vim-husk there's no risk of breaking vim's macros. Link to related
    vim-rsi issue.
  • vim-rsi has a broader scope and provides insert and normal mode
    mappings while vim-husk focuses only on vim's CLI.

Licence

MIT

添加新评论