-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
n-commodore.rc
95 lines (83 loc) · 3.65 KB
/
n-commodore.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env zsh
# Size of the Zsh history view
NC_ZHIST_SIZE=70000
#
# Aliases
#
alias rg="rg --color=always --line-number"
alias ag="ag --color --numbers"
alias bat="bat --color=always --decorations=never"
greptxt="grep -E -H -sn -I --color=always\
--exclude-dir=.git\\\* --exclude TAGS --exclude=.TAGS.z --exclude=\\\*.log\
--exclude=\\\*.patch --exclude=\\\*.diff -D skip -d recurse"
[[ -f .gitignore ]]&&greptxt+=" --exclude-from=.gitignore"
alias grep=$greptxt
alias qe=$greptxt
alias gitg="git grep -I -i -E --color=always --threads=7 -n -e"
alias cd..="cd .." ..="cd .."
#
# Some hopefully useful hashed dirs. Use in command line, e.g.: cd ~start
#
hash -d home=$HOME
hash -d start=$PWD
hash -d local=$HOME/.local
hash -d config=${XDG_CONFIG_HOME:-$HOME/.config}
#
# Variables
#
# you can use exa, fd, etc.
if type fd&>/dev/null;then
NC_DEFAULT_LS_COMMAND="fd ."
else
NC_DEFAULT_LS_COMMAND="ls -1 --color=always"
fi
# editor will be found anyway
#NC_OPEN_CMD=${VISIAL:-${EDITOR:-$PAGER}}
NC_DEFAULT_LS_LIKE_OPTS="--color=always"
NC_LS_LIKE_COMMANDS="ls fd exa"
#
# Bindkeys
#
zui::bindkey F1 cmd-main-view
zui::bindkey F2 cmd-contents-view
zui::bindkey F3 cmd-command-history-view
zui::bindkey F4 cmd-zsh-history-view
zui::bindkey F5 cmd-tags-view # F5: TAGS view
zui::bindkey $'\C-w' cmd-tags-view # Ctrl-w - Ctags view
zui::bindkey $'\ew' cmd-tags-view # Alt-w - Ctags view
zui::bindkey $'\C-_' cmd-toggle-prompt # Ctrl-/ - toggle prompt search/cmd-input
zui::bindkey $'\C-@' cmd-jump # Ctrl-Space - jump to a search result
zui::bindkey $'\C-e' cmd-set-view hist # Ctrl-e: command history view
zui::bindkey $'\ee' cmd-set-view hist # Alt-e: command history view
zui::bindkey F15 cmd-open-tig # Run Tig via Shift-F3
zui::bindkey F7 cmd-synh-switch # Syntax highlighting on/off
zui::bindkey F304 cmd-prev-hist # Ctrl-Up for prev in history
zui::bindkey F263 cmd-next-hist # Ctrl-Down … next …
zui::bindkey $'\C-D' cmd-show-pipe # Switch to standard input view
zui::bindkey $'\e0' cmd-show-pipe # As a.
zui::bindkey $'\e`' cmd-command-mode-toggle # Pipe/Whole command capture/exec
zui::bindkey $'\C-y' cmd-command-mode-toggle # Pipe/Whole command capture/exec
zui::bindkey F305 cmd-pwd-up # Shift-Up for cd ..
zui::bindkey SR cmd-pwd-up
zui::bindkey F264 cmd-prev-pwd # Shift-Down for previous CWD (work dir)
zui::bindkey SF cmd-prev-pwd
zui::bindkey $'\C-v' cmd-page-down # Ctrl-v page down
zui::bindkey $'\C-u' cmd-page-up # Ctrl-u page up
# Cursor movement
zui::bindkey $'\e/' cmd-complete # Alt-/ - the same
zui::bindkey BTAB cmd-complete # Complete from disk and current view
zui::bindkey SRIGHT cmd-cursor-right # Shift-Right - cursor right
zui::bindkey SLEFT cmd-cursor-left # Shift-Left - cursor left
zui::bindkey F283 cmd-cursor-word-left # Ctrl-Shift-Left - cursor word left
zui::bindkey F298 cmd-cursor-word-right # Ctrl-Shift-Right - cursor word right
zui::bindkey $'\C-r' cmd-item-to-prompt # Ctrl-r - item to prompt
zui::bindkey $'\e ' cmd-item-to-prompt # Alt-Space - the same
zui::bindkey $'\C-t' cmd-pwd-to-prompt # Ctrl-t - CWD to prompt
# View saving
zui::bindkey $'\C-x' cmd-push-screen # Ctrl-x - save current view
zui::bindkey F284 cmd-prev-screen # Ctrl-Shift-Left: visit previous view
zui::bindkey F299 cmd-next-screen # Ctrl-Shift-Right: visit next saved view
zui::bindkey F8 cmd-remove-screen # Remove current view from disk memory
zui::bindkey F13 cmd-help # Show help
zui::bindkey F20 cmd-prune-screens # Remove all screens
zui::bindkey F16 cmd-show # Shift-F4: Show N-C