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

Commands List #1

Open
aioutecism opened this issue Dec 19, 2015 · 25 comments
Open

Commands List #1

aioutecism opened this issue Dec 19, 2015 · 25 comments

Comments

@aioutecism
Copy link
Owner

aioutecism commented Dec 19, 2015

Selected from quickref of neovim.

N is used to indicate an optional count that can be given before the command.

Left-right motions

Status Keys Description
Done N h left (also: <BS>, or <Left> key)
Done N l right (also: <Space> or <Right> key)
Done 0 to first character in the line (also: <Home> key)
Done ^ to first non-blank character in the line
Partial N $ to the last character in the line (N-1 lines lower) (also: <End> key)
Done g0 to first character in screen line (differs from "0" when lines wrap)
Done g^ to first non-blank character in screen line (differs from "^" when lines wrap)
Partial N g$ to last character in screen line (differs from "$" when lines wrap)
Done gm to middle of the screen line
N
Done N f{char} to the Nth occurrence of {char} to the right
Done N F{char} to the Nth occurrence of {char} to the left
Done N t{char} till before the Nth occurrence of {char} to the right
Done N T{char} till before the Nth occurrence of {char} to the left
Done N ; repeat the last "f", "F", "t", or "T" N times
Done N , repeat the last "f", "F", "t", or "T" N times in opposite direction

Up-down motions

Status Keys Description
Done N k up N lines (also: <Up>)
Done N j down N lines (also: <Down>)
Done N - up N lines, on the first non-blank character
Done (except alternatives) N + down N lines, on the first non-blank character (also: <CR>)
Done N _ down N-1 lines, on the first non-blank character
Done N G goto line N (default: last line), on the first non-blank character
Done N gg goto line N (default: first line), on the first non-blank character
Done N % goto line N percentage down in the file; N must be given, otherwise it is the
Done N gk up N screen lines (differs from "k" when line wraps)
Done N gj down N screen lines (differs from "j" when line wraps)

Text object motions

Status Keys Description
Done N w N words forward
Done N W N blank-separated
Done N e forward to the end of the Nth word
Done N E forward to the end of the Nth blank-separated
Done N b N words backward
Done N B N blank-separated
N ge backward to the end of the Nth word
N gE backward to the end of the Nth blank-separated
N ) N sentences forward
N ( N sentences backward
Done N } N paragraphs forward
Done N { N paragraphs backward
N ]] N sections forward, at start of section
N [[ N sections backward, at start of section
N ][ N sections forward, at end of section
N [] N sections backward, at end of section
N [( N times back to unclosed '('
N [{ N times back to unclosed '{'
N [m N times back to start of method (for Java)
N [M N times back to end of method (for Java)
N ]) N times forward to unclosed ')'
N ]} N times forward to unclosed '}'
N ]m N times forward to start of method (for Java)
N ]M N times forward to end of method (for Java)
N [# N times back to unclosed "#if" or "#else"
N ]# N times forward to unclosed "#else" or "#endif"
N [* N times back to start of comment "/*"
N ]* N times forward to end of comment "*/"

Pattern searches

Status Keys Description
Partial N n repeat last search
Partial N N repeat last search, in opposite direction
Partial N * search forward for the identifier under the cursor
Partial N # search backward for the identifier under the cursor
N g* like "*", but also find partial matches
N g# like "#", but also find partial matches
Partial gd goto local declaration of identifier under the cursor
Partial gD goto global declaration of identifier under the cursor
Done / focus find widget

Marks and motions

Status Keys Description
m{a-zA-Z} mark current position with mark {a-zA-Z}
`{a-z} go to mark {a-z} within current file
`{A-Z} go to mark {A-Z} in any file
`{0-9} go to the position where Vim was previously exited
`` go to the position before the last jump
`" go to the position when last editing this file
`[ go to the start of the previously operated or put text
`] go to the end of the previously operated or put text
`< go to the start of the (previous) Visual area
`> go to the end of the (previous) Visual area
`. go to the position of the last change in this file
'{a-zA-Z0-9[]'"<>.} same as `, but on the first non-blank in the line
N CTRL-O go to Nth older position in jump list
N CTRL-I go to Nth newer position in jump list

Various motions

Status Keys Description
Partial (Only ([{ now) % find the next brace, bracket, comment, or "#if"/ "#else"/"#endif" in this line and go to its match
N H go to the Nth line in the window, on the first non-blank
M go to the middle line in the window, on the first non-blank
N L go to the Nth line from the bottom, on the first non-blank

Scrolling

Status Keys Description
N CTRL-E window N lines downwards (default: 1)
N CTRL-D window N lines Downwards (default: 1/2 window)
Partial N CTRL-F window N pages Forwards (downwards)
N CTRL-Y window N lines upwards (default: 1)
N CTRL-U window N lines Upwards (default: 1/2 window)
Partial N CTRL-B window N pages Backwards (upwards)
Partial z<CR> or zt redraw, current line at top of window
Done z. or zz redraw, current line at center of window
z- or zb redraw, current line at bottom of window
These only work when 'wrap' is off:
N zh scroll screen N characters to the right
N zl scroll screen N characters to the left
N zH scroll screen half a screenwidth to the right
N zL scroll screen half a screenwidth to the left

Inserting text

Status Keys Description
Partial N a append text after the cursor (N times)
Partial N A append text at the end of the line (N times)
Partial N i insert text before the cursor (N times) (also: <Insert>)
Partial N I insert text before the first non-blank in the line (N times)
N gI insert text in column 1 (N times)
Partial N o open a new line below the current line, append text (N times)
Partial N O open a new line above the current line, append text (N times)
in Visual mode:
Done I insert the same text in front of all the selected lines
Done A append the same text after all the selected lines

Insert mode keys

Status Keys Description
leaving Insert mode:
Done <Esc> end Insert mode, back to Normal mode
Done CTRL-C like <Esc>, but do not use an abbreviation
moving around:
Done cursor keys move cursor left/right/up/down
shift-left/right one word left/right
shift-up/down one screenful backward/forward
Done <End> cursor after last character in the line
Done <Home> cursor to first character in the line

Special keys in Insert mode

Status Keys Description
CTRL-V {char}.. insert character literally, or enter decimal byte value
Done <CR> begin new line
CTRL-E insert the character from below the cursor
CTRL-Y insert the character from above the cursor
CTRL-A insert previously inserted text
CTRL-@ insert previously inserted text and stop Insert mode
CTRL-R {0-9a-z%#:.-="} insert the contents of a register
CTRL-N insert next match of identifier before the cursor
CTRL-P insert previous match of identifier before the cursor
CTRL-X ... complete the word before the cursor in various ways
Done <BS> delete the character before the cursor
Done <Del> delete the character under the cursor
Done CTRL-W delete word before the cursor
Done CTRL-U delete all entered characters in the current line
CTRL-T insert one shiftwidth of indent in front of the current line
CTRL-D delete one shiftwidth of indent in front of the current line
0 CTRL-D delete all indent in the current line
^ CTRL-D delete all indent in the current line, restore indent in next line

Deleting text

Status Keys Description
Done N x delete N characters under and after the cursor
Partial N <Del> delete N characters under and after the cursor
Done N X delete N characters before the cursor
Done N d{motion} delete the text that is moved over with {motion}
Done {visual}d delete the highlighted text
Done N dd delete N lines
Partial N D delete to the end of the line (and N-1 more lines)
Partial N J join N-1 lines (delete <EOL>s)
Done {visual}J join the highlighted lines
N gJ like "J", but without inserting spaces
{visual}gJ like "{visual}J", but without inserting spaces

Copying and moving text

Status Keys Description
"{char} use register {char} for the next delete, yank, or put
Partial N y{motion} yank the text moved over with {motion} into a register
Done {visual}y yank the highlighted text into a register
Done N yy yank N lines into a register
Partial N Y yank N lines into a register
Done N p put a register after the cursor position (N times)
Done N P put a register before the cursor position (N times)
N ]p like p, but adjust indent to current line
N [p like P, but adjust indent to current line
N gp like p, but leave cursor after the new text
N gP like P, but leave cursor after the new text

Changing text

Status Keys Description
Done N r{char} replace N characters with {char}
N gr{char} replace N characters without affecting layout
Partial N R enter Replace mode (repeat the entered text N times)
N gR enter virtual Replace mode: Like Replace mode but without affecting layout
Done {visual}r{char} in Visual mode: Replace each char of the selected text with {char}
Done {visual}p in Visual mode: Replace selected text with register (also: {visual}P)
(change = delete text and enter Insert mode)
Partial N c{motion} change the text that is moved over with {motion}
Done {visual}c change the highlighted text
Partial N cc change N lines
Partial N S change N lines
Partial N C change to the end of the line (and N-1 more lines)
Partial N s change N characters
Done {visual}c in Visual mode: Change each of the selected text with the entered text
Done {visual}C in Visual mode: Change each of the selected text until end-of-line with the entered text
Done N ~ switch case for N characters and advance cursor
Done {visual}~ switch case for highlighted text
Done {visual}u make highlighted text lowercase
Done {visual}U make highlighted text uppercase
g~{motion} switch case for the text that is moved over with {motion}
gu{motion} make the text that is moved over with {motion} lowercase
gU{motion} make the text that is moved over with {motion} uppercase
{visual}g? perform rot13 encoding on highlighted text
g?{motion} perform rot13 encoding on the text that is moved over with {motion}
N CTRL-A add N to the number at or after the cursor
N CTRL-X subtract N from the number at or after the cursor
N <{motion} move the lines that are moved over with {motion} one shiftwidth left
Partial N << move N lines one shiftwidth left
N >{motion} move the lines that are moved over with {motion} one shiftwidth right
Partial N >> move N lines one shiftwidth right
N gq{motion} format the lines that are moved over with {motion} to 'textwidth' length
Partial N == filter lines through the VSCode's format process
Done ={motion} filter the text that is moved over with {motion} through the VSCode's format process
Done {visual}= filter the highlighted lines through the VSCode's format process

Visual mode

Status Keys Description
Done v start highlighting characters } move cursor and use
Done V start highlighting linewise } operator to affect
o exchange cursor position with start of highlighting
gv start highlighting on previous visual area
Done v highlight characters or stop highlighting
Done V highlight linewise or stop highlighting

Text objects (only in Visual mode or after an operator)

Status Keys Description
Partial N aw Select "a word"
Partial N iw Select "inner word"
Partial N aW Select "a
Partial N iW Select "inner
N as Select "a sentence"
N is Select "inner sentence"
N ap Select "a paragraph"
N ip Select "inner paragraph"
Partial N ab Select "a block" (from "[(" to "])")
Partial N ib Select "inner block" (from "[(" to "])")
Partial N aB Select "a Block" (from "[{" to "]}")
Partial N iB Select "inner Block" (from "[{" to "]}")
Partial N a> Select "a <> block"
Partial N i> Select "inner <> block"
Partial N at Select "a tag block" (from <aaa> to </aaa>)
Partial N it Select "inner tag block" (from <aaa> to </aaa>)
Partial N a' Select "a single quoted string"
Partial N i' Select "inner single quoted string"
Partial N a" Select "a double quoted string"
Partial N i" Select "inner double quoted string"
Partial N a` Select "a backward quoted string"
Partial N i` Select "inner backward quoted string"

Repeating commands

Status Keys Description
Partial N . repeat last change (with count replaced with N)

Undo/Redo commands

Status Keys Description
Partial N u undo last N changes
Partial N CTRL-R redo last N undone changes
U restore last changed line

Folding commands

Status Keys Description
Done zo open one fold under the cursor
Done zc close one fold under the cursor
Done zR open all folds
Done zM close all folds

Various commands

Status Keys Description
CTRL-G show current file name (with path) and cursor position
ga show ascii value of character under cursor in decimal, hex, and octal
g8 for utf-8 encoding: show byte sequence for character under cursor in hex
g CTRL-G show cursor column, line, and character position
<Del> while entering a count: delete last character

Multi-window commands

Status Keys Description
CTRL-W s split window into two parts
CTRL-W ] split window and jump to tag under cursor
CTRL-W f split window and edit file name under the cursor
CTRL-W ^ split window and edit alternate file
CTRL-W n create new empty window
CTRL-W q quit editing and close window
CTRL-W c make buffer hidden and close window
CTRL-W o make current window only one on the screen
CTRL-W p move cursor to previous active window
CTRL-W x exchange current window with next one
Repository owner locked and limited conversation to collaborators Dec 19, 2015
Repository owner unlocked this conversation Jan 1, 2016
@Beatusvir
Copy link

Ngg says partial but I doesn't do anything for me, after first g, command window clears and I end up with a single g in command (reads: g and...)

@aioutecism
Copy link
Owner Author

@Beatusvir

Only gg is supported now.
It will move the cursor to the start of file(which is not quite correct, but people often use it this way).

BTW, can you open a issue next time? It's better to track.

@Beatusvir
Copy link

I apologize, I saw the command mentioned here so I figured it could be something from on my setup, will do next time! Good job by the way! ;)

@aioutecism
Copy link
Owner Author

@Beatusvir 😄

@techniq
Copy link

techniq commented Jan 5, 2016

Very nice work @aioutecism. I'm attempting to move from Atom to VSCode and need my vim bindings :). I too tried the other extensions out there and yours is clearly the best out there. A good bit of my daily muscle memory actions are already present. I do use text objets quite a bit though (ci" and cit mostly when doing web work). Are visual objects on your roadmap?

@aioutecism
Copy link
Owner Author

@techniq
Glad you like it.
Commands listed in this issue are all on the roadmap, including text objects of course!
However, I have to solve some more common "bugs"(TODOs in codes) before getting to new functions.
Contributions are welcomed too!

@aioutecism aioutecism self-assigned this Jan 5, 2016
@techniq
Copy link

techniq commented Jan 5, 2016

Awesome. If i get some time, I'll try to dig in and take a look.

@ramirezd42
Copy link

Great work. Really needing Ctrl+C at the moment, might give it a stab. I'd also like to see Ctrl+[ implemented as well (should be the same as Ctrl+C/Esc http://vim.wikia.com/wiki/Avoid_the_escape_key).

@aioutecism
Copy link
Owner Author

@ramirezd42

Ctrl+c and Ctrl+[ are conflict with copy and outdent on Windows.
I'm considering implement keybinding feature to enable customization.
#9

@aioutecism aioutecism removed their assignment Feb 11, 2016
@xerik25
Copy link

xerik25 commented Feb 11, 2016

Well done, so much better than the other VIM options out there for VSCode. Thanks!

@rafaelrinaldi
Copy link

Just wanted to say thank you for this. I had to use VS Code on my current project and without this plugin it would be a nightmare!

@davnustratbac
Copy link

Hi, Really like the plugin, and VS Code too, spent a long time wishing Vim was an IDE and even longer trying to get it to act like one, All I really wanted was faithful Vim keybinding in a modern editor / IDE
Still very new to VS Code so forgive me if this is a stupid question regarding the Vim plug, are commands like ' :w ' available or should I be getting used to VS Codes defaults to save files ? Regards
D

@aioutecism
Copy link
Owner Author

@davnustratbac
Thank you!
In my opinion, Vim's : leading commands are a step backward comparing to Command Palette. You can get almost everything done by typing your thoughts into Command Palette, which I think is much simpler than Vim (and as fast as Vim if you get used to it).
Besides, commonly used commands such as Save can be done by Cmd+s. It's fewer keys to press and less movement of fingers. And if you don't like the default keybindings, just overwrite them in your settings.

@rbemis
Copy link

rbemis commented Aug 26, 2016

Hmm. Marking doesn't seem to work, e.g. 'ma' (mark a) puts me in append mode. Please advise.

@aioutecism
Copy link
Owner Author

@rbemis Sorry, "marks" is not supported yet. Please wait for the update.

@priort
Copy link

priort commented Mar 23, 2018

Hi there, thanks for this great plugin. I find it much snappier and more bug free then another vim vscode plugin that I was using. There are some commands that I use a lot that are missing for me:
Yank, Delete and Paste to and from registers "[register]
Marks as mentioned above
Recording and replaying keystrokes
Qx - record to x
@x - play from x or [N]@x - replay from x N times.
Are these features on the road map in the near future?
Thanks again, I'm happy to keep using the plugin in the meantime.

@aioutecism
Copy link
Owner Author

@priort
Thanks for your support!

The features are on the road map. But since this is a side project, I can’t say if they will be available in the near future.

Please be patient or submit PRs if you like!

@priort
Copy link

priort commented Mar 25, 2018

Great, thanks a million.

@kroppt
Copy link

kroppt commented Apr 24, 2018

I noticed you did not add visual block mode, CTRL-V while in normal mode. Is this intentional?

@aioutecism
Copy link
Owner Author

@kroppt
It's not intentional.
I haven't got time to refactor the codebases to support Visual Block mode.
Please wait for future updates.

@pertrai1
Copy link

@aioutecism any ideas as to why no ctrl commands are working on macOS? I have a macbook pro and just switched from vim plugin. Not able to get these working is causing me some problems. Let me know if there is any information I can add and/or should I open a new issue?

@aioutecism
Copy link
Owner Author

Hi @pertrai1,

Do you have the amVim.bindCtrlCommands set to false in your setting file?

You can refer the settings here:
https://github.com/aioutecism/amVim-for-VSCode#amvimbindctrlcommands

@pertrai1
Copy link

@aioutecism I have not changed it so I figuring it should be set to true

@aioutecism
Copy link
Owner Author

@pertrai1
Cloud you tell me which ctrl commands are not working? They may be not supported now. If that's the case, cloud you open issues so we can track with the implementation of them in the future?

Currtently these ctrl commands are supported:

  • ctrl+c
  • ctrl+r
  • ctrl+u
  • ctrl+w
  • ctrl+f
  • ctrl+b
  • ctrl+[

@pertrai1
Copy link

@aioutecism perfect, I will open the issue

Repository owner locked and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests