syntastic을 이용하여 Vim을 고기능 IDE적으로 사용 +.vimrc 노출
오랜만에 vim의 설정을 만났으므로 기록해 둡니다.
Syntastic은?
scrooloose / syntastic
Vim의 플러그인 인 syntastic을 사용하면 파일의 구문 오류를 확인할 수 있습니다. 대응하고 있는 형식도 매우 많아, vim을 이용중이라면 넣지 않으면 손해! plugin입니다. 나는 오늘 알았다. 누군가 빨리 말해줘! 같아요.
덧붙여서 ruby로 밖에 체크하고 있기 때문에 나쁘지 않아.

설치 방법 자체는 github 페이지에 작성되었지만 pathongen.vim이 포함되어 있으면
terminal
$ cd ~/.vim/bundle
$ git clone https://github.com/scrooloose/syntastic.git
에서 소개하고 vim을 시작한 후
:Helptags
에서 도입이 완료되었습니다.추가
코멘트에서 받았습니다
Neobundle
도입이 끝난 경우는NeoBundle 'scrooloose/syntastic.git'
OK입니다! 이것을 쓸 때는 pathongen 사용하고 있었습니다만, 지금은 나도 Neobundle 사용하고 있습니다. lazy 진정 편안.
작동하지 않거나 작동하지 않는 경우 pathongen 설정이 제대로 수행되었는지 확인하고,
terminal
$ vim +\!ruby\ -v +q
에서 원하는 ruby 버전이 vim에서 로드되는지 확인하세요.
특히 rbenv 등을 이용하는 경우는 조심합시다.
직접 설치한 경우
.bash_profile
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
을 기술할까 생각합니다만,
~/.bash_profile
는 아니고 ~/.zshenv
에 기술합시다.Homebrew 경유로의 인스톨에서는
~/.bash_profile
에 eval "$(rbenv init -)"
를 기술합니다만, ~/.zprofile
에도 기술해 두지 않으면 올바르게 동작하지 않습니다.라고 하는 느낌으로 현상 구문 에러의 표시등은 해 줍니다만, screenshot같이 여러가지 표시해 주지 않는 것은 무엇으로다….
백업이 굳이 현재의 .vimrc와 .gvimrc를 노출하여 '너 무슨 일의 이것' 같은 지적을 받을 수 있으면 매우 기뻐합니다.
.vimrc
let g:neocomplcache_enable_at_startup = 1
call pathogen#infect()
syntax on
filetype plugin indent on
colorscheme wombat
set ts=2 sw=2 et
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1
let g:rails_syntax=1
set backspace+=indent,eol,start
set laststatus=2 " show bottom statusline
set nocompatible
set noswapfile
set nobackup
set number " line number
set wrap
set clipboard=unnamed
set autoread " autored when the file is modified
set expandtab
set incsearch
set showmatch
set modifiable
set smartindent
" statusline
set statusline=%t "tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "filetype
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
compiler ruby
let ruby_space_errors=1
" colorscheme for statusline
augroup InsertHook
autocmd!
autocmd InsertEnter * highlight StatusLine guifg=#ccdc90 guibg=#2E4340
autocmd InsertLeave * highlight StatusLine guifg=#2E4340 guibg=#ccdc90
augroup END
.gvimrc
let g:neocomplcache_enable_at_startup = 1
set guifont=Menlo:h12
set guioptions-=T
set showtabline=2
set langmenu=eng
set encoding=utf-8
set guioptions-=r " disable right scroll bar
set guioptions-=R
set guioptions-=l " disable left scroll bar
set guioptions-=L
" fullscreen mode
" set fuoptions=maxvert,maxhorz
" autocmd GUIEnter * set fullscreen
" set current directory to the working object
autocmd BufEnter * silent! lcd %:p:h
" apply english menu
source $VIMRUNTIME/delmenu.vim
set langmenu=none
source $VIMRUNTIME/menu.vim
if has("multi_lang")
language C
endif
참고:
Syntastic을 사용할 때 zshenv에 rbenv 설정을 씁시다.
Vim에서 rbenv의 Ruby가 호출 할 수없는 문제가 발생하여 빠졌습니다.
Reference
이 문제에 관하여(syntastic을 이용하여 Vim을 고기능 IDE적으로 사용 +.vimrc 노출), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/foloinfo/items/662007fcf4f802a19f3a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)