1
0
Fork 0
mirror of synced 2024-12-24 07:43:20 -05:00

Updated plugins

This commit is contained in:
amix 2013-05-25 20:31:29 -04:00
parent 630b462208
commit 267c59c900
15 changed files with 242 additions and 335 deletions

View file

@ -44,11 +44,11 @@ The following features and functionality are provided by the NERD tree:
as you left it
* You can have a separate NERD tree for each tab, share trees across tabs,
or a mix of both.
* By default the script overrides the default file browser (netw), so if
you :edit a directory a (slighly modified) NERD tree will appear in the
* By default the script overrides the default file browser (netrw), so if
you :edit a directory a (slightly modified) NERD tree will appear in the
current window
* A programmable menu system is provided (simulates right clicking on a node)
* one default menu plugin is provided to perform basic filesytem
* one default menu plugin is provided to perform basic filesystem
operations (create/delete/move/copy files/directories)
* There's an API for adding your own keymappings

View file

@ -83,12 +83,12 @@ The following features and functionality are provided by the NERD tree:
as you left it
* You can have a separate NERD tree for each tab, share trees across tabs,
or a mix of both.
* By default the script overrides the default file browser (netw), so if
you :edit a directory a (slighly modified) NERD tree will appear in the
* By default the script overrides the default file browser (netrw), so if
you :edit a directory a (slightly modified) NERD tree will appear in the
current window
* A programmable menu system is provided (simulates right clicking on a
node)
* one default menu plugin is provided to perform basic filesytem
* one default menu plugin is provided to perform basic filesystem
operations (create/delete/move/copy files/directories)
* There's an API for adding your own keymappings
@ -228,7 +228,7 @@ gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
x.......Close the current nodes parent...........................|NERDTree-x|
X.......Recursively close all children of the current node.......|NERDTree-X|
e.......Edit the current dif.....................................|NERDTree-e|
e.......Edit the current dir.....................................|NERDTree-e|
<CR>...............same as |NERDTree-o|.
double-click.......same as the |NERDTree-o| map.
@ -780,7 +780,7 @@ If set to 1, doing a >
<
will open up a "secondary" NERD tree instead of a netrw in the target window.
Secondary NERD trees behaves slighly different from a regular trees in the
Secondary NERD trees behaves slightly different from a regular trees in the
following respects:
1. 'o' will open the selected file in the same window as the tree,
replacing it.

View file

@ -67,7 +67,7 @@ function! s:Bookmark.BookmarkNames()
endfunction
" FUNCTION: Bookmark.CacheBookmarks(silent) {{{1
" Class method to read all bookmarks from the bookmarks file intialize
" Class method to read all bookmarks from the bookmarks file initialize
" bookmark objects for each one.
"
" Args:

View file

@ -2,8 +2,8 @@
" Language: Mako
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
" URL: http://lucumr.pocoo.org/
" Last Change: 2008 September 12
" Version: 0.6.1
" Last Change: 2013-05-01
" Version: 0.6.1+
"
" Thanks to Brine Rue <brian@lolapps.com> who noticed a bug in the
" delimiter handling.
@ -27,6 +27,9 @@ endif
ru! syntax/html.vim
unlet b:current_syntax
" tell html.vim what syntax groups should take precedence (see :help html.vim)
syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
"Put the python syntax file in @pythonTop
syn include @pythonTop syntax/python.vim
@ -54,8 +57,8 @@ syn region makoAttributeValue containedin=makoTag contained start=/"/ skip=/\\"/
syn region makoAttributeValue containedin=MakoTag contained start=/'/ skip=/\\'/ end=/'/
" Tags
syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\|block\)\>" end="/\?>"
syn match makoDelim "</%\(def\|call\|namespace\|block\)>"
syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\|block\|[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*\)\>" end="/\?>"
syn match makoDelim "</%\(def\|call\|namespace\|block\|[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*\)>"
" Newline Escapes
syn match makoEscape /\\$/
@ -83,4 +86,4 @@ if version >= 508 || !exists("did_mako_syn_inits")
delc HiLink
endif
let b:current_syntax = "eruby"
let b:current_syntax = "html"

View file

@ -126,5 +126,8 @@ hi def link markdownEscape Special
hi def link markdownError Error
let b:current_syntax = "markdown"
if main_syntax ==# 'markdown'
unlet main_syntax
endif
" vim:set sw=2:

View file

@ -0,0 +1,37 @@
# Contributors #
SnipMate was originally authored by Michael Sanders
([Vim](http://www.vim.org/account/profile.php?user_id=16544),
[GitHub](https://github.com/msanders)).
It is currently maintained by [Rok Garbas](rok@garbas.si), [Marc
Weber](marco-oweber@gmx.de), and [Adnan Zafar](https://github.com/ajzafar) with
additional contributions from:
* [alderz](https://github.com/alderz)
* [asymmetric](https://github.com/asymmetric)
* [darkwise](https://github.com/darkwise)
* [henrik](https://github.com/henrik)
* [holizz](https://github.com/holizz)
* [honza](https://github.com/honza)
* [hpesoj](https://github.com/hpesoj)
* [ironcamel](https://github.com/ironcamel)
* [jb55](https://github.com/jb55)
* [jbernard](https://github.com/jbernard)
* [jherdman](https://github.com/jherdman)
* [kozo2](https://github.com/kozo2)
* [lilydjwg](https://github.com/lilydjwg)
* [marutanm](https://github.com/marutanm)
* [MicahElliott](https://github.com/MicahElliott)
* [muffinresearch](https://github.com/muffinresearch)
* [pielgrzym](https://github.com/pielgrzym)
* [pose](https://github.com/pose)
* [r00k](https://github.com/r00k)
* [radicalbit](https://github.com/radicalbit)
* [redpill](https://github.com/redpill)
* [robhudson](https://github.com/robhudson)
* [sickill](https://github.com/sickill)
* [statik](https://github.com/statik)
* [steveno](https://github.com/steveno)
* [taq](https://github.com/taq)
* [thisgeek](https://github.com/thisgeek)

View file

@ -0,0 +1,53 @@
# SnipMate #
SnipMate aims to provide support for textual snippets, similar to TextMate or
other Vim plugins like [UltiSnips][ultisnips]. For
example, in C, typing `for<tab>` could be expanded to
for (i = 0; i < count; i++) {
/* code */
}
with successive presses of tab jumping around the snippet.
Originally authored by [Michael Sanders][msanders], SnipMate was forked in 2011
after a stagnation in development. This fork is currently maintained by [Rok
Garbas][garbas], [Marc Weber][marcweber], and [Adnan Zafar][ajzafar].
## Installing SnipMate ##
SnipMate depends on [vim-addon-mw-utils][mw-utils] and [tlib][tlib]. We
recommend one of the following ways of installing all three.
* Using [Pathogen][pathogen], run the following commands:
% cd ~/.vim/bundle
% git clone https://github.com/tomtom/tlib_vim.git
% git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
% git clone https://github.com/garbas/vim-snipmate.git
* Using [VAM][vam], add `vim-snippets` to the list of packages to be installed.
* Using [Vundle][vundle], add the following to your `vimrc` then run
`:BundleInstall`
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
Lastly, since SnipMate does not ship with any snippets, we suggest looking at
the [vim-snippets][vim-snippets] repository.
[ultisnips]: https://github.com/sirver/ultisnips
[msanders]: https://github.com/msanders
[garbas]: https://github.com/garbas
[marcweber]: https://github.com/marcweber
[ajzafar]: https://github.com/ajzafar
[mw-utils]: https://github.com/marcweber/vim-addon-mw-utils
[tlib]: https://github.com/tomtom/tlib_vim
[vim-snippets]: https://github.com/honza/vim-snippets
[vam]: https://github.com/marcweber/vim-addon-manager
[pathogen]: https://github.com/tpope/vim-pathogen
[vundle]: https://github.com/gmarik/vundle

View file

@ -1,258 +0,0 @@
============
snipmate.vim
============
IMPORTANT: comment on: [What about merging whith Ultisnip using its engine](https://github.com/garbas/vim-snipmate/issues/114)
status: snipmate-snippet files are read by Ultisnip flawlessly. See
snipmate-snippets readme about how to configure and use Ultisnips as alternative
That branch also supports completion menu now
Thus there is only one reason left to keep using snipmate from my point of
view: not having python support.
In other words: upstream of snipmate is almost dead. (Better to say Marc Weber is not going to fix any bugs anymore)
:Author: `Michael Sanders`_
:Maintainer: `Adnan Zafar`_ & `Rok Garbas`_ & `Marc Weber`_
:Homepage: http://www.vim.org/scripts/script.php?script_id=2540
:Contributors: `MarcWeber`_, `lilydjwg`_, `henrik`_, `steveno`_, `asymmetric`_, `jherdman`_, `ironcamel`_, `honza`_, `jb55`_, `robhudson`_, `kozo2`_, `MicahElliott`_, `darkwise`_, `redpill`_, `thisgeek`_, `sickill`_, `pose`_, `marutanm`_, `r00k`_, `jbernard`_, `holizz`_, `muffinresearch`_, `statik`_, `taq`_, `alderz`_, `radicalbit`_, `pielgrzym`_, `hpesoj`_
.. contents::
ChangeLog
=========
0.85 [2013-04-03]
-----------------
* Allow trigger key customization
* Enable undoing of snippet expansion
* Support backslash escaping in snippets
* Add support for {VISUAL}
* Expand filetype extension with scope_aliases
* Add expansion guards
* Enable per-buffer expansion of snippets
* Fix 'cpo' compatibility
* Update supertab compatibility
* Enable customization of various things through g:snipMate
* Disable spelling in snippet files
* Highlight trigger names in .snippets files
* Update many snippets
* Separate sample snippets into separate repository
0.84
----
* Unreleased version by `Michael Sanders`_. Available on `GitHub`_.
0.83 [2009-07-13]
-----------------
* Last release done by `Michael Sanders`_. Available on `vim.org`_.
How to install
==============
Unfortunately there are many ways to install vim plugins. If you don't
see your preferred way of installation, please consider updating
this section. Basically, installation consists of 2 simple steps:
1. Install vim-snipmate
2. Install snippets
snipmate dependencies
==============
Important to note is that since version 0.85 we depend on 2 vim plugins:
* `vim-addon-mw-utils`_ providing the implementation for caching parsed
.snippets files.
* `tlib`_ for tlib#input#List which provides the excellent filterable
list selection view (and more).
* the default set of snippets (optional but recommended).
See 'Snippets repository' below.
Using `VAM`_ (recommended)
------------
- Add `snipmate-snippets` to the names to be installed. Or use
"github:name/repo" if you want to use a non standard upstream.
The default snippets depend on "snipmate" so VAM will fetch the core along
with its dependencies automatically.
Using `pathogen`_
--------------------------------------
::
% cd ~/.vim
% mkdir bundle
% cd bundle
% git clone git://github.com/garbas/vim-snipmate.git
# Install dependencies:
% git clone https://github.com/tomtom/tlib_vim.git
% git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
% git clone https://github.com/honza/vim-snippets.git
Using `Vundle`_
---------------
::
Install dependencies:
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "honza/vim-snippets"
Install:
Bundle "garbas/vim-snipmate"
And :BundleInstall
Manually (not recommended!)
---------------------------
::
% git clone git://github.com/honza/vim-snippets.git
% git clone git://github.com/garbas/vim-snipmate.git
% cd snipmate.vim
% cp -R * ~/.vim
Then in vim::
:helptags ~/.vim/doc/
Then install any dependencies (see above).
Snippets repository
===================
There is now one snippet repo containing almost all snippets. You are
encouraged to submit any fixes and new snippets there.
https://github.com/honza/vim-snippets
More snippet repositories are listed at that repository's README file.
Why forking snipMate?
=====================
After several unsuccessful attempts of contacting Michael Sanders, no
commits in last half year and long pull request line on github (none of
pull requests were commented/replied/rejected) I decided to take action,
step up and bring some love to this widely used plugin.
But nothing to worry about. We all get busy, accupied with our daily work
or just lose interest in doing boring maintainance.
While reviewing pull requests on github.com/msanders I found lots of great
improvements and I decided to **friendly** fork it, review and apply patches
that were sent, notify all the patch submitters and decided to maintain
snipmate.vim from now on. Of course if somebody wants to
help, please do not hesitate to write me, I am open to any suggestions.
Maybe I will only maintain it for a while until Michael Sanders takes things
back into his hand or until some other super-hero shows up.
Tnx and happy snipmating, Rok Garbas & Marc Weber, 2011-02-02
related work
=============
See doc/snipMate.txt
Known Bugs
=============
* Set one value default as input of another value.
https://github.com/garbas/vim-snipmate/issues/59
[2011-10-18, `bogdan`_]
TODO / Future
=============
* Notify all "forkers" about new home and ask them nicely to review already
merged changes and possibly send their changes.
[2011-02-07, `garbas`_]
* I'd like to investigate whether xptemplate or snipmate has the better
engine. So maybe my vision of the future could be making xptemplate read
snippet files. It is not important enough for me to work on it right now as
snipmate works reasonable well for me.
[2011-02-02, `MarcWeber`_]
* comment without verifying it:
< Silex> MarcWeber: btw, check out ultisnips. Much better than snipmate imho
And before this discussion xptemplate vs snipmate vs ultisnips .. continues
we should create a wiki page comparing them and keep that up to date.
If you volunteer tell me so that I can reference the link.
[2011-02-02, `MarcWeber`_]
* tcomment claims to know which language mode you're editing in even if its
JS in PHP or HTML within PHP. It would be great if that functionality could be
moved into its own plugirn (vim-detect-language-at-cursor) or such.
Then a lot of the scoped_aliases (which causes collisions easily) could
be enhanced.
.. _`Michael Sanders`: http://www.vim.org/account/profile.php?user_id=16544
.. _`Adnan Zafar`: https://github.com/ajzafar
.. _`Rok Garbas`: rok@garbas.si
.. _`Marc Weber`: marco-oweber@gmx.de
.. _`VAM`: https://github.com/MarcWeber/vim-addon-manager
.. _`pathogen`: http://www.vim.org/scripts/script.php?script_id=2332
.. _`vim-addon-mw-utils`: https://github.com/MarcWeber/vim-addon-mw-utils
.. _`tlib`: https://github.com/tomtom/tlib_vim
.. _`garbas`: https://github.com/garbas
.. _`MarcWeber`: https://github.com/MarcWeber
.. _`lilydjwg`: https://github.com/lilydjwg
.. _`henrik`: https://github.com/henrik
.. _`steveno`: https://github.com/steveno
.. _`asymmetric`: https://github.com/asymmetric
.. _`jherdman`: https://github.com/jherdman
.. _`ironcamel`: https://github.com/ironcamel
.. _`honza`: https://github.com/honza
.. _`jb55`: https://github.com/jb55
.. _`robhudson`: https://github.com/robhudson
.. _`kozo2`: https://github.com/kozo2
.. _`MicahElliott`: https://github.com/MicahElliott
.. _`darkwise`: https://github.com/darkwise
.. _`redpill`: https://github.com/redpill
.. _`thisgeek`: https://github.com/thisgeek
.. _`sickill`: https://github.com/sickill
.. _`pose`: https://github.com/pose
.. _`marutanm`: https://github.com/marutanm
.. _`r00k`: https://github.com/r00k
.. _`jbernard`: https://github.com/jbernard
.. _`holizz`: https://github.com/holizz
.. _`muffinresearch`: https://github.com/muffinresearch
.. _`statik`: https://github.com/statik
.. _`Vundle`: https://github.com/gmarik/vundle
.. _`alderz`: https://github.com/alderz
.. _`johnbintz`: https://github.com/johnbintz
.. _`thenoseman`: https://github.com/thenoseman
.. _`ervandew`: https://github.com/ervandew
.. _`blueyed`: https://github.com/blueyed
.. _`tisho`: https://github.com/tisho
.. _`pielgrzym`: https://github.com/pielgrzym
.. _`jgosmann`: https://github.com/jgosmann
.. _`taq`: https://github.com/taq
.. _`vim.org`: http://www.vim.org/scripts/script.php?script_id=2540
.. _`GitHub`: http://github.com/msanders/snipmate.vim
.. _`radicalbit`: https://github.com/radicalbit
.. _`hpesoj`: https://github.com/hpesoj

View file

@ -447,27 +447,9 @@ fun! s:AddScopeAliases(list)
return keys(did)
endf
" don't ask me wy searching for trigger { is soo slow.
fun! s:Glob(dir, file)
let f = a:dir.a:file
if a:dir =~ '\*' || isdirectory(a:dir)
" vim's glob() is somewhat unreliable since it uses the
" user's current shell which may accept different patterns
" (POSIX vs. zsh vs. bash vs. ...). On my system, that
" leads to glob() sometimes returning files that don't
" exist, so filter the returned list to make sure that the
" files really exist in the filesystem.
let res = split(glob(escape(f,"{}")), "\n")
if !empty(res)
return filter(res, 'filereadable(v:val)')
else
return []
endif
else
return filereadable(f) ? [f] : []
endif
endf
function! s:Glob(path, expr)
return filter(split(globpath(a:path, a:expr), "\n"), 'filereadable(v:val)')
endfunction
" returns dict of
" { path: { 'type': one of 'snippet' 'snippets',
@ -481,54 +463,41 @@ endf
" use mustExist = 1 to return existing files only
"
" mustExist = 0 is used by OpenSnippetFiles
fun! snipMate#GetSnippetFiles(mustExist, scopes, trigger)
let paths = funcref#Call(s:c.snippet_dirs)
function! snipMate#GetSnippetFiles(mustExist, scopes, trigger)
let paths = join(funcref#Call(s:c.snippet_dirs), ',')
let result = {}
let scopes = s:AddScopeAliases(a:scopes)
let trigger = escape(a:trigger, '{}*[]`')
let result = {}
let scopes = s:AddScopeAliases(a:scopes)
" collect existing files
for scope in scopes
" collect existing files
for scope in scopes
for f in s:Glob(paths, 'snippets/' . scope . '.snippets') +
\ s:Glob(paths, 'snippets/' . scope . '/*.snippets')
let result[f] = { 'exists' : 1, 'type' : 'snippets',
\ 'name_prefix' : fnamemodify(f, ':t:r') }
endfor
for r in paths
let rtp_last = fnamemodify(r,':t')
for f in s:Glob(paths, 'snippets/'.scope.'/'.trigger.'.snippet')
let result[f] = {'exists': 1, 'type': 'snippet', 'name': 'default',
\ 'trigger': a:trigger, 'name_prefix' : scope }
endfor
" .snippets files (many snippets per file).
let glob_p = r.'/snippets/'.scope.'.snippets'
for snippetsF in split(glob(glob_p),"\n")
let scope = fnamemodify(snippetsF,':t:r')
let result[snippetsF] = {'exists': 1, 'type': 'snippets', 'name_prefix': rtp_last.' '.scope }
endfor
for f in s:Glob(paths, 'snippets/'.scope.'/'.trigger.'/*.snippet')
let result[f] = {'exists': 1, 'type': 'snippet', 'name' : fnamemodify(f, ':t:r'),
\ 'trigger': a:trigger, 'name_prefix' : scope }
endfor
if !a:mustExist && !has_key(result, glob_p)
" name_prefix not used
let result[glob_p] = {'exists': 0, 'type': 'snippets'}
endif
if !a:mustExist
for p in split(paths, ',')
let p .= '/' . scope . '.snippets'
let result[p] = get(result, p, {'exists': 0, 'type': 'snippets'})
endfor
endif
let glob_p = r.'/snippets/'.scope.'/*.snippets'
for snippetsF in split(glob(glob_p),"\n")
let result[snippetsF] = {'exists': 1, 'type': 'snippets', 'name_prefix' : rtp_last.' '.fnamemodify(snippetsF,':t:r')}
endfor
" == one file per snippet: ==
" without name snippets/<filetype>/<trigger>.snippet
for f in s:Glob(r.'/snippets/'.scope,'/'.a:trigger.'.snippet')
let trigger = fnamemodify(f,':t:r')
let result[f] = {'exists': 1, 'type': 'snippet', 'name': 'default', 'trigger': trigger, 'name_prefix' : rtp_last.' '.scope}
endfor
" add /snippets/trigger/*.snippet files (TODO)
" with name (multi-snip) snippets/<filetype>/<trigger>/<name>.snippet
for f in s:Glob(r.'/snippets/'.scope.'/'.a:trigger,'/*.snippet')
let name = fnamemodify(f,':t:r')
let trigger = fnamemodify(f,':h:t')
let result[f] = {'exists': 1, 'type': 'snippet', 'name': name, 'trigger': trigger, 'name_prefix' : rtp_last.' '.scope}
endfor
endfor
endfor
return result
endf
return result
endfunction
fun! snipMate#EvalGuard(guard)
" left: everything left of expansion
@ -546,6 +515,7 @@ endf
fun! snipMate#DefaultPool(scopes, trigger, result)
let triggerR = substitute(a:trigger,'*','.*','g')
for [f,opts] in items(snipMate#GetSnippetFiles(1, a:scopes, a:trigger))
let opts.name_prefix = matchstr(f, '\v[^/]+\ze/snippets') . ' ' . opts.name_prefix
if opts.type == 'snippets'
for [trigger, name, contents, guard] in cached_file_contents#CachedFileContents(f, s:c.read_snippets_cached, 0)
if trigger !~ escape(triggerR,'~') | continue | endif

View file

@ -417,6 +417,41 @@ snipMate.vim currently has the following disadvantages to TextMate's snippets:
Perhaps some of these features will be added in a later release.
==============================================================================
CHANGELOG *snipMate-changelog*
0.85 - 2013-04-03
-----------------
* Allow trigger key customization
* Enable undoing of snippet expansion
* Support backslash escaping in snippets
* Add support for {VISUAL}
* Expand filetype extension with scope_aliases
* Add expansion guards
* Enable per-buffer expansion of snippets
* Fix 'cpo' compatibility
* Update supertab compatibility
* Enable customization of various things through g:snipMate
* Disable spelling in snippet files
* Highlight trigger names in .snippets files
* Update many snippets
* Separate sample snippets into separate repository
0.84
----
* Unreleased version by Michael Sanders, available on his GitHub,
<https://github.com/msanders/snipmate.vim>
0.83 - 2009-07-13
-----------------
* Last release done by Michael Sanders, available at
<http://www.vim.org/scripts/script.php?script_id=2540>
==============================================================================
CONTACT *snipMate-contact* *snipMate-author*

View file

@ -62,6 +62,12 @@ so that all users can benefit from them. People can list their snippet reposito
Installation using VAM: "github:rbonvall/snipmate-snippets-bib"
## If you believe in the success of vim-snipmate
then you may also want to have a look at [vim-git-wiki](http://github.com/MarcWeber/vim-git-wiki).
If you contribute to this git based wiki editable by Vim we have a chance
of making it official at www.vim.org.
Historical notes
================

View file

@ -9,6 +9,8 @@ snippet ddate
`strftime("%B %d, %Y")`
snippet time
`strftime("%H:%M")`
snippet datetime
`strftime("%Y-%m-%d %H:%M")`
snippet lorem
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
snippet GPL2

View file

@ -161,3 +161,40 @@ snippet obj
F.prototype = o;
return new F();
}
# Define multiple properties
snippet props
var ${1:my_object} = Object.defineProperties(
${2:new Object()},
{
${3:property} : {
get : function $1_$3_getter() {
// getter code
},
set : function $1_$3_setter(value) {
// setter code
},
value : ${4:value},
writeable : ${5:boolean},
enumerable : ${6:boolean},
configurable : ${7:boolean}
}
}
);
# Define single property
snippet prop
Object.defineProperty(
${1:object},
"${2:property}",
{
get : function $1_$2_getter() {
// getter code
},
set : function $1_$2_setter(value) {
// setter code
},
value : ${3:value},
writeable : ${4:boolean},
enumerable : ${5:boolean},
configurable : ${6:boolean}
}
);

View file

@ -79,7 +79,7 @@ snippet clatin1
snippet cascii
# -*- coding: ascii -*-
# Lambda
snippet ld
snippet lda
${1:var} = lambda ${2:vars} : ${3:action}
snippet .
self.
@ -162,3 +162,18 @@ snippet getopt
${4}
elif option in ("-v", "--verbose"):
verbose = argument
# logging
# glog = get log
snippet glog
import logging
logger = logging.getLogger(${1:__name__})
snippet le
logger.error(${1:msg})
snippet ld
logger.debug(${1:msg})
snippet lw
logger.warning(${1:msg})
snippet lc
logger.critical(${1:msg})
snippet li
logger.info(${1:msg})

View file

@ -680,6 +680,8 @@ snippet hmt
has_many :${1:object}, :through => :${2:object}
snippet ho
has_one :${1:object}
snippet hod
has_one :${1:object}, dependent: :${2:destroy}
snippet i18
I18n.t('${1:type.key}')${2}
snippet ist
@ -967,3 +969,5 @@ snippet shared
shared_examples "${1:shared examples name}" ${2}
snippet itb
it_behaves_like "${1:shared examples name}"${2}
snippet ana
accepts_nested_attributes_for :${1:association}