티스토리 뷰

Development

[Editor] Vim 익숙해지기

juniz 2020. 12. 26. 17:53
반응형

여태까지 vscode 로만 개발을 해왔으며, 

가끔 pycharm, nano editor를 사용해보기도 했지만

가장 좋아하는 유튜버 분들이 vim 을 너무 강력 추천하시기도 했고

전부터 한번 배워보고 싶은 마음이 있어 쓰는 글입니다. 

 

learning curvce 가 상대적으로 높다는 말을 많이 들었지만

그래도 개발자라면(?) 해본다라는 마음으로 하고 있습니다...

 

nano editor에서 가장 현타가 오는 순간은 

ctrl+w 로 단어를 찾으려고 찾는 순간 윈도우에선 terminal 꺼지는 순간입니다..

key mapping 을 바꿔서 사용하고 있지만 그것도 뭔가 불편해서 

vim 으로 공부중입니다. 

 

기본 모드 

  • 커맨드
    • esc : 커맨드 모드
  • 입력
    • i : insert 모드
      • shift + i : Start of line
    • a : append after word
    • shift + a : append at the end of line
    • o : 아래줄부터 insert 모드
  • 비주얼 
    • v : 알파펫 하나 visual
    • shift + v : 한줄 visual

기본 커맨드

  • 이동 :  h j k l
  • 단어 이동 :
    • w : 앞 단어(word) 이동
    • b : 뒷 단어(back) 이동
  • 종료  
    • :q! : quit (force)
    • :wq : save and quit
  • 라인 복사 / 붙여넣기 / 삭제
    • yy : 라인 복사(yank)
    • p : 붙여넣기 (paste)
    • dd : 한 줄 삭제(delete)
  • 되돌리기 / 다시하기
    • u : 되돌리기(undo) 
    • ctrl + r : 다시 하기 (redo)
  • 비주얼모드 : v or shift + v

vimrc 세팅

 

vim ~/.vimrc

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=1000

" Set to auto read when a file is changed from the outside
set autoread

" Set to auto write on opening an other file.

set autowrite

" Use mouse or not
set mouse=a

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Always show current position
set ruler

" Highlight search results
set hlsearch

" Makes search act like search in modern browsers
set incsearch

" Show matching brackets when text indicator is over them
set showmatch

" line number
" 라인넘버 표시하기
set number

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" syntax highlight
syntax on

" color scheme
colorscheme desert
set background=dark

" Set utf8 as standard encoding
set encoding=utf8

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" auto indent's tab size
set shiftwidth=4

" 1 tab == 4 spaces
set tabstop=4

" c style auto indent
set cindent

" #if has to be first on the line
set smartindent

 

 

참고하고 있는 유튜버 : Theprimagen

 

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함
반응형