Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
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>
View vimconf2016.md

Best practices for building Vim plugins

2016-11-05 VimConf 2016

View web.go
package main
import (
"fmt"
"net/http"
"os"
"runtime"
"strconv"
"strings"
View 2016-teratail.md

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(Validate.java:192)
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:397)
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:123)
[23:12:42 WARN]: at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.runTaskLater(CraftScheduler.java:106)
[23:12:42 WARN]: at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
[23:12:42 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[23:12:42 WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
[23:12:42 WARN]: at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
[23:12:42 WARN]: at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
View private.xml
<?xml version="1.0"?>
<!--
https://pqrs.org/osx/karabiner/xml.html.ja
-->
<root>
<item>
<name>Private settings</name>
<item>
<name>tmux support in Terminal</name>
<identifier>private.tmux</identifier>
View a.vimspec
Describe order
Before all
let list = ['A']
End
Before each
let list += ['B']
End
Context deep context
Before all
View gist:650e8ad5f46967a71fc73ac771005b3b
function! s:show_stars() abort
for i in range(1, 10)
echo repeat('*', i)
endfor
endfunction
call s:show_stars()
@thinca
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
endfunction
let funcname = matchstr(string(obj.func), 'function(''\zs.\{-}\ze'')')
echo assert_true(exists('*{' . funcname . '}'))
unlet obj
echo assert_false(exists('*{' . funcname . '}'))
@thinca
thinca / test_dict.vim
Created Mar 19, 2016
test funcref in dict
View test_dict.vim
let dict = {}
function! dict.func1() abort
endfunction
let dict.func2 = dict.func1
echo assert_true(dict.func1 == dict.func2)