Skip to content

Instantly share code, notes, and snippets.

@ryotako
ryotako / vimrc_memolist.vim
Created July 3, 2016 10:02
unite-qfixhowmのmemolist版のような設定
" initialization
if !exists("g:unite_source_alias_aliases")
let g:unite_source_alias_aliases = {}
endif
if !exists("g:unite_source_menu_menus")
let g:unite_source_menu_menus = {}
endif
" memolist setting
let g:memolist_unite = 1
@ryotako
ryotako / .vimrc
Created August 29, 2016 21:05
Beamerのテーマを取得する自作ソース(パスベタ書き)
" my unite source: beamer theme {{{
let s:beamer_themes_path="/usr/local/texlive/2016/texmf-dist/tex/latex/beamer/themes/theme"
let s:unite_source = {
\ 'name': 'beamer_theme',
\ 'description': 'built-in LaTeX beamer themes',
\}
function! s:unite_source.gather_candidates(args, context)
let s:files = filter(split(system('ls '.s:beamer_themes_path)),'v:val =~# "^beamertheme\.\*\\.sty$"')
return map(s:files,'{
\ "word": substitute(v:val[11:],"\.sty$","",""),
@ryotako
ryotako / .zshrc
Created September 1, 2016 23:08
Prezto関連の設定
# Source Prezto. {{{1
# if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
# source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
# fi
# alias prezto_update="cd ${ZDOTDIR:-$HOME}/.zprezto/ \
# && git pull && git submodule update --init --recursive"
# function prezto_moduleinfo(){
# module=$(ls "${ZDOTDIR:-$HOME}/.zprezto/modules/" | grep -v 'README' | peco)
# vim -R "${ZDOTDIR:-$HOME}/.zprezto/modules/$module/README.md"
# }
@ryotako
ryotako / .vimrc
Last active September 3, 2016 03:57
inclineの設定
" linewise increment {{{2
map ga <Plug>(incline-inc)
map gx <Plug>(incline-dec)
vmap <expr> <C-a> mode() ==# "V" ? "\<Plug>(incline-inc)" : "\<C-a>"
vmap <expr> <C-x> mode() ==# "V" ? "\<Plug>(incline-dec)" : "\<C-x>"
vmap <expr> g<C-a> mode() ==# "V" ? "\<Plug>(incline-inc-inclined)" : "g\<C-a>"
vmap <expr> g<C-x> mode() ==# "V" ? "\<Plug>(incline-dec-inclined)" : "g\<C-x>"
@ryotako
ryotako / .vimrc
Created September 3, 2016 04:02
unite-colorschemeをランダムな位置から起動
" カラースキーム一覧のランダムな位置に移動
" Gを挟んで一度最後まで描画させる
function! s:WanderUniteColorScheme()
let max_num = 735
let match_end = matchend(reltimestr(reltime()), '\d\+\.') + 1
let rand = reltimestr(reltime())[match_end : ] % (max_num + 1)
return ":\<C-u>Unite -auto-preview -vertical -winwidth=40 colorscheme\<CR>G:".rand."\<CR>"
endfunction
@ryotako
ryotako / .vimrc
Last active September 8, 2016 06:41
switch.vimでmarkdownのチェックボックスをトグルする設定
" switch.vim
let g:switch_custom_definitions =
\[
\ { '\v^( *- *)([^ \[].*)$' : '\1[ ] \2' },
\ { '\v^( *- *)\[ \](.*)$' : '\1[x]\2' },
\ { '\v^( *- *)\[x\] ?(.*)$' : '\1\2' },
\]
@ryotako
ryotako / .vimrc
Last active September 18, 2016 02:33
xでレジスタを汚さない&x連打のundo履歴をまとめる
" xでレジスタを汚さない&x連打はまとめてundo履歴に登録
" haya14busaさんの記事(http://haya14busa.com/improve-x-with-vim-submode/)を参考に二行に圧縮
call submode#enter_with('x', 'n', '', 'x', '"_x')
call submode#map('x', 'n', '', 'x', ":\<C-u>undojoin <bar> normal! \"_x<CR>")
@ryotako
ryotako / .vimrc
Created September 18, 2016 06:39
カラースキームをランダムに変更するcolocolo.vimのラッパー
" カラースキームをランダムに変更
command! -nargs=0 Colo highlight clear | ColoColo | redraw | colorscheme
@ryotako
ryotako / memo_for_igor_unit_test_framework.md
Last active October 18, 2016 12:01
t-b/igor-unit-testing-frameworkに関するメモ

t-b/igor-unit-testing-frameworkに関する自分用のメモ.

pdfマニュアルを参考にしているが翻訳ではない.

概要

このパッケージはIgor ProプロシージャやXOPの作成者に単体テストのユーティリティを提供する. パッケージは

  • アサーション
  • テストケース
@ryotako
ryotako / .vimrc
Created October 19, 2016 13:37
colorcolumnのトグル
" 80文字範囲外塗りつぶしのオンオフ
function! s:ToggleMargin()
let value = &colorcolumn
if strlen(value)
set colorcolumn=""
set colorcolumn?
else
execute "set colorcolumn=".join(range(&textwidth+1, 999), ',')
echo " colorcolumn=81..."
endif