作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有没有办法检查所有可用的 snipMate 片段?喜欢 i <c-r><tab>
是的,但有更多信息吗?
我很好奇:
最佳答案
这可能有帮助,也可能无济于事,但我整理了一个“ls_snip”shell 脚本,它将列出各种文件类型的片段和任何前面的注释。它没有以任何方式集成到 vim 中,并且依赖于 *nix 操作系统。此外,仅适用于snippets/filetype.snippets 文件而不适用于snippets/filetype/match.snippets 文件。您可以根据自己的喜好从这里破解它。
将它放在某个 PATH 目录中的 ls_snip 中,并使其可执行。
#! /bin/bash
list_snippets_for() {
egrep "^snippet|^#" ~/.vim/snippets/$1.snippets | awk '/^#/ {comment = comment $0} /^snippet/ {print $0 "\t\t" comment; comment=""}'
}
if [ "$1" == "" ]
then
echo "You must specify at least one file type as an argument to ls_snip"
exit
fi
for filetype in "$@"
do
echo `echo $filetype | awk '{print toupper($0)}'`
list_snippets_for $filetype
echo
done
[lwoodson@lwoodson-mint-vb spike] [root@rva-lw] $ ls_snip javascript html
JAVASCRIPT
snippet proto # Prototype
snippet fun # Function
snippet f # Anonymous Function
snippet if # if
snippet ife # if ... else
snippet t # tertiary conditional
snippet switch # switch
snippet case # case
snippet for # for (...) {...}
snippet forr # for (...) {...} (Improved Native For-Loop)
snippet wh # while (...) {...}
snippet do # do...while
snippet :f # Object Method
snippet timeout # setTimeout function
snippet get # Get Elements
snippet gett # Get Element
HTML
snippet nbs # Some useful Unicode entities# Non-Breaking Space
snippet left # ←
snippet right # →
snippet up # ↑
snippet down # ↓
snippet return # ↩
snippet backtab # ⇤
snippet tab # ⇥
snippet shift # ⇧
snippet control # ⌃
snippet enter # ⌅
snippet command # ⌘
snippet option # ⌥
snippet delete # ⌦
snippet backspace # ⌫
snippet escape # ⎋
snippet doctype HTML 4.01 Strict # Generic Doctype
snippet doctype HTML 4.01 Transitional
snippet doctype HTML 5
snippet doctype XHTML 1.0 Frameset
snippet doctype XHTML 1.0 Strict
snippet doctype XHTML 1.0 Transitional
snippet doctype XHTML 1.1
snippet docts # HTML Doctype 4.01 Strict
snippet doct # HTML Doctype 4.01 Transitional
snippet doct5 # HTML Doctype 5
snippet docxf # XHTML Doctype 1.0 Frameset
snippet docxs # XHTML Doctype 1.0 Strict
snippet docxt # XHTML Doctype 1.0 Transitional
snippet docx # XHTML Doctype 1.1
snippet html
snippet xhtml
snippet body
snippet head
snippet title
snippet script
snippet scriptsrc
snippet style
snippet base
snippet r
snippet div
snippet movie # Embed QT Movie
snippet fieldset
snippet form
snippet h1
snippet input
snippet label
snippet link
snippet mailto
snippet meta
snippet opt
snippet optt
snippet select
snippet table
snippet textarea
snippet fcg
关于vim - 查看 Snipmate 的可用片段(备忘单),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8607662/
我是一名优秀的程序员,十分优秀!