Skip to content

Instantly share code, notes, and snippets.

@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 / .ctags
Last active December 11, 2022 12:35
Delphi 用 .ctags
--c-kinds=+p
--c++-kinds=+p
--fields=+liaS
--extra=+q
--jcode=utf8
--langdef=delphi
--langmap=delphi:.pas
--regex-delphi=/(\w+)\s*=\s*\(\s*\w\s*\)/\1/t,Type/
--regex-delphi=/(\w+)\s*=\s*class\s*[^;]*$/\1/c,Class/
--regex-delphi=/^constructor\s+(T[a-zA-Z0-9_]+(<[a-zA-Z0-9_, ]+>)?\.)([a-zA-Z0-9_<>, ]+)(.*)+/\1\3/n,Constructor/
@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':
@sgur
sgur / neosnippet_completer.py
Created June 18, 2013 17:59
neosnippet_completer.py
#!/usr/bin/env python
#
# Copyright (C) 2013 Stanislav Golovanov <stgolovanov@gmail.com>
# Strahinja Val Markovic <val@markovic.io>
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or