Skip to content

Instantly share code, notes, and snippets.

@rbtnn
rbtnn / QuickrunShowExpectedConfig.vim
Created February 3, 2019 08:17
QuickrunShowExpectedConfig
function s:quickrun_show_expected_config(type) abort
let type = empty(a:type) ? &filetype : a:type
source $VIMPLUGINS/vim-quickrun/autoload/quickrun.vim
let xs = split(execute('scriptnames'), "\n")
let id = str2nr(get(filter(xs, { i, x -> x =~# 'autoload/quickrun.vim$' }), 0, ''))
let dict = function(printf("\<SNR>%d_build_config", id))({ 'type' : type })
for key in keys(dict)
echo printf("%s: %s", key, string(dict[key]))
endfor
endfunction
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// note: free return value if is not NULL.
char* parse_excmd(char* line){
const char* s = "EX(CMD_";
if (!strncmp(s, line, strlen(s))){
char* first = strchr(line, '"');
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 565f8a518..bf7db8054 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -916,6 +916,9 @@ To remove all menus use: *:unmenu-all* >
:unmenu! * " remove all menus in Insert and Command-line mode
:aunmenu * " remove all menus in all modes
+Note |:aunmenu| is to remove all menus in all modes, except for Terminal mode.
+To remove menus for Terminal mode, use |:tlunmenu| instead.
@rbtnn
rbtnn / gist:9125a7e394d8991aab7ba9e23fe1ff23
Created February 5, 2017 11:30
ラズパイのVimビルド時間
1) ./configure CFLAGS="-g" && make // -g
2分25秒
2) ./configure CFLAGS="" && make // -O2
6分27秒
3) ./configure CFLAGS="-g -O2" && make // -g -O2
7分18秒
function! ChangeColorScheme() abort
let colorschemes = ['blue', 'darkblue']
let idx = tabpagenr() - 1
if len(colorschemes) <= idx
let idx = 0
endif
execute printf('colorscheme %s', colorschemes[idx])
endfunction
augroup TabpageColorScheme
function! s:main() abort
let s = '中華料理画像うpよろしく'
let cs = split(s, '\zs')
let i = 0
while i < len(cs)
if i == 0
echomsg s
elseif i == len(cs) - 1
echomsg join(reverse(cs), '')
@rbtnn
rbtnn / main.js
Created October 9, 2016 12:54
output.innerHTML = e.innerHTML;
// <body>
// <div id="output"></div>
// <script src="./javascripts/main.js" type="text/javascript"></script>
// </body>
var output = document.getElementById('output');
var e = document.createElement('div');
var b = document.createElement('input');
new
set fileformat=unix
call setline(1, "abc" . nr2char(0x0a) . nr2char(0x0d) . "def")
diff --git src/eval.c src/eval.c
index 53c188b..3d2c22b 100644
--- src/eval.c
+++ src/eval.c
@@ -187,6 +187,7 @@ static struct vimvar
{VV_NAME("t_none", VAR_NUMBER), VV_RO},
{VV_NAME("t_job", VAR_NUMBER), VV_RO},
{VV_NAME("t_channel", VAR_NUMBER), VV_RO},
+ {VV_NAME("stacktrace", VAR_LIST), VV_RO},
};
@rbtnn
rbtnn / gist:ab8a69bc9389e8c410e310dc6351e123
Created June 18, 2016 14:32
c:\MinGW\bin\windres.exe: vim.rc:1: syntax error
mingw32-make.exe: Entering directory 'C:/Users/naru1/vim/src'
windres --preprocessor="gcc -E -xc" -DRC_INVOKED -DWIN32 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_JOB_CHANNEL -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV \
--input-format=rc --output-format=coff -i vim.rc -o obji386/vimrc.o
c:\MinGW\bin\windres.exe: vim.rc:1: syntax error
プロセスが、存在しないパイプに書き込もうとしました。
vim.rc:17:0: fatal error: when writing output to : Invalid argument
// #else
^
compilation terminated.
c:\MinGW\bin\windres.exe: preprocessing failed.