head.vim


Ⅰ. 插件描述

easy reading file head or tail, with file prefix 'head:', 'tail:'.

Ⅱ. 基本信息

创建日期:  2008-02-29
使用用户:  1
Github星:  1
插件作者:  omi taku

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Overview

Open file with file prefix 'head:','tail:',
vim editor read file 10 rows from top, or bottom.
(for example, head:sample.pl, tail:somedir/app.conf)

command example,
  - Windows
  (within vim)  : :e head;TEST.txt
                : :e tail;TEST.txt

  - Mac OSX, Unix, Liux
  (command line): vim head:TEST.txt
                : vim tail:TEST.txt

  (within vim)  : :e head:TEST.txt
                : :e tail:TEST.txt

Installation

  1. Copy the head.vim script to the $HOME/.vim/plugin or
       the $HOME/vimfiles/plugin. Refer to the ':help add-plugin',

   ':help add-global-plugin' and ':help runtimepath' topics for
   more details about Vim plugins.

  1. Restart Vim.

Usage

(Windows)
:e head;TEST.TXT  |  display 'TEST.TXT' head. (default 10 rows read.)
:r head;TEST.TXT  |  read 'TEST.TXT' head, and insert at cursor position. (default 10 rows read.)
:w head;TEST.TXT  |  update 'TEST.TXT' head with current buffer. (default 10 rows replaced.)

:e tail;TEST.TXT  |  display 'TEST.TXT' tail. (default 10 rows read.)
:r tail;TEST.TXT  |  read 'TEST.TXT' tail, and insert at cursor position. (default 10 rows read.)
:w tail;TEST.TXT  |  update 'TEST.TXT' tail with current buffer. (default 10 rows replaced.)

(OSX, Unix, Linux)
:e head:TEST.TXT  |  display 'TEST.TXT' head. (default 10 rows read.)
:r head:TEST.TXT  |  read 'TEST.TXT' head, and insert at cursor position. (default 10 rows read.)
:w head:TEST.TXT  |  update 'TEST.TXT' head with current buffer. (default 10 rows replaced.)

:e tail:TEST.TXT  |  display 'TEST.TXT' tail. (default 10 rows read.)
:r tail:TEST.TXT  |  read 'TEST.TXT' tail, and insert at cursor position. (default 10 rows read.)
:w tail:TEST.TXT  |  update 'TEST.TXT' tail with current buffer. (default 10 rows replaced.)

Plugin Options

g:head_display_lines
  customize number of lines of file reading.
  below is setting example.

      :let g:head_display_lines = 30

  you will update this parameter by command 'Head',
  for example,

      :Head 30

添加新评论