이 페이지에서

FakeVim 모드 및 명령어

FakeVim 모드에서는 메인 에디터에서 입력되는 대부분의 키 입력이 가로채어 Vim과 유사한 방식으로 해석됩니다. 지원되는 대부분의 명령어는 이동 명령어를 뒤따르게 하거나 비주얼 모드에서 실행할 수 있으며, 레지스터와 연동되거나 반복 횟수를 접두사로 지정하여 사용할 수 있습니다.

다음 섹션에서는 지원되는 모드에서 에뮬레이트되는 명령어와 그 기능이 Vim과 어떻게 다른지 설명합니다:

  • 일반
  • 비주얼
  • 명령줄 (:)
  • 삽입 및 교체

Vim 사용에 대한 자세한 내용은 Vim 웹사이트의 Vim 문서를 참조하십시오.

일반 모드 및 시각 모드

  • h/j/k/l, <C-U>, <C-D>, <C-F>, <C-B>, gg, G, 0, ^, $
  • 단어 이동, 예를 들어 w, e, b
  • ciw, 3daw, ya{
  • ft 이동
  • [ and \c ] 이동
  • { 및 } 단락 이동
  • 레지스터를 사용한 삭제/변경/복사/붙여넣기
  • 실행 취소 및 다시 실행
  • <C-A> <C-X> 를 사용하여 십진수, 8진수 또는 16진수 형식의 숫자를 증가 또는 감소시킵니다(예: 를 에서 실행하면 로 변경됩니다). 128<C-A> "0x0ff" "0x17f"
  • . 마지막 변경 내용을 반복합니다
  • /search, ?search, *, #, n, N - Vim에서는 대부분의 정규식 구문이 사용되지만, \<\> 는 QRegExp의 \b 와 동일합니다
  • @ 또한 q (매크로 기록 및 실행) 특수 키는 다음과 같이 저장됩니다. <S-Left>
  • 마크
  • gv 는 마지막 비주얼 선택 영역으로 이동합니다; 주변 텍스트가 편집된 경우 결과가 다를 수 있습니다
  • =, <<, >> 을 사용한 들여쓰기. 이동, 횟수 및 시각 모드에서 사용 가능
  • 위/아래로 이동: ~, gU, gu
  • i, a, o, I, A, O 삽입 모드 진입
  • zt, zb 등과 같은 창 스크롤, zz
  • gj, gk, g0, g^ 등과 같은 줄 감싸기 이동, g$

명령줄 모드

  • :map, :unmap, :inoremap
  • :source 소스 vimrc 파일을 한 줄씩
  • :substitute 지정된 범위 내의 표현식을 치환
  • :'<,'>!cmd 외부 명령을 통해 필터링(예: :%!sort 를 사용하여 파일의 줄을 정렬)
  • :<range>sor[t][!]
  • :.!cmd 외부 명령어의 표준 출력을 삽입합니다
  • :read
  • :yank, :delete, :change
  • :move, :join
  • :20 특정 주소로 이동
  • :history
  • :registers, :display
  • :nohlsearch
  • :undo, :redo
  • :normal
  • :<, :>
  • set formatoptions=, Vim 문서의 ‘ :h fo-table ’ 항목을 참조하십시오. 현재 지원되는 문자: fo-j

삽입 모드

  • <C-O> 단일 명령을 실행하고 삽입 모드로 돌아갑니다
  • <C-V> 원시 문자를 삽입합니다
  • <insert> 교체 모드를 전환합니다

옵션

:set ... 를 사용하여 다음 표에 나열된 옵션을 설정할 수 있습니다:

전체 이름짧은 이름인수
autoindentai
backspacebsindent, eol, start
blinkingcursorbc
clipboardcb
expandtabet
hlsearchhls
ignorecaseic
incsearchis
iskeywordisk다음 문자들의 조합: @, 48-57, _, 192-255, a-z, A-Z
relativenumberrnu
scrolloffso
shiftwidthsw
showcmdsc
smartcasescs
smartindentsi
smarttabsta
startoflinesol
tabstopts
tildeoptop
usecoresearchucs
wrapscanws

Vimrc 예시

" highlight matched
set hlsearch
" case insensitive search
set ignorecase
set smartcase
" search while typing
set incsearch
" wrap-around when searching
set wrapscan
" show pressed keys in lower right corner
set showcmd
" tab -> spaces
set expandtab
set tabstop=4
set shiftwidth=4
" keep a 5 line buffer for the cursor from top/bottom of window
set scrolloff=5
" X11 clipboard
set clipboard=unnamed
" use ~ with movement
set tildeop

" mappings
nnoremap ; :
inoremap jj <Esc>

" clear highlighted search term on space
noremap <silent> <Space> :nohls<CR>

" reselect visual block after indent
vnoremap < <gv
vnoremap > >gv

" MOVE LINE/BLOCK
nnoremap <C-S-J> :m+<CR>==
nnoremap <C-S-K> :m-2<CR>==
inoremap <C-S-J> <Esc>:m+<CR>==gi
inoremap <C-S-K> <Esc>:m-2<CR>==gi
vnoremap <C-S-J> :m'>+<CR>gv=gv
vnoremap <C-S-K> :m-2<CR>gv=gv

Vim과 같은 편집 방식FakeVim항목도 참조하십시오 .

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.