vimshell-inline-history.vim


Ⅰ. 插件描述

Inline history completion for VimShell

Ⅱ. 基本信息

创建日期:  2013-11-24
使用用户:  4
Github星:  2
插件作者:  supermomonga

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/supermomonga/vimshell-inline-history.vim

Ⅳ. 文档说明

# vimshell-inline-history.vim

This plugin provides inline history completion feature to VimShell.

Features

  • Complete histories by C-p and C-n.
  • Complete histories which start with current input.
  • Cycle completion.

Install

neobundle:

NeoBundleLazy 'supermomonga/vimshell-inline-history.vim', { 'depends' : [ 'Shougo/vimshell.vim' ] }

if neobundle#tap('vimshell-inline-history.vim')
  call neobundle#config({
  \  'autoload' : {
  \    'filetypes' : [ 'vimshell' ]
  \  }
  \})

  function! neobundle#hooks.on_post_source(bundle)
    "Example of remapping keys for plugin
    imap <buffer> <C-j>  <Plug>(vimshell_inline_history#next)
    imap <buffer> <C-k>  <Plug>(vimshell_inline_history#prev)
  endfunction

  "Example of unmapping default keys
  let g:vimshell_inline_history#default_mappings = 0

  call neobundle#untap()
endif

vim-plug:

Plug 'supermomonga/vimshell-inline-history.vim', { 'depends' : [ 'Shougo/vimshell.vim' ] }

function! VSHistmapCB(a,b)
  let g:vimshell_inline_history#default_mappings = 0
  imap <buffer> <C-j>  <Plug>(vimshell_inline_history#next)
  imap <buffer> <C-k>  <Plug>(vimshell_inline_history#prev)
endfunction

function! VSHistmap()
  call job_start(['bash','-c','echo "-"; exit;'],{'out_cb':'VSHistmapCB'})
endfunction

"Group name can be arbitrary so long as doesn't conflict with another
augroup VSHistMapping
  autocmd!
  "Get filetype with :echom &filetype when in buffer
  autocmd FileType vimshell :call VSHistmap()
augroup END

Usage

Hit C-n or C-p to complete history.

添加新评论