Skip to content

Instantly share code, notes, and snippets.

set all&
set nocompatible
set runtimepath=
set rtp+=~/repository/delimitMate/
set backspace=indent,eol,start
let delimitMate_expand_cr = 1
@bootleq
bootleq / a-unite.vim
Created August 26, 2013 08:16
Test example for unite-session `save` function.
let SessionLoad = 1
if &cp | set nocp | endif
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
let v:this_session=expand("<sfile>:p")
silent only
cd ~/repository/dotfiles/vim-test
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
let s:wipebuf = bufnr('%')
endif
set shortmess=aoO
@bootleq
bootleq / .zshrc
Created May 19, 2013 07:57
zsh alias for ag
() {
# TODO --hidden
local common='noglob ag --nobreak --nogroup --noheading --smart-case --depth=27'
local colors='--color-path 35 --color-line-number 32 --color-match "1;31"'
alias ag=$common' '$colors
alias agjs=$common' '$colors' -G public/javascripts/.*-(debug|src).js'
}
@bootleq
bootleq / moedict-tw.xml
Created April 28, 2013 15:28
萌典 OpenSearch plugin
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>萌典</ShortName>
<Description>教育部國語詞典(民間線上版)</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">https://www.moedict.tw/favicon.ico</Image>
<Url type="text/html" method="GET" template="https://www.moedict.tw/#{searchTerms}"></Url>
</OpenSearchDescription>
#!/usr/bin/env ruby
require 'rubygems'
require 'redis'
require 'active_support/core_ext/hash'
require 'optparse'
require 'yaml'
require 'pp'
options = {}.with_indifferent_access
@bootleq
bootleq / _capistrano.zsh
Created June 9, 2012 00:35
zsh capistrano completeion function
#compdef cap
#autoload
# From zsh-users (https://github.com/zsh-users/zsh-completions)
# Mix with oh-my-zsh pull request #367 (https://github.com/robbyrussell/oh-my-zsh/pull/367)
_cap() {
local curcontext="$curcontext" state line cmds ret=1
local cache_file='tmp/.cap_tasks~'
# TODO use zsh built-in cache instead of cache_file
@bootleq
bootleq / xhtml.html
Created October 5, 2015 13:00
Example file for testing webapi.vim xml#parse
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TEST XML PARSER</title>
</head>
<body><p>FOOBAR</p></body>
</html>
@bootleq
bootleq / upgrade_tig.sh
Created October 4, 2015 05:52
Install tig from source
#!/bin/bash
if which apt-get 2>&1 >/dev/null; then
[[ -z $(dpkg --get-selections | grep libncursesw5-dev) ]] && sudo apt-get install -y libncursesw5-dev
elif which brew 2>&1 >/dev/null; then
brew install tig --with-docs
exit
fi
@bootleq
bootleq / upgrade_vim.sh
Created April 4, 2012 03:24
Install/upgrade Vim from source
#!/bin/bash
# 安裝相依套件
apt-get install mercurial
apt-get install exuberant-ctags
# 取得 vim source
cd /usr/local/src
@bootleq
bootleq / gist:1489352
Created December 17, 2011 05:36
Vim 陽春 Dr.eye 字典,沒在用了,太慢
command! -nargs=* DictSearch call DictSearch(<f-args>)
" 來源:Dr.eye 字典 移動版
" 例: http://www.dreye.com/mws/dict.php?w=word&ua=dc_cont
let s:dict_search_modes = {
\ 'keys': ['cont', 'var', 'phra', 'diff', 'der' ],
\ 'values': ['字義', '變化', '片語', '辨析', '衍生']
\ }
function! DictSearch(...)
let word = a:0 > 0 ? a:1 : ''