Skip to content
/ metaGo Public
forked from metaseed/metaGo

MetaGo provides fast cursor movement/selection for keyboard focused users in vscode

Notifications You must be signed in to change notification settings

jhigdon/metaGo

 
 

Repository files navigation

Version Installs Ratings

Attention: In V3 we changed MetaJump command names and the command default trigger keys

First of all, Metago is a tool made for myself, it comes from the voice in my heart💖as a programmer.
Metago tries its best to be the coolest😎 keyboard(mouseless) focused navigation tool in vscode.
Metago tries to make your keyboard⌨ to you as meaningful as a kitchen knife to a master chef👩‍🍳.


Metago as an free tool, currently is maintained and developed by me in my spare time🌙⏳, if you think it's useful to you or even indispensable like some of our users, please support me, just buy me a drink☕ would be a great inspiration for me, which means there is someone really like it. 😊

Give me a github⭐




quotes from users:

Wicked fast cursor movement/selection for a focus on keyboard usage. This changed how I use VS Code forever. Seriously.

This boosts my performance so much since It’s a trouble for me to use VIM (I’m leftie :( )

probably the best tool for keyboard driven navigation bar none (better than vim), includes bookmarks

MetaGo is a way to move your cursor to a position quickly and without using your mouse/trackpad.

Oh, man.. I have a feeling that after that I'm going to feel crippled without it. This is fantastic.

and MORE from you...

With this new V3 released, we are going to add more features, peek features in dev:

  • hold / to hide jumper decorators on screen.(Done😉)
  • jumper commands for all opened editors, not just the active editor.(Done!)
  • support having fold regions.(V3.2 Done!)
  • ripple jump support to show less decorators on screen. one target-char for current section(seperated by empty lines), two target-chars for current document editor, three or more for all open editors.(V3.5 Done!)
  • improved line-selection extend/shrink command. (V3.6 Done!)
  • command to add multiple cursors, and multiple cursor/selection support for all command in metaGo (V3.6 Done!)
  • command to change active selection in multiple selections (V3.6 Done!)
  • command to select within separator pairs. i.e. '(', ')'; '[',']', '"',''',... (V3.6 Done!)
  • and more... at changelog

if you have andy suggestion just open an issue on github or discuss with us on Gitter☕

Features Summary

MetaGo provides fast cursor movement/selection for keyboard focused users:

MetaGo compatible with the vim plugins.

if you like this tool, and using Windows, you may also be interested in my other tool: metaTool. (release soon) 😉
with metaTool running with it's metaKeyboard plugin, you just using the 61 keys main keyboard area to type any key you want.

i.e. to jump next blank line in the document, currently the default trigger is Alt+End, now you could useLAlt+;, because LAlt+; is expanded to Alt+end

MetaJump

features highlight

  • code characters are based on priority, the character easier to type has higher priority. i.e. 'k','j', and code characters are configurable.
  • code character decorator is encoded with 1 or 2 characters, the code characters around cursor are easier to type.
  • only encode characters on viewable screen area, so metaGo is faster.
  • support having fold regions
  • support jumping to all opened editors
  • work with vim plugin

go to any character on screen

  1. type Alt+/ to tell I want to go somewhere. (Trigger)
  2. type the characters(stands for the target location) on screen, metaGo will show you some decorator codes(candidate target locations) encoded with characters. (you could hold the /(configurable) to hide the location decorators, release to show again)
  3. you could continue type characters following the target location to narrow down the possible targets range, or type the code decoration characters of one location to go to that target location.

at any time press ESC to cancel the command; Backspace to cancel last typed char in target-char-sequence. (Backspace triggers 'step-cancel')

Ripple Support, Less Decorators On Screen: type location-chars to encode locations far from center(cursor location):

  1. one target-char for current section(separated by empty lines);
  2. two target-chars for current doc;
  3. three or more target-chars for all opened editors;
  4. for one or two target-chars, one-char-decorators will pass through boundaries(section or document) if possible. (i.e. for one-target-char, one-char-decorators has encoded all possible target locations in the section, then it will continue encodes until all one-char-decorators are used up).
  • the Alt+. shortcut will trigger the metaGo.gotoAfter command, the cursor will be placed after the target character;
  • the Alt+, shortcut will trigger the metaGo.gotoBefore command, the cursor will be placed before the target character;
  • the Alt+/ shortcut will trigger the metaGo.gotoSmart command which intelligently set cursor position after navigation:
    • if the target is at the begin of the word, the cursor will be set before target character, otherwise after it;
    • The 'word' is defined as a group of all alphanumeric or punctuation characters.

Note: Enter is also usable as location character, it means the end of line. You could press Enter any times to trigger the decorator-encoding for the line-end out side of current section(2 times) or document(3 times). (like a ripple)
commands that only navigate in the active editor are also provided: metaGo.gotoAfterActive, metaGo.gotoBeforeActive, metaGo.gotoSmartActive, you could assign shortcuts by yourself.

➭Feature Summary⮵

select to any character in the active editor

  1. type Alt+Shift+/ to tell I want to select to somewhere.
  2. type the character(stands for location) on screen, metaGo will show you some codes encoded with character.
  3. type the code characters, you will select to that location.
  4. repeat 1-3 to adjust your current selection.

at any time press ESC to cancel, or press Backspace to do step cancel to re-input last typed character

support to do multiple selections,

MetaGo.MetaJump

add multiple cursors to the active editor

  1. Ctrl+Alt+, to add another cursor before the target-character
  2. Ctrl+Alt+. to add another cursor after the target-character
  3. Ctrl+Alt+/ to add another cursor smartly to the target-character

Ctrl+u to cancel last cursor action.

add-multi-cursors demo

we want to modify the three wrongly spelled words, alt+/ to goto the end of one of them, and ctrl+alt+/ two times to add two additional cursors to the end of the other two words, ctrl+backspace to delete them together, esc to escape multi-cursor mode:

MetaGo.MultiCursor

➭Feature Summary⮵

change active selection in multiple selections

the three add-cursor commands would become change-active-selection commands if the target location is inside a selection. It is useful to modify multiple selection ranges, just select one selection as the active one and do extending or shrinking there.

change-active-selection demo

we use alt+shift+/ do selection, then alt+a to alternate selection's active with anchor, then alt+shift+/ to extend selection from another end; then we use ctrl+alt+/ to add another cursor to code above, alt+shift+/ to do selection, then ctrl+alt+/ to make the first selection active, alt+shift+/ to shrink selection there: MetaGo.change-active-selection

➭Feature Summary⮵

metaSelection

alternate Selection's active with anchor

  • Alt+a to alternate the selection's active(cursor flashing) with the anchor.

➭Feature Summary⮵

lines selection

vsCode's default select current line command(Ctrl+l) selects current line and puts the cursor at the next line's start position. we create our own to extend/shrink the selection of the current line:

  • Ctrl+l to select current line if no selection at cursor, or extend/shrink selections by one line below if there is selection before/after the cursor.
  • Ctrl+o to extend/shrink selection by one line above if there is selection after/before the cursor.

extend/shrink selections work at the selection's active end(where cursor flashing), if you want to extend/shrink at the selection's anchor end, use Alt+a to alternate selection's anchor with active at first.

note: Ctrl+o triggers open file by default, and it triggers extend line selection above only when there is selection in active editor.

if you want to select line up, you should press Ctrl+l to select current line and then press Ctrl+o to extend line selection above.

by default selectLineUp command is configured as:

{
    "command": "metaGo.selectLineUp",
    "key": "ctrl+o",
    "when": "editorTextFocus && editorHasSelection"
}

you could assign a shortcut key not collision with default vscode ones, just remove the editorHasSelection condition, so it works even with no selection in editor.

lineSelection demo

we use ctrl+l to select current line, then ctrl+l again to extend current selection below, then ctrl+o to shrink current selection above, then alt+a to alternate the current selection's active end with anchor end, then ctrl+o to extend current selection above, then ctrl+alt+/ to add another cursor, and ctrl+l to select current line, ctrl+l again to extend selection below, then alt+a to alternate selection's active with anchor, then ctrl+o to extend selection above.

With the two selections, you could then delete or copy... MetaGo.LineSelection

➭Feature Summary⮵

surrounding-pair selection

commands to select content inside a pair of separators: '(',')'; '[',']'; '{','}';'<','>'; '>', '<'; or any char pair: '''; '"'... html tag pair is supported via regexp. (alt+p t, t means tag).

  1. Alt+p: I want to select inside a pair of chars.
  2. type the start character of the pair. i.e. '(', '[', '{', '"'...

Note: Alt+Shift+p to selection both the content and the pair of separators.

it supports multiple cursors/selections ➭Feature Summary⮵

surroundPairs config

"metaGo.surroundPairs": {
                    "type": "object",
                    "default":[["{","}"],["(",")"],["[","]"],["<",">"],["/<(?!br)[^\/!]+?>/", "/<\/.+?>/", "t"]]
                },

["/<(?!/)(?!br)[^!]+?>>/", "/<\/.+?>/", "t"]: this array has 3 items: start html tag regex, end html tag regex, trigger key.
the default trigger key is the start pair, if start pair is only one char.
regex is the content inside '/' and '/'
you could config your own regex pairs

<(?!/)(?!br)[^!]+?>:
<(?!/): '<' not followed by '/'. '</' is considered as end tag
(?!br): '<' not followed by 'br'. <br> is special, it is not a start tag.
[^!]+?: one or more char (not greedy before mach '>') which is not '!'(comment html tag)
➭Feature Summary⮵

surrounding-pair-selection demo

we use alt+p ( to select content inside the '(' and ')', then alt+p { to extend selection, then alt+p { to extend further, then alt+shift+p { to include then pair('{'and '}') in the selection, then alt+shift+p to extend the selection further with the pair('{' and '}') included. metago.surrounding-pair-selection

➭Feature Summary⮵

surrounding-pair-selection demo: html tag pairs

we use alt+p t to select content inside html tag, alt+shift+p to select both the content and the tag pairs. if the cursor is in the start or end tag, alt+p t would select both the tag and the content. metago.surrounding-pair-selection-html-tag ➭Feature Summary⮵

navigate between files using bookmarks

  • Alt+ ' to toggle a bookmark at the cursor location.
  • Alt+ [ goto previous bookmark.
  • Alt+ ] goto next bookmark.
  • Alt+\ to list the bookmarks with management menu:
    1. press cc then enter to clear all the bookmarks
    2. press c then enter to clear all the bookmarks in current document.
    3. press n then enter to go to the next bookmark.
    4. press p then enter to go to the previous bookmark.

MetaGo.Center

➭Feature Summary⮵

Other features

scroll the active line to the screen top, middle and bottom

  • Alt+t is the default shortcut to scroll current line to screen top.
  • Alt+m is the default shortcut to scroll current line to screen middle.
  • Alt+b is the default shortcut to scroll current line to screen bottom.

MetaGo.Center

move/select up/down between blank lines

  • Alt+Home to move cursor to the blank line above.
  • Alt+End to move cursor to the blank line below.
  • Alt+Shift+Home to select from the cursor to the blank line above.
  • Alt+Shift+End to select from the cursor to the blank line below. MetaGo.blankLine

➭Feature Summary⮵

jump to bracket

default command always put cursor before the bracket, we want it after start bracket and before end bracket.

default command always search down for the end bracket if the cursor is not at bracket, we want it search up.

  • ctrl+shift+\: jump to the begin bracket that contains the cursor. Press the shortcut again jump to the end bracket.

➭Feature Summary⮵

to invoke command from command panel

it's very easy to trigger metago command: type F1, xx.... xx` is a prefix for search metago commands

➭Feature Summary⮵

Other resources that help you understand MetaGo

Use MetaGo to Quickly Move Around Your Code in VS Code

➭Feature Summary⮵

Default Shortcut Settings

To configure the keybinding, press ctrl+k ctrl+s, or via menu: File -> Preferences -> Keyboard Shortcuts:

default shortcuts refer: keybindings section in package.json

➭Feature Summary⮵

Extension Settings

To modify the settings, press ctrl+,, and search metago...

default setting refer: configuration section in package.json

➭Feature Summary⮵

Credits

Contributors:

Thank you to all the people who have already contributed to MetaGo!🤞

➭Feature Summary⮵

About

MetaGo provides fast cursor movement/selection for keyboard focused users in vscode

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 79.5%
  • CSS 12.5%
  • HTML 4.5%
  • JavaScript 3.5%