Skip to content

Instantly share code, notes, and snippets.

@tokiwoousaka
Created January 27, 2015 12:10
Show Gist options
  • Save tokiwoousaka/36998333b0f00340c361 to your computer and use it in GitHub Desktop.
Save tokiwoousaka/36998333b0f00340c361 to your computer and use it in GitHub Desktop.
今のvimrc
" 検索文字列ハイライト
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 :noh<CR>:RCReset<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""
" NeoBundle Settings
" bundleで管理するディレクトリを指定
set runtimepath+=~/.vim/bundle/neobundle.vim/
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'daisuzu/rainbowcyclone.vim'
NeoBundle 'Shougo/unite.vim'
NeoBundle 'h1mesuke/unite-outline'
call neobundle#end()
" Required:
filetype plugin indent on
NeoBundleCheck
"""""""""""""""""""""""""""""""""""""""""""""""""
" その他
set noautoindent
:autocmd BufEnter * syntax on
:autocmd BufEnter *.md syntax off
:autocmd BufEnter *.mkd syntax off
:autocmd BufEnter *.latex syntax off
"""""""""""""""""""""""""""""""""""""""""""""""""
" 入力候補
set completeopt=menuone
for k in split("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_",'\zs')
exec "imap " . k . " " . k . "<C-N><C-P>"
endfor
imap <expr> <TAB> pumvisible() ? "\<Down>" : "\<Tab>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment