vim으로 탭하기

vim으로 탭하기

나는 원래 우분투에 별도의 사이트가 있다는 것을 깨닫기 전에 이것을 유닉스 echange에 게시하는 실수를 저질렀습니다.

나는 선택한 텍스트 편집기로 vim과 함께 Ubuntu를 사용하고 있습니다. 어떤 사람들은 vim을 사용하여 한 탭에서 다음 탭으로 전환하는 바로가기를 설정한다는 것을 알고 있습니다. 기본값은 gt 및 g T이지만 이는 어색하고 자연스럽지 않습니다. f5를 사용하면 왼쪽 탭으로 전환하고 f8을 사용하면 오른쪽 탭으로 전환할 수 있도록 별칭을 설정하고 싶습니다. 이 결과를 얻기 위해 vimrc 페이지를 변경하는 방법을 잘 모르겠습니다. 감사합니다!

답변1

키 매핑의 일반적인 구문은 다음과 같습니다.

{cmd} {attr} {lhs} {rhs}

where
{cmd}  is one of ':map', ':map!', ':nmap', ':vmap', ':imap',
       ':cmap', ':smap', ':xmap', ':omap', ':lmap', etc.
{attr} is optional and one or more of the following: <buffer>, <silent>,
       <expr> <script>, <unique> and <special>.
       More than one attribute can be specified to a map.
{lhs}  left hand side, is a sequence of one or more keys that you will use
       in your new shortcut.
{rhs}  right hand side, is the sequence of keys that the {lhs} shortcut keys
       will execute when entered.

따라서 다음 코드를.vimrc

nnoremap <F5> gt
nnoremap <F8> gT

다른 곳에서 사용할 수 있는 자세한 튜토리얼이 있습니다. 다음을 참조하세요.

  1. http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-지도 시간(1 부)
  2. http://www.techrepublic.com/blog/linux-and-open-source/create-custom-keybinds-in-vim/
  3. http://vim.wikia.com/wiki/Using_tab_pages

관련 정보