Skip to content
Dionysis Zindros edited this page Oct 28, 2018 · 37 revisions

Flash effect not appear on cursor-line, occurrence-marker is not displayed on cursor-line too.

This is because of issue described in #877.
This issue happens when syntax-them have no transparency in background-color of cursor-line.

  • You can ask syntax-theme author to give cursor-line at least some transparency.
  • Also you can workaround issue by disabling cursor-line effect in style.less.
atom-text-editor {
  .cursor-line {
    background-color: transparent;
  }
}

Map keystroke to keystroke like nnoremap, vnoremap in pure-Vim?

Use my keystroke package, you can do like this.

'atom-text-editor.vim-mode-plus.normal-mode':
  'down': 'keystroke d d p' # move line down
  'up': 'keystroke d d k P' # move line up
  'space j': 'keystroke 5 j'
  'space k': 'keystroke 5 k'

In insert-mode, hitting escape to close autocomplete popup result in normal-mode, but want to remain in insert-mode.

#339

By default escape always escape insert-mode regardless of autocomplete's popup.
To change default behavior of escape, set following keymap in your keymap.cson.

'atom-text-editor.vim-mode-plus.insert-mode.autocomplete-active':
  'escape': 'autocomplete-plus:cancel'

Or you can use different keymap to explicitly close autocomplete-plus's popup like bellow.

'atom-text-editor.vim-mode-plus.insert-mode.autocomplete-active':
  'ctrl-g': 'autocomplete-plus:cancel'

Hide indent-guide on last buffer row.

vim-mode-plus prevents move cursor on Atom's last buffer row.
When you have enabled editor.showIndentGuide, it shows indent-guide on last buffer row where vmp don't allow to move.

This is very counter intuitive.

By setting following style on you styles.less you can hide indent-guide on last buffer row.

atom-text-editor div.lines div:last-child .line:last-child {
  .indent-guide {
    box-shadow: none;
  }
}

Highlight cursor-line differently depending on current mode.

Set following code in your styles.less and modify it as you want.

.cursor-line-background(@mode, @color) {
  atom-text-editor.vim-mode-plus.@{mode}.is-focused {
    & .lines .line.cursor-line {
      background-color: @color
    }
  }
}
.cursor-line-background(normal-mode, fadeout(gray, 80%));
.cursor-line-background(insert-mode, fadeout(green, 80%));
.cursor-line-background(operator-pending-mode, fadeout(yellow, 80%));

Hide vmp's statusbar information completely

Set following in your style.less.

#status-bar-vim-mode-plus {
  display: none;
}

Define command for multiple keystroke.

Background:

#265 #266

Use keystroke

How can I use ctrl-w to close pane?

ctrl-w is used as prefix key for many commands and Atom keymap currently not providing easy way to disable prefixed key in bulk. So, you have to

  1. Disable each keymap by mapping it to unset!.
  2. Then map ctrl-w to core:close which close pane.

For step1, you have to find all the keymaps which use ctrl-w as prefix by observing key-binding-resolver(cmd-.).
You can use disable-keybindings to make this process easier.

Here is example when you don't use disable-keybindings package with vim-mode-plus v0.44.1.

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  # Disable all the keymap defined in keymaps/vim-mode-plus.cson in this scope
  'ctrl-w ctrl-h': 'unset!'
  'ctrl-w h': 'unset!'
  'ctrl-w left': 'unset!'
  'ctrl-w ctrl-l': 'unset!'
  'ctrl-w l': 'unset!'
  'ctrl-w right': 'unset!'
  'ctrl-w ctrl-k': 'unset!'
  'ctrl-w k': 'unset!'
  'ctrl-w up': 'unset!'
  'ctrl-w ctrl-j': 'unset!'
  'ctrl-w j': 'unset!'
  'ctrl-w down': 'unset!'
  'ctrl-w ctrl-w': 'unset!'
  'ctrl-w w': 'unset!'
  'ctrl-w ctrl-p': 'unset!'
  'ctrl-w p': 'unset!'
  'ctrl-w ctrl-c': 'unset!'
  'ctrl-w c': 'unset!'
  'ctrl-w ctrl-v': 'unset!'
  'ctrl-w v': 'unset!'
  'ctrl-w ctrl-s': 'unset!'
  'ctrl-w s': 'unset!'
  'ctrl-w ctrl-q': 'unset!'
  'ctrl-w z': 'unset!'
  'ctrl-w q': 'unset!'
  'ctrl-w =': 'unset!'

  'ctrl-w ctrl-x': 'unset!'
  'ctrl-w x': 'unset!'

  'ctrl-w K': 'unset!'
  'ctrl-w J': 'unset!'
  'ctrl-w H': 'unset!'
  'ctrl-w L': 'unset!'

  'ctrl-w shift-K': 'unset!'
  'ctrl-w shift-J': 'unset!'
  'ctrl-w shift-H': 'unset!'
  'ctrl-w shift-L': 'unset!'
  'ctrl-w shift-Z': 'unset!'

  'ctrl-w Z': 'unset!'

  'ctrl-w': 'core:close'

Escape from insert-mode by typing jk quickly.

Esc is a little far from home position, and ctrl-[ is difficult to type.

'atom-text-editor.vim-mode-plus.insert-mode':
  'j k': 'vim-mode-plus:activate-normal-mode' # jk to escape

Use system-clipboard only when you use space as leaderkey

From v0.66.0

  • You want y y to save unnamed(") register. vim-mode-plus local register not shared by other apps.

  • But when you type space y y, save to system-clipboard.

  • Also you want all y or d behave in same mannter. (space d d to save to system-clipboard).

  • keymap.cson

'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'space': 'vim-mode-plus:set-register-name-to-*'

Delete without saving to register.

You have three option, choose whichever you like.

1. Specify blackhole register explicitly.

  • By using _(blackhole) register, your operation does not update register.
  • For example " _ d d will delete the line but not add the line to your clipboard.
  • If typing the " _ before d d is tedious, you can shorten it by setting keymap for " _ part.
  • keymap.cson
    'atom-text-editor.vim-mode-plus:not(.insert-mode)':
      '\\': 'vim-mode-plus:set-register-name-to-_'
  • So normal d delete update register, \ d(if you keymap \) delete without updating register.

2. Define your own command to statically use blackhole register in your init.js

See ExtendVimModePlusInInitFile#advanced-deletewithbackholeregister

3. In vim-mode-settings add delete to a blackhole registered operator

  • This is the easiest option, but will never allow a delete action to update the register.
  • Find the Blackhole Registered Operators configuration in vmp settings (you can find this in your installed packages area under preferences) then set delete*, which will apply this setting to all operators within the same family. You may also set other commands individually (like change) if you wish.