mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Replaced snipmate with UltiSnips, changed default font to DejaVu Mono
This commit is contained in:
25
UltiSnips/all.snippets
Normal file
25
UltiSnips/all.snippets
Normal file
@@ -0,0 +1,25 @@
|
||||
snippet date "Current date"
|
||||
`!v strftime("%Y-%m-%d")`
|
||||
endsnippet
|
||||
|
||||
snippet datetime "Current datetime"
|
||||
`!v strftime("%Y-%m-%d %H:%M:%S")`
|
||||
endsnippet
|
||||
|
||||
snippet - "a dash, used for concatenating words"
|
||||
‐
|
||||
endsnippet
|
||||
|
||||
snippet ~ "shy, used for hyphenation hints"
|
||||
|
||||
endsnippet
|
||||
|
||||
snippet fn "filename"
|
||||
`!v expand("%")`
|
||||
endsnippet
|
||||
|
||||
snippet fp "full path filename"
|
||||
`!v expand("%:p")`
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
||||
33
UltiSnips/javascript.snippets
Normal file
33
UltiSnips/javascript.snippets
Normal file
@@ -0,0 +1,33 @@
|
||||
snippet dbg "put debugger line"
|
||||
debugger;
|
||||
endsnippet
|
||||
|
||||
snippet ass "console assert abbrv"
|
||||
console.assert(${1:condition}, ${2:})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet log "console log abbrv"
|
||||
console.log('${1:text_msg}'${2:, value})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet debug "console debug abbrv"
|
||||
console.debug('${1:text_msg}'${2:, value})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet info "console info abbrv"
|
||||
console.info('${1:text_msg}'${2:, value})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet warn "console warn abbrv"
|
||||
console.warn('${1:text_msg}'${2:, value})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet tbl "console log in table manner"
|
||||
console.table('${1:text_msg}'${2:, obj})${3:};
|
||||
endsnippet
|
||||
|
||||
snippet str "use strict" !b
|
||||
"use strict";
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
||||
45
UltiSnips/python.snippets
Normal file
45
UltiSnips/python.snippets
Normal file
@@ -0,0 +1,45 @@
|
||||
snippet dbg "IPython Debugger abbrv" !b
|
||||
import ipdb; ipdb.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet pdb "pdb abbrv" !b
|
||||
import pdb; pdb.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet docmodule "Doc module" !b
|
||||
"""
|
||||
Project: ${1:pyGTKtalog}
|
||||
Description: ${2:Tests for DataBase class.}
|
||||
Type: ${3:test}
|
||||
Author: ${4:Roman 'gryf' Dobosz, gryf73@gmail.com}
|
||||
Created: ${5:`strftime("%Y-%m-%d %H:%M:%S")`}
|
||||
"""
|
||||
endsnippet docmodule
|
||||
|
||||
snippet debug "Logging debug message"
|
||||
LOG.debug(self.${1:method_name}.__doc__.strip())
|
||||
endsnippet
|
||||
|
||||
snippet pywin "PyWin debugger"
|
||||
import pywin.debugger; pywin.debugger.set_trace()
|
||||
endsnippet
|
||||
|
||||
snippet edbg "Eclipse debbuger"
|
||||
import sys
|
||||
pydevdPath = r"/home/share/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc"
|
||||
if not pydevdPath in sys.path:
|
||||
sys.path.append(pydevdPath)
|
||||
import pydevd
|
||||
pydevd.settrace()
|
||||
endsnippet
|
||||
|
||||
snippet msg "Tk graphical message"
|
||||
from Tkinter import Tk
|
||||
import ttk
|
||||
import tkMessageBox
|
||||
window = Tk()
|
||||
window.wm_withdraw() # make window invisible. we only want message boxes
|
||||
ttk.Style().theme_use('clam')
|
||||
tkMessageBox.showinfo(title="${1:title}", message="${2:msg}", parent=window)
|
||||
endsnippet
|
||||
# vim:ft=snippets:
|
||||
130
UltiSnips/rst.snippets
Normal file
130
UltiSnips/rst.snippets
Normal file
@@ -0,0 +1,130 @@
|
||||
snippet author
|
||||
:Author: ${1:}|${2:file-as}|${3:aut}
|
||||
endsnippet
|
||||
|
||||
snippet creator
|
||||
:Creator: ${1:}|${2:file-as}|${3:aut}
|
||||
endsnippet
|
||||
|
||||
snippet contributor
|
||||
:Contributor: ${1:}|${2:file-as}|${3:ill}
|
||||
endsnippet
|
||||
|
||||
snippet organization
|
||||
:Organization: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet address
|
||||
:Address: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet contact
|
||||
:Contact: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet version
|
||||
:Version: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet revision
|
||||
:Revision: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet status
|
||||
:Status: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet copyright
|
||||
:Copyright: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet rights reST tag
|
||||
:Rights: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet type
|
||||
:Type: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet language
|
||||
:Language: ${1:en}
|
||||
endsnippet
|
||||
|
||||
snippet title
|
||||
:Title: ${1:title}
|
||||
endsnippet
|
||||
|
||||
snippet Description
|
||||
:Description: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet publisher
|
||||
:Publisher: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet pubdate
|
||||
:Date: ${1:2001-02-01}
|
||||
endsnippet
|
||||
|
||||
snippet format
|
||||
:Format: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet identifier
|
||||
:Identifier: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet source
|
||||
:Source: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet relation
|
||||
:Relation: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet coverage
|
||||
:Coverage: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet rights
|
||||
:Rights: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet subject
|
||||
:Subject: ${1:}
|
||||
endsnippet
|
||||
|
||||
snippet code
|
||||
.. sourcecode:: ${1:python}
|
||||
:cssclass: ${2:wombat}
|
||||
${3::linenos:} ${4:1}
|
||||
|
||||
${5:}
|
||||
endsnippet
|
||||
|
||||
snippet figure
|
||||
.. figure:: ${1:image.png}
|
||||
:target: ${1:}
|
||||
:alt: ${2:description}
|
||||
:figclass: ${3:custclass}
|
||||
|
||||
${2:}
|
||||
endsnippet
|
||||
|
||||
snippet article
|
||||
:Title: ${1:Blog post title}
|
||||
:Date: ${2:`!v strftime("%Y-%m-%d %H:%M:%S")`}
|
||||
:Modified: ${3:}
|
||||
:Tags: ${4:blogtag1, blogtag2}
|
||||
|
||||
${5:}
|
||||
|
||||
.. more
|
||||
endsnippet
|
||||
|
||||
snippet raw
|
||||
.. raw:: html
|
||||
|
||||
${1:}
|
||||
endsnippet
|
||||
|
||||
88
UltiSnips/spyce.snippets
Normal file
88
UltiSnips/spyce.snippets
Normal file
@@ -0,0 +1,88 @@
|
||||
snippet #!
|
||||
#!/usr/bin/python
|
||||
|
||||
snippet imp
|
||||
import ${1:module}
|
||||
# Module Docstring
|
||||
snippet docs
|
||||
'''
|
||||
File: ${1:`Filename('$1.py', 'foo.py')`}
|
||||
Author: ${2:`g:snips_author`}
|
||||
Description: ${3}
|
||||
'''
|
||||
snippet wh
|
||||
while ${1:condition}:
|
||||
${2:# code...}
|
||||
snippet for
|
||||
for ${1:needle} in ${2:haystack}:
|
||||
${3:# code...}
|
||||
# New Class
|
||||
snippet cl
|
||||
class ${1:ClassName}(${2:object}):
|
||||
"""${3:docstring for $1}"""
|
||||
def __init__(self, ${4:arg}):
|
||||
${5:super($1, self).__init__()}
|
||||
self.$4 = $4
|
||||
${6}
|
||||
# New Function
|
||||
snippet def
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
"""${3:docstring for $1}"""
|
||||
${4:pass}
|
||||
snippet deff
|
||||
def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
|
||||
${3}
|
||||
# New Method
|
||||
snippet defs
|
||||
def ${1:mname}(self, ${2:arg}):
|
||||
${3:pass}
|
||||
# New Property
|
||||
snippet property
|
||||
def ${1:foo}():
|
||||
doc = "${2:The $1 property.}"
|
||||
def fget(self):
|
||||
${3:return self._$1}
|
||||
def fset(self, value):
|
||||
${4:self._$1 = value}
|
||||
# Lambda
|
||||
snippet ld
|
||||
${1:var} = lambda ${2:vars} : ${3:action}
|
||||
snippet .
|
||||
self.
|
||||
snippet try Try/Except
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
snippet try Try/Except/Else
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
else:
|
||||
${5:pass}
|
||||
snippet try Try/Except/Finally
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
finally:
|
||||
${5:pass}
|
||||
snippet try Try/Except/Else/Finally
|
||||
try:
|
||||
${1:pass}
|
||||
except ${2:Exception}, ${3:e}:
|
||||
${4:raise $3}
|
||||
else:
|
||||
${5:pass}
|
||||
finally:
|
||||
${6:pass}
|
||||
# if __name__ == '__main__':
|
||||
snippet ifmain
|
||||
if __name__ == '__main__':
|
||||
${1:main()}
|
||||
# __magic__
|
||||
snippet _
|
||||
__${1:init}__${2}
|
||||
snippet dbg
|
||||
import pywin.debugger; pywin.debugger.set_trace()
|
||||
29
UltiSnips/tex.snippets
Normal file
29
UltiSnips/tex.snippets
Normal file
@@ -0,0 +1,29 @@
|
||||
snippet li "Item in itemize list"
|
||||
\item ${VISUAL}$0
|
||||
endsnippet
|
||||
|
||||
snippet lst "Code Listing for listings package" !b
|
||||
\begin{lstlisting}
|
||||
${VISUAL}$0
|
||||
\end{lstlisting}
|
||||
endsnippet
|
||||
|
||||
snippet hrefoot "Make hyper ref with footnote"
|
||||
\href{$2}{${VISUAL}${1:name}}\footnote{\url{${2:url}}}.$0
|
||||
endsnippet
|
||||
|
||||
snippet href "Make hyperlink"
|
||||
\href{$2}{${VISUAL}${1:name}}.$0
|
||||
endsnippet
|
||||
|
||||
snippet subsec "Subsection" !b
|
||||
\subsection{${VISUAL}${1:name}}$0
|
||||
endsnippet
|
||||
|
||||
snippet sss "Sub subsection" !b
|
||||
\subsubsection{${VISUAL}${1:name}}$0
|
||||
endsnippet
|
||||
|
||||
snippet tt "Make text monospaced"
|
||||
\texttt{${VISUAL}}$0
|
||||
endsnippet
|
||||
12
UltiSnips/xhtml.snippets
Normal file
12
UltiSnips/xhtml.snippets
Normal file
@@ -0,0 +1,12 @@
|
||||
snippet xhtml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ops="http://www.idpf.org/2007/ops" xml:lang="en">
|
||||
<head>
|
||||
<title>${1:title}</title>
|
||||
<link href="css/style.css" type="text/css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
${2:end}
|
||||
</body>
|
||||
</head>
|
||||
Reference in New Issue
Block a user