programing tip

Vim 사용자 여러분, 오른손은 어디에 있습니까?

itbloger 2020. 8. 8. 11:41
반응형

Vim 사용자 여러분, 오른손은 어디에 있습니까? [닫은]


오랫동안 vim 사용자 여러분, 손가락을 계속 사용하십니까, jkl;아니면 hjkl일반 모드입니까?

표준 터치 타이핑은 오른손의 홈 위치가 j키에 검지 손가락이 있으므로 손가락이 켜져 있음을 알려줍니다 jkl;.

그러나 표준 vim 모션 키는 hjkl.

나는 10 년 이상 지나서 vim으로 돌아오고 (omg, 내가주의를 기울이지 않았을 때 나이가 들었다)hjkl ...에 끌리는 나 자신을 발견한다 . 그러나 그것은 오른쪽 위 문자, 중괄호 등을 입력하는 것을 더 어렵게 만든다. 나중에 다시 훈련하는 대신 지금 가장 효율적이고 실용적인 방법을 사용하도록 스스로 훈련하고 싶습니다.

오랫동안 하드 코어 Vim 사용자에게 가장 좋은 방법은 무엇입니까?


노트 :

  1. 와 더 큰 중첩 터치 타이피스트가 VI에서 탐색 방법은?
  2. 나는 이것이 단순히 사람들의 선호도가 아니라 무의식적 인 모범 사례를 고의적으로 배양하는 것이기 때문에 "주관적"테스트를 통과한다고 생각합니다.

나는 그것이 jkl;실제로 vi에 대한 더 적절한 사용법 이라고 생각합니다 . 하나, h그리고 l정말 많은 문제가되지 않습니다. w, e,와 b크게 수평 탐색을위한 더 유용합니다. 보너스 ;로 언어에 필요한 경우 쉽게 얻을 수 있습니다. k상처 부위에 손가락이 약하고 , 네 손가락 중 가장 많이 사용되는에 h있어야 할 때 가장 강한 손가락이 필요하지 않습니다 j.


소개

이전 두 가지 솔루션 중 어느 것도 100 % 만족스럽지 않았습니다. 나는 두 세계의 장점을 결합한 세 번째 방법을 제안합니다.

내 추천 : "왼쪽 위 아래로"

그들이있는 곳에서 위 / 아래를 유지 한 다음 세 번째 및 네 번째 손가락을 왼쪽오른쪽으로 만듭니다.

그런 다음 기본 Vim 기능을 덮어 쓰지 않으려면 다음과 같이하십시오 . 이제 비어있는 h 버튼으로

귀여운 보너스로 " l "키는 이제 " 왼쪽 "을 의미합니다 .)

noremap lh
noremap; l
noremap h;



둘 다 "left-down-up-right"레이아웃을 사용하는 이전 "주자" :


선택 1 : "hjkl"

@alternative의 추천 . 바인드는 기본값 으로 유지 ( hjkl ), 오른손 은 홈 행에 유지 ( jkl; )

  • 장점 :
    • j (아래쪽)k (위쪽)는 기본 두 손가락에 머물러 있습니다.
  • 단점 :
    • h (왼쪽) 에 도달해야합니다 . w, e, b 만큼 사용되지 않더라도 여전히 피투성이의 화살표 버튼이며 홈 행에 있으면 좋을 것입니다.
    • 기본적으로 : 네 손가락 모두 자연스럽게 화살표 버튼 위에 놓이지 않습니다. 손이 헷갈리네요


선택 2 : "jkl;"

4 개의 바인드 를 1 번 위로 밀어서 홈 행에 앉도록합니다.

noremap; l
noremap lk
noremap kj
noremap jh

  • 장점 :
    • No finger confusion; all the arrows are under the fingers naturally
  • cons:
    • As @alternative said, up/down being on the 2nd and 3rd finger is very "non-optimal"
    • Similarly, the strongest finger being on left is also a waste

I keep my hands on the home row, in the normal touch-typist manner. Rarely do I use the h key for movement, as moving one space to the left is not usually an efficient way to move (and does not really fit the essence of Vim).


I understand, that hjkl is used for historic reasons (i.e. Here is why vim uses the hjkl keys as arrow keys) and it is not based on any ergonomic rationale.

I personally prefer to follow the approach recommended by i3 window manager which as explained in the FAQ on Why does the default config use jkl; instead of hjkl? is an ergonomic choice.

i3 uses jkl; because these keys make up the "home row" underneath your right hand when touch typing.

Check this on vim remapping the hjkl to jkl;


While I understand Vim's philosophy of having all the movement available in the home row, I found hjkl to be counter intuitive. A much more saner map I thought would be a wasd-like setup with ijkl

    nnoremap j h
    nnoremap k j
    nnoremap i k

I found this to be very easy to navigate with very natrually.

j:left
i:up
k:down
l:right

For toggling in/out of insert/normal mode, I personally use Alt-e since I almost always use Gvim and not have to worry that some terminals have issues with Alt.

    nnoremap <A-e> i
    inoremap <A-e> <esc>l

참고URL : https://stackoverflow.com/questions/6698521/vim-users-where-do-you-rest-your-right-hand

반응형