Skip to content

Instantly share code, notes, and snippets.

View seanh's full-sized avatar

Sean Hammond seanh

View GitHub Profile
@seanh
seanh / README.md
Created November 19, 2012 12:46 — forked from rufuspollock/data.json
A script that pulls some demo data (gold prices, Malawi aid projects, etc.) from datahub.io and pushes them to your CKAN instance.

Installation

virtualenv load_demo_data
. load_demo_data/bin/activate
mkdir load_demo_data/src
cd load_demo_data/src
git clone git://gist.github.com/4110454.git load_demo_data
pip install -r load_demo_data/pip-requirements.txt
@seanh
seanh / obsession.vim.md
Last active June 12, 2019 22:44
obsession.vim cheatsheet (simple, no-hassle Vim sessions from Tim Pope)

obsession.vim cheatsheet

obsession.vim is simple, no-hassle Vim sessions from Tim Pope. It's a small plugin that just provides :Obsession, a better replacement for the standard :mksession command.

  • Adds the :Obsession command:

  • :Obsession with no argument creates a Session.vim file in the current

@seanh
seanh / vimgrep.md
Last active April 5, 2024 19:28
vimgrep cheatsheet

vimgrep

  • Vimcasts on vimgrep

  • Uses native vim regexes (which are slightly different from the regexes used by grep, ack, ag, etc) so the patterns are the same as with vim's within-file search patterns.

You can do a normal within-file search first, then re-use the same pattern to

@seanh
seanh / netrw.md
Last active April 23, 2024 18:13
Netrw Cheatsheet (Vim's Built-in Directory Browser)

Netrw Cheatsheet (Vim's File Browser)

See also:

  • vinegar.vim, which makes - open netrw in the directory of the current file, with the cursor on the current file (and pressing - again goes up a directory). Vinegar also hides a bunch of junk that's normally at the top of netrw windows, changes the default order of files, and hides files that match wildignore.

    With vinegar, . in netrw opens Vim's command line with the path to the file under the cursor at the end of the command. ! does the same but also prepends ! at the start of the command. y. copies the absolute path of the file under the cursor. ~ goes to your home dir. Ctrl+6 goes back to the file (buffer) that you had open before you opened netrw.

To launch netrw: