Skip to content

Instantly share code, notes, and snippets.

Avatar

Gary Fixler gfixler

View GitHub Profile
@gfixler
gfixler / EasyJumpPreciseMotionAce.vim
Created Jul 24, 2012
A Vim take on Emacs' AceJump mode, itself based on Vim's PreciseJump and EasyMotion plugins
View EasyJumpPreciseMotionAce.vim
" ACEJUMP
" Based on emacs' AceJump feature (http://www.emacswiki.org/emacs/AceJump).
" AceJump based on these Vim plugins:
" EasyMotion (http://www.vim.org/scripts/script.php?script_id=3526)
" PreciseJump (http://www.vim.org/scripts/script.php?script_id=3437)
" Type AJ mapping, followed by a lower or uppercase letter.
" All words on the screen starting with that letter will have
" their first letters replaced with a sequential character.
" Type this character to jump to that word.
@gfixler
gfixler / vim_mapkey.vim
Created Jul 25, 2012
Vim Mapkey() function: an inverse for maparg()
View vim_mapkey.vim
function! Mapkey (keys, mode)
" Inverse of maparg()
" Pass in a key sequence and the first letter of a Vim mode.
" Returns key mapping mapped to it in that mode, else '' if none.
" <Keys> - e.g. "<Space>" and "<CR>" - are matched case-insensitively,
" as are things before dashes, e.g. the "C-S-" part of "<C-S-A>".
" Chorded "<keys>" are not handled properly yet (i.e. "<C-Space>")
" Example:
" :nnoremap <Tab> :bn<CR>
" :call Mapkey(':bn<CR>', 'n')
@gfixler
gfixler / showsh.vim
Created Jul 27, 2012
Vim: Show-And-Shell - simple, shell session playback
View showsh.vim
" SHOW-AND-SHELL
" An *extremely* simplistic shell 'simulator'.
" Allows for copying a shell session into vim,
" marking up 'typed' sections, then stepping
" through a simulation of using the shell with
" a single key. Useful for didactic demos.
"
" Usage:
" Load or create a ShowShell file.
" Run :ShowShell_setup()
@gfixler
gfixler / blamecol.py
Created Aug 26, 2012
Simple SVN blame temporal grayscale colorization
View blamecol.py
#!/usr/bin/env python
'''
SVN blame temporal colorizer
Pipe shell output of `svn blame` through this.
Creates a grayscale heatmap of recentness of line changes.
Normalizes range of revisions over 20 shades of gray.
Usage:
@gfixler
gfixler / OpenCourseOnline
Created Feb 11, 2013
OpenCourseOnline youtube channel links, prettied up. These were so hard to find, and so inconsistently named.
View OpenCourseOnline
Probabilistic Graphical Models with Professor Daphne Koller - Stanford University {{{1
01.01 - Welcome | https://www.youtube.com/watch?v=WPSQfOkb1M8
01.02 - Overview and Motivation | https://www.youtube.com/watch?v=6AVurePzK3Y
01.03 - Distributions | https://www.youtube.com/watch?v=Y1i7Tzj9YFg
01.04 - Factors | https://www.youtube.com/watch?v=5R5ixMmKQzg
02.01 - Semantics & Factorization | https://www.youtube.com/watch?v=6ODl1rxoT14
02.02 - Reasoning Patterns | https://www.youtube.com/watch?v=dSLlBMOKWF4
02.03 - Flow of Probabilistic Influence | https://www.youtube.com/watch?v=PfirsYouObw
@gfixler
gfixler / sendit
Last active Dec 12, 2015
Gnome Nautilus script to zip/scp files to server.
View sendit
#!/bin/bash
# zip/scp selected file(s) to server; copy URL to X clipboard
# put in ~/.gnome2/nautilus
# Put these 4 lines in ~/.sendit:
# SENDIT_USER='username' # your scp login
# SENDIT_SITE='yoursite.com' # site to scp to
# SENDIT_PATH='website/path' # where to 'sendit'
# SENDIT_LINK='http://www.yoursite.com/path' # for copying URL
@gfixler
gfixler / gist:5368404
Last active Dec 16, 2015
ThatOtherFile - Stateless buffer toggling in Vim, via basename. Toggle between proj/file.ext and proj/<basename>/<basename>_file.ext
View gist:5368404
function! ThatOtherFile (basename)
" Toggle between ./file.ext and ./<basename>/<basename>_file.ext
" Prompts to create missing <basename> directory if absent.
let path = expand('%:p:h')
let filename = expand('%:p:t')
let opath = path[-len(a:basename):]
let ofilename = filename[:len(a:basename)]
if opath == a:basename
if ofilename == a:basename.'_'
let opath = path[:-len(a:basename) - 1]
View randcode
aol bpm
aar bbs
abe bcf
ade bef
adm ben
ahl bim
ame bnf
amr bns
ana bob
ann boo
View A vim Primer
Intro
Why Vim?
Approach
Configuration
vim as Language
Getting Things Done
Searching Your Text
Moving Around Your Text
Changing Text
Deleting Text
View mayaOnUbuntu.sh
#!/bin/bash
#Heith Seewald 2012
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then