Skip to content

Instantly share code, notes, and snippets.

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

thinca thinca

⌨️
Happy Vimming!
View GitHub Profile
" append to syntax/hatena.vim
let b:hatena_syntax_super_pre_loaded = {} " Reset when load.
function! s:update_super_pre()
let mx = '^>|\zs.*\ze|$'
for curline in getline(1, '$')
let ft = matchstr(curline, mx)
if ft != '' && !has_key(b:hatena_syntax_super_pre_loaded, ft)
\ && globpath(&rtp, 'syntax/' . ft . '.vim') != ''
unlet! b:current_syntax
let save_isk= &l:isk " For scheme.
" vimrcbox.vim
" Author: Sora harakami <sora134@gmail.com>
" Modified by: thinca <thinca+vim@gmail.com> thanks!
" Modified by: Shougo <Shougo.Matsu@gmail.com> thanks!
" Require: curl
" Licence: MIT Licence
if exists('g:loaded_vimrcbox')
finish
endif
"=============================================================================
" FILE: poslist.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" MODIFIED BY: thinca <thinca@gmail.com>
" Last Modified: 23 Jan 2010
" Usage: Just source this file.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
@thinca
thinca / gist:261452
Created December 22, 2009 02:41 — forked from Shougo/gist:261441
function! s:ParseMarkdown()
return map(split(join(getline(1, '$'), "\n"), '\v(^|\n)\ze#+'), 'split(v:val, "\n")')
endfunction
" Usage
let s:pages = s:ParseMarkdown()
let s:max_page_number = len(s:pages) - 1
@thinca
thinca / .vimrc
Created March 20, 2010 19:24 — forked from tyru/.vimrc
function! s:uniq(list) "{{{
let s:dict = {}
let counter = 1
for i in a:list
if !has_key(s:dict, i)
let s:dict[i] = counter
let counter += 1
endif
endfor
@thinca
thinca / .vimrc
Created May 16, 2010 00:20 — forked from tyru/.vimrc
" <Space><C-n>, <Space><C-p>: Move window position {{{
nnoremap <silent> <Space><C-n> :<C-u> call <SID>swap_window(v:count1)<CR>
nnoremap <silent> <Space><C-p> :<C-u> call <SID>swap_window(-v:count1)<CR>
function! s:modulo(n, m) "{{{
let d = a:n * a:m < 0 ? 1 : 0
return a:n + (-(a:n + (0 < a:m ? d : -d)) / a:m + d) * a:m
endfunction "}}}
function! s:swap_window(n) "{{{
vnew
setlocal bufhidden=hide buftype=nofile noswapfile nobuflisted
let s:doyagao = {'counter': 0, 'save_updatetime': &updatetime, 'bufnr': bufnr('%')}
function! s:doyagao.funcall() dict
if self.bufnr !=# bufnr('%')
call self.clear()
return
@thinca
thinca / fmv.vim
Created January 27, 2012 10:38 — forked from h-east/fmv.vim
Create vimdoc-ja folder structure and move files. (for iOS Vim ja-help)
call mkdir("vimdoc-ja/doc", "p")
call mkdir("vimdoc-ja/syntax", "p")
call rename("help_ja.vim","vimdoc-ja/syntax/help_ja.vim")
for s:file in split(glob('*.jax'), "\n")
call rename(s:file, "vimdoc-ja/doc/" . s:file)
endfor
" ~/.vim/syntax/markdown.vim
" \c で 大文字小文字無視します :help /\c
" todo: TODO: をハイライトしたい
syntax match myTodo /\ctodo:/ containedin=ALL
" done: DONE: をハイライトしたい
syntax match myDone /\cdone:/ containedin=ALL
" 適当に色付け
highlight link myTodo Todo
@thinca
thinca / test.rb
Last active December 16, 2015 23:09 — forked from supermomonga/test.rb
Signal.trap(:QUIT) do
puts "QUIT signal sent."
exit 0
end
puts "Signal.list['QUIT'] => #{Signal.list['QUIT']}"
puts "My pid is #{$$}\n"
loop do
puts 'I\'m alive!'