Vim 환경설정 세팅하기

1 분 소요

Vim 환경설정 세팅하기

Vim 와 사용법은 비슷하지만 더 향상된 Neovim 을 사용하고 있습니다.

# Neovim install
brew install nvim

❗️현재 설치 후 실행하면 에러가 발생하여 Vim 설정하여 사용.

Neovim 환경설정

파일을 더 편하고 많은 정보를 표현할 수 있도록 환경설정을 수정합니다.

환경설정 경로

  • Neovim: ~/.config/nvim

  • Vim: ~/.vimrc

아래 Vim 환경설정 내용을 환경설정 파일에 입력하고 저장하면 된다.

set nocompatible           " Use Vim defaults (much better!)
set bs=indent,eol,start    " allow backspacing over everything in insert mode.
set autowrite              " write the contents of the file, if it has been modifired, on each and command.
set autoread               " automatically read it again.
set laststatus=2           " the value of this option influences when the last windows will have a status line.
set ruler                  " show the line and column number of the cursor position, separated by a comma.
set cindent                " enables automatic C program indenting. C 언어 스타일의 들여쓰기를 사용합니다.
set autoindent             " always set autoindenting on. 자동 들여쓰기를 사용합니다.
set smartindent            " do smart autoindenting when starting a new line.
set showcmd                " show (partial) command in the last line of the screen
set showmatch              " when a bracket is inserted, briefly jump to the matching one.
set number                 " print the line number in front of each line. 화면에 행 번호를 표시합니다.
set tabstop=4              " number of spaces that a <Tab> in the file counts for.
set shiftwidth=4           " numver of spaces to use for each of (auto)indent.
set softtabstop=4          " number of spaces that a <Tab> counts for while performing editing operations, like inseting a <Tab> or using <BS>.
set expandtab              " use the appropriate number of spaces to insert a <Tab>.

syntax enable
syntax on
let python_highlight_all=1
filetype indent plugin on

" ----- Color Setting -----
colorscheme elflord

" ----- Macro Setting -----
map <F1> :x!<cr>
map <F2> :up<cr>
map <F3> :q!<cr>
map <F4> :up<cr>:!python3 %<cr>
map <F5> :up<cr>:!gcc -Wall -W -O2 %<cr>:!./a.out<cr>
" -Wall: 모든 경고 메시지 출력
" -W: Wall에서 제외된 16가지의 경고를 출력
" -O2: 최적화 수행
map <F6> :NERDTreeToggle<cr>

카테고리:

업데이트:

댓글남기기