Skip to content

Instantly share code, notes, and snippets.

View i-give-up's full-sized avatar

i-give-up

View GitHub Profile
@i-give-up
i-give-up / Snipe.vim
Created March 4, 2018 13:28
Vim user command for use with UltiSnips to view a snippet's definition
"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 November 4, 2015 11:56
A simple script to test if `clipboard_append` from `tkinter` module is working properly
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)