diff --git a/config/kitty.json b/config/kitty.json index b4dd4ea..84b26f3 100644 --- a/config/kitty.json +++ b/config/kitty.json @@ -2,40 +2,40 @@ "name": "Kitty Terminal", "url": "https://github.com/jmcastagnetto/kitty-terminal-cheatsheet/blob/fbdf2e6ed4c6ef07d01a9eca7d07fc1e889769ed/kitty-terminal-cheatsheet.pdf", "shortcuts": { - "Ctrl+Shift+T": "New tab", - "Ctrl+Shift+W": "Close tab", - "Ctrl+Shift+H": "Move focus to left tab", - "Ctrl+Shift+L": "Move focus to right tab", - "Ctrl+Shift+PageUp": "Move to previous tab", - "Ctrl+Shift+PageDown": "Move to next tab", - "Ctrl+Shift+C": "Copy selected text to clipboard", - "Ctrl+Shift+V": "Paste from clipboard", - "Ctrl+Shift+N": "New Kitty instance", - "Ctrl+Shift+Q": "Quit Kitty", - "Ctrl+Shift+R": "Reload configuration file", - "Ctrl+Shift+F": "Find", - "Ctrl+Shift+G": "Find next", - "Ctrl+Shift+J": "Scroll down one line", - "Ctrl+Shift+K": "Scroll up one line", - "Ctrl+Shift+U": "Scroll up one page", - "Ctrl+Shift+D": "Scroll down one page", - "Ctrl+Shift+Home": "Scroll to top", - "Ctrl+Shift+End": "Scroll to bottom", - "Ctrl+Shift+S": "Save session", - "Ctrl+Shift+O": "Open saved session", - "Ctrl+Shift+X": "Clear scrollback buffer", - "Ctrl+Shift+Z": "Toggle zoom", - "Ctrl+Shift+I": "Inspect current terminal", - "Ctrl+Shift+Tab": "Switch to previous window", - "Ctrl+Shift+Num+": "Increase font size", - "Ctrl+Shift+Num-": "Decrease font size", - "Ctrl+Shift+Num*": "Reset font size", - "Ctrl+Shift+Num/": "Toggle ligatures", - "Ctrl+Shift+Num0": "Reset all settings to default", - "Ctrl+Shift+Num1": "Switch to profile 1", - "Ctrl+Shift+Num2": "Switch to profile 2", - "Ctrl+Shift+Num3": "Switch to profile 3", - "Ctrl+Shift+Num4": "Switch to profile 4", - "Ctrl+Shift+Num5": "Switch to profile 5" + "Ctrl + Shift + T": "New tab", + "Ctrl + Shift + W": "Close tab", + "Ctrl + Shift + H": "Move focus to left tab", + "Ctrl + Shift + L": "Move focus to right tab", + "Ctrl + Shift + PageUp": "Move to previous tab", + "Ctrl + Shift + PageDown": "Move to next tab", + "Ctrl + Shift + C": "Copy selected text to clipboard", + "Ctrl + Shift + V": "Paste from clipboard", + "Ctrl + Shift + N": "New Kitty instance", + "Ctrl + Shift + Q": "Quit Kitty", + "Ctrl + Shift + R": "Reload configuration file", + "Ctrl + Shift + F": "Find", + "Ctrl + Shift + G": "Find next", + "Ctrl + Shift + J": "Scroll down one line", + "Ctrl + Shift + K": "Scroll up one line", + "Ctrl + Shift + U": "Scroll up one page", + "Ctrl + Shift + D": "Scroll down one page", + "Ctrl + Shift + Home": "Scroll to top", + "Ctrl + Shift + End": "Scroll to bottom", + "Ctrl + Shift + S": "Save session", + "Ctrl + Shift + O": "Open saved session", + "Ctrl + Shift + X": "Clear scrollback buffer", + "Ctrl + Shift + Z": "Toggle zoom", + "Ctrl + Shift + I": "Inspect current terminal", + "Ctrl + Shift + Tab": "Switch to previous window", + "Ctrl + Shift + Num + ": "Increase font size", + "Ctrl + Shift + Num-": "Decrease font size", + "Ctrl + Shift + Num*": "Reset font size", + "Ctrl + Shift + Num/": "Toggle ligatures", + "Ctrl + Shift + Num0": "Reset all settings to default", + "Ctrl + Shift + Num1": "Switch to profile 1", + "Ctrl + Shift + Num2": "Switch to profile 2", + "Ctrl + Shift + Num3": "Switch to profile 3", + "Ctrl + Shift + Num4": "Switch to profile 4", + "Ctrl + Shift + Num5": "Switch to profile 5" } } \ No newline at end of file diff --git a/config/neovim.json b/config/neovim.json index 506a894..2d3acfb 100644 --- a/config/neovim.json +++ b/config/neovim.json @@ -1,6 +1,6 @@ { "name": "Neovim", - "url": "https://cheatography.com/dcschmid/cheat-sheets/personal-neovim-cheatsheet/pdf/", + "url": "https://cheatography.com/dcschmid/cheat + sheets/personal + neovim + cheatsheet/pdf/", "shortcuts": { "i": "Insert mode", "esc": "Normal mode", @@ -10,30 +10,30 @@ "yy": "Yank/copy current line", "p": "Paste yanked/cut text", "u": "Undo", - "Ctrl-r": "Redo", + "Ctrl + r": "Redo", "w": "Save changes", "q": "Quit", - "Ctrl-w": "Close current window", - "Ctrl-n": "Open new empty buffer", - "Ctrl-o": "Open last closed buffer", - "Ctrl-^": "Switch between the current and previous buffer", - "Ctrl-]": "Jump to the definition of a symbol", - "Ctrl-t": "Jump back from the definition of a symbol", - "Ctrl-p": "Open fuzzy finder", - "Ctrl-x Ctrl-f": "Open file explorer", - "Ctrl-x Ctrl-b": "Open buffer explorer", - "Ctrl-g": "Show file information", - "Ctrl-a": "Select all", - "Ctrl-v": "Paste in visual mode", + "Ctrl + w": "Close current window", + "Ctrl + n": "Open new empty buffer", + "Ctrl + o": "Open last closed buffer", + "Ctrl + ^": "Switch between the current and previous buffer", + "Ctrl + ]": "Jump to the definition of a symbol", + "Ctrl + t": "Jump back from the definition of a symbol", + "Ctrl + p": "Open fuzzy finder", + "Ctrl + x Ctrl + f": "Open file explorer", + "Ctrl + x Ctrl + b": "Open buffer explorer", + "Ctrl + g": "Show file information", + "Ctrl + a": "Select all", + "Ctrl + v": "Paste in visual mode", "v": "Enter visual mode", "V": "Enter line visual mode", - "Ctrl-c": "Copy in visual mode", + "Ctrl + c": "Copy in visual mode", "y": "Yank in visual mode", "d": "Delete in visual mode", "c": "Change in visual mode", "r": "Replace in visual mode", "s": "Substitute in visual mode", - "Ctrl-l": "Clear search highlight", + "Ctrl + l": "Clear search highlight", "n": "Next search result", "N": "Previous search result" } diff --git a/config/vscode.json b/config/vscode.json index 3acafd6..65fb3b0 100644 --- a/config/vscode.json +++ b/config/vscode.json @@ -2,40 +2,40 @@ "name": "vscode", "url": "https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf", "shortcuts": { - "Ctrl+Shift+P": "Command Palette", - "Ctrl+k Ctrl+R": "Help Keyboard Shortcuts Reference", - "Ctrl+Shift+N": "New Window", - "Ctrl+Shift+W": "Close Window", - "Ctrl+Shift+T": "Reopen Closed Editor", - "Ctrl+Tab": "Switch Editor", - "Ctrl+Shift+Tab": "Switch Editor in Reverse Order", - "Ctrl+Shift+G": "Toggle Source Control", - "Ctrl+Shift+D": "Toggle Debug", - "Ctrl+Shift+X": "Toggle Extensions", - "Ctrl+Shift+V": "Open Markdown Preview", - "Ctrl+K V": "Open Markdown Preview to the Side", - "Ctrl+Shift+F": "Find in Files", - "Ctrl+F": "Find", - "Ctrl+H": "Replace", + "Ctrl + Shift + P": "Command Palette", + "Ctrl + k Ctrl + R": "Help Keyboard Shortcuts Reference", + "Ctrl + Shift + N": "New Window", + "Ctrl + Shift + W": "Close Window", + "Ctrl + Shift + T": "Reopen Closed Editor", + "Ctrl + Tab": "Switch Editor", + "Ctrl + Shift + Tab": "Switch Editor in Reverse Order", + "Ctrl + Shift + G": "Toggle Source Control", + "Ctrl + Shift + D": "Toggle Debug", + "Ctrl + Shift + X": "Toggle Extensions", + "Ctrl + Shift + V": "Open Markdown Preview", + "Ctrl + K V": "Open Markdown Preview to the Side", + "Ctrl + Shift + F": "Find in Files", + "Ctrl + F": "Find", + "Ctrl + H": "Replace", "F12": "Go to Definition", - "Ctrl+F12": "Go to Definition (in the same file)", - "Alt+F12": "Peek Definition", - "Ctrl+Shift+O": "Go to Symbol", - "Ctrl+Shift+M": "Show Problems", - "Ctrl+Shift+J": "Toggle Search Details", - "Alt+Up": "Move Line Up", - "Alt+Down": "Move Line Down", - "Ctrl+Shift+K": "Delete Line", - "Ctrl+D": "Add Selection to Next Find Match", - "Ctrl+K Ctrl+D": "Move Last Selection to Next Find Match", - "Alt+Left": "Go Back", - "Alt+Right": "Go Forward", - "Ctrl+Shift+U": "Change Case", - "Ctrl+K Z": "Toggle Zen Mode", - "Ctrl+K S": "Toggle Editor Group Layout", - "Ctrl+K Ctrl+W": "Close All Editors", - "Ctrl+Shift+E": "Show Explorer", - "Ctrl+Shift+H": "Replace in Workspace", - "Ctrl+K Ctrl+X": "Trim Trailing Whitespace" + "Ctrl + F12": "Go to Definition (in the same file)", + "Alt + F12": "Peek Definition", + "Ctrl + Shift + O": "Go to Symbol", + "Ctrl + Shift + M": "Show Problems", + "Ctrl + Shift + J": "Toggle Search Details", + "Alt + Up": "Move Line Up", + "Alt + Down": "Move Line Down", + "Ctrl + Shift + K": "Delete Line", + "Ctrl + D": "Add Selection to Next Find Match", + "Ctrl + K Ctrl + D": "Move Last Selection to Next Find Match", + "Alt + Left": "Go Back", + "Alt + Right": "Go Forward", + "Ctrl + Shift + U": "Change Case", + "Ctrl + K Z": "Toggle Zen Mode", + "Ctrl + K S": "Toggle Editor Group Layout", + "Ctrl + K Ctrl + W": "Close All Editors", + "Ctrl + Shift + E": "Show Explorer", + "Ctrl + Shift + H": "Replace in Workspace", + "Ctrl + K Ctrl + X": "Trim Trailing Whitespace" } } \ No newline at end of file diff --git a/scut b/scut index 7e78f72..c61dfd3 100755 Binary files a/scut and b/scut differ diff --git a/scut-latest.zip b/scut-latest.zip index fceef38..1ada5ca 100644 Binary files a/scut-latest.zip and b/scut-latest.zip differ diff --git a/scut-latest.zip.sha256 b/scut-latest.zip.sha256 index 085bdd3..c927f4b 100644 --- a/scut-latest.zip.sha256 +++ b/scut-latest.zip.sha256 @@ -1 +1 @@ -7759ebff812719efa139b428b43795bb849dbd8540aaf927233922018a8db23f scut-latest.zip +2a1e8f7a7a07d31e0bfbb1ab93f22db69acd1d8343521f999f241eb37abc1a21 scut-latest.zip diff --git a/scut.go b/scut.go index bbf289a..16d6218 100644 --- a/scut.go +++ b/scut.go @@ -93,6 +93,31 @@ func loadConfig(dir string) Config { return config } +// sort shortcuts by name +func sortShortcuts(shortcuts map[string]string) map[string]string { + + // Create a slice of keys + keys := make([]string, 0, len(shortcuts)) + + // Append the keys from the map to the slice + for k := range shortcuts { + keys = append(keys, k) + } + + // Sort the slice of keys + //sort.Strings(keys) + + // Create a new map to store the sorted keys + sortedShortcuts := make(map[string]string) + + // Iterate over the slice of keys + for _, k := range keys { + sortedShortcuts[k] = shortcuts[k] + } + + return sortedShortcuts +} + func main() { underline := "- -- - -- - -- - -- - -- - -- - -- - -- - -- - --" @@ -129,8 +154,6 @@ func main() { flag.Parse() - fmt.Println(*configDir) - config := loadConfig(*configDir) cleanFilter := strings.TrimFunc(*filter, func(r rune) bool { @@ -169,7 +192,7 @@ func main() { fmt.Println(underline) fmt.Fprintln(w, " S H O R T C U T S : "+app.Name) fmt.Println(underline) - for shortcut, desc := range app.Shortcuts { + for shortcut, desc := range sortShortcuts(app.Shortcuts) { if strings.Contains(strings.ToUpper(shortcut), strings.ToUpper(cleanFilter)) || strings.Contains(strings.ToUpper(desc), strings.ToUpper(cleanFilter)) { fmt.Fprintf(w, "%s \t %s\n", shortcut, desc) }