mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
21 lines
536 B
Python
21 lines
536 B
Python
"""A plugin for Sublime Text to enhance f-string editing experience.
|
|
|
|
Specifically, this plugin simplifies typing of escaped curly braces
|
|
in an f-string:
|
|
{|}, where | is for cursir, gets replaced with
|
|
{{|, when '{' is typed again.
|
|
"""
|
|
|
|
|
|
# Used by `settings/sublime/Default.sublime-keymap`.
|
|
|
|
|
|
import sublime_plugin
|
|
|
|
|
|
class FstringbraceCommand(sublime_plugin.WindowCommand):
|
|
def run(self):
|
|
view = self.window.active_view()
|
|
view.run_command('right_delete')
|
|
view.run_command('insert', {'characters': '{'})
|