PlainTasks
PlainTasks copied to clipboard
[Feature request] Jump to next task
Hey, first of all thank you for all the work on this package. It is by far my favorite todo list. It would be great to have a keybinding to jump to the next task. I write tons of comments between tasks and sometimes it takes a while to scroll to the next unresolved task. It has also happened that I would accidentally miss a task entirely while scrolling.
Do you know that there are fold to level commands? in main menu Edit → Code folding If your notes are indented under tasks it should be enough to overview all tasks and or go to a next one.
Thank you, I didn't know that. Since I'm not usually working with code folding in my tasks, I would still prefer a dedicated shortcut.
I tried to create a sublime macro and just record ctrl + f ☐. But it seems that finding text is not supported in sublime macros.
Well, try to create command in Python then? You would get a list of all tasks and then use bisect to find the closest one to some point, well, cursor will be a point in this case, clear and re-add selection, scroll.
All examples can be found in the file.
I've never used Python before but it might be a good place to start 😁 Thank you for the suggestion
Just coming back to this.
You can create a new plugin (tools => developer => new plugin)
import sublime
import sublime_plugin
class FindCheckboxCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().run_command('show_panel', {'panel': 'find', 'reverse': False})
self.view.window().run_command('insert', {'characters': '☐'})
self.view.window().run_command('find_next')
self.view.window().run_command('hide_panel')
if len(self.view.sel()) > 0:
cursor_position = self.view.sel()[0].b
self.view.sel().clear()
self.view.sel().add(sublime.Region(cursor_position))
Save it to find_checkbox.py and you can bind it to the key of your choice (preferences: key bindings).
{ "keys": ["alt+n"], "command": "find_checkbox"}