Skip to content

Instantly share code, notes, and snippets.

View mattn's full-sized avatar
🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
View GitHub Profile
@h-east
h-east / vim_multi_statusline.patch
Last active January 19, 2024 12:52
Vim multi-statusline patch
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 2e58c854e..2220cfb2c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -9485,6 +9485,7 @@ multi_byte Compiled with support for 'encoding'
multi_byte_encoding 'encoding' is set to a multi-byte encoding.
multi_byte_ime Compiled with support for IME input method.
multi_lang Compiled with support for multiple languages.
+multi_statusline Compiled with 'statuslineheight' support.
mzscheme Compiled with MzScheme interface |mzscheme|.
@youz
youz / fib.sql
Created July 13, 2012 04:05
再帰CTEでフィボナッチ数列
WITH fibs (fib, pre) AS (
SELECT 1, 0
UNION ALL
SELECT fib+pre, fib from fibs
)
SELECT TOP 40 fib FROM fibs;
@hail2u
hail2u / ckww.js
Created May 22, 2012 01:01
GitHub for Windowsでckwを使うためのラッパー
/*global WScript */
var ckw = 'C:\\Path\\to\\ckw.exe';
var WshShell = WScript.CreateObject('WScript.Shell');
WshShell.Run(ckw + ' -cd "' + WshShell.CurrentDirectory + '"');
@mattn
mattn / gist:2215297
Created March 27, 2012 11:57
summary
body
@s-yukikaze
s-yukikaze / uint64.vim
Created March 16, 2012 09:02
64bit unsigned integer implementation@vim script
function! uint64#unit()
let a = copy(s:UInt64).init(0x1234,0x56789ABC)
let b = copy(s:UInt64).init(0x8765,0x43210FED)
let c = a.add(b)
echo printf("%x%x", c._high, c._low)
let d = b.sub(a)
echo printf("%x%x", d._high, d._low)
let e = a.mul(b)
echo printf("%x%x", e._high, e._low)
endfunction
@rummelonp
rummelonp / 矩形.txt
Created February 15, 2012 02:59
クケェーッ!!!
               ,, -―-、       
             /     ヽ   
       / ̄ ̄/  /i⌒ヽ、|    クケェーッ!!!!
      /  (゜)/   / /          
     /     ト、.,../ ,ー-、       
    =彳      \\‘゚。、` ヽ。、o   
    /          \\゚。、。、o
   /         /⌒ ヽ ヽU  o
   /         │   `ヽU ∴l
  │         │     U :l
@mattn
mattn / gist:1631877
Created January 18, 2012 08:01
[vim]ユーザ補完関数で-2を返すとキャンセル出来る様にする為のパッチ
diff -r 0dabc2ce136c runtime/doc/insert.txt
--- a/runtime/doc/insert.txt Tue Jan 10 22:31:32 2012 +0100
+++ b/runtime/doc/insert.txt Wed Jan 18 17:01:03 2012 +0900
@@ -1010,7 +1010,8 @@
at the characters just before the cursor and including those characters that
could be part of the completed item. The text between this column and the
cursor column will be replaced with the matches. Return -1 if no completion
-can be done.
+can be done. The completion will be canceled. If you want to cancel
+gracefully, return -2.
@mattn
mattn / gist:1631857
Created January 18, 2012 07:55
[vim]ユーザ補完関数で"."レジスタが壊れる問題の修正パッチ
diff -r 0dabc2ce136c src/edit.c
--- a/src/edit.c Tue Jan 10 22:31:32 2012 +0100
+++ b/src/edit.c Wed Jan 18 16:55:02 2012 +0900
@@ -3465,11 +3465,17 @@
if (ins_compl_need_restart())
ins_compl_restart();
- vim_free(compl_leader);
- compl_leader = vim_strnsave(ml_get_curline() + compl_col,
- (int)(curwin->w_cursor.col - compl_col));
@mattn
mattn / refe-0.8.0-ruby19.diff
Created January 5, 2012 01:49
ruby1.9でrefeを動かすパッチ
diff -ur refe-0.8.0.orig/lib/refe/fsdbm.rb refe-0.8.0/lib/refe/fsdbm.rb
--- refe-0.8.0.orig/lib/refe/fsdbm.rb 2012-01-05 10:53:10.996251700 +0900
+++ refe-0.8.0/lib/refe/fsdbm.rb 2012-01-05 11:21:36.400799000 +0900
@@ -85,7 +85,7 @@
def encode( str )
str.gsub(/[^a-z0-9_]/n) {|ch|
- (/[A-Z]/n === ch) ? "-#{ch}" : sprintf('%%%02x', ch[0])
+ (/[A-Z]/n === ch) ? "-#{ch}" : sprintf('%%%02x', ch.ord)
}.downcase
12/01 @manga_osyo Vim の開発環境 http://d.hatena.ne.jp/osyo-manga/20111201/1322665228
12/02 @mattn_jp モテる男のVim Script短期集中講座 http://mattn.kaoriya.net/software/vim/20111202085236.htm
12/03 @ShougoMatsu Vimと過ごすイチャラブクリスマス そして伝説へ http://vinarian.blogspot.com/2011/12/vim.html
12/04 @thinca ‘tabline’ を活用しよう http://d.hatena.ne.jp/thinca/20111204/1322932585
12/05 @h1mesuke word の中の単語を選択する textobj-wiw を書いた http://d.hatena.ne.jp/h1mesuke/20111205/p1
12/06 @hell2u たった一行で人生が変わった.vimrcでの設定とその意味 http://hail2u.net/blog/software/only-one-line-life-changing-vimrc-setting.html
12/07 @aizen76 Modern Vim Life! http://d.hatena.ne.jp/alwei/20111206/1323187998
12/08 @__papix__ 初心者がオススメする初心者でも安心なVimプラグイン集 http://papix.hateblo.jp/entry/2011/12/08/130431
12/09 @kaoriya nyancat.vimの裏話 http://www.kaoriya.net/blog/201112/20111209
12/10 @choplin VimとKinesisの話 http://choplin.hatenablog.com/entry/2011/12/10/222645