Skip to content

Instantly share code, notes, and snippets.

@aileron
Created July 27, 2018 07:44
Show Gist options
  • Save aileron/80aca170aa8ee72911bacc9e17422c9e to your computer and use it in GitHub Desktop.
Save aileron/80aca170aa8ee72911bacc9e17422c9e to your computer and use it in GitHub Desktop.
minimum vimrc
if has('vim_starting')
set rtp+=~/.vim/plugged/vim-plug
if !isdirectory(expand('~/.vim/plugged/vim-plug'))
echo 'install vim-plug...'
call system('mkdir -p ~/.vim/plugged/vim-plug')
call system('git clone https://github.com/junegunn/vim-plug.git ~/.vim/plugged/vim-plug/autoload')
end
endif
call plug#begin('~/.vim/plugged')
" application development rails
" basic plugin
Plug 'fholgado/minibufexpl.vim'
"Plug 'powerline/powerline'
"Plug 'altercation/vim-colors-solarized'
" rails development
Plug 'slim-template/vim-slim'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rbenv'
Plug 'tpope/vim-rails'
Plug 'ngmy/vim-rubocop'
Plug 'w0rp/ale'
" Initialize plugin system
call plug#end()
let g:Powerline_symbols = 'fancy'
let g:vimrubocop_config = '.rubocop.yml'
"自動的に QuickFix リストを表示する
"autocmd QuickfixCmdPost make,grep,grepadd,vimgrep,vimgrepadd cwin
"autocmd QuickfixCmdPost lmake,lgrep,lgrepadd,lvimgrep,lvimgrepadd lwin
" slim
" autocmd BufNewFile,BufRead *.slim set ft=slim
set backspace=indent,eol,start
set hidden " ファイルの保存をしていなくても、べつのファイルを開けるようにする
set history=2000
set clipboard=unnamed
set laststatus=2 " 常にステータスラインを表示
set visualbell t_vb= "
set autoindent " 自動でインデント
set smartindent " 新しい行を開始したときに、新しい行のインデントを現在行と同じ量にする。
set shiftwidth=2
set tabstop=2
set expandtab
set nobackup
set nowritebackup
set noswapfile
set nrformats-=octal
set nofoldenable
set foldmethod=marker
set title
set incsearch
set noignorecase
set fillchars+=stl:\ ,stlnc:\
set diffopt=filler,iwhite
set wildmenu " コマンド補完を強化
set wildchar=<tab> " コマンド補完を開始するキー
set wildmode=list:full " リスト表示,最長マッチ
set complete+=k " 補完に辞書ファイル追加
" Ex-modeでの<C-p><C-n>をzshのヒストリ補完っぽくする
cnoremap <C-p> <Up>
cnoremap <Up> <C-p>
cnoremap <C-n> <Down>
cnoremap <Down> <C-n>
au BufNewFile,BufRead *.slim set ft=Ruby syntax=slim
au BufNewFile,BufRead *.less set ft=less
au BufNewFile,BufRead *.hamlc set ft=haml
au BufNewFile,BufRead *.jbuilder set ft=Ruby
au BufNewFile,BufRead Schemafile set ft=Ruby
"-------------------------------------------------------------------------------
" 表示 Apperance
"-------------------------------------------------------------------------------
set background=dark
set showmatch " 括弧の対応をハイライト
"set number " 行番号表示
set list " 不可視文字表示
set listchars=tab:>.,trail:_,extends:>,precedes:< " 不可視文字の表示形式
set display=uhex " 印字不可能文字を16進数で表示
hi Pmenu ctermbg=white ctermfg=darkgray
hi PmenuSel ctermbg=blue ctermfg=white
hi PmenuSbar ctermbg=0 ctermfg=9
" 全角スペースの表示
highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=darkgray
match ZenkakuSpace / /
" カーソル行をハイライト
set cursorline
" カレントウィンドウにのみ罫線を引く
augroup cch
autocmd! cch
autocmd WinLeave * set nocursorline
autocmd WinEnter,BufRead * set cursorline
augroup END
hi clear CursorLine
hi CursorLine gui=underline
highlight CursorLine ctermbg=black guibg=black
" ターミナルタイプによるカラー設定
if &term =~ "xterm-256color" || "screen-256color"
" 256色
set t_Co=256
set t_Sf=<1b>[3%dm
set t_Sb=<1b>[4%dm
elseif &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sf=<1b>[3%dm
set t_Sb=<1b>[4%dm
elseif &term =~ "xterm-color"
set t_Co=8
set t_Sf=<1b>[3%dm
set t_Sb=<1b>[4%dm
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment