Comments (14)
This seems to work for me:
let g:multi_cursor_quit_key=''
nnoremap :call multiple_cursors#quit()
As found on the README, on the bottom of this section:
https://github.com/terryma/vim-multiple-cursors#mapping
from vim-multiple-cursors.
+1
from vim-multiple-cursors.
Pressing C-c
in multicursor's visual mode works as expected. Every virtual cursor will go back to normal mode, this is consistent with Vim's behavior.
Pressing C-c
in multicursor's normal mode breaks with the default setting like you described above. If you want C-c
to quit multicursor's normal mode and go back to Vim's normal mode and clears all virtual cursors, you can map the g:multi_cursor_quit_key
to <C-c>
. This of course isn't ideal since <Esc>
will no longer work to quit multicursor mode. It sounds like what you want is the ability to assign multiple keys to quit multicursor mode. Would that address your issue? Something like
let g:multi_cursor_quit_keys='<Esc>,<C-c>'
from vim-multiple-cursors.
Seems like that might be a sensible default, if it were possible? ;) Usually C-c
just aborts whatever operation you're in the middle of, so if that's using multi-cursors, I'd expect it go back into "normal" (actual normal) mode. Allowing multiple key bindings would work well too though, yes. I could technically map C-c
to <ESC>
locally, but that causes other problems.
from vim-multiple-cursors.
+1 for making this default, I came here after googling for this same issue.
from vim-multiple-cursors.
with @faceleg and @d11wtq on this one, came here after googling as well <esc>
is too far away to use for quitting :) also <c-n> <esc>
does not clear the cursors.
from vim-multiple-cursors.
Still a no go on this?
from vim-multiple-cursors.
👍 Any fix coming up for this?
from vim-multiple-cursors.
@terryma, As I understand it, there is a subtle difference between ctrl-c
and esc
:
ctrl-c
can be used for "go back to normal mode", but is a variation more akin to "abort": e.g. http://stackoverflow.com/questions/5030164/whats-the-difference-between-ctrlc-and-ctrl, :help CTRL-C
, and :help i_CTRL-C
.
It's esc
and its equivalent, ctrl-]
, that's "go back to normal mode": e.g. :help i_CTRL-[
, help c_Esc
, :help mode-switching
, :help escape
.
I actually found myself in this issues section because I discovered ctrl-]
didn't work, for which I've created issue #82
from vim-multiple-cursors.
This is an issue that is getting in my way. I don't understand the inner technicalities, but:
I use <ctrl-c>
as a way to get out of insert mode. Frankly, I'd like it to be a way to get out of any special mode.
I also see this was filed as an "enhancement". While this may or may not require refactoring, it does run contrary to the behavior that an end-user would expect.
Would it help if the function to quit out of highlighting was made public? I tried giving it a shot in #126.
from vim-multiple-cursors.
While the PR you submitted does seem to let me quit multi cursor mode with <C-c>
, it leaves the editor with the previous selections still visible.
from vim-multiple-cursors.
I also notice this same problem. The behavior in my PR is flawed and it should probably be reverted. I have tried various approaches but could not find a way to clear previous selections.
from vim-multiple-cursors.
In vanilla, how does esc
trigger the desired behaviour?
According to Vim's documentation, Ctrl+C does not check for abbreviations and does not trigger the InsertLeave autocommand event while Ctrl+[ does.
From http://stackoverflow.com/a/80761/187954
Can one trigger autocommands manually? i.e. could we just add a InsertLeave
firing to the public function you added?
Maybe with :do
? http://vimdoc.sourceforge.net/htmldoc/autocmd.html#autocmd-execute
from vim-multiple-cursors.
My bad, wrong git pagemultiple_cursors#quit()
doesn't appear to be a callable function
from vim-multiple-cursors.
Related Issues (20)
- Input ignored after leading key of insert mode mapping HOT 1
- Support not moving cursors when scrolling HOT 1
- ReadMe have a complex explanation on the usage, bad for newcomers. HOT 3
- After enter multi-select and c, cmd+v does not work HOT 2
- Request: When in wait_for_user_input(), show prompt HOT 6
- How can I use <A-n> in mac? There is no 'A' key. HOT 1
- How to yank multiple cursors? HOT 2
- can't return to regular vim and it stucks HOT 6
- Doesn't work with nondefault langmap HOT 3
- Restrict mappings to a mode (?) HOT 1
- Stuck HOT 6
- Crash on search a char using `f` when target char isn't found HOT 1
- Esc does not work in INSERT mode after multicursor is on. HOT 3
- Annoying beep when pressing <ESC> to switch from ' -- (insert) --' to multi line HOT 3
- Select all occurrences within specified text area HOT 1
- Change cursor style when in insert mode?
- rake vulnerability found in …/vim-multiple-cursors/Gemfile.lock
- Multicursor crash when try to insert HOT 1
- Plugin is deprecated, use vim-visual-multi instead HOT 7
- region col possibly to -1 be invalid...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-multiple-cursors.