CM6 duplicateLine + toggleComment options?


I am looking at migrating from CM5 to CM6. I used to have the sublime.js keymap, but I haven’t found a CM6 equivalent (although I suspect defaultKeymap does most of what I need). One key shortcut I really want to keep is duplicateLine. How would I go to add it?

As for toggleComment, I would really like it to not have any padding. Back in CM5, it was possible to specify { padding: '' }. Is this still doable in CM6?


The copyLineUp/Down commands might be what you’re looking for.

Comment padding is not currently configurable.

Thanks for the quick response! copyLineDown is exactly what I need. How would I go to add Ctrl+D to the extensions?


This works for me!

                doc: doc,
                extensions: [
                    keymap.of([{key: 'Ctrl-d', run: copyLineDown}, indentWithTab, defaultKeymap]),

(Disclaimer: the current configuration appears to enable highlightSelectionMatches with Ctrl-d)

Thanks @marijn :slight_smile: