This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:SelectColorScheme() | |
30vnew | |
let files = split(globpath(&rtp, 'colors/*.vim'), "\n") | |
for idx in range(0, len(files) - 1) | |
let file = files[idx] | |
let name = matchstr(file , '\w\+\(\.vim\)\@=') | |
call setline(idx + 1, name) | |
endfor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" <Tab>: completion. | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : <SID>left_is_keyword() ? "\<C-n>" : "\<Tab>" | |
function! s:left_is_keyword() "{{{ | |
let col = col('.') - 1 | |
return col != 0 && getline('.')[col - 1] =~# '\k' | |
endfunction "}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" You can use ambiguous command. | |
" Version: 0.2.0 | |
" Author : thinca <thinca+vim@gmail.com> | |
" Shougo <Shougo.Matsu (at) gmail.com> | |
" tyru <tyru.exe@gmail.com> | |
" License: Creative Commons Attribution 2.1 Japan License | |
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en> | |
" Install: copy to autoload/ambicmd.vim | |
let s:save_cpo = &cpo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'curses' | |
def val2aa(wave, val) | |
wave[(val + 0x8000) * wave.size / 0x10000] | |
end | |
def write_wave(counter) | |
[ | |
# ['˾_˼ߎ˨-˧H˕ߙ˦˥՟T˺˭'.split(//u), 79], # 文字化けする... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:toggle_bang(cmdline) | |
" :substituteみたいに引数とコマンドの間に | |
" 空白がなくても呼ばれたりするものもあるので完璧ではない。 | |
" そもそも:substituteはbangとらないけど。 | |
let m = matchlist(a:cmdline, '^\(\s*\)\(\S\+\)\(.*\)') | |
if empty(m) | return a:cmdline | endif | |
let [ws, cmd, rest] = m[1:3] | |
return ws . (cmd[strlen(cmd) - 1] == '!' ? cmd[:-2] : cmd . '!') . rest | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Thread.start do | |
l = '/ - \ |'.split | |
loop do | |
c = l.shift | |
print "\r" | |
print c | |
STDOUT.flush | |
sleep 0.1 | |
l.push c | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define R | |
(lambda () | |
(print "商標登録です。") | |
R)) | |
(((((R))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (prompt() == 'ujihisa') { | |
var Ujihisa = new Function(); | |
Ujihisa.prototype.hi = function () { alert("my name is ujihisa"); }; | |
var the_class = Ujihisa; | |
} | |
else { | |
var Ujm = new Function(); | |
Ujm.prototype.hi = function () { alert("this is a pen"); }; | |
var the_class = Ujm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call submode#enter_with('winsize', 'n', '', 'mws', ':<C-u>call VimrcSubmodeResizeWindow()<CR>') | |
call submode#leave_with('winsize', 'n', '', '<Esc>') | |
function! VimrcSubmodeResizeWindow() | |
let curwin = winnr() | |
wincmd j | let target1 = winnr() | exe curwin "wincmd w" | |
wincmd l | let target2 = winnr() | exe curwin "wincmd w" | |
execute printf("call submode#map ('winsize', 'n', 'r', 'j', '<C-w>%s')", curwin == target1 ? "-" : "+") | |
execute printf("call submode#map ('winsize', 'n', 'r', 'k', '<C-w>%s')", curwin == target1 ? "+" : "-") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" http://d.hatena.ne.jp/os0x/20081115/1226770265 | |
echo len(substitute(join(range(1001)), '[^0]', '', 'g')) |
OlderNewer