본문 바로가기

Linux

vi 키맵핑 차이점

Vim: What is the difference between the remap, noremap, nnoremap and vnoremap mapping commands?

remap is an option that makes mappings work recursively. By default it is on and I'd recommend you leave it that way. The rest are mapping commands, described below:

:map and :noremap are recursive and non-recursive versions of the various mapping commands. What that means is that if you do:

:map j gg
:map Q j
:noremap W j

j will be mapped to ggQ will also be mapped to gg, because j will be expanded for the recursive mapping. W will be mapped to j (and not to gg) because j will not be expanded for the non-recursive mapping.

Now remember that Vim is a modal editor. It has a normal mode, visual mode and other modes.

For each of these sets of mappings, there is a mapping that works in all modes (:map and:noremap), one that works in normal mode (:nmap and :nnoremap), one in visual mode (:vmap and :vnoremap) and so on.

For more guidance on this, see:

:help :map
:help :noremap
:help recursive_mapping
:help :map-modes

'Linux' 카테고리의 다른 글

nohup을 대체 하는 screen  (0) 2012.04.30
tar, gzip, split  (0) 2012.04.04
리눅스 캐쉬 메모리 정리  (0) 2012.03.21
Ubuntu 에 SunJDK(java-6-sun) 설치  (0) 2012.03.02
우분투 putty에서 연결시 한글 입력이 안될때  (0) 2012.02.29