From f2e5eeb591bbf03592f69402652c0629d2f41e98 Mon Sep 17 00:00:00 2001 From: Julius Riegel Date: Wed, 24 Apr 2024 11:06:09 +0200 Subject: [PATCH] Add commenting shortcuts --- content/config/helix/config.toml | 12 ++++++++---- content/config/nushell/scripts/ide.nu | 10 ++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/content/config/helix/config.toml b/content/config/helix/config.toml index e02385b..2b7f417 100644 --- a/content/config/helix/config.toml +++ b/content/config/helix/config.toml @@ -40,10 +40,14 @@ esc = ["collapse_selection", "normal_mode"] [keys.normal] esc = ["collapse_selection", "keep_primary_selection"] -C-j = "half_page_down" -C-k = "half_page_up" +C-j = ["half_page_down", "goto_window_center", "align_view_center"] +C-k = ["half_page_up", "goto_window_center", "align_view_center"] [keys.select] esc = ["collapse_selection", "keep_primary_selection", "normal_mode"] -C-j = "half_page_down" -C-k = "half_page_up" +C-j = ["half_page_down", "goto_window_center"] +C-k = ["half_page_up", "goto_window_center"] + +[keys.normal."A-/"] +j = ["goto_line_start", ":insert-output use ide.nu; ide doc-comment java-style", "normal_mode", "move_visual_line_up", "insert_at_line_end"] +r = ["goto_line_start", ":insert-output use ide.nu; ide doc-comment rust-style", "normal_mode", "insert_at_line_end"] diff --git a/content/config/nushell/scripts/ide.nu b/content/config/nushell/scripts/ide.nu index 08f1114..ba14e97 100755 --- a/content/config/nushell/scripts/ide.nu +++ b/content/config/nushell/scripts/ide.nu @@ -65,6 +65,16 @@ export def last-notification [] { $notif } +export def `doc-comment java-style` [] { +print `/** + * + */` +} + +export def `doc-comment rust-style` [] { + print `/// ` +} + def open-editor [path: string] { zellij ac move-focus right zellij ac write-chars $":open ($path)\r"