Open lord opened 7 years ago
A workaround here is just to over-ride this particular keybinding and put it back to whatever your Vi plugin uses.
For example, I use NeoVintageous, and so I added the following to my keybindings:
{"keys": ["'"], "command": "_nv_feed_key", "args": {"key": "'"}, "context": [{"key": "vi_command_mode_aware"}]},
And normal mode works as intended on Rust files again.
I'm interested in contributing a fix to this. Is there a known way for Sublime plugins to play nice when trying to override keybinds like this without needing the NeoVintageous plugin to explicitly acknowledge Rust Enhanced or vice-versa?
You can try something like this:
diff --git a/Default.sublime-keymap b/Default.sublime-keymap
index 337e78b..fb033ac 100644
--- a/Default.sublime-keymap
+++ b/Default.sublime-keymap
@@ -1,7 +1,11 @@
[
// Disable auto-pair for single quote since it is often used for lifetimes.
{ "keys": ["'"], "command": "insert_snippet", "args": {"contents": "'"}, "context":
- [{ "key": "selector", "operator": "equal", "operand": "source.rust" }]
+ [
+ { "key": "selector", "operator": "equal", "operand": "source.rust" },
+ // Ignore this binding in Vintage command mode.
+ { "key": "setting.command_mode", "operand": false }
+ ]
},
// ' in b'c' will skip past the end quote.
{ "keys": ["'"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
I don't use vi mode, so I don't really know if it works properly. This might need to be done for the other key bindings. You might also try asking on the sublime forum to see if there are other ideas on how to handle this.
Sublime Text Version
Sublime Text 3 (Build 3126)
Rust Enhanced Version
1.3.2
Operating system
macOS 10.12.4
Expected behavior
When I type
'm
in command mode in Vim mode, I expect to be able to jump to a bookmark made previously with 'mm'.Actual behavior
Instead, the
'
is typed literally. This may be because of the snippet in #26 that prevents Sublime from making a second close single quote?Sorry if this was already fixed and I somehow haven't updated my Rust Enhanced — I've got a weird Sublime setup somehow! Thanks for the awesome plugin <3
Steps to reproduce
'
key while in command modeReferences
26