Skip to content

Instantly share code, notes, and snippets.

@tokiwoousaka
Created June 12, 2013 15:56
Show Gist options
  • Save tokiwoousaka/5766635 to your computer and use it in GitHub Desktop.
Save tokiwoousaka/5766635 to your computer and use it in GitHub Desktop.
仕事先で使えるよう公開
" 検索文字列ハイライト
set hlsearch
"""""""""""""""""""""""""""""""""""""""""""""""""
" 実行
:function ExecFile()
:w
:if &filetype == "haskell"
:! runghc %
:elseif &filetype == "scala"
:! scalac % ;scala -classpath . %:r
:elseif &filetype == "lisp"
:! clisp %
:elseif &filetype == "cs"
:! gmcs % ; ./%:r.exe
:elseif &filetype == "ruby"
:! ruby %
:elseif &filetype == "egison"
:! egison %
:else
:echo "This file can't execute"
:endif
:endfunction
"
" キーバインド割り当て
"
:nmap zk :call ExecFile()<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""
" インタラクティブ実行
:function ExecFileI()
:w
:if &filetype == "haskell"
:! ghci %
:elseif &filetype == "verilog"
:! coqtop -l %
:elseif &filetype == "egison"
:! egison -p %
:else
:echo "This file can't execute"
:endif
:endfunction
:nmap zi :call ExecFileI()<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""
" バッファ移動
:nmap nf :n<CR>
:nmap nb :N<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""
" タブ/ウィンドウ操作
:function TabNext()
:tabnew
:n
:endfunction
:nmap tb :call TabNext()<CR>
:nmap tn :tabnew<CR>
:nmap to :tabnew .<CR>
" Ctrlキーは押したく無い人/体で覚えるべし
:nmap \\ :split<CR>
:nmap \q <C-w><C-w>
"""""""""""""""""""""""""""""""""""""""""""""""""
" キーワードハイライト
" rainbowcycloneプラグイン使用
:nmap c/ <Plug>(rc_highlight)<C-R><C-W><CR>
:nmap c* <Plug>(rc_highlight_with_cursor)<C-R><C-W><CR>
:nmap cn <Plug>(rc_highlight_with_last_pattern)<CR>
:nmap cc :RCReset<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment