glowshi-ft.vim


Ⅰ. 插件描述

improve movement of f/t with glow shift.

Ⅱ. 基本信息

创建日期:  2014-03-21
使用用户:  12
Github星:  54
插件作者:  shinya saiho

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# glowshi-ft.vim Build Status

improve movement of f/t with glow shift.

Introduction

glowshi-ft is a Vim plugin to improve movement of f/t. The basic behavior is the same, but when there are multiple targets in the current line, you are able to choose and shift to candidates of position which glow.

Screencapture

screencapture

Interface

Key mappings

glowshi-ft's key mappings are defined for first action only. see ORIGINAL KEY MAPPINGS about another operation.

keymapreal keymapmovement
f{char}<Plug>(glowshi-ft-f){char}Search for {char} towards right from the cursor.
t{char}<Plug>(glowshi-ft-t){char}Search for till before {char} towards right from the cursor.
F{char}<Plug>(glowshi-ft-F){char}Search for {char} towards left from the cursor.
T{char}<Plug>(glowshi-ft-T){char}Search for till after {char} towards left from the cursor.
;<Plug>(glowshi-ft-repeat)Repeat latest, like ;.
,<Plug>(glowshi-ft-opposite)Repeat latest in opposite direction, like ,.

Original key mappings

Original mechanism judges the following key and controls it, if current line has multiple target. (the following key mappings don't use :map command).

keymapmovement
h[count] move to the left. If there is cursor in the left-side end, it move to the last.
l[count] move to the right. If there is cursor in the right-side end, it move to the first.
^Move to the first.
0Same as "^".
$Move to the last.
<Enter>Fix the position under the cursor. This key is modifiable. see g:glowshi_ft_fix_key.
<ESC>Cancel the moving. This key is modifiable. see g:glowshi_ft_cancel_key.
[other keys]In case inputting other keys, fix the position at the time, and take the state that typed the key. For example, if you press "i", you will insert mode on the position.

Settings

Variables

Use:

let g:option_name = option_value

to set them in your .vimrc.

basic

Keymapmovementdefault
g:glowshi_ft_no_default_key_mappingsIf you don't want default key mappings, define this variable and set "1" before this plugin is loaded, and describe :map command for Normal mode and Operator-pending mode and Visual mode.-
g:glowshi_ft_ignorecaseIgnore case in search patterns like 'ignorecase' option.0
g:glowshi_ft_smartcaseSmart case in search patterns like 'smartcase' option.0
g:glowshi_ft_nohlsearchThe highlight of search results is turned off temporarily.1
g:glowshi_ft_timeoutlenTime in milliseconds to determine the cursor position, like 'timeoutlen' option.0 (no limit)
g:glowshi_ft_vcount_forced_landingWhen you pass v:count, it forced landing to {char} of N-th. For example, 2fa.0
g:glowshi_ft_fix_keyWhen the same key as the value that you set for this variable is pressed, fix the position under the cursor. Regular expression is used in the same judgment of the key. This variable can not appoint modifier key alone."[\<NL>\<CR>]" (enter key)
g:glowshi_ft_cancel_keyYou can specify the key in the regular expression like g:glowshi_ft_fix_key option in this variable, but the behavior of matching is the cancellation of moving."\<ESC>"

highlight

Keymapmovementdefault
g:glowshi_ft_selected_hl_ctermfgSpecify terminal vim color for selected position."Black"
g:glowshi_ft_selected_hl_ctermbgSpecify terminal vim background color for selected position."White"
g:glowshi_ft_selected_hl_guifgSpecify gui vim color for selected position."#000000"
g:glowshi_ft_selected_hl_guibgSpecify gui vim background color for selected position."#FFFFFF"
g:glowshi_ft_selected_hl_linkWhen the highlight group of the value of this variable is defined, color for selected position links to it. see :highlight-link.""
g:glowshi_ft_candidates_hl_ctermfgSpecify terminal vim color for candidates of position."Black"
g:glowshi_ft_candidates_hl_ctermbgSpecify terminal vim background color for candidates of position."Red"
g:glowshi_ft_candidates_hl_guifgSpecify gui vim color for candidates of position."#000000"
g:glowshi_ft_candidates_hl_guibgSpecify gui vim background color for candidates of position."#FF0000"
g:glowshi_ft_candidates_hl_linkWhen the highlight group of the value of this variable is defined, color for candidates of position links to it. see :highlight-link.""

Custom example

Follows are an example of the custom.

" keymap
let g:glowshi_ft_no_default_key_mappings = s:true
map f <plug>(glowshi-ft-f)
map F <plug>(glowshi-ft-F)
map t <plug>(glowshi-ft-t)
map T <plug>(glowshi-ft-T)
map : <plug>(glowshi-ft-repeat)
map , <plug>(glowshi-ft-opposite)

" highlight
let g:glowshi_ft_selected_hl_link = 'Cursor'
let g:glowshi_ft_candidates_hl_link = 'Error'

" timeout
let g:glowshi_ft_timeoutlen = 1000

Installation

You can install the plugin just copy "plugin" and "autoload" directories under your ~/.vim.

or

  • Pathogen

    • git clone https://github.com/saihoooooooo/glowshi-ft.vim ~/.vim/bundle/glowshi-ft.vim
  • Vundle

    • Bundle 'saihoooooooo/glowshi-ft.vim'
  • NeoBundle

    • NeoBundle 'saihoooooooo/glowshi-ft.vim'

添加新评论