From 22900d289155076020ad911f2b02483cefcdb7b2 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 9 Aug 2018 09:40:14 -0500 Subject: [PATCH] Various shell improvements --- apps/neovim/plugins.vim | 3 +++ de/sxhkdrc | 6 +++--- de/xinitrc | 2 ++ setup | 3 +++ shell/aliases | 21 ++++++++++++++------- shell/autocompletions | 2 ++ shell/inputrc | 9 +++++++-- 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/apps/neovim/plugins.vim b/apps/neovim/plugins.vim index 0e31b52..56c80d7 100644 --- a/apps/neovim/plugins.vim +++ b/apps/neovim/plugins.vim @@ -110,6 +110,9 @@ Plug 'sheerun/vim-polyglot' " vim plugin loader for many languages " Elixir Plug 'slashmili/alchemist.vim', {'for': ['elixir', 'exs', 'ex']} +" MoonScript +Plug 'leafo/moonscript-vim', {'for': ['moon', 'moonscript']} + call plug#end() " call neomake#configure#automake('nrwi', 500) diff --git a/de/sxhkdrc b/de/sxhkdrc index 4fae910..b518d2e 100755 --- a/de/sxhkdrc +++ b/de/sxhkdrc @@ -140,7 +140,7 @@ super + alt + minus # spawn a transparent node super + alt + t - alacritty && compton-trans -c -o 0 + urxvtc && compton-trans -c -o 0 # rotate the current node super + r @@ -164,11 +164,11 @@ super + shift + t # spawn a terminal super + Return - alacritty + urxvtc # spawn a floating terminal super + shift + Return - bspc rule -a '*' -o state=floating && alacritty --dimensions 80x24 + bspc rule -a '*' -o state=floating && urxvtc --dimensions 80x24 # spawn the app launcher super + space diff --git a/de/xinitrc b/de/xinitrc index 3a3baec..a7ca66e 100644 --- a/de/xinitrc +++ b/de/xinitrc @@ -24,6 +24,8 @@ pulseaudio --start & xset s off -dpms & +urxvtd & + autocutsel -fork & autocutsel -selection PRIMARY -fork & diff --git a/setup b/setup index b486b73..958f7b6 100755 --- a/setup +++ b/setup @@ -65,6 +65,9 @@ links=( "$dfp/apps/qutebrowser/qutebrowser.conf" "$XDG_CONFIG_HOME/qutebrowser/qutebrowser.conf" "$dfp/apps/qutebrowser/keys.conf" "$XDG_CONFIG_HOME/qutebrowser/keys.conf" + # document viewer + "$dfp/apps/zathura/" "$XDG_CONFIG_HOME/zathura" + # terminal emulator "$dfp/apps/alacritty/" "$XDG_CONFIG_HOME/alacritty" diff --git a/shell/aliases b/shell/aliases index 75fe810..497fa54 100644 --- a/shell/aliases +++ b/shell/aliases @@ -23,11 +23,21 @@ alias la='ll -A' # show all alias tree='tree -Csuh' # navigation aliases -alias c="cd \$HOME/.." +function c() { + if [[ -n $1 ]]; then + cd "${NICE_HOME}" || exit 1 + else + cd "${NICE_HOME}" && cd "${[@]}" || exit 1 + fi +} alias cd..="cd .." alias cdd="cd \"\$DOTFILES_PATH\"" # go to dotfiles alias cdc="cd \"\$XDG_CONFIG_HOME\"" # go to +function cdp() { + cd "$(dirname "$(fzf)")" || return +} + # quick parent-directory aliases alias ..="cd .." alias ...="cd ../.." @@ -72,12 +82,6 @@ grb() { git rebase -i "$(git merge-base "$CUR_BRANCH" "$MAIN_BRANCH")" } -# browser aliases -alias qute="qutebrowser --backend webengine" - -# networking aliases -alias p="ping 8.8.8.8" - # DEPRECATED: we use network manager (nmtui/nmcli) now # start netctl using any available profile on the first wireless network # interface @@ -85,6 +89,8 @@ alias p="ping 8.8.8.8" #alias wifi="sudo systemctl start netctl-auto@$(for wli in /sys/class/net/wl*; do echo $(basename $wli); break; done)" # misc aliases +alias qute="qutebrowser --backend webengine" +alias p="ping 8.8.8.8" alias setbg="feh --bg-fill" alias C="clear && clear" alias keyrepeat="xset r rate 250 80" @@ -92,6 +98,7 @@ alias r="ranger" alias sctl="sudo systemctl" alias pt="htop -t" # experimental htop tree-view-by-default alias resrc="source \$HOME/.bashrc" +alias redshift="redshift -l 39.0997:-94.5786" # games aliases # this sometimes fixes steam dynamic library issues? diff --git a/shell/autocompletions b/shell/autocompletions index 593f0f5..660dcbd 100644 --- a/shell/autocompletions +++ b/shell/autocompletions @@ -3,3 +3,5 @@ # autocompletions complete -cf sudo complete -cf man + +complete -F _fzf_path_completion -o default -o bashdefault zathura diff --git a/shell/inputrc b/shell/inputrc index 5a53414..4800332 100644 --- a/shell/inputrc +++ b/shell/inputrc @@ -8,11 +8,16 @@ set editing-mode vi "\C-a": beginning-of-line "\C-e": end-of-line "\C-d": delete-char -"\C-D": "\C-c\C-d" + +"\e\C-p": "cdp\n" # vi settings $if mode=vi set keymap vi-insert - "kj": vi-movement-mode "jk": vi-movement-mode + "Jk": vi-movement-mode + "JK": vi-movement-mode + "jj": vi-movement-mode + "Jj": vi-movement-mode + "JJ": vi-movement-mode $endif