vim 플러그인(plugin) 설치방법

이호용·2021년 12월 20일

플러그인 설치방법

vim 플러그인을 설치하는 방법은 크게 두가지가 있다.
1. 수동으로 plugin을 git clone받아 적용해준다.
2. vim vundle을 이용해 플러그인을 클론받아 적용해준다.

vundle을 이용하면 좀더 쉽게 플러그인을 관리할 수 있다.

우선 번들을 설치하고 간단한 사용법을 익혀보자.

vundle 설치방법

일단 아래의 코드를 터미널에서 실행하자. .vim폴더 안에 vundle을 설치해준다.

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

그리고 ~/.vimrc를 열어서 아래 코드를 추가해준다.
이미 .vimrc에 코드가 있다면 맨위에다가 추가해주자.

"vim tool 쉽게 설치하려고 번들 만드는 과정에서 코드 추가.
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()

" let Vundle manage Vundle, required
Plugin 'VundleVim/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
" 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/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/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       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

vim bundle은 이제 끝이다. 새롭게 창을 열고 :PluginInstall를 입력해보자. 빔 명령모드에서 하면된다.(혹시 모르는 사람이 있다면 명령모드는 빔에서 "ESC + :" 을 누르면 된다.)

vundle 사용법

" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal

vundle사용법은 간단하다.

  • :PluginList 설치된 플러그인 리스트를 볼 수 있다.
  • :PluginInstall ~/.vimrc에 수정된 내용을 설치할수 잇다.
  • :PluginSearch foo foo를 검색합니다. 로컬 캐시를 새로 고치려면 !를 추가하십시오.
  • :PluginClean 사용하지 않는 플러그인 삭제.

다음시간 부터는 본격적인 플러그인 설치 및 사용법을 알아보자.

0개의 댓글