Restoring ctrl-c as copy in Atom with vim keybindings because sometimes vim goes to far
Vim is fantastic because it’s convenient. I use it constantly, and i know about three keybindings. But they are really convenient keybindings.
What is not convenient is not being able to type control C to copy and control V to paste as one can absolutely anywhere else. In regular Vim this can take some work, but in Atom it’s just a matter of removing the ill-advised conflicting keybidings that vim-mode-plus and ex-mode provide. Which also takes some work:
There’s one almost correct answer in a sea of misinformation:
https://discuss.atom.io/t/disable-default-keybindings/1077/12 and same at https://stackoverflow.com/a/33023451/1028376
What these are missing is that setting them to blank isn’t good enough to restore the previous (Atom-defined) behavior. They need to be set back to the behavior they had before, which is conveniently also shown in the list of ctrl-c commands in the settings. Here is what my ~/.atom/keymap.cson
contains now:
# Give ctrl-c back to copy, you insane vim thing you
'atom-text-editor.ex-mode-editor':
'ctrl-c': 'core:copy'
'atom-text-editor.vim-mode-plus':
'ctrl-c': 'core:copy'
'atom-text-editor.vim-mode-plus-input':
'ctrl-c': 'core:copy'
'atom-text-editor.vim-mode-plus-search':
'ctrl-c': 'core:copy'
… which i copied from that file to this one with ctrl-c and ctrl-v, thank you very much.
I also lived without this for a while but i try ctrl+w for closing tabs all the time and i never use these vim mode things which had been mapped to ‘core:cancel’ and ’editor:delete-to-beginning-of-word’ respectively. I’m not even sure what the former is supposed to be for, and for the latter i’ll use esc
and daw
or daW
.
# Give ctrl-w back to closing tabs
'.platform-linux .go-to-line atom-text-editor[mini]':
'ctrl-w': 'core:close'
'atom-text-editor.vim-mode-plus.insert-mode':
'ctrl-w': 'core:close'