Enviar pesquisa
Carregar
Customize snipmate
•
0 gostou
•
517 visualizações
R
Rhythm Sun
Seguir
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 22
Baixar agora
Baixar para ler offline
Recomendados
Using vim
Using vim
Rhythm Sun
做卓有成效的程序员
做卓有成效的程序员
Lv Jian
Outside
Outside
Rhythm Sun
Debian & Packaging
Debian & Packaging
LI Daobing
设置用vim编辑python
设置用vim编辑python
King Hom
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)
King Hom
GNU AS簡介
GNU AS簡介
Wen Liao
terminal, shell and process group
terminal, shell and process group
nightelf1984
Recomendados
Using vim
Using vim
Rhythm Sun
做卓有成效的程序员
做卓有成效的程序员
Lv Jian
Outside
Outside
Rhythm Sun
Debian & Packaging
Debian & Packaging
LI Daobing
设置用vim编辑python
设置用vim编辑python
King Hom
手把手教你把Vim改装成一个IDE编程环境(图文)
手把手教你把Vim改装成一个IDE编程环境(图文)
King Hom
GNU AS簡介
GNU AS簡介
Wen Liao
terminal, shell and process group
terminal, shell and process group
nightelf1984
vliv výzkumů
vliv výzkumů
SIMAR
Reforma da constituição ou retrocesso político no brasil
Reforma da constituição ou retrocesso político no brasil
Fernando Alcoforado
Dsc 0113 b&wexercise
Dsc 0113 b&wexercise
hblack27
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
翔霖 詹
Project I Nt Upret V2
Project I Nt Upret V2
Ng
historia
historia
johanamarybel
03 el bautismo en las aguas
03 el bautismo en las aguas
Iglesia Adventista de la Promesa
uomini
uomini
camoweb
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
Yiwei Ma
5, system admin
5, system admin
ted-xu
Tiptop gp 5.1 setup_instructions
Tiptop gp 5.1 setup_instructions
guest994aeb5
Linux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
Kenny (netman)
Git in a nutshell
Git in a nutshell
Nelson Tai
微型團隊的 web 程式開發流程
微型團隊的 web 程式開發流程
Chang Mt
Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹
wantingj
GNU gettext簡介 - 以C語言為範例
GNU gettext簡介 - 以C語言為範例
Wen Liao
Node.js從無到有 基本課程
Node.js從無到有 基本課程
Simon Su
Git 入门实战
Git 入门实战
icy leaf
版本控制 使用Git & git hub
版本控制 使用Git & git hub
維佋 唐
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
SZ Lin
Lx4 coffee mercurial-usage
Lx4 coffee mercurial-usage
Zoom Quiet
Python 2 - 快速簡介
Python 2 - 快速簡介
Cheyin L
Mais conteúdo relacionado
Destaque
vliv výzkumů
vliv výzkumů
SIMAR
Reforma da constituição ou retrocesso político no brasil
Reforma da constituição ou retrocesso político no brasil
Fernando Alcoforado
Dsc 0113 b&wexercise
Dsc 0113 b&wexercise
hblack27
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
翔霖 詹
Project I Nt Upret V2
Project I Nt Upret V2
Ng
historia
historia
johanamarybel
03 el bautismo en las aguas
03 el bautismo en las aguas
Iglesia Adventista de la Promesa
uomini
uomini
camoweb
Destaque
(8)
vliv výzkumů
vliv výzkumů
Reforma da constituição ou retrocesso político no brasil
Reforma da constituição ou retrocesso político no brasil
Dsc 0113 b&wexercise
Dsc 0113 b&wexercise
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
高市職業訓練創新發展協會 美容產品定價與通路發展-詹翔霖教授
Project I Nt Upret V2
Project I Nt Upret V2
historia
historia
03 el bautismo en las aguas
03 el bautismo en las aguas
uomini
uomini
Semelhante a Customize snipmate
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
Yiwei Ma
5, system admin
5, system admin
ted-xu
Tiptop gp 5.1 setup_instructions
Tiptop gp 5.1 setup_instructions
guest994aeb5
Linux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
Kenny (netman)
Git in a nutshell
Git in a nutshell
Nelson Tai
微型團隊的 web 程式開發流程
微型團隊的 web 程式開發流程
Chang Mt
Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹
wantingj
GNU gettext簡介 - 以C語言為範例
GNU gettext簡介 - 以C語言為範例
Wen Liao
Node.js從無到有 基本課程
Node.js從無到有 基本課程
Simon Su
Git 入门实战
Git 入门实战
icy leaf
版本控制 使用Git & git hub
版本控制 使用Git & git hub
維佋 唐
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
SZ Lin
Lx4 coffee mercurial-usage
Lx4 coffee mercurial-usage
Zoom Quiet
Python 2 - 快速簡介
Python 2 - 快速簡介
Cheyin L
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)
Chu-Siang Lai
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档
xuebao_zx
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版
redhat9
利用免費服務建立R的持續整合環境
利用免費服務建立R的持續整合環境
Wush Wu
Adorable python
Adorable python
Rhythm Sun
Django development
Django development
loveyudu
Semelhante a Customize snipmate
(20)
Nagios的安装部署和与cacti的整合(linuxtone)
Nagios的安装部署和与cacti的整合(linuxtone)
5, system admin
5, system admin
Tiptop gp 5.1 setup_instructions
Tiptop gp 5.1 setup_instructions
Linux network monitoring hands-on pratice
Linux network monitoring hands-on pratice
Git in a nutshell
Git in a nutshell
微型團隊的 web 程式開發流程
微型團隊的 web 程式開發流程
Npm 套件管理 & 常用開發工具介紹
Npm 套件管理 & 常用開發工具介紹
GNU gettext簡介 - 以C語言為範例
GNU gettext簡介 - 以C語言為範例
Node.js從無到有 基本課程
Node.js從無到有 基本課程
Git 入门实战
Git 入门实战
版本控制 使用Git & git hub
版本控制 使用Git & git hub
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
Debian 套件打包教學指南 v0.19 - 繁體中文翻譯
Lx4 coffee mercurial-usage
Lx4 coffee mercurial-usage
Python 2 - 快速簡介
Python 2 - 快速簡介
Automate with Ansible basic (2/e)
Automate with Ansible basic (2/e)
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档
Bypat博客出品-利用cent os快速构建自己的发行版
Bypat博客出品-利用cent os快速构建自己的发行版
利用免費服務建立R的持續整合環境
利用免費服務建立R的持續整合環境
Adorable python
Adorable python
Django development
Django development
Mais de Rhythm Sun
长连接服务 WebSocket Service
长连接服务 WebSocket Service
Rhythm Sun
Trello workflow by @imRhythm
Trello workflow by @imRhythm
Rhythm Sun
Bitcoin and retail
Bitcoin and retail
Rhythm Sun
Garage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_video
Rhythm Sun
Beginning git
Beginning git
Rhythm Sun
Doc 2011101412020074
Doc 2011101412020074
Rhythm Sun
Doc 2011101411284862
Doc 2011101411284862
Rhythm Sun
Doc 2011101410543721
Doc 2011101410543721
Rhythm Sun
Doc 2011101404575913
Doc 2011101404575913
Rhythm Sun
Doc 2010050608572429
Doc 2010050608572429
Rhythm Sun
火狐2011 sfd讲稿
火狐2011 sfd讲稿
Rhythm Sun
Linuxdeepin
Linuxdeepin
Rhythm Sun
Sunpinyin and it's future
Sunpinyin and it's future
Rhythm Sun
Zsh
Zsh
Rhythm Sun
First meetingwithgit
First meetingwithgit
Rhythm Sun
Mais de Rhythm Sun
(15)
长连接服务 WebSocket Service
长连接服务 WebSocket Service
Trello workflow by @imRhythm
Trello workflow by @imRhythm
Bitcoin and retail
Bitcoin and retail
Garage cafe keynote peak ji_no_video
Garage cafe keynote peak ji_no_video
Beginning git
Beginning git
Doc 2011101412020074
Doc 2011101412020074
Doc 2011101411284862
Doc 2011101411284862
Doc 2011101410543721
Doc 2011101410543721
Doc 2011101404575913
Doc 2011101404575913
Doc 2010050608572429
Doc 2010050608572429
火狐2011 sfd讲稿
火狐2011 sfd讲稿
Linuxdeepin
Linuxdeepin
Sunpinyin and it's future
Sunpinyin and it's future
Zsh
Zsh
First meetingwithgit
First meetingwithgit
Customize snipmate
1.
Customize SnipMate
By Richard Ma (richard_ma) Sunday, July 3, 2011 Tianjin Linux User Group
2.
IF 有问题 THEN
请示意我 Tianjin Linux User Group
3.
Overview ●
简介与安装 ● 基本使用方法 ● Snippet 语法与自定义 ● 高级 Snippet 特性 ● 操作演示 ● 改进方向 ● 参考资料 Tianjin Linux User Group
4.
简介 ●
SnipMate 可以将简短的触发短语 (trigger) 替换为 需要的文字片段。 ● SnipMate 在 vim.org 的主页: – http://www.vim.org/scripts/script.php?script_id=2540 ● SnipMate 最新开发版仓库: http://github.com/msanders/snipmate.vim – ● 本例中使用 SnipMate 版本为 v0.83 Tianjin Linux User Group
5.
安装 ●
下载 SnipMate 安装压缩包 ● 解压到 ~/.vim/ 目录下(如果是版本升级,请先 删除所有旧版本文件,包括默认的 snippets ) ● 打开 filetype 和 plugin 支持(可以添加到 vimrc 中) Tianjin Linux User Group
6.
基本使用方法 ●
SnipMate 默认就提供了很多缩写和文字段落的数 据,类似 trigger —— expand text (这样的一组叫做 snippet ) ● 在 insert 模式下使用: trigger<tab> ● 在 tab 键按下后, trigger 会被替换为: expand text Tianjin Linux User Group
7.
Snippet 运行机制 ●
SnipMate 在查询 Snippet 时,依据 filetype 分类, 每个 filetype 可以定义自己的 Snippet ● Snippet 以 trigger 作为 id ,但允许 id 重复 ● 多个 Snippet 可以定义在一个文件中,也可分为 单独的文件 ● Snippet 中可以使用变量( tab stop )和占位符 ( placeholder ) ● 所有 Snippet 定义文件保存在 ~/.vim/snippets/ Tianjin Linux User Group
8.
在一个文件中定义多个 Snippet ●
文件扩展名为: <filetype>.snippets – filetype 为文件类型,扩展名末尾有 s Tianjin Linux User Group
9.
基本语法 ●
在一个文件中定义多个 snippet 语法: – snippet <trigger> <expand text> ● 带有注释的写法 – # This is a comment snippet <trigger> <expand text> ● 注释必须放在行开头,不可以放在 <expand text> 中; <expand text> 可以写多行,以 <tab> 开头。 Tianjin Linux User Group
10.
Tab Stop ●
<expand text> 中加入变量,可是使得 SnipMate 的替换功能更加强大 – ${#} 这里的 # 为一个数字,表示按 tab 跳转的序 号 Tianjin Linux User Group
11.
Placeholder ●
Placeholder 可以给 Tab Stop 赋予默认值 – ${1:placeholder} Tianjin Linux User Group
12.
引用 Tab Stop
的值 ● 使用 $# 的方式引用 Tab Stop 的值(包括 placeholder ) Tianjin Linux User Group
13.
将 Tab Stop
作为 Placeholder ● ${1:placeholder} 可以作为 ${2:$1} 的 placeholder Tianjin Linux User Group
14.
多匹配 trigger Tianjin Linux
User Group
15.
全局 Snippet ●
snippet/_.snippets ● 语法与其他 snippets 文件相同 ● 任何 filetype 都可以触发其中的 trigger Tianjin Linux User Group
16.
插入正在编辑的文件名 filename<tab>
test (filename is test.st) Tianjin Linux User Group
17.
调用 vimrc 中的变量 ●
在 ~/.vimrc 中定义变量,使用如下方式调用。 Tianjin Linux User Group
18.
使用 system() 函数调用
bash 命令 grouplist<tab> Tianjin Linux User Group
19.
SnipMate 操作演示 ●
使用 SnipMate 协助完成一个分割数字的程序 ● 借助 SnipMate 自动生成注释文档 ● 递归算法 ● C 语言编写 Tianjin Linux User Group
20.
改进方向 ●
Tab stop 必须从 1 开始编号 ● 不支持 placeholder 的嵌套 – <div ${1: id=”${2:some_id)”}>${3}</div> id=”${2:some_id)”} ● Tab stop 不支持正则表达式匹配 ● 不支持多行 Placeholder ● 在同一文件中,不支持分段落使用不同的 snippets 定义文件 ● Snippet 的 mashup Tianjin Linux User Group
21.
参考资料 ●
SnipMate 帮助文档 – 进入 vim – :h snipmate Tianjin Linux User Group
22.
Tianjin Linux User
Group
Baixar agora