Skip to content

Instantly share code, notes, and snippets.

@thinca
thinca / fix_textprop.patch
Last active Mar 18, 2019
テキストプロパティで落ちるやつ
View fix_textprop.patch
diff --git a/src/textprop.c b/src/textprop.c
index 674faebe2..00436f51a 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -629,7 +629,7 @@ f_prop_remove(typval_T *argvars, typval_T *rettv)
mch_memmove(newptr, buf->b_ml.ml_line_ptr,
buf->b_ml.ml_line_len);
buf->b_ml.ml_line_ptr = newptr;
- curbuf->b_ml.ml_flags |= ML_LINE_DIRTY;
+ buf->b_ml.ml_flags |= ML_LINE_DIRTY;
View 2019-03-11-try-text-property.md

テキストプロパティ触ってみた

2019-03-11 gorilla.vim #2

View wordcount.vim
let s:S = vital#vital#import('Data.String')
let s:L = vital#vital#import('Data.List')
function! s:count_words(text) abort
let F = { memo, x -> extend(memo, {x: get(memo, x, 0) + 1}) }
return s:L.foldl(F, {}, s:S.scan(a:text, '\w\+'))
endfunction
echo s:count_words('this is a pen or not a pen')
" {'this': 1, 'is': 1, 'a': 2, 'pen': 2, ...}
View 2018-10-31-helpbot.md

Vim の helpbot は裏で何をしているのか

2018-10-31 .vimconf.swp 2018

@thinca
thinca / megurorb17.md
Created Jul 31, 2018
Meguro.rb #17 Ruby で Vim を拡張する
View megurorb17.md

Ruby で Vim を拡張する

View greenlet.log
Collecting greenlet
1 location(s) to search for versions of greenlet:
* https://pypi.python.org/simple/greenlet/
Getting page https://pypi.python.org/simple/greenlet/
Starting new HTTPS connection (1): pypi.python.org
"GET /simple/greenlet/ HTTP/1.1" 200 24008
Analyzing links from page https://pypi.python.org/simple/greenlet/
Skipping link https://pypi.python.org/packages/00/6b/9d4b5faa314ac579fda43f874b69246f9d7d1635a39f02c5d5f8866f04e6/greenlet-0.4.5-cp27-none-win_amd64.whl#md5=e06ab7f742a642b7d5b490c90521d0fc (from https://pypi.python.org/simple/greenlet/); it is not compatible with this Python
Skipping link https://pypi.python.org/packages/00/73/63fa90c85f94c2deebe229d940da56148bababc8678d3109bd3ff67f1ace/greenlet-0.4.2.win-amd64-py2.7.exe#md5=ecf74a210b67842e4759a8d81ad5ca62 (from https://pypi.python.org/simple/greenlet/); unsupported archive format: .exe
Skipping link https://pypi.python.org/packages/00/8b/4ccae511e6a9d429ccbf701f1df16a3fe6afbbf75b338ab143754733d831/greenlet-0.4.
View gist:330b3ebc33bd0212a8d9f24de3c39260
function! X() abort
let x = 10
let scope = l:
let F = { -> extend(scope, {'x': 200}) }
call F()
echo x
endfunction
call X()
View fablicvim2.md

なぜ Vim はいきなり文字を入力できないのか

2017-07-20 Fablic.vim #2

@thinca
thinca / .zshrc
Last active Nov 23, 2017
Support :command in zsh in Vim (experimental)
View .zshrc
# put this code in your .zshrc
if [[ "${VIM_TERMINAL_SHELL}" != "" ]]; then
command_not_found_handler() {
if [[ "${1}" != :* ]]; then
echo "command not found: ${1}" > /dev/stderr
return 127
fi
echo -ne "\e_$*\e\\" > /dev/tty
while [[ ! -f "${VIM_TERMINAL_SHELL}" ]]; do
View csv.vim
syntax match csvHead /^/ nextgroup=csvOddColumn
syntax match csvOddColumn /[^,]*/ contained nextgroup=csvOddComma
syntax match csvOddComma /,/ contained nextgroup=csvEvenColumn
syntax match csvEvenColumn /[^,]*/ contained nextgroup=csvEvenComma
syntax match csvEvenComma /,/ contained nextgroup=csvOddColumn
highlight default link csvOddColumn Constant
highlight default link csvEvenColumn Statement