Skip to content

Instantly share code, notes, and snippets.

@burke
Last active June 7, 2019 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burke/b9d71077512fa568d60343e06ea3bfca to your computer and use it in GitHub Desktop.
Save burke/b9d71077512fa568d60343e06ea3bfca to your computer and use it in GitHub Desktop.

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