티스토리 뷰

___리눅스

[리눅스] Vim Editor 설정 및 사용법

변군 변군이글루 2020. 5. 12. 00:16

Vim Editor 설정 및 사용법

.vimrc 파일

cat ~/.vimrc 
" Begin .vimrc
set nowrap                              " don't wrap lines
set tabstop=4                           " a tab is four spaces
set backspace=indent,eol,start          " allow backspacing over everything in insert mode
set autoindent                          " always set autoindenting on
set copyindent                          " copy the previous indentation on autoindenting
set number                              " always show line numbers
set shiftwidth=4                        " number of spaces to use for autoindenting
set shiftround                          " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch                           " set show matching parenthesis
set ignorecase                          " ignore case when searching
set smartcase                           " ignore case if search pattern is all lowercase, case-sensitive otherwise
set smarttab                            " insert tabs on the start of a line according to shiftwidth, not tabstop
set hlsearch                            " highlight search terms
set incsearch                           " show search matches as you type
set history=1000                        " remember more commands and search history
set undolevels=1000                     " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title                               " change the terminal's title
set visualbell                          " don't beep
set noerrorbells                        " don't beep
set nobackup

" --- vim map (macro) commands ---
func! Remarkon()
exe "'<,'>norm i#"
endfunc

func! Remarkoff()
exe "'<,'>norm 2x"
endfunc
" Begin .vimrc

Ctrl + V (VISUAL BLOCK) ;주석 처리할 부분 선택

:'<,'> ;'<,'> 삭제

주석 ON
:call Remarkon()

주석 OFF
:call Remarkoff()

 

원본 URL : www.norux.me/30

참고 URL : www.vimconfig.com

참고 URL : www.tutorialdocs.com/article/vim-configuration.html

댓글
댓글쓰기 폼