Skip to content

Instantly share code, notes, and snippets.

@sgur
sgur / gdipp_setting.xml
Created March 1, 2012 05:25
gdipp_setting.xml
<?xml version="1.0" encoding="UTF-8" ?>
<gdipp>
<version>0.9.1</version>
<gdimm>
<process>
<freetype>
<cache_max_faces>8</cache_max_faces>
<cache_max_sizes>16</cache_max_sizes>
<cache_max_bytes>1048576</cache_max_bytes>
@sgur
sgur / gist:2947094
Created June 18, 2012 06:14
vimproc#system() don't work.vim
echo 'executable():' executable('ctags')
echo 'system():' system('ctags --help')
echo 'vimproc#system()' vimproc#system('ctags --help')
finish
" ↑ の結果。
executable(): 1
@sgur
sgur / gist:3223355
Created August 1, 2012 03:21
:, /, ? 2度押しで cmdline から cmdwin へ移行する
function! s:switch_cmdline(trigger)
if empty(getcmdline()) && getcmdtype() == a:trigger
call feedkeys("\<ESC>q".a:trigger, 'n')
else
return a:trigger
endif
endfunction
cmap <expr> ; <SID>switch_cmdline(';')
cmap <expr> / <SID>switch_cmdline('/')
@sgur
sgur / gist:3393989
Created August 19, 2012 09:43
HTMLヘルプのセキュリティ警告対応
Visual Studio のHTMLヘルプを表示する度にセキュリティ警告が表示される不具合の解決方法
差出人: "Microsoft e-Support Japan"
件名 : SRX1159808338ID - Microsoft Office 2007 のお問い合わせについての回答 (マイクロソフトサポート)
日時 : 2011年8月15日 18:56
このたびはマイクロソフト 電子メール サポートをご利用いただき誠にありがとうございます。
Office 担当 千葉 と申します。よろしくお願いいたします。
@sgur
sgur / simplify.sh
Created September 5, 2012 08:24
collect plugins into "simplified/" directory
mkdir -p simplified
for d in bundle/* ; do
for p in $d/* ; do
if [ -d $p ]; then
cp -ulr $p simplified
fi
done
done
@sgur
sgur / standard_keyboard + CTRL_N,P.ini
Created September 19, 2012 03:00
Operaキーボードショートカット変更
Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding
[Version]
File Version=1
[Info]
Description=Opera Standard Keyboard setup
Author=Opera Software ASA
@sgur
sgur / 2013-03-18-151956.vim
Created March 18, 2013 07:21
taskodone.com の API を webapi.vim から利用するサンプル
" taskodne.com API sample
let s:user_id = 1
let s:api_key = 'See http://taskodone.com/user/account'
let s:number = type(0)
let s:string = type('')
function! s:validate_params(params, types)
if len(a:params) != len(a:types)
@sgur
sgur / googlesuggest.diff
Created May 13, 2013 16:20
googlesuggest-complete-vim (https://github.com/mattn/googlesuggest-complete-vim) を &filetype で絞り込む変更
diff --git a/autoload/googlesuggest.vim b/autoload/googlesuggest.vim
index eb3ae37..3f652ab 100644
--- a/autoload/googlesuggest.vim
+++ b/autoload/googlesuggest.vim
@@ -68,12 +68,11 @@ function! googlesuggest#Complete(findstart, base)
else
" find months matching with "a:base"
let ret = []
- let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" })
+ let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : &filetype . ' ' . a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" })
@sgur
sgur / gist:5569599
Created May 13, 2013 16:26
AutoComplPopでGoogleサジェストを自動補完する設定
let g:acp_behaviorUserDefinedFunction = 'googlesuggest#Complete'
let g:acp_behaviorUserDefinedMeets = 'acp#meetsForKeyword'
@sgur
sgur / pyglob.vim
Created June 18, 2013 16:18
Sample code to use vim fucntion with `g:ctrlp_user_command`. https://github.com/sgur/ctrlp.vim/commit/8b645c21f1a1c30d72a5aa0f01175a05150bc8f2
fu! PyGlob(path)
let path = escape(a:path, '\')
python << EOF
import vim
import re, os, os.path, fnmatch
custom_ignore = vim.eval('g:ctrlp_custom_ignore')
if custom_ignore['dir'][:2] == '\\v':
custom_ignore['dir'] = custom_ignore['dir'][2 :]
if custom_ignore['file'][:2] == '\\v':