본문 바로가기

Javascript

Vim plugins for Javascript

1. Vundle 설치

$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim


2. Vundle 설정

Put below to ~/.vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList          - list configured plugins
" :PluginInstall(!)    - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

3. Javascript 설정

Also put below to ~/.vimrc

" color

Bundle 'jelera/vim-javascript-syntax'


" indenting

Bundle 'pangloss/vim-javascript'

Bundle 'nathanaelkane/vim-indent-guides'


" automate some typing

Bundle 'Raimondi/delimitMate'


" linting integration

Bundle 'scrooloose/syntastic'


" amazing code completion

Bundle 'Valloric/YouCompleteMe'


" These are the tweaks I apply to YCM's config, you don't need them but they might help.

" YCM gives you popups and splits by default that some people might not like, so these should tidy it up a bit for you.

let g:ycm_add_preview_to_completeopt=0

let g:ycm_confirm_extra_conf=0

set completeopt-=preview


Bundle 'marijnh/tern_for_vim'


4. 패키지 인스톨

$ vim +PluginInstall


5. 최신버전 VIM 설치

$ ./configure --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config

$ make

$ make install


6. YouCompleteMe 설치

$ cd ~/.vim/bundle/YouCompleteMe

$ ./install.sh --clang-completer



http://oli.me.uk/2013/06/29/equipping-vim-for-javascript/