본문 바로가기

Ubuntu/others

Vi editor 사용법

728x90

저장

기능
:w 저장
:q 닫기
:q! 저장하지 않고 닫기
:wq 저장하고 닫기
:숫자 지정한 줄 번호로 이동

 

 

편집

기능
dd 현재 줄 잘라내기
yy 현재 줄 복사하기
p 붙여넣기
u 실행취소 (Undo)
ctrl + r 재실행 (Redo)
v Visual모드
y 복사
c 잘라내기

 

 

검색

기능
: -> /찾는 문자열 n 을 누르면 다음으로 이동
   

 

명령

vundle 을 이용하여 plugin 기능을 install 하거나 조회할때 .vimrc 를 open 한 이후 사용한다.

.vimrc 에 필요한 script 가 아래와 같이 미리 준비되어 있어야 한다.

 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'
 Plugin 'vim-vdebug/vdebug'


 " 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:
기능
:PluginInstall .vimrc 에 등록된 plugin module 을 install 함
:PluginList .vimrc 에 install 된 plugin module 을 list up 함
:PluginSearch  

 

 

'Ubuntu > others' 카테고리의 다른 글

VIM side by side files open  (0) 2023.08.06
nano editor 사용법  (0) 2022.05.14
CMake  (0) 2022.02.10
Ubuntu 에서 apt-get 명령어 정리  (0) 2021.08.11