Skip to content

Instantly share code, notes, and snippets.

@k-takata
k-takata / gist:628ff1103f92b9135041a15c43c85b32
Last active September 28, 2016 14:12
Vim 7.4.001 to 7.4.2367 patch contributor ranking
210 (Christian Brabandt)
174 (Ken Takata)
103 (Hirohito Higashi)
92 (Yasuhiro Matsumoto)
86 (Dominique Pelle)
45 (Yegappan Lakshmanan)
39 (Kazunobu Kuriyama)
34 (Mike Williams)
32 (ZyX)
28 (Ozaki Kiichi)
@k-takata
k-takata / README.md
Last active April 7, 2019 18:27
Output some data to Cygwin pty from a normal Win32 program
@k-takata
k-takata / dl-kaoriya-vim.py
Last active April 28, 2016 17:43
Download the latest KaoriYa Vim from the GitHub release (https://github.com/koron/vim-kaoriya/releases)
#!/usr/bin/python3
# Download the latest KaoriYa Vim from the GitHub release
import argparse
import calendar
import io
import json
import os
import sys
@k-takata
k-takata / sample-vimrc.vim
Created December 12, 2015 16:20
Sample settings when using matchit.vim
" Load matchit.vim
runtime macros/matchit.vim
function! s:set_match_words()
" Enable these pairs for all file types
let words = ['(:)', '{:}', '[:]', '(:)', '「:」']
if exists('b:match_words')
for w in words
if b:match_words !~ '\V' . w
let b:match_words .= ',' . w
@k-takata
k-takata / clang-c2-help.diff
Last active December 8, 2015 19:12
clang with Microsoft CodeGen version 3.7.0
--- /c/tmp/clang.txt 2015-12-09 03:50:13.363861600 +0900
+++ /c/tmp/clang-c2.txt 2015-12-09 03:33:23.445028500 +0900
@@ -9,11 +9,13 @@
Emit ARC errors even if the migrator can fix them
-arcmt-migrate-report-output <value>
Output path for the plist report
+ -B2 <value> Location of backend dll
--cuda-device-only Do device-side CUDA compilation only
--cuda-host-only Do host-side CUDA compilation only
-cxx-isystem <directory>
@k-takata
k-takata / gist:2aa25f48038ae5599464
Created November 21, 2015 14:37
GCC stopped with SEGV when compiling Vim 7.4.930 on Cygwin64 on Win10
$ make
gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -o objects/ex_cmds2.o ex_cmds2.c
ex_cmds2.c: 関数 ‘profile_divide’ 内:
ex_cmds2.c:981:2: コンパイラ内部エラー: Segmentation fault
tm2->tv_sec = floor(usec / 1000000.0);
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:2588: ターゲット 'objects/ex_cmds2.o' のレシピで失敗しました
From 4775f9b3379dee2333ed70ce4ff49596585aa89a Mon Sep 17 00:00:00 2001
From: "K.Takata" <[email protected]>
Date: Sat, 5 Sep 2015 21:02:39 +0900
Subject: [PATCH 1/4] Fix that preventing multiple instances didn't work
OpenMutex() shouldn't be used for this purpose, use CreateMutex()
instead.
---
CLCLSet/CLCLSet.c | 5 ++---
main.c | 5 ++---
@k-takata
k-takata / vimproc-encdec.vim
Last active August 29, 2015 14:28
Test for new vimproc data handling routine
" Encode a 32-bit integer into a 5-byte string.
function! s:encode_size(n)
" Set each bit7 to 1 in order to avoid NUL byte.
return printf("%c%c%c%c%c",
\ ((a:n / 0x10000000) % 0x80) + 0x80,
\ ((a:n / 0x200000) % 0x80) + 0x80,
\ ((a:n / 0x4000) % 0x80) + 0x80,
\ ((a:n / 0x80) % 0x80) + 0x80,
\ ( a:n % 0x80) + 0x80)
endfunction
@k-takata
k-takata / sscanf-test.c
Created August 14, 2015 22:43
VC14's sscanf returns different value
#include <stdio.h>
int main()
{
int i, d, n, ret;
char *strs[] = {"3", "3x", "3\x80", "3\xf0", "3\xfe", "3\xff"};
for (i = 0; i < sizeof(strs) / sizeof(strs[0]); i++) {
ret = sscanf(strs[i], "%d%n", &d, &n);
printf("str=%s: d=%d, n=%d, ret=%d\n", strs[i], d, n, ret);
@k-takata
k-takata / CreateScrBuf.c
Last active September 30, 2015 09:53
Test of CreateConsoleScreenBuffer and SetConsoleActiveScreenBuffer (Doesn't work on winpty)
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <io.h>
int main()
{
HANDLE hScr, hConOut;
DWORD written;
int c;