Skip to content

Instantly share code, notes, and snippets.

@KazukiTanaka
Created April 14, 2015 10:18
Show Gist options
  • Save KazukiTanaka/9fe63330ffbe9427f793 to your computer and use it in GitHub Desktop.
Save KazukiTanaka/9fe63330ffbe9427f793 to your computer and use it in GitHub Desktop.
" macにhomebrewでvimを入れる
" brew install lua
" brew install vim --with-lua
" echo 'export PATH=/usr/local/bin:/usr/bin' >> ~/.bash_profile
" source ~/.bash_profile
"=========================
" ショートカット
"=========================
"ctrl+eでNERDTreeを開く
nnoremap <silent><C-e> :NERDTreeToggle<CR>
"=========================
" Neobundle設定
"=========================
" bundleで管理するディレクトリを指定
set runtimepath+=~/.vim/bundle/neobundle.vim/
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" neobundle自体をneobundleで管理
NeoBundleFetch 'Shougo/neobundle.vim'
"-------------------------
" 各種プラグライン
"-------------------------
" colorscheme
"NeoBundle 'w0ng/vim-hybrid'
"NeoBundle 'vim-scripts/twilight'
" エクスプローラー的なNERDTree
NeoBundle 'scrooloose/nerdtree'
" 入力保管
NeoBundle 'Townk/vim-autoclose'
" マークアップ用入力補完
NeoBundle 'mattn/emmet-vim'
" ソースコード実行
NeoBundle 'thinca/vim-quickrun'
" grep
NeoBundle 'grep.vim'
" 静的解析
NeoBundle 'scrooloose/syntastic'
" コード補完
NeoBundle 'Shougo/neocomplete.vim'
NeoBundle 'marcus/rsense'
NeoBundle 'supermomonga/neocomplete-rsense.vim'
call neobundle#end()
" 未インストールのプラグインがある場合、インストールするかを確認する
NeoBundleCheck
"=========================
" 基本設定
"=========================
" vim内部で使われる文字エンコーディングをutf-8に設定する
set encoding=utf-8
" 想定される改行コードの指定する
set fileformats=unix,dos,mac
" ハイライトを有効化する
syntax enable
" 文字色
colorscheme desert
" 検索でハイライト
set hlsearch
" backspaceを許可
set backspace=start,eol,indent
"=========================
" indent
"=========================
" 新しい行を開始したとき、新しい行のインデントを現在行と同じにする
set autoindent
set smartindent
" タブ入力を複数の空白入力に置き換える
set expandtab
" softtabstopはTabキー押し下げ時の挿入される空白の量,0の場合はtabstopと同じ,BSにも影響する
set tabstop=2 shiftwidth=2 softtabstop=0
if has("autocmd")
"ファイルタイプの検索を有効にする
filetype plugin on
"そのファイルタイプにあわせたインデントを利用する
filetype indent on
autocmd FileType perl setlocal sw=4 sts=4 ts=4 et
autocmd FileType css setlocal sw=2 sts=2 ts=2 et
autocmd FileType diff setlocal sw=4 sts=4 ts=4 et
autocmd FileType html setlocal sw=2 sts=2 ts=2 et
autocmd FileType javascript setlocal sw=2 sts=2 ts=2 et
autocmd FileType ruby setlocal sw=2 sts=2 ts=2 et
autocmd FileType haml setlocal sw=2 sts=2 ts=2 et
autocmd FileType sh setlocal sw=4 sts=4 ts=4 et
autocmd FileType sql setlocal sw=4 sts=4 ts=4 et
autocmd FileType vim setlocal sw=2 sts=2 ts=2 et
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment