5
votes

I have installed the Filter Lines plugin (Windows OS) but I can't figure out if it is possible to have a keyboard combination for the Edit > Code Folding > Fold With String as I cannot find the default keyboard combination ctrl+k ctrl+s in the Key Bindings - Default?

If this is not possible, can anyone then refer to another filter plugin, which (ideally) realtime filters the text, so I can edit all the lines in one go?

I want keyboard shortcuts for the Code Folding lines:

I want keyboard actions for the Code Folding stuff

2

2 Answers

6
votes

Just look at the plugin source and you will know what command to run as shortcut. If the name of the command class is FoldToLinesCommand, the command name in the shortcut files will be fold_to_lines.

Another solution is to open Sublime console, and enter

sublime.log_commands(True)

this will log all the commands in the console. After, you just have to run the command you want as a shortcut, look at the console output and write it in your key bindings files. Do not forget to disable command logging when you are done to avoid useless output.

1
votes

As alternative to extra plugins, I'm currently using Sublime's own folding shortcuts. Note that when making a selection, of a word or line for example, you will only fold the selected string.

The ctrlshift[ shortcut may be used to fold a code block. Ofcourse, unfolding can be done with the related ctrlshift] shortcut.

These shortcuts are defined in the Default Sublime keymap, as fold and unfold, as following.

{ "keys": ["ctrl+shift+["], "command": "fold" },
{ "keys": ["ctrl+shift+]"], "command": "unfold" },

Hope this helps you out.