-
Notifications
You must be signed in to change notification settings - Fork 112
TIPS
- Flash effect not appear on cursor-line, occurrence-marker is not displayed on cursor-line too.
- Map keystroke to keystroke like
nnoremap
,vnoremap
in pure-Vim? - In insert-mode, hitting
escape
to close autocomplete popup result innormal-mode
, but want to remain ininsert-mode
. - Hide indent-guide on last buffer row.
- Highlight cursor-line differently depending on current mode.
- Hide vmp's statusbar information completely
- Define command for multiple keystroke.
- How can I use
ctrl-w
to close pane? - Escape from insert-mode by typing jk quickly.
- Use system-clipboard only when you use
space
as leaderkey - Delete without saving to register.
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 instyle.less
.
atom-text-editor {
.cursor-line {
background-color: transparent;
}
}
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
.
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'
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;
}
}
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%));
Set following in your style.less
.
#status-bar-vim-mode-plus {
display: none;
}
Background:
Use keystroke
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
- Disable each keymap by mapping it to
unset!
. - Then map
ctrl-w
tocore: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'
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
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
ord
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-*'
You have three option, choose whichever you like.
- 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
" _
befored 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.
See ExtendVimModePlusInInitFile#advanced-deletewithbackholeregister
- 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 setdelete*
, which will apply this setting to all operators within the same family. You may also set other commands individually (likechange
) if you wish.