Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for VsCode Vim extension #6687

Merged
merged 1 commit into from
Dec 11, 2019
Merged

Fixes for VsCode Vim extension #6687

merged 1 commit into from
Dec 11, 2019

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Dec 4, 2019

Several fixes and adaptations that allow to use VsCode Vim extension

What it does

  • Do not throw an error if no active handler has been found during command execution.
  • Add monaco trigger transit command.
  • Register built-in VsCode command: default:type.

How to test

Apply VsCode Vim extension

Available commands:

Key Action Followed by
a enter insertion mode after current character text, ESC
b back word
c change command cursor motion command
d delete command cursor motion command
e end of word
f find character after cursor in current line character to find
h move left one character
i enter insertion mode before current character text, ESC
j move down one line
k move up one line
l move right one character
m mark current line and position mark character tag (a-z)
n repeat last search
o open line below and enter insertion mode text, ESC
p put buffer after cursor
r replace single character at cursor replacement character expected
s substitute single character with new text text, ESC
t same as "f" but cursor moves to just before found character character to find
u undo
w move foreward one word
x delete single character
y yank command cursor motion command
z position current line CR = top; "." = center; "-"=bottom
A enter insertion mode after end of line text, ESC
B move back one Word
C change to end of line text, ESC
D delete to end of line
E move to end of Word
F backwards version of "f" character to find
G goto line number prefixed, or goto end if none
H home cursor - goto first line on screen (requires vscode cursorMove built-in command)
I enter insertion mode before first non-whitespace character text, ESC
J join current line with next line
L goto last line on screen (requires vscode cursorMove built-in command)
M goto middle line on screen (requires vscode cursorMove built-in command)
N repeat last search, but in opposite direction of original search
O open line above and enter insertion mode text, ESC
P put buffer before cursor
Q leave visual mode (go into "ex" mode)
R replace mode - replaces through end of current line, then inserts text, ESC
S substitute entire line - deletes line, enters insertion mode text, ESC (requires vscode editor.action.reindentselectedlines built-in command)
T backwards version of "t" character to find
U restores line to state when cursor was moved into it
W foreward Word
X delete backwards single character
Y yank entire line
Z first half of quick save-and-exit "Z"
0 move to column zero
1-9 numeric precursor to other commands [additional numbers (0-9)] command
  (SPACE) move right one character
$ move to end of line
% match nearest [],(),{} on line, to its match (same line or others)
^ move to first non-whitespace character of line
& repeat last ex substitution (":s ...") not including modifiers
( move to previous sentence
) move to next sentence
| move to column zero
- move to first non-whitespace of previous line
_ similar to "^" but uses numeric prefix oddly
+ move to first non-whitespace of next line
[ move to previous "{...}" section "["
] move to next "{...}" section "]"
{ move to previous blank-line separated section "{"
} move to next blank-line separated section "}"
; repeat last "f", "F", "t", or "T" command
' move to marked line, first non-whitespace character tag (a-z)
` move to marked line, memorized column character tag (a-z)
: ex-submode ex command
" access numbered buffer; load or access lettered buffer 1-9,a-z
~ reverse case of current character and move cursor forward
, reverse direction of last "f", "F", "t", or "T" command
. repeat last text-changing command
/ search forward search string, ESC or CR
< unindent command cursor motion command
> indent command cursor motion command
? search backward search string, ESC or CR

Review checklist

Reminder for reviewers

@vinokurig vinokurig added keybindings issues related to keybindings vscode issues related to VSCode compatibility labels Dec 4, 2019
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vim extension works without errors for me, thank you! @vinokurig

It feels slower than usual typing. Probably because of client-server turnaround for each character or maybe it is the same in VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keybindings issues related to keybindings vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants