Skip to content

Instantly share code, notes, and snippets.

Avatar

i-give-up

View GitHub Profile
@i-give-up
i-give-up / Snipe.vim
Created Mar 4, 2018
Vim user command for use with UltiSnips to view a snippet's definition
View Snipe.vim
"user-defined command for use with UltiSnips to view snippet definition
command! -complete=custom,ListSnippets -nargs=1 Snipe call ViewSnippet(<q-args>)
function! ViewSnippet(word)
"you have to call this function to populate `g:current_ulti_dict_info` with
"information about the available snippets
call UltiSnips#SnippetsInCurrentScope(1)
let dict = g:current_ulti_dict_info
if has_key(dict, a:word)
let matches = matchlist(dict[a:word].location, '\v(.*):(\d+)')
@i-give-up
i-give-up / tktest.py
Created Nov 4, 2015
A simple script to test if `clipboard_append` from `tkinter` module is working properly
View tktest.py
import sys
try:
from tkinter import Tk
except ImportError:
from Tkinter import Tk
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append(sys.version)