nclipper.vim


Ⅰ. 插件描述

copy lines into clipboard with the line numbers

Ⅱ. 基本信息

创建日期:  2011-01-19
使用用户:  3
Github星:  12
插件作者:  ujihisa .

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# nclipper.vim

Usage

Start visual mode with V and select some lines.

before

Type <C-y>

after

Now your clipboard or Vim register "+ has the lines you selected with line numbers. Paste it anywhere you want!

on skype

If you also want to copy the filename in the 1st line, use <M-y> (meta + y which is cmd + y on OSX and alt + y on Linux.)

Author

Tatsuhiro Ujihisa

Configulation

If you don't want to map <C-y>, assign a true value into g:nclipper_nomap in your ~/.vimrc.

let g:nclipper_nomap = 1

And you can map the functionality on any key like the following example.

vmap <space>y <Plug>(nclipper)
vmap <space>Y <Plug>(nclipper-with-filename)

If you want to change the format of yanked string,
you can specify the format with g:nclipper_format.
Here is the default value:

let g:nclipper_format = 'printf("%" . max_len . "d %s", v:key + begin, v:val)'

You can use these variables:

  • v:key

    • current line's index number
  • v:val

    • current line's string
  • begin

    • the first line number
  • end

    • the last line number
  • max_len

    • max string length between begin and end.
    1. e.g.: when begin is 98 and end is 102, max_len is 3.

    this value is identical to len(end).

添加新评论