1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 11:30:29 +01:00

Exchange UltiSnips with old snipmate.

I'm not very heavy user of snippets. UltiSnips lately dropped support
for python2, yet I'm using some machines with old OSes, which complain a
lot during boostrapping my vimrc, so I was started to look for a simpler
replacement. Finally decided on a (slightly modified) original snipmate.
This commit is contained in:
2020-02-18 21:15:15 +01:00
parent b50b721562
commit c6560ce397
13 changed files with 87 additions and 370 deletions

14
snippets/_.snippets Normal file
View File

@@ -0,0 +1,14 @@
snippet date Current date
`strftime("%Y-%m-%d")`
snippet datetime Current datetime
`strftime("%Y-%m-%d %H:%M:%S")`
snippet - a dash, used for concatenating words
snippet ~ shy, used for hyphenation hints
­
snippet fn filename
`expand("%")`
snippet fp full path
`expand("%:p")`
snippet uuid
`system("python -c 'import uuid; print(uuid.uuid4())'")`

12
snippets/html.snippets Normal file
View 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>

View File

@@ -0,0 +1,2 @@
snippet dbg
debugger;

35
snippets/python.snippets Normal file
View File

@@ -0,0 +1,35 @@
snippet #!
#!/usr/bin/env python
snippet #!2
#!/usr/bin/env python2
# coding: utf-8
snippet utf
# coding: utf-8
snippet #!3
#!/usr/bin/env python3
snippet dbg Python Debugger abbrv
__import__('pdb').set_trace()
snippet ipdb ipdb abbrv
__import__('ipdb').set_trace()
snippet rpdb remote_pdb debbuger
__import__('remote_pdb').set_trace()
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)
snippet _ Dunder completion
__${1:init}__$0

33
snippets/rst.snippets Normal file
View File

@@ -0,0 +1,33 @@
snippet dbg
debugger;
snippet code
.. code:: ${1:python}
:cssclass: ${2:wombat}
${3::linenos:} ${4:1}
${5:}
snippet figure
.. figure:: ${1:image.png}
:target: ${1:}
:alt: ${2:description}
:figclass: ${3:custclass}
${2:}
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
snippet raw
.. raw:: html
${1:}

2
snippets/tex.snippet Normal file
View File

@@ -0,0 +1,2 @@
snippet hrefoot
\href{$2}{${1:name}}\footnote{\url{${2:url}}}