Skip to content

Instantly share code, notes, and snippets.

View koron's full-sized avatar
🐱
meow

MURAOKA Taro koron

🐱
meow
View GitHub Profile
@koron
koron / ex_getln.c.diff
Created July 20, 2011 13:57
make in_history() sensible of 'firstc' (vim)
--- ex_getln.c.orig 2011-07-20 22:35:22.540320700 +0900
+++ ex_getln.c 2011-07-20 22:48:04.029204400 +0900
@@ -67,7 +67,7 @@
static int hist_char2type __ARGS((int c));
-static int in_history __ARGS((int, char_u *, int));
+static int in_history __ARGS((int, char_u *, int, int));
# ifdef FEAT_EVAL
static int calc_hist_idx __ARGS((int histype, int num));
@koron
koron / compl_onselected.vim
Created September 24, 2011 02:59
Sample of onselected hook of completion.
" Special completion function.
"
" This function completes very very limited strings:
"
" "a" -> "aa1", "foo2", "foo3", "many words start with 'aa'"
" "ab" -> "ab1", "ab2", "ab3"
function! LimitedComplete1(findstart, base)
if a:findstart == 1
let s = getline(line('.'))[0 : col('.') - 1]
@koron
koron / patch-eval_marks.diff
Created September 29, 2011 08:55
eval_marks, complete with some bugs.
# HG changeset patch
# Parent 9eda149d53d824729a0953951eb0f9b8be567669
diff -r 9eda149d53d8 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Sat Sep 24 12:15:30 2011 +0900
+++ b/runtime/doc/eval.txt Sat Oct 01 22:49:27 2011 +0900
@@ -1844,6 +1844,10 @@
String rhs of mapping {name} in mode {mode}
mapcheck( {name}[, {mode} [, {abbr}]])
String check for mappings matching {name}
@koron
koron / numstr.c
Created October 2, 2011 00:46
bigint arithmetics by string.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
static int
digit(char ch)
{
return ch - '0';
@koron
koron / gist:1287149
Created October 14, 2011 13:47
vimdoc-ja's message on `make html`.
vim_faq.jax.html: tag error: faq-2.4
vim_faq.jax.html: tag error: faq-2.5
vim_faq.jax.html: tag error: faq-2.10
vim_faq.jax.html: tag error: faq-3.3
vim_faq.jax.html: tag error: faq-3.4
vim_faq.jax.html: tag error: faq-4.1
vim_faq.jax.html: tag error: faq-4.2
vim_faq.jax.html: tag error: faq-14.1
vim_faq.jax.html: tag error: 'tabstop'
vim_faq.jax.html: tag error: 'textwidth'
@koron
koron / _config.yml
Created October 15, 2011 00:59
make vimdoc-ja using jekyll's feature
safe: false
auto: false
server: false
server_port: 4000
base-url: http://vim-jp.org/vimdoc-ja
source: .
destination: ./_site
plugins: ./_plugins
@koron
koron / encode_japan.vim
Created December 6, 2011 01:32
add EncodingChanged event handler.
" vim:set ts=8 sts=2 sw=2 tw=0: (この行に関しては:help modelineを参照)
"
" 日本語向けにエンコードを設定するサンプル - Vim7用
"
" Last Change: 06-Dec-2011.
" Maintainer: MURAOKA Taro <koron.kaoriya@gmail.com>
" 各エンコードを示す文字列のデフォルト値。s:CheckIconvCapabilityを()呼ぶことで
" 実環境に合わせた値に修正される。
"
@koron
koron / enc_considered_setenv.diff
Created December 16, 2011 15:02
vim: encoding sensitive setenv() for windows
# HG changeset patch
# Parent 622b4fb33b85d68a98fd1c4d209e105b3ddecef7
convert encoding of environment value when mismatch between Vim and OS
diff -r 622b4fb33b85 src/os_win32.c
--- a/src/os_win32.c Fri Dec 16 09:14:12 2011 +0900
+++ b/src/os_win32.c Fri Dec 16 23:58:48 2011 +0900
@@ -5816,3 +5816,34 @@
set_alist_count();
}
@koron
koron / gist:1531313
Created December 29, 2011 02:33
スパルタンVimの序文
スパルタンVim(以下、本書)は最近はあまり見かけなくなった質実剛健(スパルタン)な
Vimユーザを目指す読者を対象に書かれています。本書はVimどころかコンピュータを利
用する際に、一切の甘え、妥協を許しません。Vimを含めツールの過度な機能に頼った
り、CPUの速度や潤沢なメモリに甘えたりすることは禁忌としています。そう、コン
ピュータ利用の際に隠蔽されているあらゆる詳細を意識することを強要します。
本書が目指すのはVimを使うことを通じてユーザの革新、ユーザ自身が持つハードウェア
(脳を含めた肉体)の最適化です。いわばニュータイプです。「ツールが人間に合わせ
る」など愚の骨頂、「人間がツールに極限まで適応する」のです。なぜならば人間が合
わせたほうが速いから。ツールが人間に合わせるには修正のために少なからず時間がか
# HG changeset patch
# Parent 2e546d787ee8d12f7ea1b22172b9d491652c1ed7
support lua 5.2 (intermediate #4)
diff -r 2e546d787ee8 src/if_lua.c
--- a/src/if_lua.c Thu Jan 05 09:14:30 2012 +0900
+++ b/src/if_lua.c Sat Jan 07 21:18:35 2012 +0900
@@ -13,6 +13,9 @@
#include <lua.h>