maj json
This commit is contained in:
parent
896ff124f9
commit
85dcd7a5dd
@ -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"
|
||||
}
|
||||
|
BIN
scut-latest.zip
BIN
scut-latest.zip
Binary file not shown.
@ -1 +1 @@
|
||||
7759ebff812719efa139b428b43795bb849dbd8540aaf927233922018a8db23f scut-latest.zip
|
||||
2a1e8f7a7a07d31e0bfbb1ab93f22db69acd1d8343521f999f241eb37abc1a21 scut-latest.zip
|
||||
|
29
scut.go
29
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user