Skip to content

Instantly share code, notes, and snippets.

@burke burke/vscode-vim.md
Last active Jun 7, 2019

Embed
What would you like to do?

r<cr>

Replacing a space with a newline doesn't obey indentation rules:

  def foo(x)
    a = x.each { |e| puts(e) }
                  # ^ put cursor here and press `r<cr>`.

    # Actual result in vscode+vim
    a = x.each { |e|
puts(e) }

    # Expected result from vim:
    a = x.each { |e|
      puts(e) }

ci|

Replacing block args in ruby via ci| doesn't work:

x.each do { |k, v| ... }
          #  ^ cursor here, press `ci|`.

# In vim, we get '{ || ... }' with the cursor on the 2nd pipe in insert mode.
# in VSCode, nothing happens.

yii

yank-inside-indent doesn't copy the trailing newline. (this is also true for yai)

def foo
  bar
end

# cursor on 'bar' and pressing `yii` yanks "  bar\n" in vim, "  bar" in vscode.

Short options

set textwidth works but set tw doesn't.

ci' won't seek forward

import {Stack} from '@shopify/polaris';
^  ci' doesn't work

// but...

import {Stack} from '@shopify/polaris';
                     ^  ci' works

b and B add spaces

foo(bar)
#   ^ csbB with surround.vim: foo{bar}
#   ^ csbB with vscode+vim:   foo{ bar }

Pasting values ending with newline should append lines, not insert

Get " a\n b" into your pastebuffer.

// words
^ cursor here and paste

Vim and vscode+vim:
/  a
  b/ words

Get " a\n b\n" into your pastebuffer.

// words
^ cursor here and paste

Vim
// words
  a
  b

vscode+vim:
/  a
  b
/ words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.