movealong.vim


Ⅰ. 插件描述

Context-aware motion commands for Vim

Ⅱ. 基本信息

创建日期:  2013-08-11
使用用户:  1
Github星:  3
插件作者:  Markus Koller

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

movealong.vim

This plugin gives you commands to repeat a motion until either a specific
word or syntax group is encountered, or an arbitrary expression returns true.
It also skips over blank lines, punctuation and other syntax noise.

The included default keymaps are disabled by default, you can enable them
by putting the following into your .vimrc:

let g:movealong_default_keys = 1

You can also override any of the default keys as follows: >

  let g:movealong_default_maps = {
    \ 'WordForward'  : '<Space>',
    \ 'WordBackward' : '<Backspace>',
    \ 'LineForward'  : '<Tab>',
    " ... etc.
  \ }

The following keys will be mapped in normal mode:

  " Space - Move to the next useful word
  noremap <silent> <Space>         :Movealong w -defaults<CR>
  " Shift-Space Move to the previous useful word
  noremap <silent> <S-Space>       :Movealong b -defaults<CR>

  " Tab - Move to the next useful line
  noremap <silent> <Tab>           :Movealong j^ -defaults<CR>
  " Shift-Tab - Move to the previous useful line
  noremap <silent> <S-Tab>         :Movealong k^ -defaults<CR>

  " <Leader>i - Move to the next line with the same indent
  noremap <silent><expr> <C-Tab>   ":Movealong j^ -expression indent('.')==" . indent('.') . "<CR>"
  
  " <Leader>I - Move to the previous line with the same indent
  noremap <silent><expr> <C-S-Tab> ":Movealong k^ -expression indent('.')==" . indent('.') . "<CR>"

  " <Leader>f - Move to the next function declaration
  nnoremap <silent> <Leader>f :Movealong j^ -defaults -syntax vimFuncKey,rubyDefine,pythonFunction,phpFCKeyword<CR>

  " <Leader>F - Move to the previous function declaration
  nnoremap <silent> <Leader>F :Movealong k^ -defaults -syntax vimFuncKey,rubyDefine,pythonFunction,phpFCKeyword<CR>

Customization

See :help Movealong for more information.

Bitdeli Badge

添加新评论