qtmplsel.vim


Ⅰ. 插件描述

quick template selector with expression expansion

Ⅱ. 基本信息

创建日期:  2009-08-29
使用用户:  1
Github星:  3
插件作者:  Takahiro SUZUKI

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This plugin enables you to select a template on creating a new file.
Templates are typically placed in ~/.vim/template .
On creating a file, corresponding templates, if any, are listed up. You
can select one of them by k(up)/j(down). Press Enter to load the selected
template, or press 'q' to load no templates.
You can cancel the insertion of selected template by pressing 'u'(undo).

There is an optional global varialbe:
  g:qts_templatedir : specifies the template dir
                      (default: ~/.vim/template)

Template search rules:
  1) by filetype
    filetype=python -> ~/.vim/template/python_*
  2) by suffix
    .cpp           -> ~/.vim/template/.cpp
  3) by filename
    Makefile        -> ~/.vim/template/Makefile_*

Note that especially in case 3, 'Makefile_' is a legal template name
but 'Makefile' is not even if you have no other template file.

New in 1.1.0 - expression expansion:
  String surrounded by '@{@' '@}@' in the template file is regarded as a vim
  expression, and will be eval()ed on loading.
  e.g.)
    @{@expand('%:t')@}@          ->  newfile.py
    @{@strftime('%Y-%m-%d')@}@   ->  2009-08-30

添加新评论