Skip to content

Instantly share code, notes, and snippets.

diff -r dd44a527c2bd src/edit.c
--- a/src/edit.c Sun Apr 06 21:34:04 2014 +0200
+++ b/src/edit.c Wed Apr 09 20:24:53 2014 +0900
@@ -9330,12 +9330,7 @@
tpos = curwin->w_cursor;
if (oneleft() == OK)
{
-#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
- /* Only call start_arrow() when not busy with preediting, it will
- * break undo. K_LEFT is inserted in im_correct_cursor(). */
// > cl /LD set_icon.c user32.lib
// :call libcallnr('path/to/set_icon.dll', 'set_icon', v:windowid . ',' . 'path/to/myvim.ico')
#include <windows.h>
#include <stdio.h>
__declspec(dllexport) int set_icon(char **args)
{
HWND hWnd;
char iconpath[1024];
HICON hIcon;
@ynkdir
ynkdir / rogue_vim.log
Created September 16, 2014 11:30
rogue_vim.log
[2014年09月16日 20時20分34秒]
...ro/.vim/package/rogue.vim/autoload/rogue/monster.lua:203: attempt to index field '?' (a nil value)
stack traceback:
...hiro/.vim/package/rogue.vim/autoload/rogue/debug.lua:241: in function <...hiro/.vim/package/rogue.vim/autoload/rogue/debug.lua:235>
...ro/.vim/package/rogue.vim/autoload/rogue/monster.lua:203: in function 'aim_monster'
...ro/.vim/package/rogue.vim/autoload/rogue/monster.lua:217: in function 'put_m_at'
...ro/.vim/package/rogue.vim/autoload/rogue/monster.lua:751: in function 'create_monster'
...kihiro/.vim/package/rogue.vim/autoload/rogue/use.lua:463: in function 'read_scroll'
...ihiro/.vim/package/rogue.vim/autoload/rogue/play.lua:145: in function 'play_level'
@ynkdir
ynkdir / a.vim
Created October 16, 2014 13:34
substitute test
let y = substitute('aaa', '\ze', 'x', 'g') | $put =y " => xaxaxax
$put ='aaa' | s/\ze/x/g " => xaxaxa
let y = substitute('abc', 'a\|\ze', 'x', 'g') | $put =y " => xxbxcx
$put ='abc' | s/a\|\ze/x/g " => xbxc
@ynkdir
ynkdir / cc500.vim
Created December 1, 2014 15:53
cc500.vim
" This is a port of CC500
" http://homepage.ntlworld.com/edmund.grimley-evans/cc500/
"
"-------------------------------------------------------------------------------
" ORIGINAL HEADER
"-------------------------------------------------------------------------------
" Copyright (C) 2006 Edmund GRIMLEY EVANS <edmundo@rano.org>
"
" This program is free software; you can redistribute it and/or modify
" it under the terms of the GNU General Public License as published by
@ynkdir
ynkdir / getvimexepath.vim
Last active August 29, 2015 14:14
GetVimExePath
" :echo exepath(v:progpath)
" unix: :echo resolve('/proc/self/exe')
function! GetVimExePath()
let r = SystemListUtf16(printf('wmic PROCESS WHERE ProcessID=%d GET ExecutablePath /FORMAT:CSV', getpid()))
return split(r[2], ',')[1]
endfunction
function! SystemUtf16(cmd)
return s:utf16tostr(s:lines2bytes(systemlist(a:cmd)))
endfunction
@ynkdir
ynkdir / wmitest.js
Created January 28, 2015 15:12
wmitest.js
// [Scripting API for WMI](https://msdn.microsoft.com/en-us/library/aa393258.aspx)
var SWbemServices = GetObject("winmgmts:");
//var SWbemServices = GetObject("winmgmts:{impersonationLevel=impersonate}");
//var SWbemServices = GetObject("winmgmts:\\\\.\\root\\cimv2")
var objWbemObjectSet = SWbemServices.InstancesOf("Win32_NetworkAdapterConfiguration");
//var objWbemObjectSet = SWbemServices.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration")
for (var e = new Enumerator(objWbemObjectSet); !e.atEnd(); e.moveNext()) {
var s = e.item();
WScript.Echo(s.Caption);
}
@ynkdir
ynkdir / winuniout.c
Created January 28, 2015 12:23
windows unicode stdout
// a.exe => locale encoding
// a.exe | cmd => utf-8
// a.exe > file => utf-16le
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <locale.h>
#include <sys/stat.h>
#include <sys/types.h>
@ynkdir
ynkdir / readme.txt
Created March 13, 2015 08:55
vim patches
ynkdir-imoverthespot
gtk2: Changed Input Method editing style from on-the-spot to over-the-spot. On-the-spot implementation is buggy and has problems detailed in mbyte.c:im_preedit_changed_cb().
ynkdir-imactivatekey
gtk2: Removed 'imactivatekey' option and related code because it doesn't work.
ynkdir-imcursorhold
x11: Changed to not fire CursorHold? autocmd event while IM pre-editing. It may cause trouble.
ynkdir-pangolineheight
diff -r 18d84ed365a5 src/normal.c
--- a/src/normal.c Wed Apr 22 22:18:22 2015 +0200
+++ b/src/normal.c Thu May 21 10:52:34 2015 +0900
@@ -1547,8 +1547,10 @@
}
/* In Select mode, a linewise selection is operated upon like a
- * characterwise selection. */
- if (VIsual_select && VIsual_mode == 'V')
+ * characterwise selection.