Skip to content

Instantly share code, notes, and snippets.

@h14i
h14i / _direnv
Created February 24, 2014 07:26
direnv sub-commands completion for zsh. inspired https://gist.github.com/yonchu/5005758
#compdef direnv
# setopt -eu
function _direnv {
local direnv
local -a comp_list
direnv="\
allow[Grants direnv to load the given .envrc]
@h14i
h14i / d_include.vim
Last active January 3, 2016 12:49
FileType d
" For gf, [I, i_CTRL-X_CTRL-I
" There is a need to modify path because it is suit my environment.
setlocal suffixesadd=.d,.di
let &l:include = '^\s*\%(\%(public\|static\)\s\+\)\?\<import'
" let &l:path = '.,' . g:V.system('denv prefix')[:-2] . '/src/*,' . &l:path . ',,'
setlocal path=.,/path/to/dmd/src/**,,
let &l:includeexpr = 'substitute(substitute(v:fname, "\\.", "/", "g"), "$", ".d", "")'
@h14i
h14i / godoc.vim
Created November 29, 2013 17:11 — forked from mattn/godoc.vim
autoload/ref/godoc.vim with completion.
" A ref source for godoc.
" Version: 0.0.1
" Author : mattn <mattn.jp@gmail.com>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
let s:save_cpo = &cpo
set cpo&vim
@h14i
h14i / contextual
Last active December 29, 2015 14:39
contextual rails wrapper script for zsh.
# contextual - wrapper of (spring|bundle exec) commands.
# usage:
# # in zshrc
# source /path/to/contextual
# alias rails=contextual-rails
# alias rake=contextual-rake
# alias rspec=contextual-rspec
# completion:
# # in zshrc
# # require https://github.com/zsh-users/zsh-completions/src/_rails
@h14i
h14i / config.vim
Created October 6, 2013 22:51
quickrun.vim with tsc 0.9.1.1.
" Fedora 19, npm 1.3.11, tsc 0.9.1.1
let g:quickrun_config['typescript/base'] = {
\ 'cmdopt': '',
\ 'exec': ['tsc %o %s --out %s:p:r.js', '%c %s:p:r.js', 'rm -f %s:p:r.js'],
\ 'temp': '%{tempname()}.ts',
\ }
let g:quickrun_config['typescript/nodejs'] = {
\ 'type': 'typescript/base',
\ 'command': 'node',
\ }
@h14i
h14i / test.rb
Created April 16, 2013 11:41
test
class C
def hello
puts 'Hello!'
end
end
C.new.hello