Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
Happy Vimming!

thinca thinca

⌨️
Happy Vimming!
View GitHub Profile
View prison.vim
" The Vim prison.
" Can you leave from the vim?
redir => g
silent! autocmd
redir END
for i in filter(split(g, "\n")[1:], "v:val !~ '^\\s'")
execute 'autocmd!' i
endfor
mapclear
mapclear!
View brainfuck.vim
function! Bf()
let bf = {}
function! bf.inc()
let self[self.ptr] = get(self, self.ptr, 0) + 1
endfunction
function! bf.dec()
let self[self.ptr] = get(self, self.ptr, 0) - 1
endfunction
function! bf.next()
View javascript_tofunc.vim
" Vim additional ftplugin: javascript_tofunc - TOFunc settings
" Author : thinca <http://d.hatena.ne.jp/thinca/>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
if exists('g:TOFunc.javascript')
finish
endif
let s:save_cpo = &cpo
View comment.vim
" textobj-comment - Text objects for a comment.
" Version: 0.0
" Author : thinca <http://d.hatena.ne.jp/thinca/>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
if exists('g:loaded_textobj_comment') "{{{1
finish
endif
View GetSnippetsList.diff
*** snipMate.vim.old 2009-04-23 02:30:12.703125000 +0900
--- snipMate.vim 2009-04-23 01:41:56.890625000 +0900
***************
*** 187,190 ****
--- 187,202 ----
let num = inputlist(snippet) - 1
return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
endf
+
+ fun GetSnippetsList(ft)
View javaclass.vim
if executable('jad')
silent %!jad -t -clear -ff -nonlb -8 -p "%"
runtime! syntax/java.vim
setlocal readonly
endif
View jproperties.vim
if executable("native2ascii") && &modifiable
execute 'silent %!native2ascii -reverse -encoding ' . (&fileencoding == "" ? &encoding : &fileencoding)
augroup custom_ftplugin_jproperties
autocmd! * <buffer>
autocmd BufWritePre <buffer> execute 'silent %!native2ascii -encoding ' . (&fileencoding == "" ? &encoding : &fileencoding)
autocmd BufWritePost <buffer> execute 'silent %!native2ascii -reverse -encoding ' . (&fileencoding == "" ? &encoding : &fileencoding)
augroup END
endif
View textobj-function.vim
" Vim additional ftplugin: javascript/textobj-function
" Author : thinca <http://d.hatena.ne.jp/thinca/>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
let s:save_cpo = &cpo
set cpo&vim
if !exists('*g:textobj_function_javascript_select')
function! g:textobj_function_javascript_select(object_type)
View textobj-function.vim
" Vim additional ftplugin: perl/textobj-function
" Author : thinca <http://d.hatena.ne.jp/thinca/>
" License: Creative Commons Attribution 2.1 Japan License
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
let s:save_cpo = &cpo
set cpo&vim
if !exists('g:textobj_function_perl_select')
function! g:textobj_function_perl_select(object_type)
View file.vim.diff
--- file.vim.old 2009-05-16 00:00:07.000000000 +0900
+++ file.vim 2009-05-15 23:56:51.000000000 +0900
@@ -79,28 +79,18 @@
return s:cached_items[cache_key]
endif
- let i = strridx(a:pattern, ku#path_separator())
- let components = split(a:pattern, ku#path_separator(), !0)
- let root_directory_pattern_p = i == 0
- let user_seems_want_dotfiles_p = components[-1][:0] == '.'