Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / gist:55896e5899aff1677424
Created November 20, 2015 15:06 — forked from dahu/gist:39282c57bba5b2d1e7b1
Choose Your Own Vim Adventure -- Goal Driven Learning for Vim

Goal Driven Learning for Vim

Principles

@illucent
illucent / gist:4f1741166370853ca76c
Created November 20, 2015 15:05 — forked from romainl/gist:9970697
How to use Tim Pope's Pathogen.

How to use Tim Pope's Pathogen.

I'll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea.

Vim plugins are collections of specialized scripts that you are supposed to put in "standard" locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

#!/bin/bash
m () {
echo "$0: $@"
}
e () {
echo "Error: $0: $@"
exit 1
}
#!/usr/bin/env bash
#
# compositing - enable/disable compositing (Xorg + compton)
# Simple compton wrapper script (default values in brackets)
#
# https://github.com/netzverweigerer
# opacity of window borders (100)
border_opacity=80
#!/bin/bash
# xinitrc - @netzverweigerer (Github/Twitter)
# xmessage wrapper script, stops annoying xmessage popups
alias xmessage="$HOME/bin/xmessage"
# terminal enthuasiast friendly keyboard repeat rate
xset r rate 220 15
# enable X11 terminate keyboard shortcut (Ctrl-Alt-Backspace)
@illucent
illucent / comptonwrapper
Created November 19, 2015 23:47
comptonwrapper - added by [gist]
#!/bin/bash
# simple compton startup script - <armin@mutt.email>
killall -9 compton
compton_top_offset="-10"
compton_left_offset="-10"
compton_opacity_borders="1.0"
compton_opacity_shadows="0.5"
compton_radius="10"
compton -t "$compton_top_offset" -l "$compton_left_offset" --xinerama-shadow-crop --vsync opengl -e "$compton_opacity_borders" -o "$compton_opacity_shadows" -r "$compton_radius" -D 3 -m 0.95 -C -G --dbe --use-ewmh-active-win -f --no-fading-openclose -c --shadow-exclude="name = 'XOSD'" &
# compton --backend glx --vsync opengl-swc -t "$compton_top_offset" -l "$compton_left_offset" --xinerama-shadow-crop -e "$compton_opacity_borders" -o "$compton_opacity_shadows" -r "$compton_radius" -D 3 -m 0.95 -C -G --dbe --use-ewmh-active-win -f --no-fading-openclose -c --shadow-exclude="name = 'XOSD'"
@illucent
illucent / colors.py
Created November 17, 2015 17:01
Color Highlight Text -
import sys, re
class TerminalController:
"""
A class that can be used to portably generate formatted output to
a terminal.
`TerminalController` defines a set of instance variables whose
values are initialized to the control sequence necessary to
perform a given action. These can be simply included in normal
@illucent
illucent / easy-182.py
Created November 15, 2015 13:21 — forked from gulan/easy-182.py
r/dailyprogrammer
#! /usr/bin/env python2
def input_to_words(fh,col_width):
for line in fh:
for word in line.split(' '):
w = word.strip()
if len(w) > col_width:
raise Exception, "%r is longer that column width" % w
yield w
@illucent
illucent / check.py
Created November 15, 2015 12:24 — forked from lukaspustina/check.py
#!/usr/bin/python
###############################################################################
# Lukas Pustina
# This script takes a dictionary (one word by line) as well as multiple text
# files and checks how many words of these text files are part of the
# dictionary.
#
# Primary use is to analyse the quality of tesseract.
###############################################################################
# Example:
class SimpleHash {
private:
// data
string * m_pData;
int * counter;
int maxIndex;
int numberOfWords;