Browse Source

Organize aliases into folder

Don't show hidden files by default.
red-hat-laptop
Kevin Mok 5 years ago
parent
commit
3427891897
Signed by: Kevin-Mok GPG Key ID: AEA75288DC135CF5
  1. 1
      .chezmoiignore
  2. 14
      aliases/key_aliases.tmpl
  3. 5
      aliases/key_dirs.tmpl
  4. 6
      aliases/key_files.tmpl
  5. 2
      dot_bashrc
  6. 3
      dot_config/fish/config.fish.tmpl
  7. 6
      dot_config/fish/functions/cd.fish.tmpl
  8. 4
      dot_config/fish/functions/grep-aliases.fish
  9. 8
      dot_config/fish/functions/man-vim.fish
  10. 4
      dot_config/fish/functions/refresh-config.fish
  11. 3
      dot_config/i3/config.tmpl
  12. 3
      dot_config/ranger/rc.conf.tmpl
  13. 3
      dot_tmux.conf
  14. 1
      dot_vimrc.tmpl
  15. 3
      dot_zshrc
  16. 8
      scripts/executable_sync-shortcuts

1
.chezmoiignore

@ -1,4 +1,5 @@
README.md README.md
commit-msg.txt
{{ if not .gui }} {{ if not .gui }}
.config/i3/ .config/i3/

14
key_aliases.tmpl → aliases/key_aliases.tmpl

@ -44,9 +44,11 @@ ctld "sudo systemctl disable"
ctla "sudo systemctl start" ctla "sudo systemctl start"
ctls "sudo systemctl stop" ctls "sudo systemctl stop"
ctlt "sudo systemctl status" ctlt "sudo systemctl status"
ctltd "sudo systemctl status dhcpcd"
ctlr "sudo systemctl restart" ctlr "sudo systemctl restart"
ctltd "sudo systemctl status dhcpcd"
ctlas "sudo systemctl start sshd"
nct "sudo netctl" nct "sudo netctl"
nctf "sudo ip link set dev wlp3s0 down" nctf "sudo ip link set dev wlp3s0 down"
nctr "sudo systemctl restart netctl-auto@wlp4s0.service" nctr "sudo systemctl restart netctl-auto@wlp4s0.service"
@ -71,10 +73,13 @@ vdr "vidir --verbose"
# directory-related [[[ # # directory-related [[[ #
{{ if not (eq .linux_os "termux") }} {{ if not (eq .linux_os "termux") }}
l "lsd -a"
ll "lsd -al"
# l "lsd --group-dirs first"
l "lsd"
la "lsd -A --group-dirs first"
ll "lsd -Al --group-dirs first --size short"
{{ else }} {{ else }}
l "ls -a"
l "ls"
la "ls -a"
ll "ls -al" ll "ls -al"
{{ end }} {{ end }}
cwd "echo (pwd) | xclip -selection clipboard" cwd "echo (pwd) | xclip -selection clipboard"
@ -326,6 +331,7 @@ gr "git remote -v"
gra "git remote add origin" gra "git remote add origin"
grr "git remote remove origin" grr "git remote remove origin"
grs "git remote show origin" grs "git remote show origin"
gru "git branch --set-upstream-to=origin/master master"
# ]]] branch # # ]]] branch #

5
key_dirs.tmpl → aliases/key_dirs.tmpl

@ -77,8 +77,9 @@ lt ~/school/latex-notes
6 ~/school/263 6 ~/school/263
63 ~/school/263/a5 63 ~/school/263/a5
# 631 ~/school/263/a4/q1
# 632 ~/school/263/a4/q2
# 631 ~/school/263/a5/q1
# 632 ~/school/263/a5/q2
633 ~/school/263/a5/q3
63t ~/school/latex-notes/263/a5 63t ~/school/latex-notes/263/a5
al1 ~/school/algorithms/w1-union-find al1 ~/school/algorithms/w1-union-find

6
key_files.tmpl → aliases/key_files.tmpl

@ -3,10 +3,10 @@
# sys [[[ # # sys [[[ #
3 ~/linux-config/dot_config/i3/config.tmpl 3 ~/linux-config/dot_config/i3/config.tmpl
a ~/linux-config/key_aliases.tmpl
d ~/linux-config/key_dirs.tmpl
a ~/linux-config/aliases/key_aliases.tmpl
d ~/linux-config/aliases/key_dirs.tmpl
dw ~/dwm/config.def.h dw ~/dwm/config.def.h
f ~/linux-config/key_files.tmpl
f ~/linux-config/aliases/key_files.tmpl
hs ~/.local/share/fish/fish_history hs ~/.local/share/fish/fish_history
p ~/linux-config/txt/pacman-pkgs/pacman-pkgs.txt p ~/linux-config/txt/pacman-pkgs/pacman-pkgs.txt
r ~/linux-config/dot_config/ranger/rc.conf.tmpl r ~/linux-config/dot_config/ranger/rc.conf.tmpl

2
dot_bashrc

@ -204,4 +204,4 @@ fi
# Both PC/Laptop }}} # Both PC/Laptop }}}
[ -f ~/.fzf.bash ] && source ~/.fzf.bash [ -f ~/.fzf.bash ] && source ~/.fzf.bash
source /home/kevin/.key_aliases
source ~/aliases/.key_aliases

3
dot_config/fish/config.fish.tmpl

@ -57,7 +57,8 @@ set -x EDITOR nvim
set -x VISUAL nvim set -x VISUAL nvim
set -U fish_help_browser firefox set -U fish_help_browser firefox
builtin cd $last_dir
builtin cd $last_dir && ls > /dev/null
# builtin cd $last_dir
bind \ce edit_command_buffer bind \ce edit_command_buffer
bind \cr forward-word bind \cr forward-word

6
dot_config/fish/functions/cd.fish.tmpl

@ -47,9 +47,11 @@ function cd --description "Change directory"
set -U last_dir $PWD set -U last_dir $PWD
{{ if (not (eq .linux_os "termux")) }} {{ if (not (eq .linux_os "termux")) }}
lsd -a
# lsd -a
lsd
{{ else }} {{ else }}
ls -a
# ls -a
ls
{{ end }} {{ end }}
end end

4
dot_config/fish/functions/grep-aliases.fish

@ -1,5 +1,5 @@
function grep-aliases function grep-aliases
set key_aliases ~/key_aliases
rg $argv[1] $key_aliases
set key_aliases ~/aliases/key_aliases
# rg "^$argv[1]" $key_aliases # rg "^$argv[1]" $key_aliases
rg $argv[1] $key_aliases
end end

8
dot_config/fish/functions/man-vim.fish

@ -1,3 +1,9 @@
function man-vim function man-vim
nvim -c ":Man $argv[1]" -c "only"
if count $argv > /dev/null
set prog $argv[1]
else
set prog (apropos . | awk '{ print $1 }' | fzf -e)
end
nvim -c ":Man $prog" -c "only"
end end

4
dot_config/fish/functions/refresh-config.fish

@ -1,8 +1,8 @@
function refresh-config function refresh-config
chezmoi apply chezmoi apply
and echo 'Applied chezmoi.' and echo 'Applied chezmoi.'
and tmux source-file ~/.tmux.conf
and echo 'Sourced tmux config.'
# and tmux source-file ~/.tmux.conf
# and echo 'Sourced tmux config.'
sync-shortcuts sync-shortcuts
echo 'Synced shortcuts.' echo 'Synced shortcuts.'

3
dot_config/i3/config.tmpl

@ -146,7 +146,8 @@ set $inner_gaps 20
# set $inner_gaps 0 # set $inner_gaps 0
set $outer_gaps 0 set $outer_gaps 0
set $border_radius 15
# set $border_radius 15
set $border_radius 0
# remove window titlebars # remove window titlebars
# for_window [class="^.*"] border pixel 2 # for_window [class="^.*"] border pixel 2
for_window [class="^.*"] border pixel 3 for_window [class="^.*"] border pixel 3

3
dot_config/ranger/rc.conf.tmpl

@ -36,7 +36,8 @@ set column_ratios 1,3,4
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$ set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh' # Show hidden files? You can toggle this by typing 'zh'
set show_hidden true
# set show_hidden true
set show_hidden false
# Ask for a confirmation when running the "delete" command? # Ask for a confirmation when running the "delete" command?
# Valid values are "always", "never", "multiple" (default) # Valid values are "always", "never", "multiple" (default)

3
dot_tmux.conf

@ -41,6 +41,9 @@ bind-key -T copy-mode-vi M-\ select-pane -l
bind-key -n M-Enter split-window -h bind-key -n M-Enter split-window -h
# bind-key -n M-v split-window -h # bind-key -n M-v split-window -h
bind-key m select-pane -m
bind-key j join-pane \; select-layout main-vertical
bind-key -n M-q kill-pane bind-key -n M-q kill-pane
# }}} panes # # }}} panes #

1
dot_vimrc.tmpl

@ -524,6 +524,7 @@ autocmd Filetype fish inoremap <localleader>2 $argv[2]
autocmd Filetype javascript inoremap <localleader>x process.exit() autocmd Filetype javascript inoremap <localleader>x process.exit()
autocmd Filetype markdown inoremap <localleader>cb - [ ] autocmd Filetype markdown inoremap <localleader>cb - [ ]
autocmd Filetype markdown nnoremap <localleader>j :set tw=9999999<CR>gggqG
autocmd Filetype markdown nnoremap <localleader>x 0f[lrx autocmd Filetype markdown nnoremap <localleader>x 0f[lrx
" nnoremap <localleader>x 0f[lrx " nnoremap <localleader>x 0f[lrx

3
dot_zshrc

@ -174,7 +174,6 @@ fi
export GPG_TTY=$(tty) export GPG_TTY=$(tty)
export PASSWORD_STORE_CLIP_TIME=120 export PASSWORD_STORE_CLIP_TIME=120
source /home/kevin/.shortcuts
#exec fish #exec fish
source /home/kevin/.key_aliases
source ~/aliases/.key_aliases

8
scripts/executable_sync-shortcuts

@ -19,7 +19,7 @@ fish_config="$HOME/.config/fish/config.fish"
ranger_config="$HOME/.config/ranger/rc.conf" ranger_config="$HOME/.config/ranger/rc.conf"
# Output locations # Output locations
aliases="$HOME/.key_aliases"
aliases="$HOME/aliases/.key_aliases"
fish_abbr="$HOME/.config/fish/key_abbr.fish" fish_abbr="$HOME/.config/fish/key_abbr.fish"
ranger_mappings="$HOME/.config/ranger/key_mappings.conf" ranger_mappings="$HOME/.config/ranger/key_mappings.conf"
@ -30,9 +30,9 @@ ensure "source $aliases" "$zshrc"
ensure "source $ranger_mappings" "$ranger_config" ensure "source $ranger_mappings" "$ranger_config"
# key files # key files
key_dirs="$HOME/key_dirs"
key_files="$HOME/key_files"
key_aliases="$HOME/key_aliases"
key_dirs="$HOME/aliases/key_dirs"
key_files="$HOME/aliases/key_files"
key_aliases="$HOME/aliases/key_aliases"
# Remove, prepare files # Remove, prepare files
rm -f "$ranger_mappings" 2>/dev/null rm -f "$ranger_mappings" 2>/dev/null

Loading…
Cancel
Save