$vi /home/user/.vimrc
.vimrc 파일을 열어 아래 나열된 설정을 입력한다.
set nocompatible " 오리지널 vi와 연관이 있다.
" This must be first, because it changes other options as side effect set nocompatible
syntax on " 구문을 강조한다.
set number " 왼쪽에 행 번호를 표시한다.
set notitle " 제목을 표시하지 않는다.
set noautoindent " 자동 들여쓰기를 하지 않게 한다.
set smartindent " 스마트하게 들여쓰기
set cindent " C 들여쓰기
set showmatch " 닫는 괄호를 입력시 짝이 되는 괄호를 강조해서 알려준다.
set history=10000 " vi 명령어에 대한 기억을 10000개까지 한다.
set backspace=indent,eol,start " 줄의 끝, 시작, 들여쓰기에서 백스페이스시 이전 줄로 이동한다.
set ruler " 오른쪽 아래에 위치를 좌표로 표시하는 옵션
set tabstop=2 " tab 간격 2칸
set shiftwidth=2 " 들여쓰기 간격 2칸
set hlsearch " 검색어 강조
set nowrapscan " 검색할 때 끝까지 검색하면 다시 처음으로 가지 않는다.
set ignorecase " 검색할 때 대소문자 무시
color codeschool " 편집기 화면의 색상을 설정
if has("autocmd")
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
endif
: CentOS에서는 저장 후에 수정하기 전에 위치로 움직이는 설정이 /etc/vimrc 파일에 위와 같이 들어가 있다. 다른 운영체제를 사용할 때는 ~/.vimrc에 직접 써주도록 하자.
-끝.
'C, Python, and Linux' 카테고리의 다른 글
vim color scheme 설정하기 (0) | 2020.08.30 |
---|---|
[C] Power-law distribution (1) - Normalization (0) | 2020.08.07 |
[Linux] tar - 파일 묶기, 압축, 풀기 (0) | 2020.08.07 |
[Linux] ssh 공개키 서버에 등록하기 (0) | 2020.08.01 |
[Linux] alias 설정하기 (0) | 2020.01.27 |