" Note: Skip initialization for vim-tiny or vim-small. if 0 | endif set background=dark set t_Co=256 colorscheme Tomorrow-Night-Eighties set nocompatible set clipboard=unnamed set fileencodings=utf-8,cp932,sjis,iso-2022-jp,euc-jp set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set nofoldenable augroup vimrc autocmd! filetype perl setlocal shiftwidth=4 tabstop=2 softtabstop=2 autocmd! filetype ruby setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype haml setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype html setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype css setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype scss setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype coffee setlocal shiftwidth=2 tabstop=2 softtabstop=2 autocmd! filetype feature setlocal shiftwidth=2 tabstop=2 softtabstop=2 augroup END " viminfo " http://vimwiki.net/?%27viminfo%27 set viminfo='50,\"1000,:0,n~/.vim/viminfo if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim/ endif call neobundle#begin(expand('~/.vim/bundle')) NeoBundle 'Shougo/neobundle.vim' NeoBundle 'Shougo/vimproc.vim', { \ 'build' : { \ 'windows' : 'tools\\update-dll-mingw', \ 'cygwin' : 'make -f make_cygwin.mak', \ 'mac' : 'make -f make_mac.mak', \ 'linux' : 'make', \ 'unix' : 'gmake', \ }, \ } NeoBundle 'Shougo/unite.vim' NeoBundle 'Shougo/neocomplete.vim' NeoBundle 'Shougo/vimfiler' NeoBundle 'Shougo/context_filetype.vim' NeoBundle 'vim-scripts/vim-auto-save' NeoBundle 'chrisbra/Colorizer' "NeoBundle 'tpope/vim-fugitive' NeoBundle 'tpope/vim-surround' NeoBundle 'tpope/vim-endwise' NeoBundle 'tpope/vim-pathogen' NeoBundle 'tacroe/unite-mark' NeoBundle 'kmnk/vim-unite-giti' "NeoBundle 'Yggdroot/indentLine' NeoBundle 'jiangmiao/auto-pairs' NeoBundle 'plasticboy/vim-markdown' NeoBundle 'tyru/open-browser.vim' NeoBundle 'tyru/eskk.vim' NeoBundle 'tyru/skkdict.vim' NeoBundle 'LeafCage/yankround.vim' NeoBundle 'mattn/emmet-vim' NeoBundle 'thinca/vim-quickrun' NeoBundle 'tyru/caw.vim' NeoBundle 'scrooloose/nerdcommenter' NeoBundle 'chrisbra/Recover.vim' NeoBundle 'wakatime/vim-wakatime' NeoBundle 'tpope/vim-afterimage' NeoBundle 'szw/vim-tags' NeoBundle 'chriskempson/vim-tomorrow-theme' NeoBundle 'thinca/vim-ref' NeoBundle 'yuku-t/vim-ref-ri' NeoBundle 'hail2u/vim-css3-syntax' NeoBundle 'othree/html5.vim' "NeoBundle 'taichouchou2/vim-javascript' NeoBundle 'kchmck/vim-coffee-script' NeoBundle 'derekwyatt/vim-scala' NeoBundle 'tpope/vim-cucumber' NeoBundle 'tpope/vim-haml' NeoBundle 'basyura/unite-rails' " if !has('gui_running') " NeoBundle 'tyru/skk.vim' " NeoBundle 'vim-scripts/buftabs' " end NeoBundleLazy 'kannokanno/previm', { \ 'autoload' : { \ 'commands' : [ 'PrevimOpen' ] \ }} NeoBundleLazy 'AndrewRadev/inline_edit.vim', { \ 'autoload' : { \ 'commands' : [ 'InlineEdit' ] \ }} NeoBundleLazy 'lambdalisue/vim-gita', { \ 'autoload': { \ 'commands': ['Gita'], \}} NeoBundleLazy 'scrooloose/syntastic', { \ 'autoload' : { \ 'commands': ['SyntasticCheck'] \}} " NeoBundleLazy 'alpaca-tc/alpaca_tags', { " \ 'depends': ['Shougo/vimproc', 'Shougo/unite.vim'], " \ 'autoload' : { " \ 'commands' : ['Tags', 'TagsUpdate', 'TagsSet', 'TagsBundle', 'TagsCleanCache'], " \ 'unite_sources' : ['tags'] " \ }} " NeoBundleLazy 'alpaca-tc/beautify.vim', { \ 'autoload' : { \ 'commands' : [ \ { \ 'name' : 'Beautify', \ 'complete' : 'customlist,beautify#complete_options' \ } \ ] \ }} " NeoBundleLazy 'alpaca-tc/alpaca_rails_support', { " \ 'depends' : ['Shougo/neocomplete.vim', 'tpope/vim-rails', 'Shougo/vimproc', 'Shougo/unite.vim'], " \ 'autoload': { " \ 'insert' : 1, " \ 'unite_sources' : 'rails_support/locales', " \ 'commands' : [ " \ 'RSCreateRoutesCache', 'RSCleanCache', " \ 'RSShowLocale', 'RSCreateLocaleCache', " \ ] " \ }} NeoBundleLazy 'airblade/vim-gitgutter', { \ 'autoload' : { \ 'commands' : [ 'GitGutterEnable' ] \ }} call neobundle#end() filetype plugin indent on NeoBundleCheck autocmd QuickFixCmdPost *grep* cwindow "----------------------------------------- " neocomplete let g:neocomplete#skip_auto_completion_time = '0.2' let g:neocomplete#enable_at_startup=1 "if !exists('g:neocomplete#force_omni_input_patterns') "let g:neocomplete#force_omni_input_patterns = {} "endif "let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' "----------------------------------------- "----------------------------------------- " for vim-auto-save let g:auto_save = 1 "----------------------------------------- "----------------------------------------- " alpaca_tags " ~/.ctagsにctagsの設定ファイルを設置します。現在無い人は、このディレクトリ内の.ctagsをコピーしてください。 " 適切なlanguageは`ctags --list-maps=all`で見つけてください。人によりますので。 "let g:alpaca_update_tags_config = { "\ '_' : '-R --sort=yes --languages=-js,html,css', "\ 'ruby': '--languages=+Ruby', "\ } "augroup AlpacaTags "autocmd! "if exists(':Tags') "autocmd BufWritePost * TagsUpdate ruby "autocmd BufWritePost Gemfile TagsBundle "endif "augroup end nnoremap tt ':Unite tags -horizontal -buffer-name=tags -input='.expand("").'' "----------------------------------------- "----------------------------------------- " buftabs " バッファタブにパスを省略してファイル名のみ表示する let g:buftabs_only_basename = 1 " バッファタブをステータスライン内に表示する "let g:buftabs_in_statusline=1 " 現在のバッファをハイライト "let g:buftabs_active_highlight_group="Visual" " ステータスライン "set statusline=%=\ [%{(&fenc!=''?&fenc:&enc)}/%{&ff}]\[%Y]\[%04l,%04v][%p%%] set statusline=%F%m%r%h%w%=\ [%{(&fenc!=''?&fenc:&enc)}/%{&ff}]\[%Y]\[%l,%v][%p%%] " ステータスラインを常に表示 set laststatus=2 "----------------------------------------- "----------------------------------------- " indentLine let g:indentLine_color_term = 23 let g:indentLine_faster = 1 "----------------------------------------- " "----------------------------------------- " syntastic let g:syntastic_enable_signs = 1 let g:syntastic_auto_loc_list = 2 let g:syntastic_mode_map = {'mode': 'passive'} " augroup AutoSyntastic " autocmd! " autocmd BufWritePost * SyntasticCheck " augroup END "----------------------------------------- "----------------------------------------- " vim-tags let g:vim_tags_project_tags_command = "/usr/local/bin/ctags -R {OPTIONS} {DIRECTORY} 2>/dev/null" let g:vim_tags_gems_tags_command = "/usr/local/bin/ctags -R {OPTIONS} `bundle show --paths` 2>/dev/null" "----------------------------------------- "----------------------------------------- " mark auto reg " http://saihoooooooo.hatenablog.com/entry/2013/04/30/001908 if !exists('g:markrement_char') let g:markrement_char = [ \ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', \ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' \ ] endif function! s:AutoMarkrement() if !exists('b:markrement_pos') let b:markrement_pos = 0 else let b:markrement_pos = (b:markrement_pos + 1) % len(g:markrement_char) endif call Vm_toggle_sign() execute 'mark' g:markrement_char[b:markrement_pos] echo 'marked' g:markrement_char[b:markrement_pos] endfunction "----------------------------------------- "----------------------------------------- " previm setting augroup PrevimSettings autocmd! autocmd BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} set filetype=markdown augroup END let g:previm_open_cmd = "open -a 'Google Chrome'" "----------------------------------------- "----------------------------------------- " skk.vim " http://peryaudo.hatenablog.com/entry/20100505/1273048637 if !has('gui_running') " let skk_jisyo = '~/.skk-jisyo' " let skk_large_jisyo = '~/Library/Application Support/AquaSKK/SKK-JISYO.L' " let skk_auto_save_jisyo = 1 " let skk_keep_state = 1 " let skk_egg_like_newline = 1 " let skk_show_annotation = 1 let g:eskk#directory = "~/.eskk" let g:eskk#dictionary = { 'path': "~/.skk-jisyo", 'sorted': 0, 'encoding': 'utf-8', } let g:eskk#large_dictionary = { 'path': "~/.eskk/SKK-JISYO.L", 'sorted': 1, 'encoding': 'euc-jp', } let skk_use_face = 1 end "----------------------------------------- command! -nargs=? Jq call s:Jq() function! s:Jq(...) if 0 == a:0 let l:arg = "." else let l:arg = a:1 endif execute "%! jq \"" . l:arg . "\"" endfunction "let g:giti_log_pretty_format='%h %s (%an)%d' syntax on set encoding=utf8 set fileencoding=utf8 set list set listchars=tab:>.,trail:_,eol:↲,extends:>,precedes:<,nbsp:% set number set ruler set imdisable set hidden set matchpairs& matchpairs+=<:> hi SpecialKey ctermfg=18 inoremap =strftime("%Y-%m-%d") inoremap =strftime("%H:%M:%S") inoremap inoremap inoremap nnoremap ; $ nnoremap \ @ nnoremap :bp nnoremap :bn nnoremap nnoremap nnoremap d :bd nnoremap :bd nnoremap :bd! nnoremap 1 :b1 nnoremap 2 :b2 nnoremap 3 :b3 nnoremap 4 :b4 nnoremap 5 :b5 nnoremap 6 :b6 nnoremap 7 :b7 nnoremap 8 :b8 nnoremap 9 :b9 nnoremap 0 :b10 nmap p (yankround-p) nmap P (yankround-P) nmap gp (yankround-gp) nmap gP (yankround-gP) nmap (yankround-prev) nmap (yankround-next) vnoremap ; $h vnoremap a ggvvG$ nnoremap m :call AutoMarkrement() nnoremap [unite] nmap [unite] nnoremap [unite]m :Unite mark nnoremap [unite]b :Unite buffer nnoremap [unite]f :VimFiler -split -horizontal -force-quit nnoremap [unite]ff :VimFiler -split -simple -winwidth=35 -no-quit nnoremap [unite]rm :Unite rails/model nnoremap [unite]rc :Unite rails/controller nnoremap [unite]rv :Unite rails/view nnoremap [unite]rj :Unite rails/javascript nnoremap [unite]rs :Unite rails/stylesheet nnoremap [unite]gb :Gita blame nnoremap [unite]gs :Gita status nnoremap [unite]gl :Gita log nmap [unite]gg :Unite giti/grep nmap [unite]ggp :Unite giti/grep" nmap [unite]gg* yiw:Unite giti/grep" let mapleader = "," " カーソル下のURLをブラウザで開く nmap o (openbrowser-open) vmap o (openbrowser-open) " ググる nnoremap g :OpenBrowserSearch nmap c (caw:hatpos:toggle) vmap c (caw:hatpos:toggle) command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis au BufRead,BufNewFile *.md set filetype=markdown au BufRead,BufNewFile *.md setf markdown au BufRead,BufNewFile *.hamlc set filetype=haml au BufRead,BufNewFile *.hamlc setf haml au BufNewFile,BufRead *.jb set filetype=ruby