Skip to content

Instantly share code, notes, and snippets.

Happy Vimming!

thinca thinca

Happy Vimming!
View GitHub Profile
View vimrc
nnoremap <silent> <Plug>(vimrc-show-current-syntax)
\ :<C-u>echo join(map(synstack(line('.'), col('.')),
\ 'synIDattr(v:val, "name")
\ ."(".synIDattr(synIDtrans(v:val), "name").")"'), ',')<CR>

Best practices for building Vim plugins

2016-11-05 VimConf 2016

View web.go
package main
import (

teratail と Vim の共通点

2016-09-15 集まっtail #6 thinca

View gist:dd7b9f635620de77a865151db19b064e
[23:12:42 WARN]: java.lang.IllegalArgumentException: Plugin cannot be null
[23:12:42 WARN]: at org.apache.commons.lang.Validate.notNull(
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.validate(
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.runTaskTimer(
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.runTaskLater(
[23:12:42 WARN]: at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
[23:12:42 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(
[23:12:42 WARN]: at java.lang.reflect.Method.invoke(
[23:12:42 WARN]: at clojure.lang.Reflector.invokeMatchingMethod(
[23:12:42 WARN]: at clojure.lang.Reflector.invokeInstanceMethod(
View private.xml
<?xml version="1.0"?>
<name>Private settings</name>
<name>tmux support in Terminal</name>
View a.vimspec
Describe order
Before all
let list = ['A']
Before each
let list += ['B']
Context deep context
Before all
View gist:650e8ad5f46967a71fc73ac771005b3b
function! s:show_stars() abort
for i in range(1, 10)
echo repeat('*', i)
call s:show_stars()
thinca / test_del_func.vim
Created Mar 19, 2016
test delete object with funcref
View test_del_func.vim
let obj = {}
function! obj.func() abort
let funcname = matchstr(string(obj.func), 'function(''\zs.\{-}\ze'')')
echo assert_true(exists('*{' . funcname . '}'))
unlet obj
echo assert_false(exists('*{' . funcname . '}'))
thinca / test_dict.vim
Created Mar 19, 2016
test funcref in dict
View test_dict.vim
let dict = {}
function! dict.func1() abort
let dict.func2 = dict.func1
echo assert_true(dict.func1 == dict.func2)