"--------------------------------------------------------------------------------" " BOXP vimrc " "--------------------------------------------------------------------------------" " Last modified 2014/09/20 " source privacy vars(githubに上げたくないパラメーター達) " g:evervim_devtoken, g:mail_address source .pri_vimrc " NeoBundleの設定 set nocompatible " be iMproved if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim/ call neobundle#rc(expand('~/.vim/bundle/')) endif NeoBundle 'Shougo/vimproc', { \ 'build' : { \ 'windows' : 'make -f make_mingw32.mak', \ 'cygwin' : 'make -f make_cygwin.mak', \ 'mac' : 'make -f make_mac.mak', \ 'unix' : 'make -f make_unix.mak', \ }, \ } NeoBundle "mattn/vimplenote-vim" NeoBundle "mattn/webapi-vim" NeoBundle "mattn/mkdpreview-vim" NeoBundle "Solarized" NeoBundle 'synic.vim' NeoBundle 'sudo.vim' NeoBundle "Shougo/neocomplcache" NeoBundle "Shougo/unite.vim" NeoBundle "Shougo/neomru.vim" NeoBundle "Shougo/vimshell" NeoBundle "Shougo/vimfiler" NeoBundle 'Shougo/neobundle.vim' NeoBundle 'Shougo/echodoc' NeoBundle 'Shougo/neosnippet' NeoBundle 'Shougo/neosnippet-snippets' NeoBundle 'Shougo/unite-ssh' NeoBundle 'Shougo/vinarise' NeoBundle 'Shougo/unite-session' NeoBundle 'YankRing.vim' NeoBundle 'tyru/open-browser.vim' NeoBundle 'basyura/twibill.vim' NeoBundle 'h1mesuke/unite-outline' NeoBundle 'tpope/vim-pathogen' NeoBundle 'thinca/vim-quickrun' NeoBundle 'thinca/vim-logcat' NeoBundle 'thinca/vim-ref' NeoBundle 'ujihisa/vimshell-ssh' NeoBundle 'Markdown' NeoBundle 'textutil.vim' NeoBundle 'osyo-manga/unite-quickfix' NeoBundle 'tsukkee/unite-help' NeoBundle 'kmnk/vim-unite-giti' NeoBundle 'tpope/vim-fugitive' NeoBundle 'VimClojure' NeoBundle 'tpope/vim-fireplace' NeoBundle 'tpope/vim-classpath' NeoBundle 'guns/vim-clojure-static' NeoBundle 'kakkyz81/evervim' NeoBundle 'kannokanno/unite-todo' NeoBundle 'aharisu/vim_goshrepl' NeoBundle 'aharisu/vim-gdev' NeoBundle 'https://bitbucket.org/kovisoft/slimv' NeoBundle 'ujihisa/neoclojure.vim' NeoBundle 'ujihisa/unite-colorscheme.vim' " メガネケースで起動しちゃだーめ NeoBundleLazy 'basyura/bitly.vim' NeoBundleLazy 'basyura/TweetVim' NeoBundleLazy 'tsukkee/lingr-vim' NeoBundleLazy 'motemen/hatena-vim' NeoBundleLazy 'ujihisa/blogger.vim' if (hostname() != "meganecase") NeoBundleSource endif " キーマップ的な何か inoremap inoremap imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) nnoremap r. :source ~/Dropbox/dotfiles/.vimrc :source ~/.gvimrc nnoremap su :e sudo:% nmap yyp nmap @a " window mapping nmap w nnoremap :q! inoremap :q! " tab mapping nnoremap :tabnew nmap gt nmap gT imap gt imap gT nmap :tabfirst nmap :tablast imap :tabfirst imap :tablast " YankRing nnoremap yr :YRShow " vimfiler nnoremap vf :VimFilerCurrentDir nnoremap vfs :VimFilerSplit nnoremap vt :VimFilerTab nnoremap vi :VimFiler -split -simple -winwidth=35 -no-quit " Unite nmap , [unite] nnoremap [unite]f :Unite file nnoremap [unite]bf :Unite buffer nnoremap [unite]bk :Unite bookmark nnoremap [unite]r :Unite file_mru nnoremap [unite]a :Unite file buffer file_mru nnoremap [unite]tt :Unite tweetvim nnoremap [unite]p :Unite mpc:playlist nnoremap [unite]m :Unite mpc:listall nnoremap [unite]d :Unite mpc:ls nnoremap [unite]o :Unite outline nnoremap [unite] :Unite tab nnoremap [unite]g :Unite giti nnoremap [unite]s :Unite session nnoremap [unite]to :Unite todo nnoremap :Unite mapping " quickrun nnoremap \ :QuickRun -input "input.txt" " QuickRun with args(input.txt) "" runner/vimproc/updatetime で出力バッファの更新間隔をミリ秒で設定できます "" updatetime が一時的に書き換えられてしまうので注意して下さい let g:quickrun_config = { \ "_" : { \ "runner" : "vimproc", \ "runner/vimproc/updatetime" : 60 \ }, \} "インサートモードで開始 let g:unite_enable_start_insert = 1 " Execute help. nnoremap :Unite -buffer-name=help help " Vimplenote " FIXME: feedkeysを用いるべきではない nnoremap vnl :call feedkeys("\VimpleNote -l\" . g:mail_address . "\") nnoremap vnn :call feedkeys("\VimpleNote -n\ . g:mail_address . "\") " w3m nnoremap gks :W3mSplit google " マウス機能有効化 set mouse=a ""行番号を表示 set number " インクリメンタル検索を有効化 set incsearch " 補完時の一覧表示機能有効化 set wildmenu wildmode=list:full " 自動的にファイルを読み込むパスを設定 ~/.vim/userautoload/*vim set runtimepath+=~/.vim/ runtime! userautoload/*.vim " neocomplcache設定 let g:neocomplcache_enable_at_startup = 1 if has("gui_running") let g:NeoComplCache_DictionaryFileTypeLists = { \ 'scala' : $HOME.'\Dropbox\dict\scala.dict', \ 'java' : $HOME.'\Dropbox\dict\java.dict' \ } else let g:NeoComplCache_DictionaryFileTypeLists = { \ 'scala' : $HOME.'/Dropbox/dict/scala.dict', \ 'java' : $HOME.'/Dropbox/dict/java.dict' \ } endif " vimshell setting let g:vimshell_interactive_update_time = 10 let g:vimshell_prompt = $USERNAME."% " " vimshell map nnoremap vs :VimShell nnoremap vsc :VimShellCreate nnoremap vp :VimShellPop " TweetVim設定 " タイムライン表示 nnoremap tf :TweetVimHomeTimeline " 発言用バッファを表示する nnoremap tt :TweetVimSay " mentions を表示する nnoremap tr :TweetVimMentions " アイコン表示 let g:tweetvim_display_icon = 0 " spで開く let g:tweetvim_open_buffer_cmd = 'split!' " 1ページあたりの表示ツイート数 let g:tweetvim_tweet_per_page = 100 " 更新キーをマップ autocmd FileType tweetvim nmap (tweetvim_action_reload) autocmd FileType tweetvim imap (tweetvim_action_reload) "16色に設定 set t_Co=16 "meganecase設定 if(hostname() == "meganecase") set t_Co=256 endif " スクリーン名のキャッシュを利用して、neocomplcache で補完する if !exists('g:neocomplcache_dictionary_filetype_lists') let g:neocomplcache_dictionary_filetype_lists = {} endif let neco_dic = g:neocomplcache_dictionary_filetype_lists let neco_dic.tweetvim_say = $HOME . '/.tweetvim/screen_name' " solarized設定 "let g:solarized_termtrans=1 syntax enable " 輝度を高くする " let g:solarized_visibility = "high" " コントラストを高くする " let g:solarized_contrast = "high" if (hostname() == "Ooedo") " デスクトップの場合 colorscheme synic else colorscheme solarized set background=dark endif " カレント行ハイライトON set cursorline " アンダーラインを引く(color terminal) highlight CursorLine cterm=underline ctermfg=NONE ctermbg=NONE " アンダーラインを引く(gui) highlight CursorLine gui=underline guifg=NONE guibg=NONE " vimfiler let g:vimfiler_safe_mode_by_default = 0 let g:vimfiler_as_default_explorer = 1 " yank to clipboard set clipboard+=unnamed " ステータスライン set laststatus=2 " Always show the statusline " 文字コードの自動認識 if &encoding !=# 'utf-8' set encoding=japan set fileencoding=japan endif if has('iconv') let s:enc_euc = 'euc-jp' let s:enc_jis = 'iso-2022-jp' " iconvがeucJP-msに対応しているかをチェック if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb" let s:enc_euc = 'eucjp-ms' let s:enc_jis = 'iso-2022-jp-3' " iconvがJISX0213に対応しているかをチェック elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb" let s:enc_euc = 'euc-jisx0213' let s:enc_jis = 'iso-2022-jp-3' endif " fileencodingsを構築 if &encoding ==# 'utf-8' let s:fileencodings_default = &fileencodings let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932' let &fileencodings = &fileencodings .','. s:fileencodings_default unlet s:fileencodings_default else let &fileencodings = &fileencodings .','. s:enc_jis set fileencodings+=utf-8,ucs-2le,ucs-2 if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$' set fileencodings+=cp932 set fileencodings-=euc-jp set fileencodings-=euc-jisx0213 set fileencodings-=eucjp-ms let &encoding = s:enc_euc let &fileencoding = s:enc_euc else let &fileencodings = &fileencodings .','. s:enc_euc endif endif " 定数を処分 unlet s:enc_euc unlet s:enc_jis endif " 日本語を含まない場合は fileencoding に encoding を使うようにする if has('autocmd') function! AU_ReCheck_FENC() if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0 let &fileencoding=&encoding endif endfunction autocmd BufReadPost * call AU_ReCheck_FENC() endif " 改行コードの自動認識 set fileformats=unix,dos,mac " □とか○の文字があってもカーソル位置がずれないようにする if exists('&ambiwidth') set ambiwidth=double endif "CD au BufEnter * execute ":lcd " . expand("%:p:h") "im_control.vim " 「日本語入力固定モード」切替キー inoremap =IMState('FixMode') " PythonによるIBus制御指定 let IM_CtrlIBusPython = 1 " vim-quickrun設定 let g:quickrun_config = {} let g:quickrun_config.scala = {'command' : 'scala'} let g:quickrun_config.hxml = {'command' : 'haxe'} let g:quickrun_config.mm = {'command' : 'matx'} let g:quickrun_config.c = { \ 'cmdopt' : '-lm' } " スカウター function! Scouter(file, ...) let pat = '^\s*$\|^\s*"' let lines = readfile(a:file) if !a:0 || !a:1 let lines = split(substitute(join(lines, "\n"), '\n\s*\\', '', 'g'), "\n") endif return len(filter(lines,'v:val !~ pat')) endfunction command! -bar -bang -nargs=? -complete=file Scouter \ echo Scouter(empty() ? $MYVIMRC : expand(), 0) command! -bar -bang -nargs=? -complete=file GScouter \ echo Scouter(empty() ? $MYGVIMRC : expand(), 0) "backspace" set backspace=indent,eol,start " vim-python setting autocmd FileType python set omnifunc=pythoncomplete#Complete " disable buzzer set visualbell t_vb= " surround.vim settings nmap ysW" nmap " cs'" nmap ' cs"' " haxe settings if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif let g:neocomplcache_omni_patterns.haxe = '\v([\]''"]|\w)(\.|\()' " indent settings set tabstop=2 set autoindent set shiftwidth=2 set expandtab " GUI font setting if (has("gui_running") ) if (hostname() == "Ooedo" || hostname() == "Grimoire") set guifont =Ricty\ 10 endif if (hostname() == "BOXP-PC") set guifont=MeiryoKe_Console:h10 endif endif "GUI settings set guioptions-=T "ツールバーなし set guioptions-=r "右スクロールバーなし set guioptions-=R set guioptions-=l "左スクロールバーなし set guioptions-=L set guioptions-=b "下スクロールバーなし set guioptions-=m "メニューバー無し " fullscreen "----------------------------------------------------------- if (has("gui_running")) nnoremap :call ToggleFullScreen() function! ToggleFullScreen() if &guioptions =~# 'C' set guioptions-=C if exists('s:go_temp') if s:go_temp =~# 'm' set guioptions+=m endif if s:go_temp =~# 'T' set guioptions+=T endif endif simalt ~r else let s:go_temp = &guioptions set guioptions+=C set guioptions-=m set guioptions-=T simalt ~x endif endfunction endif " vim-ref "webdictサイトの設定 let g:ref_source_webdict_sites = { \ 'je': { \ 'url': 'http://dictionary.infoseek.ne.jp/jeword/%s', \ }, \ 'ej': { \ 'url': 'http://dictionary.infoseek.ne.jp/ejword/%s', \ }, \ 'wiki': { \ 'url': 'http://ja.wikipedia.org/wiki/%s', \ }, \ } "デフォルトサイト let g:ref_source_webdict_sites.default = 'ej' "出力に対するフィルタ。最初の数行を削除 function! g:ref_source_webdict_sites.je.filter(output) return join(split(a:output, "\n")[15 :], "\n") endfunction function! g:ref_source_webdict_sites.ej.filter(output) return join(split(a:output, "\n")[15 :], "\n") endfunction function! g:ref_source_webdict_sites.wiki.filter(output) return join(split(a:output, "\n")[17 :], "\n") endfunction nmap rj :Ref webdict je nmap re :Ref webdict ej nmap rw :Ref webdict wiki "Lisp全般の設定 let g:lisp_rainbow=1 "cljs設定 autocmd BufRead,BufNewFile *.cljs set filetype=clojure "cljx設定 autocmd BufRead,BufNewFile *.cljx set filetype=clojure " matx autocmd BufRead,BufNewFile *.mm set filetype=C " fxml autocmd BufRead,BufNewFile *.fxml set filetype=xml "neosnippet設定 " Tell Neosnippet about the other snippets let g:neosnippet#snippets_directory='~/Dropbox/mysnippets' " 自動保存 function! _CompileTexDocument() :w exe ":!~/Dropbox/bin/texcomp.sh" endfunction function! _CompileMarkdown() :w exe ":!markdown " . expand("%:p") . " >> output.html" endfunction command! CompileTexDocument call _CompileTexDocument() command! CompileMarkdown call _CompileMarkdown() autocmd BufWrite *.{tex} :CompileTexDocument autocmd BufWrite *.{md} :CompileMarkdown " gauche vmap (gosh_repl_send_block) " neoclojure augroup vimrc-neoclojure autocmd! autocmd FileType clojure setlocal omnifunc=neoclojure#complete augroup END let g:quickrun_config.clojure = { \ 'runner': 'neoclojure', \ 'command': 'dummy', \ 'tempfile': '%{tempname()}.clj' \ }