Sublime plugin doesn't work on v6

@craftzdog さん

いつも素敵なアプリをありがとうございます。

既にご認識済みでしたら恐縮ですが、
v6 において、sublime プラグインが動作しません。

結構、便利に使わせて頂いていたので、困っています。

こちらは、プラグイン自体のアップデート、あるいはv6に標準機能として組み込むなど、
なにか計画はございますか?

よろしければ、ご検討いただければ幸いです。よろしくお願い致します。

Thank you for the great app as always!

Apologies if you’re already aware of this, but the sublime plugin doesn’t work in v6.

I’ve been relying on it quite a bit, so this has been a bit of a problem for me.

Is there any plan to update the plugin itself, or perhaps incorporate similar keybindings as a built-in feature in v6?

I’d really appreciate it if you could consider this. Thank you for your time.

Best regards,
Ryuki

Hi @Ryuki_Yokoo ,

Unfortunately, CodeMirror 6 doesn’t have a Sublime Text keymap module.
Yes, the Sublime Text plugin is deprecated.
Which keymaps do you particularly use?
However, Inkdrop covers some of the equivalent commands to Sublime Text. Here is a coverage table:

sublime:* v6 command mac linux / win
swap-line-up / swap-line-down editor:move-line-up / editor:move-line-down alt-up / alt-down alt-up / alt-down
delete-line editor:delete-line cmd-d ctrl-d
indent-less editor:indent-less / editor:unindent cmd-[ / shift-tab ctrl-[ / shift-tab
del-line-right editor:kill-line, editor:delete-wrapped-line-right ctrl-k, cmd-delete unbound
del-line-left editor:delete-wrapped-line-left cmd-backspace unbound
add-cursor-to-prev-line / next-line editor:select-lines-upward / editor:select-lines-downward ctrl-shift-up / ctrl-shift-down ctrl-shift-up / ctrl-shift-down
single-selection-top editor:single-selection escape escape
transpose-chars editor:transpose-chars ctrl-t unbound
smart-backspace editor:delete-char-before (custom handler) backspace backspace
find-incremental editor:find cmd-f ctrl-f
go-line-start-smart editor:go-line-start — plain, not the toggling “smart” variant cmd-left home, alt-left

It doesn’t cover all the equivalent commands.
Could you tell me which commands are specifically necessary for you?

@craftzdog
Hi, thank you for the rapid reply!

The commands that are specifically necessary for me are below:


"ctrl-l": "sublime:select-line",    
"ctrl-enter": "sublime:insert-line-after",
"ctrl-k ctrl-k": "sublime:del-line-right",
"shift-ctrl-up": "sublime:swap-line-up",
"shift-ctrl-down": "sublime:swap-line-down",

I appreciate your kind support!

Best regards,
Ryuki

1 Like

These three are already available as I mentioned in the table. You can bind them in your keymap.json like so:

{
  ".cm-editor .cm-scroller": {
    "ctrl-k ctrl-k": "editor:kill-line",
    "shift-ctrl-up": "editor:move-line-up",
    "shift-ctrl-down": "editor:move-line-down"
  }
}

See the doc page on key customizations:

I’ll add equivalent commands to sublime:select-line and sublime:insert-line-after.
Note that ctrl-enter is already taken by editor:edit-with-ai, which is the same keybinding as Zed.

Thanks for your feedback!

@craftzdog Thank you for the reply!

I understand! I’ll try setting up the keymap!

Also, thank you for considering adding the commands.
I’m looking forward to the update!

Hi @craftzdog ,

I have a quick question about the description on the List of commands page.

The description for the editor:kill-line command simply says “Deletes the line at the cursor,” which reads to me as if it deletes the entire line. Could you clarify whether it deletes the whole line, or only from the cursor to the end of the line (similar to Emacs’ traditional kill-line behavior)? I just want to make sure I’m binding the right command for my use case.

Thanks in advance!

Best regards,
Ryuki

Hi @Ryuki_Yokoo -san,

Yes, editor:kill-line works just as Emacs’.
Also, I just released v6.1.0, which includes a bunch of new editor commands covering Sublime Text actions.
And most importantly for you, I revived the sublime plugin as v1.0.0 :tada:

Thanks again for your feedback :heart:

Hi @craftzdog,

Thanks for confirming! That makes sense.

Since the description on the docs page could be misleading for others as well, I went ahead and opened a small PR to clarify it: https://github.com/inkdropapp/api-docs/pull/41

Also, thank you so much for releasing v6.1.0 and reviving the Sublime plugin — I really appreciate it. I’ll go try it out.

Thanks again for all your help throughout this thread.

Best regards,
Ryuki