mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Entry point to edit config file
This commit is contained in:
parent
ef6164eecb
commit
c440470276
2 changed files with 13 additions and 0 deletions
|
|
@ -65,6 +65,11 @@ def run_kitten(args: List[str]) -> None:
|
|||
rk(kitten)
|
||||
|
||||
|
||||
def edit_config_file(args: List[str]) -> None:
|
||||
from kitty.utils import edit_config_file as f
|
||||
f()
|
||||
|
||||
|
||||
def namespaced(args: List[str]) -> None:
|
||||
func = namespaced_entry_points[args[1]]
|
||||
func(args[1:])
|
||||
|
|
@ -77,6 +82,7 @@ entry_points = {
|
|||
'runpy': runpy,
|
||||
'launch': launch,
|
||||
'kitten': run_kitten,
|
||||
'edit-config': edit_config_file,
|
||||
|
||||
'@': remote_control,
|
||||
'+': namespaced,
|
||||
|
|
|
|||
|
|
@ -580,6 +580,13 @@ def parse_uri_list(text: str) -> Generator[str, None, None]:
|
|||
yield unquote(purl.path)
|
||||
|
||||
|
||||
def edit_config_file() -> None:
|
||||
from kitty.config import prepare_config_file_for_editing
|
||||
p = prepare_config_file_for_editing()
|
||||
editor = get_editor()
|
||||
os.execvp(editor[0], editor + [p])
|
||||
|
||||
|
||||
class SSHConnectionData(NamedTuple):
|
||||
binary: str
|
||||
hostname: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue