Nice programing

SublimeText 3에서 키보드로 열 / 수직 선택

nicepro 2020. 11. 19. 22:02
반응형

SublimeText 3에서 키보드로 열 / 수직 선택


저는 Mac을 사용하고 있습니다. Sublime Text 3에는 각각 300 줄씩 7 개의 열이 있습니다. 가능하면 단일 키보드 단축키를 사용하여 네 번째 열만 선택하고 싶습니다.

부적절한 옵션

  • ctrl+ shift+up/down
  • alt+ mouse+drag
  • ctrl+ alt+ up/down. (이것은 실제로 아무것도 수행하지 않으며 내 콘솔 세션에 표시되지 않으며 단일 키보드 단축키도 아닙니다.)
  • 또한 VI / VIM 모드는 내 워크 플로의 일반적인 부분이 아니므로이를 위해 사용하지 않는 것이 좋습니다.

내가 시도한 것 :

  • 매크로 : 그러나 충분히 구체적이지 않습니다.
  • 사용 command및 '페이지 아래로' ctrl및 'shift': 운이 없습니다.
  • SublimeText 3 Column-Select 플러그인 : 나를 위해 작동하지 않는 것 같습니다.

내 이상적인 해결책은 커서를 열의 아무 곳에 나 놓고 바로 가기 (예 : ctrl-alt-shift-a)를 눌러 전체 열을 선택하는 것입니다.

다음은 그 예입니다.

존 샐리 벤슨 머라이어 패트릭 사만다 마틴

사이먼 케이트 캐리들로 레스 조슈아 사무엘 엘리자

한 번의 키 입력으로 Maria와 Delores로 열을 선택하고 싶습니다. 이 작업은 여러 가지 이유로 (잘라 내기 / 붙여 넣기, 대소 문자 변경, 추가, 따옴표 추가, 매크로 실행 등) 자주 수행하므로 빠르고 반복 가능한 작업을 원합니다.

어떻게해야합니까?


Sublime Column Selection 이 표시되어야합니다 .

마우스 사용

각 플랫폼에서 다른 마우스 버튼이 사용됩니다.

OS X

  • 왼쪽 마우스 버튼 +
  • 또는 : 마우스 가운데 버튼

  • 선택에 추가 :

  • 선택에서 빼기 : +

윈도우

  • 오른쪽 마우스 버튼 +Shift
  • 또는 : 마우스 가운데 버튼

  • 선택에 추가 : Ctrl

  • 선택에서 빼기 : Alt

리눅스

  • 오른쪽 마우스 버튼 +Shift

  • 선택에 추가 : Ctrl

  • 선택에서 빼기 : Alt

키보드 사용

OS X

  • Ctrl+ Shift+
  • Ctrl+ Shift+

윈도우

  • Ctrl+ Alt+
  • Ctrl+ Alt+

리눅스

  • Ctrl+ Alt+
  • Ctrl+ Alt+

Mac 용 숭고한 문서화 된 단축키가 작동하지 않는 이유는 Mission Control, Application Windows 등과 같은 다른 Mac 기능의 단축키에 연결되어 있기 때문입니다. 해결책 : 시스템 환경 설정-> 키보드-> 단축키로 이동 한 다음 선택을 취소합니다. Mission Control 및 Application Windows에 대한 옵션. 이제 필요한 텍스트를 선택하기 위해 "Control + Shift [+ 화살표 키]"를 시도한 다음 마우스 클릭없이 원하는 위치로 커서를 이동하여 필요한 위치에 올바른 들여 쓰기로 선택 항목을 붙여 넣을 수 있습니다.


제 경우에는 (Linux) alt+ shift up/down

 { "keys": ["alt+shift+up"], "command": "select_lines", "args": {"forward": false} },
 { "keys": ["alt+shift+down"], "command": "select_lines", "args": {"forward": true} },    

The SublimeText 3 Column-Select plugin should be all you need. Install that, then make sure you have something like the following in your 'Default (OSX).sublime-keymap' file:

    // Column mode
    { "keys": ["ctrl+alt+up"], "command": "column_select", "args": {"by": "lines", "forward": false}},
    { "keys": ["ctrl+alt+down"], "command": "column_select", "args": {"by": "lines", "forward": true}},
    { "keys": ["ctrl+alt+pageup"], "command": "column_select", "args": {"by": "pages", "forward": false}},
    { "keys": ["ctrl+alt+pagedown"], "command": "column_select", "args": {"by": "pages", "forward": true}},
    { "keys": ["ctrl+alt+home"], "command": "column_select", "args": {"by": "all", "forward": false}},
    { "keys": ["ctrl+alt+end"], "command": "column_select", "args": {"by": "all", "forward": true}}

What exactly about it did not work for you?


Alright, here's the best solution I've found that meets all the requirements:

  1. Download the Sublime-Text-Advanced-CSV Sublime plugin and install.
  2. Specify a delimiter for your column (default is ","), via the "CSV: Set Delimiter" command.
  3. Hit "ctrl + , s" (or select from Command Palette) and your column will be selected.

No need for mouse interaction whatsoever.


Commenting just so people can have a solution to the intended question.

You can do what you are wanting but it isn't quite as nice as Notepad++ but it may work for small solutions decently enough.

In sublime if you hold ctrl, or mac equiv., and select the word/characters you want on a single line with the mouse and still holding ctrl go to another line and select the word/characters you want on that line it will be additive and you will build your selection. I mainly use notepadd++ as my extractor and data cleanup and sublime for actual development.

The other way is if your columns are in perfect alignment you can simply middle click on windows or option + click on mac and this enables you to select text in a square like fashion, Columns, inside the lines of text.


For macOS, you don't need install any plugin or mouse. just do like this : ctrl+shift +down


I know notepad++ has a feature that lets you select blocks of text independent of line/column by holding control + alt + drag. So you can select just about any block of text you want.

참고URL : https://stackoverflow.com/questions/25085479/column-vertical-selection-with-keyboard-in-sublimetext-3

반응형