Git Plugin 관리자 vundle 및 vimawesome

Situation

오래되고 구닥다리같은 vim 편집기도 사실 많은 발전을 이뤄서 사용하기 좋아졌습니다. 그렇다고 vim 사용이 쉽다는건 아니지만, plugin 설치가 쉬워졌고 또 유용한 plugin을 많이 경험해 볼 수 있습니다.

Task

  • 사용하기 편리한 vim 플러그인 매니저 vundle 설치
  • vimawesome 에서 플러그인 검색 및 설치

Action

vundle 설치

vundle 설정

다음의 명령으로 vundle을 설정합니다.

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

vimrc 설정

.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 '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
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/'}
" 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 실행 후 아래 명령 실행

:PluginInstall
vim 플러그인 설치

위와 비슷한 vim 탭이 뜨면서 기본 플러그인들이 설치됩니다.

vimawesome

볼때마다 이름 잘 지은것 같습니다. 어썸~
vimawesome.com 을 방문합니다.
첫 페이지의 상단에 있는 인기 플러그인들은 한번씩 설치해보시기 바랍니다.
여기서는 rust 플러그인을 설치해보도록 하겠습니다.
Rust 검색 결과

rust 검색결과 위와 같습니다. 사실 저도 rust를 배우는 중이라 어떤 플러그인이 좋은지 모릅니다. 일단 최상단의 rust.vim 을 설치해보도록 합니다.
rust.vim

사용자도 많고 21일전 업데이트면 잘 관리되는 플러그인 이라는 뜻이겠죠. Vundle 탭에 설치 방법이 나와있습니다. 거의 대부분의 플러그인을 이 방법으로 간단하게 설치할 수 있습니다.

Plugin 설치

~/.vimrc 에 다음 설정을 붙여넣기 합니다.
Plugin 'rust-lang/rust.vim'
vim에서 source % 과 PluginInstall을 실행합니다.



Result

어려워보이기만 하는 vim도 매우 간편해졌으니 많이 사용하면 좋겠네요!

댓글

이 블로그의 인기 게시물

WSL2 Ubuntu 20.04 및 네트워크 설정

리눅스 멀티코어를 사용하는 tar 압축/해제

git pull 을 했더니 branch가 갈라지는 경우