Hello, Gist.vim!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:open_pair_file() | |
let path = expand('%:p') | |
let pairs = [ | |
\ ['/autoload/\([^/]\+\).vim$', '/plugin/\1.vim'], | |
\ ['/plugin/\([^/]\+\).vim$', '/autoload/\1.vim'] | |
\ ] | |
for [pat, sub] in pairs | |
if match(path, pat) != -1 | |
execute 'hide' 'edit' substitute(path, pat, sub, '') | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" http://subtech.g.hatena.ne.jp/motemen/20080504/1209838652 | |
nnoremap <expr> ^ search('^\s*\%#\S', 'bn') ? '0' : '^' | |
nnoremap <expr> 0 col('.') == 1 ? '^' : '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:snr() | |
let sfile = expand('<sfile>') | |
return matchstr(sfile, '<SNR>\zs\d\+\ze_snr$') | |
endfunction | |
function! s:sid() | |
let snr = s:snr() | |
return printf('<SNR>%s_', snr) | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <expr> p col('.') == 1 ? 'P' : 'p' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host 560 | |
HostName very.long.host.name | |
User user560 | |
Port 560 | |
IdentityFile ~/.ssh/id_rsa.560 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:yank_gist() | |
let gist_id = input('gist? ') | |
execute 'Gist' gist_id | |
let match = matchlist(bufname('%'), '^gist:\(\d*\)/\(.*\)$') | |
if empty(match) | |
echoerr 'no match' | |
return | |
endif | |
let gist_url = printf('https://gist.github.com/%s.js?file=%s', match[1], match[2]) | |
let code = join(getline(1, '$'), "\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//samba/shared/repos/git /repos cifs user=user,password=password 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
(function(){ | |
var id = 'bouzuya-22'; | |
var pattern = /^http:\/\/www\.amazon\.co\.jp(?:.*)\/(?:(?:gp\/product)|(?:dp))\/([0-9A-Za-z]{10}).*$/; | |
var result = location.href.match(pattern); | |
if (result == null) { | |
return; | |
} | |
var text = document.createTextNode('A!'); | |
var href = 'http://amazon.jp/o/ASIN/' + result[1] + '/' + id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var f="bouzuya-22";var d=/^http:\/\/www\.amazon\.co\.jp(?:.*)\/(?:(?:gp\/product)|(?:dp))\/([0-9A-Za-z]{10}).*$/;var a=location.href.match(d);if(a==null){return}var e=document.createTextNode("A!");var b="http://amazon.jp/o/ASIN/"+a[1]+"/"+f;var c=document.createElement("a");c.appendChild(e);c.setAttribute("href",b);document.getElementById("btAsinTitle").appendChild(c);return false})(); |
OlderNewer