Created
January 19, 2014 23:38
-
-
Save calorie/8512492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set showmatch " 括弧の対応をハイライト | |
set number " 行番号表示 | |
set list " 不可視文字表示 | |
set listchars=tab:>.,trail:_,extends:>,precedes:< " 不可視文字の表示形式 | |
set display=uhex " 印字不可能文字を16進数で表示 | |
set previewheight=15 " プレビュー画面サイズ | |
set cmdheight=1 " コマンドラインに使われる画面上の行数 | |
set lazyredraw " コマンド実行中は再描画しない | |
set ttyfast " 高速ターミナル接続を行う | |
set cursorline " カーソル行をハイライト | |
let mapleader = "," " キーマップリーダー | |
set shortmess+=I " 起動時のメッセージを消す | |
set scrolloff=5 " スクロール時の余白確保 | |
set textwidth=0 " 一行に長い文章を書いていても自動折り返しをしない | |
set nobackup " バックアップ取らない | |
set autoread " 他で書き換えられたら自動で読み直す | |
set noswapfile " スワップファイル作らない | |
set hidden " 編集中でも他のファイルを開けるようにする | |
set backspace=indent,eol,start " バックスペースでなんでも消せるように | |
set formatoptions=lmoq " テキスト整形オプション,マルチバイト系を追加 | |
set vb t_vb= " ビープをならさない | |
set browsedir=buffer " Exploreの初期ディレクトリ | |
set whichwrap=b,s,h,l,<,>,[,] " カーソルを行頭、行末で止まらないようにする | |
set showcmd " コマンドをステータス行に表示 | |
set showmode " 現在のモードを表示 | |
set viminfo='50,<1000,s100,\"50 " viminfoファイルの設定 | |
set modelines=0 " モードラインは無効 | |
" OSのクリップボードを使用する | |
set clipboard=unnamed | |
" ターミナルでマウスを使用できるようにする | |
set mouse=a | |
set guioptions+=a | |
set ttymouse=xterm2 | |
set wildmenu " コマンド補完を強化 | |
set wildchar=<tab> " コマンド補完を開始するキー | |
set wildmode=list:full " リスト表示,最長マッチ | |
set history=1000 " コマンド・検索パターンの履歴数 | |
set complete+=k " 補完に辞書ファイル追加 | |
"------------------------------------ | |
" neocomplecache.vim | |
"------------------------------------ | |
" AutoComplPopを無効にする | |
let g:acp_enableAtStartup = 0 | |
" neocompleteを無効にする | |
let g:neocomplete#enable_at_startup = 0 | |
" NeoComplCacheを有効にする | |
let g:neocomplcache_enable_at_startup = 1 | |
" 補完が自動で開始される文字数 | |
let g:neocomplcache_auto_completion_start_length = 2 | |
" smarrt case有効化。 大文字が入力されるまで大文字小文字の区別を無視する | |
let g:neocomplcache_enable_smart_case = 1 | |
" camle caseを有効化。大文字を区切りとしたワイルドカードのように振る舞う | |
let g:neocomplcache_enable_camel_case_completion = 1 | |
" _(アンダーバー)区切りの補完を有効化 | |
let g:neocomplcache_enable_underbar_completion = 1 | |
" シンタックスをキャッシュするときの最小文字長を3に | |
let g:neocomplcache_min_syntax_length = 3 | |
" neocomplcacheを自動的にロックするバッファ名のパターン | |
let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' | |
" -入力による候補番号の表示 | |
let g:neocomplcache_enable_quick_match = 1 | |
" 補完候補の一番先頭を選択状態にする(AutoComplPopと似た動作) | |
let g:neocomplcache_enable_auto_select = 0 | |
"ポップアップメニューで表示される候補の数。初期値は100 | |
let g:neocomplcache_max_list = 20 | |
let g:neocomplcache_skip_auto_completion_time = '0.6' | |
" let g:neocomplcache_source_look_dictionary_path = $HOME . '/words' | |
let g:neocomplcache_source_look_dictionary_path = '' | |
let g:neocomplcache_vim_completefuncs = { | |
\ 'Ref' : 'ref#complete', | |
\ 'Unite' : 'unite#complete_source', | |
\ 'VimShellExecute' : | |
\ 'vimshell#vimshell_execute_complete', | |
\ 'VimShellInteractive' : | |
\ 'vimshell#vimshell_execute_complete', | |
\ 'VimShellTerminal' : | |
\ 'vimshell#vimshell_execute_complete', | |
\ 'VimShell' : 'vimshell#complete', | |
\ 'VimFiler' : 'vimfiler#complete', | |
\ 'Vinarise' : 'vinarise#complete', | |
\ } | |
" Define dictionary. | |
let g:neocomplcache_dictionary_filetype_lists = { | |
\ 'default' : '', | |
\ 'vimshell' : $HOME.'/.vimshell_hist', | |
\ 'scala' : $HOME.'/.vim/bundle/vim-scala/dict/scala.dict', | |
\ 'java' : $HOME.'/.vim/dict/java.dict', | |
\ 'c' : $HOME.'/.vim/dict/c.dict', | |
\ 'cpp' : $HOME.'/.vim/dict/cpp.dict', | |
\ 'javascript' : $HOME.'/.vim/dict/javascript.dict', | |
\ 'ocaml' : $HOME.'/.vim/dict/ocaml.dict', | |
\ 'perl' : $HOME.'/.vim/dict/perl.dict', | |
\ 'php' : $HOME.'/.vim/dict/php.dict', | |
\ 'scheme' : $HOME.'/.vim/dict/scheme.dict', | |
\ 'vm' : $HOME.'/.vim/dict/vim.dict', | |
\ 'ruby' : $HOME.'/.vim/dict/ruby.dict' | |
\ } | |
" Define keyword. | |
if !exists('g:neocomplcache_keyword_patterns') | |
let g:neocomplcache_keyword_patterns = {} | |
endif | |
let g:neocomplcache_keyword_patterns['default'] = '\h\w*' | |
" ユーザー定義スニペット保存ディレクトリ | |
let g:neocomplcache_snippets_dir = '~/.vim/bundle/neosnippet/autoload/neosnippet/snippets,~/.vim/snippet' | |
" スニペット | |
imap <C-y> <Plug>(neocomplcache_snippets_expand) | |
smap <C-k> <Plug>(neocomplcache_snippets_expand) | |
" 補完を選択しpopupを閉じる | |
" inoremap <expr><C-y> neocomplcache#close_popup() | |
" 補完をキャンセルしpopupを閉じる | |
" inoremap <expr><C-e> neocomplcache#cancel_popup() | |
" TABで補完できるようにする | |
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" | |
" undo | |
inoremap <expr><C-g> neocomplcache#undo_completion() | |
" 補完候補の共通部分までを補完する | |
inoremap <expr><C-s> neocomplcache#complete_common_string() | |
" SuperTab like snippets behavior. | |
imap <expr><TAB> neocomplcache#sources#snippets_complete#expandable() ? "\<Plug>(neocomplcache_snippets_expand)" : pumvisible() ? "\<C-n>" : "\<TAB>" | |
" C-kを押すと行末まで削除 | |
" inoremap <C-k> <C-o>D | |
" C-nでneocomplcache補完 | |
inoremap <expr><C-n> pumvisible() ? "\<C-n>" : "\<C-x>\<C-u>\<C-p>" | |
" C-pでkeyword補完 | |
inoremap <expr><C-p> pumvisible() ? "\<C-p>" : "\<C-p>\<C-n>" | |
" 補完候補が出ていたら確定、なければ改行 | |
inoremap <expr><CR> pumvisible() ? neocomplcache#close_popup() : "<CR>" | |
" <C-h>, <BS>: close popup and delete backword char. | |
inoremap <expr><C-h> neocomplcache#smart_close_popup()."\<C-h>" | |
inoremap <expr><BS> neocomplcache#smart_close_popup()."\<C-h>" | |
inoremap <expr><C-x><C-o> &filetype == 'vim' ? "\<C-x><C-v><C-p>" : neocomplcache#manual_omni_complete() | |
" buffer開いたらneoconでcache | |
autocmd BufReadPost,BufEnter,BufWritePost :NeoComplCacheCachingBuffer <buffer> | |
" FileType毎のOmni補完を設定 | |
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | |
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType html setlocal omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS | |
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType php setlocal omnifunc=phpcomplete#CompletePHP | |
autocmd FileType c setlocal omnifunc=ccomplete#Complete | |
autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete | |
autocmd FileType java setlocal omnifunc=javacomplete#Complete | |
" autocmd FileType java setlocal completefunc=javacomplete#CompleteParamsInfo | |
" Enable heavy omni completion. | |
if !exists('g:neocomplcache_omni_patterns') | |
let g:neocomplcache_omni_patterns = {} | |
endif | |
" let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' | |
" let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' | |
let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' | |
" let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*' | |
let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::' | |
" autocmd FileType ruby let g:neocomplcache_source_disable = { | |
" \ 'include_complete' : 1, | |
" \ 'omni_complete' : 1 | |
" \ } | |
"インクルードパスの指定 | |
let g:neocomplcache_include_paths = { | |
\ 'cpp' : '.,/opt/local/include/gcc46/c++,/opt/local/include,/usr/include', | |
\ 'c' : '.,/usr/include', | |
\ 'ruby' : '.,$HOME/.rbenv/versions/1.9.3-p194/lib/ruby/*', | |
\ } | |
"インクルード文のパターンを指定 | |
let g:neocomplcache_include_patterns = { | |
\ 'cpp' : '^\s*#\s*include', | |
\ 'ruby' : '^\s*require', | |
\ 'perl' : '^\s*use', | |
\ } | |
"インクルード先のファイル名の解析パターン | |
let g:neocomplcache_include_exprs = { | |
\ 'ruby' : substitute(v:fname,'::','/','g') | |
\ } | |
" ファイルを探す際に、この値を末尾に追加したファイルも探す。 | |
let g:neocomplcache_include_suffixes = { | |
\ 'ruby' : '.rb', | |
\ 'haskell' : '.hs' | |
\ } | |
"------------------------------------ | |
" neocomplcache-rsense | |
"------------------------------------ | |
let g:neocomplcache#sources#rsense#home_directory = neobundle#get_neobundle_dir() . 'rsense-0.3' | |
set autoindent " 自動でインデント | |
" set paste " ペースト時にautoindentを無効に(onにするとautocomplpop.vimが動かない) | |
set smartindent " 新しい行を開始したときに、新しい行のインデントを現在行と同じ量にする。 | |
set cindent " Cプログラムファイルの自動インデントを始める | |
" softtabstopはTabキー押し下げ時の挿入される空白の量,0の場合はtabstopと同じ,BSにも影響する | |
set tabstop=2 shiftwidth=2 softtabstop=0 | |
set wrapscan " 最後まで検索したら先頭へ戻る | |
set ignorecase " 大文字小文字無視 | |
set smartcase " 検索文字列に大文字が含まれている場合は区別して検索する | |
set incsearch " インクリメンタルサーチ | |
set hlsearch " 検索文字をハイライト |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment