Skip to content

Instantly share code, notes, and snippets.

View todashuta's full-sized avatar
👋
(  ̄ ♢  ̄ )

todashuta todashuta

👋
(  ̄ ♢  ̄ )
View GitHub Profile
" .vimrc
" .vimrc がある時点で nocompatible になってますが一応書いておきます。
set nocompatible
set backupdir=~/.vimbackup
set shiftwidth=2
" コマンドモードで自動的に半角英数に変換
if has('gui_macvim')
# .tmux.conf の if はどうも頼りないので default-command に全部まとめちゃう
# .tmux.conf にこれを書くだけ
set-option -g default-command 'which reattach-to-user-namespace > /dev/null 2>&1 && reattach-to-user-namespace -l $SHELL || $SHELL'
# オマケ: バックスラッシュで改行できる...!
set-option -g default-command \
'which reattach-to-user-namespace > /dev/null 2>&1 && \
call smartinput#map_to_trigger('i', '<Plug>(smartinput_Tab)',
\ '<Tab>',
\ '<Tab>')
imap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Plug>(smartinput_Tab)"
augroup hlCursorIM
autocmd!
autocmd ColorScheme,VimEnter * highlight CursorIM guibg=Purple guifg=NONE
augroup END
------------------------------------------------------------
/Users/todashuta/.pyenv/versions/2.7.6/bin/pip run on Sun Dec 29 11:39:40 2013
Getting page https://pypi.python.org/simple/sentimental-skk/
URLs to search for versions for sentimental-skk in ./.pyenv/versions/2.7.6/lib/python2.7/site-packages:
* https://pypi.python.org/simple/sentimental-skk/
Analyzing links from page https://pypi.python.org/simple/sentimental-skk/
Skipping link https://pypi.python.org/packages/2.5/s/sentimental-skk/sentimental_skk-0.0.100-py2.5.egg#md5=b94011cdad27578bee1fed7ba84898e8 (from https://pypi.python.org/simple/sentimental-skk/); unknown archive format: .egg
Skipping link https://pypi.python.org/packages/2.5/s/sentimental-skk/sentimental_skk-0.0.101-py2.5.egg#md5=548304fd0b0e46cb5226367b96795258 (from https://pypi.python.org/simple/sentimental-skk/); unknown archive format: .egg
Skipping link https://pypi.python.org/packages/2.5/s/sentimental-skk/sentimental_skk-0.0.102-py2.5.egg#md5=ddc5bf9cfbcd515eabb99975410cfa48
@todashuta
todashuta / ack.vim
Last active January 2, 2016 02:39
Vim script でアッカーマン関数
" Vim script でアッカーマン関数
function! s:ack(m, n)
if a:m == 0
return a:n + 1
elseif a:n == 0
return s:ack(a:m - 1, 1)
else
return s:ack(a:m - 1, s:ack(a:m, a:n - 1))
" 最強のたらいまわし
" 出典: http://blog.livedoor.jp/dankogai/archives/50838244.html
" ただのたらいまわし関数
function! s:normal_tarai(x, y, z)
return a:x <= a:y ? a:y
\ : s:normal_tarai(s:normal_tarai(a:x - 1, a:y, a:z),
\ s:normal_tarai(a:y - 1, a:z, a:x),
\ s:normal_tarai(a:z - 1, a:x, a:y))
@todashuta
todashuta / closure-counter.lua
Last active August 29, 2015 14:01
luaのクロージャを使ったカウンタ
function createCounter()
local n = 0
return function()
n = n + 1
return n
end
end
counter = createCounter()
@todashuta
todashuta / stap_cells_generator.rb
Last active November 8, 2015 06:34
STAP細胞ジェネレーター
#!/usr/bin/env ruby
(1..Float::INFINITY).each do |cnt|
s = "#{ [*'A'..'Z'].sample(4).join }細胞"
if s == 'STAP細胞'
puts "#{cnt}回目で#{s}ができました☆"
break
else
puts "#{cnt}回目: #{s}"
@todashuta
todashuta / .minimal_vimrc.vim
Last active August 29, 2015 14:03
検証用
" minimal vimrc
if &compatible | set nocompatible | endif
augroup MyAutoCmd
autocmd!
augroup END
if has('vim_starting')