Skip to content

Instantly share code, notes, and snippets.

View thinca's full-sized avatar
⌨️
Happy Vimming!

thinca thinca

⌨️
Happy Vimming!
View GitHub Profile
@thinca
thinca / getcwd.diff
Last active November 15, 2015 13:17
Improve getcwd() and haslocaldir()
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6e7039c..e36b6b6 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1828,7 +1828,7 @@ getcmdpos() Number return cursor position in command-line
getcmdtype() String return current command-line type
getcmdwintype() String return current command-line window type
getcurpos() List position of the cursor
-getcwd() String the current working directory
+getcwd( [{winnr} [, {tabnr}]]) String get the working directory
root@a6f8855c1ce0:~/omnisharp-roslyn# scripts/Omnisharp -s OmniSharp.sln
info : [OmniSharp.Startup] Omnisharp server running on port '2000' at location '/root/omnisharp-roslyn' on host -1.
info : [OmniSharp.Dnx.DnxPaths] Looking for sdk version in '/root/omnisharp-roslyn/global.json'.
info : [OmniSharp.Dnx.DnxPaths] Using runtime '/root/.dnx/runtimes/dnx-mono.1.0.0-beta4'.
info : [OmniSharp.Dnx.DnxProjectSystem] Scanning '/root/omnisharp-roslyn' for DNX projects
info : [OmniSharp.Dnx.DnxProjectSystem] Found project '/root/omnisharp-roslyn/src/OmniSharp/project.json'.
info : [OmniSharp.Dnx.DnxProjectSystem] Found project '/root/omnisharp-roslyn/src/OmniSharp.Stdio/project.json'.
info : [OmniSharp.Dnx.DnxProjectSystem] Found project '/root/omnisharp-roslyn/tests/OmniSharp.Stdio.Tests/project.json'.
info : [OmniSharp.Dnx.DnxProjectSystem] Found project '/root/omnisharp-roslyn/tests/OmniSharp.Tests/project.json'.
Listening on port 38597
$ mono --version
Mono JIT compiler version 4.0.3 (Stable 4.0.3.20/d6946b4 Tue Sep 15 11:22:07 JST 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
gcc -L. -L/home/thinca/.anyenv/envs/rbenv/versions/2.2.2/lib -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath=/home/thinca/.anyenv/envs/pyenv/versions/system/lib -L/usr/local/lib -Wl,--as-needed -o vim objects/buffer.o objects/blowfish.o objects/charset.o objects/crypt.o objects/crypt_zip.o objects/diff.o objects/digraph.o objects/edit.o objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o objects/if_cscope.o objects/if_xcmdsrv.o objects/mark.o objects/memline.o objects/menu.o objects/message.o objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o objects/sha256.o objects/spell.o objects/syntax.o objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/
@thinca
thinca / remove-empty-dir-meta.go
Created July 27, 2015 06:54
Unity の空のディレクトリの .meta ファイルを消すやつ
package main
import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
)
set runtimepath^=~/.vim/bundle/ultisnips
set runtimepath^=~/.vim/bundle/dispatch
set runtimepath^=~/.vim/bundle/omnisharp " Use pr-209 branch
filetype plugin indent on
syntax enable
set completeopt& completeopt+=menuone completeopt-=preview
let g:OmniSharp_want_snippet = 1
Describe vimspec-style
Describe supports lexical scope
let test_var_1 = 1
It can access to the variable
Assert True(exists('test_var_1'))
Assert Equals(test_var_1, 1)
End
It does not taint the global scope

Test for Vim script!

2014/11/08 VimConf 2014

[[1,2],[2,3],[6,7,8],[7,9],[100,1000]].each_with_object([{}, []]) {|a, (o, r)|
e = a.find {|i| o.include?(i) }
if e
o[e].concat(a)
else
r.push(a)
end
x = o[e] || a
a.each do |i|
o[i] = x
@thinca
thinca / gist:0e528b4c3e11012d9e67
Created October 8, 2014 17:11
plenv install 5.21.4 -Duseshrplib + vim ./configure --enable-perlinterp=dynamic
if_perl.xs:174:0: 警告: "Perl_croak_nocontext" が再定義されました [デフォルトで有効]
# define Perl_croak_nocontext dll_Perl_croak_nocontext
^
In file included from /home/thinca/.anyenv/envs/plenv/versions/5.21.4/lib/perl5/5.21.4/x86_64-linux/CORE/perl.h:5443:0,
from if_perl.xs:53:
/home/thinca/.anyenv/envs/plenv/versions/5.21.4/lib/perl5/5.21.4/x86_64-linux/CORE/embed.h:1829:0: 備考: ここが以前の宣言がある位置です
# define Perl_croak_nocontext Perl_croak
^
In file included from /home/thinca/.anyenv/envs/plenv/versions/5.21.4/lib/perl5/5.21.4/x86_64-linux/CORE/perl.h:5372:0,
from if_perl.xs:53: