BIG REFACTOR; PLEASE BE ADVISED
finally going to commit that zshrc refactor - smolvsdefault on altaria - i3-utils refactor - no need for custom scwrypt executable anymore - time to say goodbye to the old dotwryn.env in favor of the new and improved rc.ds - vim/rc.d refactor + QuickREPL and QuickCommand replacements for \r and \t - going to stop tracking Archives explicitly until new hard drive - tty-colorscheme is now referenced directly - colorscheme/spring-sunset needed to swap primary/secondary colors for focus in i3 since it was confusing - setup config no longer needs to create ~/.config/wryn/env.vim; added some dependencies to arch-linux - switch from dmenu to rofi by default; allow .i3 overrides in colorschemes; tty-colorscheme is now referenced directly
This commit is contained in:
parent
466d4ec77d
commit
ad66d50b11
@ -1,8 +1,29 @@
|
||||
#!/bin/zsh
|
||||
source ${0:a:h}/xorg.zsh
|
||||
|
||||
USE_SMOL=false
|
||||
xrandr -q | grep $XRANDR_OUTPUT__smol | grep -v 'disconnected' && {
|
||||
xrandr -q | grep $XRANDR_OUTPUT__smol | grep -qv primary && {
|
||||
USE_SMOL=true
|
||||
}
|
||||
}
|
||||
|
||||
XRANDR_ARGS=()
|
||||
case $USE_SMOL in
|
||||
true )
|
||||
XRANDR_ARGS+=(
|
||||
${XRANDR_ARGS__smol__1080p[@]} --pos 0x0 --primary
|
||||
)
|
||||
;;
|
||||
false )
|
||||
XRANDR_ARGS+=(
|
||||
${XRANDR_ARGS__office__4k[@]} --pos 0x0 --primary
|
||||
${XRANDR_ARGS__livingroom__4k[@]} --pos 0x0
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
XRANDR_SET \
|
||||
--screen-blank disable \
|
||||
${XRANDR_ARGS__office__4k[@]} --pos 0x0 --primary \
|
||||
${XRANDR_ARGS__livingroom__4k[@]} --pos 0x0 \
|
||||
${XRANDR_ARGS[@]} \
|
||||
;
|
||||
|
@ -2,9 +2,8 @@
|
||||
source ${0:a:h}/xorg.zsh
|
||||
|
||||
XRANDR_SET \
|
||||
--compositing disable \
|
||||
--compositing enable \
|
||||
--screen-blank disable \
|
||||
--background captain-falcon.jpg \
|
||||
--sound-effect gamedock \
|
||||
${XRANDR_ARGS__smol__1080p[@]} --pos 0x0 --primary \
|
||||
;
|
||||
|
30
bin/i3-utils
30
bin/i3-utils
@ -1,26 +1,24 @@
|
||||
#!/bin/zsh
|
||||
source "$HOME/.config/wryn/env.zsh"
|
||||
case $1 in
|
||||
( next | previous | play-pause ) playerctl $1 ;;
|
||||
( fastforward ) playerctl position 5+ ;;
|
||||
( rewind ) playerctl position 5- ;;
|
||||
|
||||
#next ) scwrypts desktop media -- next ;;
|
||||
#prev ) scwrypts desktop media -- prev ;;
|
||||
#play ) scwrypts desktop media -- play ;;
|
||||
( volumedown ) scwrypts -n desktop pulseaudio -- sink down ;;
|
||||
( volumeup ) scwrypts -n desktop pulseaudio -- sink up ;;
|
||||
( volumemute ) scwrypts -n desktop pulseaudio -- sink mute ;;
|
||||
( micmute ) scwrypts -n desktop pulseaudio -- source mute ;;
|
||||
|
||||
volumeup ) scwrypts desktop pulseaudio -- sink up ;;
|
||||
volumedown ) scwrypts desktop pulseaudio -- sink down ;;
|
||||
volumemute ) scwrypts desktop pulseaudio -- sink mute ;;
|
||||
micmute ) scwrypts desktop pulseaudio -- source mute ;;
|
||||
( backlightup ) scwrypts -n desktop backlight -- up ;;
|
||||
( backlightdown ) scwrypts -n desktop backlight -- down ;;
|
||||
|
||||
backlightup ) scwrypts desktop backlight -- up ;;
|
||||
backlightdown ) scwrypts desktop backlight -- down ;;
|
||||
( lock ) scwrypts -n desktop lock i3 -- ;;
|
||||
|
||||
lock ) scwrypts desktop lock i3 -- ;;
|
||||
( bgrandomize ) scwrypts desktop set i3 background -- random ;;
|
||||
|
||||
bgrandomize ) scwrypts desktop set i3 background -- random ;;
|
||||
( logout ) scwrypts desktop i3 logout -- ;;
|
||||
|
||||
logout ) scwrypts desktop i3 logout -- ;;
|
||||
|
||||
launch )
|
||||
( launch )
|
||||
local PROGRAM
|
||||
local ARGS=()
|
||||
case $2 in
|
||||
@ -40,7 +38,7 @@ case $1 in
|
||||
scwrypts i3 launch or show -- $PROGRAM ${ARGS[@]}
|
||||
;;
|
||||
|
||||
screenshot )
|
||||
( screenshot )
|
||||
command -v deepin-screen-recorder || notify-send "I3 UTILS" "no screenshot application available"
|
||||
deepin-screen-recorder
|
||||
DEEPIN_CONFIG="$HOME/.config/deepin/deepin-screen-recorder/deepin-screen-recorder.conf"
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/zsh
|
||||
__X="$SCWRYPTS_ENV"
|
||||
source $HOME/.config/wryn/env.zsh
|
||||
|
||||
SCWRYPTS_ENV="$__X" "$DOTWRYN/zsh/plugins/scwrypts/scwrypts" $@
|
1
bin/umbreon/scwrypts
Symbolic link
1
bin/umbreon/scwrypts
Symbolic link
@ -0,0 +1 @@
|
||||
../../zsh/plugins/scwrypts/scwrypts
|
@ -5,6 +5,22 @@ foreground: .material.secondary.50
|
||||
alacritty:
|
||||
transparency: 0.85
|
||||
|
||||
i3:
|
||||
focused:
|
||||
border: .material.primary.500
|
||||
indicator: .material.primary.700
|
||||
text: .material.foreground.primary.500
|
||||
|
||||
inactive:
|
||||
border: .material.secondary.400
|
||||
indicator: .material.secondary.500
|
||||
text: .material.foreground.secondary.400
|
||||
|
||||
unfocused:
|
||||
border: .material.secondary.800
|
||||
indicator: .material.secondary.900
|
||||
text: .material.foreground.secondary.800
|
||||
|
||||
ansi:
|
||||
blue:
|
||||
regular: '#5ab5e0'
|
||||
|
@ -1,14 +0,0 @@
|
||||
" -- RC Resources ----------------------------------------------- {{{
|
||||
if empty($DOTWRYN)
|
||||
let $DOTWRYN=expand("$HOME/.wryn")
|
||||
endif
|
||||
let $WRYNVIMPATH=expand("$DOTWRYN/vim")
|
||||
let $WRYNVIMRC=expand("$WRYNVIMPATH/rc.vim")
|
||||
" }}}
|
||||
|
||||
" -- Leader bindings -------------------------------------------- {{{
|
||||
let mapleader = "\\"
|
||||
|
||||
nmap <BS> <Nop>
|
||||
let maplocalleader = "\<BS>"
|
||||
" }}}
|
@ -1,72 +1,21 @@
|
||||
#####################################################################
|
||||
### Path References #################################################
|
||||
### default .wryn configuration settings ############################
|
||||
#####################################################################
|
||||
|
||||
# installation path for this repository
|
||||
export DOTWRYN="$HOME/.wryn"
|
||||
export SOURCE_PACKAGES="$HOME/.local/share/source-packages"
|
||||
|
||||
RELOAD_ZSH_UTILS() {
|
||||
local SCWRYPTS_ROOT="$(scwrypts --root 2>/dev/null)"
|
||||
: \
|
||||
&& [ $SCWRYPTS_ROOT ] \
|
||||
&& [ -d "$SCWRYPTS_ROOT" ] \
|
||||
&& source "$(scwrypts --root)/zsh/lib/utils/utils.module.zsh" \
|
||||
&& export DOTWRYN_UTILS_LOADED=1 \
|
||||
;
|
||||
}
|
||||
[ $DOTWRYN_UTILS_LOADED ] || RELOAD_ZSH_UTILS
|
||||
|
||||
#####################################################################
|
||||
### Application Settings ############################################
|
||||
#####################################################################
|
||||
|
||||
export PREFERRED_EDITOR=(vim vi)
|
||||
|
||||
RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config"
|
||||
# order of editor preference
|
||||
export PREFERRED_EDITORS=(vim vi nano)
|
||||
|
||||
# prompt generator settings
|
||||
PS1_BRANCH_SYMBOL=''
|
||||
PS1_INDICATOR_SYMBOL='☕'
|
||||
PS1_SEPARATOR='::'
|
||||
PS1_USER='%m'
|
||||
|
||||
# run at each zsh login
|
||||
WELCOME () {
|
||||
[[ $TERM =~ tmux ]] && return 0
|
||||
{ figlet 'Welcome, beautiful'; cowsay -p 'damn u sexy'; } | lolcat
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
### External Plugins / Settings #####################################
|
||||
#####################################################################
|
||||
|
||||
# fzf
|
||||
EXTERNAL_PLUGINS+=(
|
||||
'/usr/share/fzf/key-bindings.zsh'
|
||||
'/usr/share/fzf/completion.zsh'
|
||||
)
|
||||
|
||||
export FZF_DEFAULT_OPTS='--reverse --ansi --height 50% --bind=ctrl-c:cancel'
|
||||
export FZF_DEFAULT_COMMAND='rg --files'
|
||||
|
||||
# fzf-tab
|
||||
EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh")
|
||||
|
||||
zstyle ':fzf-tab:*' accept-line enter
|
||||
zstyle ':fzf-tab:*' fzf-bindings 'space:accept' ';:toggle'
|
||||
zstyle ':fzf-tab:*' continuous-trigger '/'
|
||||
|
||||
# scwrypts
|
||||
EXTERNAL_PLUGINS+=("$(scwrypts --root 2>/dev/null)/scwrypts.plugin.zsh")
|
||||
|
||||
for e in \
|
||||
"local.$(hostnamectl --static).secret" \
|
||||
"local.$(hostnamectl --static)" \
|
||||
"local"
|
||||
do export SCWRYPTS_ENV="$e"; [ -f "$HOME/.config/scwrypts/environments/scwrypts/$e" ] && break; done
|
||||
|
||||
# z
|
||||
EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/z/z.sh")
|
||||
|
||||
# code-activator
|
||||
EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/code-activator/activator.plugin.zsh")
|
||||
|
||||
# ssh
|
||||
EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/ssh/ssh.plugin.zsh")
|
||||
|
@ -10,44 +10,44 @@ font pango:Monaspace Argon, pango:Noto Color Emoji, pango:Symbols Nerd Font 16
|
||||
## Custom Utility ##############################################################
|
||||
################################################################################
|
||||
|
||||
set $UTILS /home/w0ryn/.config/i3/utils
|
||||
set $UTILS exec --no-startup-id /home/w0ryn/.config/i3/utils
|
||||
|
||||
# Audio
|
||||
bindsym XF86AudioRewind exec --no-startup-id $UTILS prev
|
||||
bindsym XF86AudioPrev exec --no-startup-id $UTILS prev
|
||||
bindsym XF86AudioForward exec --no-startup-id $UTILS next
|
||||
bindsym XF86AudioNext exec --no-startup-id $UTILS next
|
||||
bindsym XF86AudioPlay exec --no-startup-id $UTILS play
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id $UTILS volumeup
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id $UTILS volumedown
|
||||
bindsym XF86AudioMute exec --no-startup-id $UTILS volumemute
|
||||
bindsym XF86AudioMicMute exec --no-startup-id $UTILS micmute
|
||||
bindsym XF86AudioRewind $UTILS previous
|
||||
bindsym XF86AudioPrev $UTILS previous
|
||||
bindsym XF86AudioForward $UTILS next
|
||||
bindsym XF86AudioNext $UTILS next
|
||||
bindsym XF86AudioPlay $UTILS play-pause
|
||||
bindsym XF86AudioRaiseVolume $UTILS volumeup
|
||||
bindsym XF86AudioLowerVolume $UTILS volumedown
|
||||
bindsym XF86AudioMute $UTILS volumemute
|
||||
bindsym XF86AudioMicMute $UTILS micmute
|
||||
|
||||
# Screen brightness
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id $UTILS backlightup
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id $UTILS backlightdown
|
||||
bindsym XF86MonBrightnessUp $UTILS backlightup
|
||||
bindsym XF86MonBrightnessDown $UTILS backlightdown
|
||||
|
||||
# Quick applications
|
||||
bindsym $mod+Shift+m exec --no-startup-id $UTILS launch messages
|
||||
bindsym $mod+Shift+d exec --no-startup-id $UTILS launch discord
|
||||
bindsym $mod+c exec --no-startup-id $UTILS launch voice
|
||||
bindsym $mod+m exec --no-startup-id $UTILS launch ytmusic
|
||||
bindsym $mod+Shift+s exec --no-startup-id $UTILS launch spotify
|
||||
bindsym $mod+a exec --no-startup-id $UTILS launch pavuctrl
|
||||
bindsym $mod+Shift+p exec --no-startup-id $UTILS launch scrcpy
|
||||
bindsym $mod+Shift+o exec --no-startup-id $UTILS launch obs
|
||||
bindsym $mod+Shift+m $UTILS launch messages
|
||||
bindsym $mod+Shift+d $UTILS launch discord
|
||||
bindsym $mod+c $UTILS launch voice
|
||||
bindsym $mod+m $UTILS launch ytmusic
|
||||
bindsym $mod+Shift+s $UTILS launch spotify
|
||||
bindsym $mod+a $UTILS launch pavuctrl
|
||||
bindsym $mod+Shift+p $UTILS launch scrcpy
|
||||
bindsym $mod+Shift+o $UTILS launch obs
|
||||
|
||||
# Terminal
|
||||
bindsym $mod+Return exec --no-startup-id i3-sensible-terminal
|
||||
|
||||
# Other
|
||||
bindsym $mod+p exec --no-startup-id $UTILS bgrandomize
|
||||
bindsym $mod+p $UTILS bgrandomize
|
||||
|
||||
bindsym $mod+Shift+minus exec --no-startup-id $UTILS lock
|
||||
bindsym $mod+Shift+minus $UTILS lock
|
||||
|
||||
bindsym $mod+space exec --no-startup-id dmenu_run -c -l 5 -fn 'DejaVuSansMono Nerd Font-25'
|
||||
|
||||
bindsym $mod+backslash exec --no-startup-id $UTILS screenshot
|
||||
bindsym $mod+backslash $UTILS screenshot
|
||||
|
||||
################################################################################
|
||||
## Window Management and Navigation ############################################
|
||||
@ -126,6 +126,20 @@ bindsym $mod+Shift+x [class=$GAMES_CLIENT_CLASSES] scratchpad show
|
||||
set $TERMINAL_EMULATOR_CLASSES ^(Alacritty)$
|
||||
bindsym $mod+x [class=$TERMINAL_EMULATOR_CLASSES] scratchpad show
|
||||
|
||||
# floating window / notification compatibility
|
||||
for_window [window_role="About"] floating enable
|
||||
for_window [window_role="Organizer"] floating enable
|
||||
for_window [window_role="Preferences"] floating enable
|
||||
for_window [window_role="bubble"] floating enable
|
||||
for_window [window_role="page-info"] floating enable
|
||||
for_window [window_role="pop-up"] floating enable
|
||||
for_window [window_role="task_dialog"] floating enable
|
||||
for_window [window_role="toolbox"] floating enable
|
||||
for_window [window_role="webconsole"] floating enable
|
||||
for_window [window_type="dialog"] floating enable
|
||||
for_window [window_type="menu"] floating enable
|
||||
for_window [class="[xX]fce4-notifyd"] border pixel 0
|
||||
|
||||
################################################################################
|
||||
## i3 Settings #################################################################
|
||||
################################################################################
|
||||
@ -141,8 +155,6 @@ for_window [class="^.*"] border pixel 4
|
||||
gaps inner 0
|
||||
gaps outer 0
|
||||
|
||||
# prevent borders on xfce4-notifyd
|
||||
for_window [class="[xX]fce4-notifyd"] border pixel 0
|
||||
|
||||
bindsym $mod+z gaps outer current plus 2; gaps inner current plus 2;
|
||||
bindsym $mod+shift+z gaps outer current minus 2; gaps inner current minus 2;
|
||||
|
@ -8,18 +8,18 @@ font:
|
||||
FontAwesome
|
||||
|
||||
application-launcher: >-
|
||||
dmenu_run -c -l 5 -fn 'DejaVuSansMono Nerd Font-25'
|
||||
"rofi -theme $DOTWRYN/config/rofi.theme.rasi -modes drun,run -show run"
|
||||
|
||||
# application-launcher: >-
|
||||
# dmenu_run -c -l 5 -fn 'DejaVuSansMono Nerd Font-25'
|
||||
|
||||
gaps:
|
||||
inner: 0
|
||||
outer: 0
|
||||
|
||||
i3configs:
|
||||
- |-
|
||||
# for use after any command which should refresh the statusbar
|
||||
set $refresh_statusbar killall -SIGUSR1 i3status
|
||||
bar {
|
||||
status_command i3status
|
||||
}
|
||||
# - exec_always --no-startup-id $DOTWRYN/bin/polybar &
|
||||
- exec --no-startup-id i3-msg workspace 1
|
||||
statusbar:
|
||||
# supported values are 'polybar' and 'i3status'
|
||||
type: polybar
|
||||
|
||||
# a list of i3conifg excerpts that should be appended to the generated config
|
||||
i3configs: []
|
||||
|
@ -14,7 +14,6 @@ $DOTWRYN/bin/i3-utils i3/utils
|
||||
$DOTWRYN/colorschemes/active/kitty.conf kitty/theme.conf
|
||||
$DOTWRYN/colorschemes/active/alacritty.toml alacritty/theme.toml
|
||||
$DOTWRYN/colorschemes/active/alacritty.yaml alacritty/theme.yml
|
||||
$DOTWRYN/colorschemes/active/getty.sh wryn/tty-colorscheme
|
||||
$DOTWRYN/config/alacritty.toml alacritty/alacritty.toml
|
||||
$DOTWRYN/config/alacritty.default.toml alacritty/default.toml
|
||||
$DOTWRYN/config/alacritty.yaml alacritty/alacritty.yml
|
||||
|
@ -36,14 +36,13 @@ export LINEAR__API_TOKEN=
|
||||
# s3 bucket name and filesystem targets for media backups
|
||||
export MEDIA_SYNC__S3_BUCKET=yage # from local
|
||||
export MEDIA_SYNC__TARGETS=(
|
||||
.local/share/dolphin-emu
|
||||
.porn
|
||||
Games/roms
|
||||
Games/wrynscape
|
||||
Pictures
|
||||
Documents
|
||||
Media
|
||||
Pictures
|
||||
Archives/recordings
|
||||
.local/.porn
|
||||
Games/roms
|
||||
.local/share/dolphin-emu
|
||||
Games/archives
|
||||
)
|
||||
|
||||
# redis connection credentials
|
||||
|
@ -1,10 +1,24 @@
|
||||
#!/bin/zsh
|
||||
export PATH="$DOTWRYN/bin/$(hostnamectl --static):$PATH"
|
||||
for PREFERRED_TERMINAL in \
|
||||
alacritty \
|
||||
kitty \
|
||||
;
|
||||
do
|
||||
command -v $PREFERRED_TERMINAL &</dev/null \
|
||||
&& export TERMINAL="$(which $PREFERRED_TERMINAL)" \
|
||||
&& break
|
||||
done
|
||||
|
||||
command -v kitty >/dev/null 2>&1 \
|
||||
&& export TERMINAL=$(which kitty)
|
||||
for PREFERRED_BROWSER in \
|
||||
google-chrome-stable \
|
||||
google-chrome \
|
||||
;
|
||||
do
|
||||
command -v $PREFERRED_BROWSER & >/dev/null \
|
||||
&& export BROWSER="$(which $PREFERRED_BROWSER)" \
|
||||
&& break
|
||||
done
|
||||
|
||||
command -v alacritty >/dev/null 2>&1 \
|
||||
&& export TERMINAL=$(which alacritty)
|
||||
for XINITRC in $(find /etc/X11/xinit/xinitrc.d); do source "$XINITRC"; done
|
||||
|
||||
for SCRIPT in $(find /etc/x11/xinit/xinitrc.d); do source $SCRIPT; done
|
||||
unset PREFERRED_TERMINAL PREFERRED_BROWSER XINITRC
|
||||
|
@ -1,23 +1,18 @@
|
||||
#!/bin/zsh
|
||||
source "$HOME/.config/wryn/env.zsh"
|
||||
source "$HOME/.zshrc" &>/dev/null
|
||||
source "$DOTWRYN/config/xinitrc.common"
|
||||
|
||||
command -v dex && dex -a
|
||||
|
||||
for FILE in $(find /etc/X11/xinit/xinitrc.d/ -type f)
|
||||
for BACKGROUND_APPLICATION in \
|
||||
apps \
|
||||
/usr/lib/xfce-polkit/xfce-polkit \
|
||||
/usr/lib/xfce4/notifyd/xfce4-notifyd \
|
||||
"$DOTWRYN/bin/xorg-activate-default" \
|
||||
;
|
||||
do
|
||||
source "$FILE"
|
||||
command -v $BACKGROUND_APPLCATION \
|
||||
&& exec $BACKGROUND_APPLICATION &
|
||||
done
|
||||
unset FILE
|
||||
|
||||
[ -f /usr/lib/xfce-polkit/xfce-polkit ] \
|
||||
&& exec /usr/lib/xfce-polkit/xfce-polkit &
|
||||
|
||||
[ -f /usr/lib/xfce4/notifyd/xfce4-notifyd ] \
|
||||
&& exec /usr/lib/xfce4/notifyd/xfce4-notifyd &
|
||||
|
||||
$DOTWRYN/bin/xorg-activate-default &
|
||||
|
||||
cd
|
||||
export DESKTOP_SESSION=i3wm
|
||||
exec i3
|
||||
|
||||
cd; exec i3
|
||||
|
@ -32,5 +32,5 @@ return 0
|
||||
}
|
||||
|
||||
_SET_THEME__getty() {
|
||||
ln -sf "$_COLORSCHEME_FILE__getty" "$HOME/.config/wryn/tty-colorscheme"
|
||||
return 0 # theme is referenced explicitly after generation
|
||||
}
|
||||
|
@ -66,6 +66,17 @@ I3__GENERATE_CUSTOM_CONFIG() {
|
||||
echo "# - i3 config base : $DOTWRYN/config/i3.conf"
|
||||
echo "# - custom values : $CONFIG_DEFAULT_FILE"
|
||||
echo "# - override values : $CONFIG_OVERRIDE_FILE"
|
||||
|
||||
case $(GET .statusbar.type) in
|
||||
i3status )
|
||||
echo 'set $refresh_statusbar killall -SIGUSR1 i3status'
|
||||
echo 'bar { status_command i3status }'
|
||||
;;
|
||||
polybar )
|
||||
echo "exec_always --no-startup-id $DOTWRYN/bin/polybar &"
|
||||
echo "exec --no-startup-id i3-msg workspace 1"
|
||||
;;
|
||||
esac
|
||||
} > "$I3_CONFIG.temp" \
|
||||
&& sed "
|
||||
/Legacy Defaults/,\$d
|
||||
@ -85,25 +96,25 @@ I3__GENERATE_CUSTOM_CONFIG() {
|
||||
|
||||
s/^\(# color settings\).*$/\1 (theme '$(basename $(readlink -f "$DOTWRYN/colorschemes/active/main.conf") | sed 's/\.conf//')')/
|
||||
|
||||
s/\(^set \$FOCUSED_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .material.secondary.500 .ansi.green.bright)/
|
||||
s/\(^set \$FOCUSED_INDICATOR.*#\).*/\1$(COLOR .material.secondary.700 .ansi.green.regular)/
|
||||
s/\(^set \$FOCUSED_TEXT.*#\).*/\1$(COLOR .material.foreground.secondary.500 .foreground)/
|
||||
s/\(^set \$FOCUSED_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .i3.focused.border .material.secondary.500 .ansi.green.bright)/
|
||||
s/\(^set \$FOCUSED_INDICATOR.*#\).*/\1$(COLOR .i3.focused.indicator .material.secondary.700 .ansi.green.regular)/
|
||||
s/\(^set \$FOCUSED_TEXT.*#\).*/\1$(COLOR .i3.focused.text .material.foreground.secondary.500 .foreground)/
|
||||
|
||||
s/\(^set \$INACTIVE_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .material.primary.500 .ansi.blue.bright)/
|
||||
s/\(^set \$INACTIVE_INDICATOR.*#\).*/\1$(COLOR .material.primary.600 .ansi.blue.regular)/
|
||||
s/\(^set \$INACTIVE_TEXT.*#\).*/\1$(COLOR .material.foreground.primary.500 .foreground)/
|
||||
s/\(^set \$INACTIVE_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .i3.inactive.border .material.primary.500 .ansi.blue.bright)/
|
||||
s/\(^set \$INACTIVE_INDICATOR.*#\).*/\1$(COLOR .i3.inactive.indicator .material.primary.600 .ansi.blue.regular)/
|
||||
s/\(^set \$INACTIVE_TEXT.*#\).*/\1$(COLOR .i3.inactive.text .material.foreground.primary.500 .foreground)/
|
||||
|
||||
s/\(^set \$UNFOCUSED_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .material.primary.700 .ansi.yellow.bright)/
|
||||
s/\(^set \$UNFOCUSED_INDICATOR.*#\).*/\1$(COLOR .material.primary.900 .ansi.yellow.regular)/
|
||||
s/\(^set \$UNFOCUSED_TEXT.*#\).*/\1$(COLOR .material.foreground.primary.700 .foreground)/
|
||||
s/\(^set \$UNFOCUSED_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .i3.unfocused.border .material.primary.700 .ansi.yellow.bright)/
|
||||
s/\(^set \$UNFOCUSED_INDICATOR.*#\).*/\1$(COLOR .i3.unfocused.indicator .material.primary.900 .ansi.yellow.regular)/
|
||||
s/\(^set \$UNFOCUSED_TEXT.*#\).*/\1$(COLOR .i3.unfocused.text .material.foreground.primary.700 .foreground)/
|
||||
|
||||
s/\(^set \$URGENT_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .material.error.500 .ansi.red.bright)/
|
||||
s/\(^set \$URGENT_INDICATOR.*#\).*/\1$(COLOR .material.error.700 .ansi.red.regular)/
|
||||
s/\(^set \$URGENT_TEXT.*#\).*/\1$(COLOR .material.foreground.error.500 .foreground)/
|
||||
s/\(^set \$URGENT_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .i3.urgent.border .material.error.500 .ansi.red.bright)/
|
||||
s/\(^set \$URGENT_INDICATOR.*#\).*/\1$(COLOR .i3.urgent.indicator .material.error.700 .ansi.red.regular)/
|
||||
s/\(^set \$URGENT_TEXT.*#\).*/\1$(COLOR .i3.urgent.text .material.foreground.error.500 .foreground)/
|
||||
|
||||
s/\(^set \$PLACEHOLDER_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .material.primary.300 .ansi.cyan.bright)/
|
||||
s/\(^set \$PLACEHOLDER_INDICATOR.*#\).*/\1$(COLOR .material.primary.100 .ansi.cyan.regular)/
|
||||
s/\(^set \$PLACEHOLDER_TEXT.*#\).*/\1$(COLOR .material.foreground.primary.300 .foreground)/
|
||||
s/\(^set \$PLACEHOLDER_\(BORDER\|BACKGROUND\|CHILD_BORDER\).*#\).*/\1$(COLOR .i3.placeholder.border .material.primary.300 .ansi.cyan.bright)/
|
||||
s/\(^set \$PLACEHOLDER_INDICATOR.*#\).*/\1$(COLOR .i3.placeholder.indicator .material.primary.100 .ansi.cyan.regular)/
|
||||
s/\(^set \$PLACEHOLDER_TEXT.*#\).*/\1$(COLOR .i3.placeholder.text .material.foreground.primary.300 .foreground)/
|
||||
" "$DOTWRYN/config/i3.conf" > "$I3_CONFIG.temp2" \
|
||||
&& grep "^font " "$I3_CONFIG.temp2" >> "$I3_CONFIG.temp" \
|
||||
&& grep "^set " "$I3_CONFIG.temp2" >> "$I3_CONFIG.temp" \
|
||||
|
@ -33,8 +33,7 @@ CONFIG__SET_DEFAULT_SHELL() {
|
||||
#####################################################################
|
||||
|
||||
CONFIG__VIM() {
|
||||
CONFIG__ENV vim || return 1
|
||||
CONFIG__RC vim || return 2
|
||||
CONFIG__RC vim || return 1
|
||||
|
||||
STATUS 'starting vim setup'
|
||||
SCWRYPTS --name system/vim/vundle/install --group scwrypts --type zsh || return 1
|
||||
@ -61,7 +60,6 @@ CONFIG__ENV() {
|
||||
STATUS "setting up $1 configuration ($LOCAL_CONFIG)"
|
||||
|
||||
case $1 in
|
||||
vim ) COMMENT='"' ;;
|
||||
zsh ) COMMENT='#' ;;
|
||||
esac
|
||||
|
||||
@ -96,4 +94,3 @@ CONFIG__RC() {
|
||||
|| FAIL 1 "failed to configure ${TYPE}rc" \
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
1password
|
||||
1password-cli
|
||||
alacritty
|
||||
arch-install-scripts
|
||||
aws-cli-v2
|
||||
base-devel
|
||||
bat
|
||||
cmake
|
||||
cowsay
|
||||
feh
|
||||
figlet
|
||||
fprintd
|
||||
fzf
|
||||
@ -13,20 +17,42 @@ google-chrome
|
||||
htop
|
||||
i3-wm
|
||||
i3lock-color
|
||||
i3status
|
||||
jdk-openjdk
|
||||
jq
|
||||
lolcat
|
||||
lxappearance
|
||||
monaspace-font
|
||||
mono
|
||||
ncurses
|
||||
neofetch
|
||||
nodejs
|
||||
noto-fonts-emoji
|
||||
npm
|
||||
ntp
|
||||
obs-studio
|
||||
openssh
|
||||
pam-fprint-grosshack
|
||||
picom
|
||||
playerctl
|
||||
polybar
|
||||
python
|
||||
python-pip
|
||||
python-pylint
|
||||
python-rtmidi
|
||||
python-virtualenv
|
||||
ripgrep
|
||||
rofi
|
||||
rustup
|
||||
sudo
|
||||
tmux
|
||||
unipicker
|
||||
vi
|
||||
vim
|
||||
vim-runtime
|
||||
which
|
||||
xclip
|
||||
xdotool
|
||||
yamllint
|
||||
zip
|
||||
zsh
|
||||
zsh-completions
|
||||
|
@ -5,6 +5,7 @@ figlet
|
||||
fzf
|
||||
go
|
||||
java
|
||||
jq
|
||||
lolcat
|
||||
ncurses
|
||||
node
|
||||
@ -13,3 +14,4 @@ python3
|
||||
rg
|
||||
tmux
|
||||
xbuild
|
||||
yq
|
||||
|
25
vim/rc.d/00.plugin-vundle.vim
Normal file
25
vim/rc.d/00.plugin-vundle.vim
Normal file
@ -0,0 +1,25 @@
|
||||
if !isdirectory(expand("$HOME/.vim/bundle/Vundle.vim")) | let g:plugins_ok = 0 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
set nocompatible
|
||||
filetype off
|
||||
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
|
||||
call vundle#begin()
|
||||
Plugin 'VundleVim/Vundle.vim' " 00.plugin-vundle.vim
|
||||
Plugin 'valloric/youcompleteme' " 01.plugin-youcompleteme.vim
|
||||
Plugin 'w0rp/ale' " 02.plugin-ale.vim
|
||||
Plugin 'scrooloose/nerdtree' " 03.plugin-nerdtree.vim
|
||||
Plugin 'tpope/vim-surround' " 04.plugin-vim-surround.vim
|
||||
Plugin 'tpope/vim-fugitive' " 05.plugin-vim-fugitive.vim
|
||||
Plugin 'jeffkreeftmeijer/vim-dim' " 07.plugin-vim-dim.vim
|
||||
Plugin 'chrisbra/unicode.vim' " 08.plugin-unicode.vim
|
||||
Plugin 'rrethy/vim-hexokinase' " 09.plugin-vim-hexokinase.vim
|
||||
Plugin 'fatih/vim-go' " 10.plugin-vim-go.vim
|
||||
Plugin 'rust-lang/rust.vim' " 11.plugin-rust.vim
|
||||
" ---------------------------------------------------------------------
|
||||
call vundle#end()
|
||||
|
||||
filetype plugin indent on
|
||||
let g:plugins_ok = 1
|
29
vim/rc.d/01.plugin-youcompleteme.vim
Normal file
29
vim/rc.d/01.plugin-youcompleteme.vim
Normal file
@ -0,0 +1,29 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
||||
let g:ycm_goto_buffer_command = 'new-tab'
|
||||
let g:ycm_auto_hover = ''
|
||||
|
||||
let g:preferred_rust_root = trim(system("rustup toolchain list -v | grep default | sed 's|[^/]*||'"))
|
||||
|
||||
if isdirectory(g:preferred_rust_root)
|
||||
let g:ycm_rust_toolchain_root = g:preferred_rust_root
|
||||
endif
|
||||
|
||||
function! ToggleYCM()
|
||||
if g:ycm_auto_trigger
|
||||
let g:ycm_auto_trigger = 0
|
||||
echohl DiffDelete | echo "YouCompleteMe autocompletion disabled" | echohl None
|
||||
else
|
||||
let g:ycm_auto_trigger = 1
|
||||
echohl DiffAdd | echo "YouCompleteMe autocompletion enabled" | echohl None
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <S-y> :call ToggleYCM()<CR>
|
||||
nnoremap gd :YcmCompleter GoToDefinition<CR>
|
||||
|
||||
augroup ycm_hover
|
||||
autocmd FileType rust,typescript,javascript,python nnoremap <silent><buffer> ? <Plug>(YCMHover)
|
||||
augroup end
|
26
vim/rc.d/02.plugin-ale.vim
Normal file
26
vim/rc.d/02.plugin-ale.vim
Normal file
@ -0,0 +1,26 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:ale_linters = {
|
||||
\ 'cs' : ['OmniSharp'],
|
||||
\ 'python' : ['pylint'],
|
||||
\ 'go' : ['golint'],
|
||||
\ 'rust' : ['analyzer'],
|
||||
\}
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ 'javascript': ['prettier'],
|
||||
\ 'typescript': ['prettier'],
|
||||
\ 'rust': ['rustfmt'],
|
||||
\}
|
||||
|
||||
let g:ale_lint_on_text_changed = 0
|
||||
let g:ale_lint_on_insert_leave = 0
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_sign_column_always = 1
|
||||
|
||||
nnoremap <Leader>at <Plug>(ale_toggle_buffer)
|
||||
nnoremap <Leader>ae <Plug>(ale_next)
|
||||
nnoremap <Leader>ad :YcmDiags<CR> " requires 01.plugin-youcompleteme.vim
|
||||
nnoremap <Leader>ar <Plug>(ale_previous)
|
||||
nnoremap <Leader>f <Plug>(ale_fix)
|
5
vim/rc.d/03.plugin-nerdtree.vim
Normal file
5
vim/rc.d/03.plugin-nerdtree.vim
Normal file
@ -0,0 +1,5 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
nnoremap <C-o> :NERDTreeToggle %<CR>
|
||||
let g:NERDTreeNodeDelimiter = "\u00a0" " -- fixes ^G character
|
3
vim/rc.d/04.plugin-vim-surround.vim
Normal file
3
vim/rc.d/04.plugin-vim-surround.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
9
vim/rc.d/05.plugin-vim-fugitive.vim
Normal file
9
vim/rc.d/05.plugin-vim-fugitive.vim
Normal file
@ -0,0 +1,9 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
" I'm not really convinced this is a useful plugin for me; keeping it
|
||||
" around for a bit longer to see if I find some fantastic way I work
|
||||
" well with it since it is very popular :)
|
||||
|
||||
" \g git fugitive shortcuts
|
||||
nnoremap <Leader>gb :Git blame<CR>
|
3
vim/rc.d/07.plugin-vim-dim.vim
Normal file
3
vim/rc.d/07.plugin-vim-dim.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
4
vim/rc.d/08.plugin-unicode.vim
Normal file
4
vim/rc.d/08.plugin-unicode.vim
Normal file
@ -0,0 +1,4 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
imap <C-U> <Plug>(UnicodeFuzzy)
|
4
vim/rc.d/09.plugin-vim-hexokinase.vim
Normal file
4
vim/rc.d/09.plugin-vim-hexokinase.vim
Normal file
@ -0,0 +1,4 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:Hexokinase_highlighters = ['foregroundfull']
|
8
vim/rc.d/10.plugin-vim-go.vim
Normal file
8
vim/rc.d/10.plugin-vim-go.vim
Normal file
@ -0,0 +1,8 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
let g:go_imports_autosave = 0
|
||||
let g:go_def_mapping_enabled = 0
|
||||
let g:go_fmt_fail_silently = 1
|
||||
let g:go_def_reuse_buffer = 1
|
||||
let g:go_textobj_enabled = 0
|
3
vim/rc.d/11.plugin-rust.vim
Normal file
3
vim/rc.d/11.plugin-rust.vim
Normal file
@ -0,0 +1,3 @@
|
||||
if g:plugins_ok != 1 | finish | endif
|
||||
" -------------------------------------------------------------------
|
||||
|
@ -8,4 +8,4 @@ set timeoutlen=200
|
||||
set showmatch matchtime=0
|
||||
set backspace=indent,eol,start
|
||||
|
||||
set spellfile=$WRYNVIMPATH/en.utf-8.add spelllang=en
|
||||
set spellfile=$DOTWRYN/vim/en.utf-8.add spelllang=en
|
7
vim/rc.d/30.utility.vim
Normal file
7
vim/rc.d/30.utility.vim
Normal file
@ -0,0 +1,7 @@
|
||||
function EnsureTmuxSession()
|
||||
call system("tmux new -ds " . g:escapeTmuxSession . " -c $HOME >/dev/null 2>&1")
|
||||
endfunction
|
||||
|
||||
function FindGitRoot()
|
||||
return finddir('.git/..', expand('%:p:h').';')
|
||||
endfunction
|
@ -1,18 +1,13 @@
|
||||
"
|
||||
" escape-to-shell execution wrapper with great functionality
|
||||
" and an OK-to-bad API (EXTREMELY helpful)
|
||||
"
|
||||
|
||||
let escapeTmuxSession = "vim-exec"
|
||||
let escapeTmuxPaneID = g:escapeTmuxSession . ":0.0"
|
||||
|
||||
let escapeCommandOutputs = ['tmux', 'split-pane-vertical', 'split-pane-horizontal']
|
||||
|
||||
function ExecuteScwrypt(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
let b:scwryptsPrevArgs = a:args
|
||||
call ExecuteCommand('scwrypts -n ' . a:scwrypt . ' -- ' . a:args, a:output, 'shell', a:syntax)
|
||||
echom 'scwrypts -n ' . a:scwrypt . '--' . a:args
|
||||
endfunction
|
||||
|
||||
function ExecuteScwryptInteractive(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
call ExecuteScwrypt(a:scwrypt, a:args . input('scwrypts ' . a:scwrypt . '--' . a:args), a:output, a:syntax)
|
||||
endfunction
|
||||
|
||||
function ExecuteCommand(args = '', output = '', flavor = 'shell', syntax = 'bash')
|
||||
let output = a:output
|
||||
if output == ''
|
||||
@ -83,11 +78,3 @@ function GetPrefferredCommandOutput()
|
||||
|
||||
return 'shell-escape'
|
||||
endfunction
|
||||
|
||||
function EnsureTmuxSession()
|
||||
call system("tmux new -ds " . g:escapeTmuxSession . " -c $HOME >/dev/null 2>&1")
|
||||
endfunction
|
||||
|
||||
function FindGitRoot()
|
||||
return finddir('.git/..', expand('%:p:h').';')
|
||||
endfunction
|
13
vim/rc.d/32.utility-scwrypts.vim
Normal file
13
vim/rc.d/32.utility-scwrypts.vim
Normal file
@ -0,0 +1,13 @@
|
||||
"
|
||||
" 31.utility-execute.vim wrapper for scwrypts-specific execution
|
||||
"
|
||||
|
||||
function ExecuteScwrypt(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
let b:scwryptsPrevArgs = a:args
|
||||
call ExecuteCommand('scwrypts -n ' . a:scwrypt . ' -- ' . a:args, a:output, 'shell', a:syntax)
|
||||
echom 'scwrypts -n ' . a:scwrypt . '--' . a:args
|
||||
endfunction
|
||||
|
||||
function ExecuteScwryptInteractive(scwrypt = '', args = '', output = '', syntax = 'bash')
|
||||
call ExecuteScwrypt(a:scwrypt, a:args . input('scwrypts ' . a:scwrypt . '--' . a:args), a:output, a:syntax)
|
||||
endfunction
|
59
vim/rc.d/34.utility-quick-repl.vim
Normal file
59
vim/rc.d/34.utility-quick-repl.vim
Normal file
@ -0,0 +1,59 @@
|
||||
"
|
||||
" quickly open a REPL with <Leader>r
|
||||
"
|
||||
" tries to guess based on configuration + filetype what repl to use,
|
||||
" otherwise asks the user to provide the required REPL command
|
||||
" for the current buffer
|
||||
"
|
||||
" always uses the last used REPL type unless specified otherwise
|
||||
" in the :call arguments
|
||||
"
|
||||
|
||||
let g:quickrepl_commands_by_filetype = {
|
||||
\ 'python': 'bpython',
|
||||
\ 'zsh': 'zsh',
|
||||
\ 'bash': 'bash',
|
||||
\ 'typescript': 'node',
|
||||
\ 'javascript': 'node',
|
||||
\}
|
||||
|
||||
let g:quickrepl_output_format_default = 'split-pane-horizontal'
|
||||
let g:quickrepl_output_format_overrides_by_repl_command = {
|
||||
\ 'bpython': 'split-pane-vertical',
|
||||
\ 'node': 'split-pane-vertical',
|
||||
\ 'zsh': 'split-pane-vertical',
|
||||
\}
|
||||
|
||||
let g:quickrepl_repl_command_args_by_repl_command= {
|
||||
\ 'zsh': '-l',
|
||||
\}
|
||||
|
||||
function QuickREPL(repl = '')
|
||||
let l:repl = a:repl
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = get(b:, 'quick_repl', '')
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = get(g:quickrepl_commands_by_filetype, &filetype, '')
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
let l:repl = input('input a repl command : ') | redraw
|
||||
endif
|
||||
|
||||
if ( l:repl == '' )
|
||||
echohl DiffDelete | echo "no command supplied; canceled REPL execution" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let b:quick_repl = l:repl
|
||||
|
||||
let l:output = get(g:quickrepl_output_format_overrides_by_repl_command, l:repl, g:quickrepl_output_format_default)
|
||||
let l:repl_args = get(g:quickrepl_repl_command_args, l:repl, '')
|
||||
|
||||
call ExecuteCommand(l:repl . ' ' . l:repl_args, l:output)
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>r :call QuickREPL()<CR>
|
43
vim/rc.d/35.utility-quick-command.vim
Normal file
43
vim/rc.d/35.utility-quick-command.vim
Normal file
@ -0,0 +1,43 @@
|
||||
"
|
||||
" quickly run a custom command with <Leader>t
|
||||
"
|
||||
" this is a safer version of what used to be my 'quicktest'
|
||||
" bindings; sometimes I don't have the time to create a proper
|
||||
" language/technology-specific testing utility, and would
|
||||
" rather run a quick SHELL command at the touch of a button
|
||||
"
|
||||
" this safer, upgrade to the previous bindings (listed below)
|
||||
" requires buffer-level specificity and does not allow quick
|
||||
" commands to bleed between vim sessions and buffers; this
|
||||
" has saved me from some accidental push-to-main-with-admin-power
|
||||
" situations which arose from the previous bindings
|
||||
"
|
||||
" previously:
|
||||
"
|
||||
" " \t = run last quicktest
|
||||
" " t)ype new quicktest
|
||||
" " e)dit last quicktest
|
||||
" nnoremap <Leader>t q:?^echom 'quicktest'<CR><CR><CR>
|
||||
" nnoremap <Leader>tt q:oechom 'quicktest' \| call ExecuteCommand('')<ESC>F'i
|
||||
" nnoremap <Leader>te q:?^echom 'quicktest'<CR>
|
||||
"
|
||||
|
||||
let g:quick_command_output_format = 'split-pane-horizontal'
|
||||
|
||||
function QuickCommand()
|
||||
let l:quick_command = get(b:, 'quick_command', '')
|
||||
if ( l:quick_command == '' )
|
||||
let l:quick_command = input('input quick command : ') | redraw
|
||||
endif
|
||||
|
||||
if ( l:quick_command == '' )
|
||||
echohl DiffDelete | echo "no command supplied; canceled execution" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let b:quick_command = l:quick_command
|
||||
|
||||
call ExecuteCommand(l:quick_command, g:quick_command_output_format)
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>t :call QuickCommand()<CR>
|
@ -1,7 +1,10 @@
|
||||
|
||||
function Sudowrite()
|
||||
execute 'w !sudo tee "%"'
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader><Leader>w :call Sudowrite()<CR>
|
||||
|
||||
function MakeFileExecutable(sudo = 0)
|
||||
if a:sudo
|
||||
execute '! sudo chmod +x "%"'
|
||||
@ -9,3 +12,6 @@ function MakeFileExecutable(sudo = 0)
|
||||
execute '! chmod +x "%"'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader><Leader>x :call MakeFileExecutable(0)<CR>
|
||||
nnoremap <Leader><Leader>xx :call MakeFileExecutable(1)<CR>
|
@ -40,6 +40,15 @@ augroup file_specific_commands
|
||||
autocmd FileType yaml let b:executeBuild = 'call ExecuteScwrypt(b:scwryptBuild, b:scwryptArgs, "split-pane-vertical", "yaml")'
|
||||
autocmd FileType yaml let b:executeTest = 'call ExecuteScwrypt(b:scwryptDefault, b:scwryptArgs, "split-pane-vertical", "yaml")'
|
||||
|
||||
autocmd FileType rust let b:executeDefault = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeDefault = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeInteractive = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet -- ' . input('cargo run -- ') . '\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeInteractive = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo run --quiet -- ' . input('cargo run -- ') . '\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeBuild = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo build\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeBuild = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo build\"', 'split-pane-horizontal')"
|
||||
autocmd FileType rust let b:executeTest = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo test\"', 'split-pane-horizontal')"
|
||||
autocmd BufRead,BufNewFile */Cargo.toml let b:executeTest = "call ExecuteCommand('zsh -c \"cd %:p:h; cargo test\"', 'split-pane-horizontal')"
|
||||
|
||||
" --- OVERRIDES ---------------------------- "
|
||||
|
||||
autocmd FileType *.scwrypts let b:scwryptsType = ""
|
8
vim/rc.d/70.bindings.vim
Normal file
8
vim/rc.d/70.bindings.vim
Normal file
@ -0,0 +1,8 @@
|
||||
" backslash for Leader and backspace for LocalLeader
|
||||
nmap <BS> <Nop>
|
||||
let mapleader = "\\"
|
||||
let maplocalleader = "\<BS>"
|
||||
|
||||
" (e)dit / (s)ource (v)imrc
|
||||
nnoremap <Leader>ev :tabedit $VIMRC<CR>
|
||||
nnoremap <Leader>sv :source $VIMRC<CR>
|
70
vim/rc.vim
70
vim/rc.vim
@ -1,22 +1,15 @@
|
||||
source $HOME/.config/wryn/env.vim
|
||||
|
||||
if isdirectory(expand("$HOME/.vim/bundle/Vundle.vim"))
|
||||
source $WRYNVIMPATH/vundle.vim
|
||||
if empty($DOTWRYN)
|
||||
let $DOTWRYN=expand("$HOME/.wryn")
|
||||
endif
|
||||
|
||||
source $WRYNVIMPATH/options.vim
|
||||
source $WRYNVIMPATH/execute.vim
|
||||
source $WRYNVIMPATH/formatting.vim
|
||||
source $WRYNVIMPATH/file-execute.vim
|
||||
source $WRYNVIMPATH/navigation.vim
|
||||
source $WRYNVIMPATH/color.vim
|
||||
source $WRYNVIMPATH/utility.vim
|
||||
let $VIMRC=expand("$DOTWRYN/vim/rc.vim")
|
||||
for vimrcfile in split(trim(system("find " . expand("$DOTWRYN/vim/rc.d") . " -type f | sort -u")), '\n')
|
||||
execute 'source ' . vimrcfile
|
||||
endfor
|
||||
|
||||
source $WRYNVIMPATH/override/rentdynamics.vim
|
||||
source $WRYNVIMPATH/override/directus.vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" {{{
|
||||
" -------------------------------------------------------------------
|
||||
" --- generic bindings (easy reference) -----------------------------
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
" <SPACE> to execute macro on q
|
||||
nnoremap <Space> @q
|
||||
@ -27,48 +20,22 @@ nnoremap <Leader>q q:
|
||||
" \s previous selection command
|
||||
nnoremap <Leader>s :'<,'>
|
||||
|
||||
" \m to set buffer to modifiable
|
||||
nnoremap <Leader>m :set modifiable<CR>
|
||||
|
||||
" (e)dit / (s)ource vimrc
|
||||
nnoremap <Leader>ev :tabedit $WRYNVIMRC<CR>
|
||||
nnoremap <Leader>sv :source $MYVIMRC<CR>
|
||||
|
||||
" Q to replace current line/selection with bash execution
|
||||
" Q to replace current line(s) with shell execution
|
||||
vnoremap Q !$SHELL<CR>
|
||||
nnoremap Q !!$SHELL<CR>
|
||||
|
||||
" \j like J, but append current line to the line below
|
||||
nnoremap <Leader>j ddpkJ
|
||||
|
||||
" move the current line down/up one
|
||||
nnoremap - :move +1 <CR>
|
||||
nnoremap _ :move -2 <CR>
|
||||
|
||||
" \j like J, but append current line to the line below
|
||||
nnoremap <Leader>j ddpkJ
|
||||
|
||||
" \d insert formatted date below
|
||||
nnoremap <Leader>d :let @d = system("date '+%A, %B %-d, %Y'")<CR>o<C-r>d<BS> <esc>
|
||||
|
||||
" \g git fugitive shortcuts
|
||||
nnoremap <Leader>gb :Git blame<CR>
|
||||
|
||||
" \r = open last REPL (p)ython (n)odejs (c)lisp
|
||||
nnoremap <Leader>r q:?^echom 'quickrepl'<CR><CR>
|
||||
nnoremap <Leader>rp q:oechom 'quickrepl' \| call ExecuteCommand('bpython', 'split-pane-vertical')<CR>
|
||||
nnoremap <Leader>rn q:oechom 'quickrepl' \| call ExecuteCommand('node', 'split-pane-vertical')<CR>
|
||||
nnoremap <Leader>rc q:oechom 'quickrepl' \| call ExecuteCommand('clisp', 'split-pane-horizontal')<CR>
|
||||
nnoremap <Leader>rs q:oechom 'quickrepl' \| call ExecuteCommand('zsh -l', 'split-pane-vertical')<CR>
|
||||
|
||||
" \t = run last quicktest
|
||||
" t)ype new quicktest
|
||||
" e)dit last quicktest
|
||||
nnoremap <Leader>t q:?^echom 'quicktest'<CR><CR><CR>
|
||||
nnoremap <Leader>tt q:oechom 'quicktest' \| call ExecuteCommand('')<ESC>F'i
|
||||
nnoremap <Leader>te q:?^echom 'quicktest'<CR>
|
||||
|
||||
" ./utility.vim
|
||||
nnoremap <Leader><Leader>w :call Sudowrite()<CR>
|
||||
nnoremap <Leader><Leader>x :call MakeFileExecutable(0)<CR>
|
||||
nnoremap <Leader><Leader>xx :call MakeFileExecutable(1)<CR>
|
||||
" \m to set buffer to modifiable
|
||||
nnoremap <Leader>m :set modifiable<CR>
|
||||
|
||||
" (c)opy / (p)aste from xclip
|
||||
" TODO: learn how to compile vim with x11 compatibility and delete
|
||||
@ -79,13 +46,12 @@ nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
|
||||
" enable/disable true color
|
||||
nnoremap <f12> :set invtermguicolors<CR>
|
||||
|
||||
" --- available / rarely used bindings (personal reference) ---
|
||||
" -------------------------------------------------------------------
|
||||
" --- available / rarely used bindings (personal reference) ---------
|
||||
" -------------------------------------------------------------------
|
||||
|
||||
" nnoremap <BS>
|
||||
" nnoremap <C-t>
|
||||
" nnoremap <C-b>
|
||||
" nnoremap z
|
||||
" nnoremap ^
|
||||
|
||||
" }}}
|
||||
" ---------------------------------------------------------------------
|
||||
|
@ -1,86 +0,0 @@
|
||||
set nocompatible
|
||||
filetype off
|
||||
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
|
||||
Plugin 'VundleVim/Vundle.vim'
|
||||
" --- installed plugins -----------------------------------------------
|
||||
" {{{
|
||||
Plugin 'fatih/vim-go'
|
||||
Plugin 'jeffkreeftmeijer/vim-dim'
|
||||
Plugin 'rrethy/vim-hexokinase'
|
||||
Plugin 'scrooloose/nerdtree'
|
||||
Plugin 'tpope/vim-fugitive'
|
||||
Plugin 'tpope/vim-surround'
|
||||
Plugin 'valloric/youcompleteme'
|
||||
Plugin 'w0rp/ale'
|
||||
Plugin 'chrisbra/unicode.vim'
|
||||
" }}}
|
||||
" ---------------------------------------------------------------------
|
||||
call vundle#end()
|
||||
filetype plugin indent on
|
||||
|
||||
" --- plugin configuration --------------------------------------------
|
||||
" {{{
|
||||
|
||||
" fatih/vim-go
|
||||
let g:go_imports_autosave = 0
|
||||
let g:go_def_mapping_enabled = 0
|
||||
let g:go_fmt_fail_silently = 1
|
||||
let g:go_def_reuse_buffer = 1
|
||||
let g:go_textobj_enabled = 0
|
||||
|
||||
|
||||
" rrethy/vim-hexokinase
|
||||
let g:Hexokinase_highlighters = ['foregroundfull']
|
||||
|
||||
" scrooloose/nerdtree
|
||||
nnoremap <C-o> :NERDTreeToggle %<CR>
|
||||
let g:NERDTreeNodeDelimiter = "\u00a0" " -- fixes ^G character
|
||||
|
||||
|
||||
" Valloric/YouCompleteMe
|
||||
function! ToggleYCM()
|
||||
if g:ycm_auto_trigger
|
||||
let g:ycm_auto_trigger = 0
|
||||
echohl DiffDelete | echo "YouCompleteMe autocompletion disabled" | echohl None
|
||||
else
|
||||
let g:ycm_auto_trigger = 1
|
||||
echohl DiffAdd | echo "YouCompleteMe autocompletion enabled" | echohl None
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:ycm_autoclose_preview_window_after_insertion = 1
|
||||
let g:ycm_goto_buffer_command = 'new-tab'
|
||||
|
||||
nnoremap <S-y> :call ToggleYCM()<CR>
|
||||
nnoremap gd :YcmCompleter GoToDefinition<CR>
|
||||
|
||||
|
||||
" w0ryn/ale
|
||||
let g:ale_linters = {
|
||||
\ 'cs' : ['OmniSharp'],
|
||||
\ 'python' : ['pylint'],
|
||||
\ 'go' : ['golint']
|
||||
\}
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ 'javascript': ['prettier'],
|
||||
\ 'typescript': ['prettier']
|
||||
\}
|
||||
|
||||
let g:ale_lint_on_text_changed = 0
|
||||
let g:ale_lint_on_insert_leave = 0
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_sign_column_always = 1
|
||||
|
||||
nmap <Leader>at <Plug>(ale_toggle_buffer)
|
||||
nmap <Leader>ae <Plug>(ale_next)
|
||||
nmap <Leader>ar <Plug>(ale_previous)
|
||||
nmap <Leader>f <Plug>(ale_fix)
|
||||
|
||||
imap <C-U> <Plug>(UnicodeFuzzy)
|
||||
|
||||
" }}}
|
||||
" ---------------------------------------------------------------------
|
80
zsh/alias
80
zsh/alias
@ -1,5 +1,7 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
### basic alias #####################################################
|
||||
#####################################################################
|
||||
|
||||
alias pd='pushd'
|
||||
alias qd='popd'
|
||||
@ -8,10 +10,23 @@ alias lsd='dirs'
|
||||
alias pdo='pwd | xclip' # [p]aste [d]irectory [o]n clipboard
|
||||
alias cdo='cd $(xclip -o)' # [c]hange to [d]irectory [o]n clipboard
|
||||
|
||||
alias restart='clear; source ~/.zshrc'
|
||||
#####################################################################
|
||||
### default command override ########################################
|
||||
#####################################################################
|
||||
|
||||
alias fix='vim $(git diff --name-only | uniq) -p'
|
||||
alias ls='ls --color=auto --group-directories-first'
|
||||
|
||||
command -v bat >/dev/null 2>&1 \
|
||||
&& alias cat='bat --style="plain"'
|
||||
|
||||
command -v startplasma-x11 >/dev/null 2>&1 \
|
||||
&& alias startk="startx '$DOTWRYN/config/xinitrc.kde'"
|
||||
|
||||
command -v i3 >/dev/null 2>&1 \
|
||||
&& alias starti="startx '$DOTWRYN/config/xinitrc.i3'"
|
||||
|
||||
#####################################################################
|
||||
### fancy alias (not technically an "alias" but makes sense here) ###
|
||||
#####################################################################
|
||||
|
||||
w() { # fancy(?) version of "alias w='watch -tcn1 '"
|
||||
@ -37,20 +52,57 @@ w() { # fancy(?) version of "alias w='watch -tcn1 '"
|
||||
watch ${WATCH_ARGS[@]} "zsh -c 'source ~/.zshrc >/dev/null 2>&1; $(while read e; do printf 'export '; printf '%q ' "$e"; echo; done < <(env) | grep '='); echo \" $@\n---------------------------------------------------- \$(date +%H:%m:%S)\"; $@'"
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
erg() { # [e]dit files with [r]ip[g]rep matches
|
||||
$EDITOR $(rg --color=never --files-with-matches $@)
|
||||
}
|
||||
|
||||
command -v bat >/dev/null 2>&1 \
|
||||
&& alias cat='bat --style="plain"'
|
||||
fix() { # [fix] merge conflicts
|
||||
local PREFIX="$(git rev-parse --show-toplevel)"
|
||||
[ $PREFIX ] || return 128
|
||||
|
||||
command -v startplasma-x11 >/dev/null 2>&1 \
|
||||
&& alias startk="startx '$DOTWRYN/config/xinitrc.kde'"
|
||||
local FILE FILES=()
|
||||
for FILE in $(git diff --name-only 2>/dev/null | sort -u)
|
||||
do
|
||||
echo "diff detected in $(basename -- $(dirname -- "$FILE"))/$(basename -- "$FILE")" >&2
|
||||
FILES+=("$PREFIX/$FILE")
|
||||
done
|
||||
|
||||
command -v i3 >/dev/null 2>&1 \
|
||||
&& alias starti="startx '$DOTWRYN/config/xinitrc.i3'"
|
||||
|
||||
#####################################################################
|
||||
|
||||
alias erg='EDIT_RIPGREP_FILE_MATCHES'
|
||||
EDIT_RIPGREP_FILE_MATCHES() { $EDITOR $(rg --color=never -l $@); }
|
||||
[[ ${#FILES[@]} -eq 0 ]] && {
|
||||
echo "no merge conflicts detected"
|
||||
return 0
|
||||
}
|
||||
|
||||
$EDITOR ${FILES[@]}
|
||||
}
|
||||
|
||||
restart() { # reload zshrc with some bonus options
|
||||
local _S EXECUTION_MODE=quiet
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
_S=1
|
||||
case $1 in
|
||||
( -h | --help ) which restart; return 0 ;;
|
||||
( -v | --verbose ) EXECUTION_MODE=verbose ;;
|
||||
( -l | --login ) EXECUTION_MODE=login ;;
|
||||
esac
|
||||
shift $_S
|
||||
done
|
||||
|
||||
case $EXECUTION_MODE in
|
||||
login )
|
||||
echo "--- fresh start c: ---" >&2
|
||||
zsh -l
|
||||
echo "--- fresh end :c ---" >&2
|
||||
;;
|
||||
verbose )
|
||||
source "$HOME/.zshrc"
|
||||
;;
|
||||
quiet )
|
||||
clear
|
||||
source "$HOME/.zshrc" 2>/dev/null
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
return 0
|
||||
|
@ -1,9 +0,0 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
|
||||
alias ls='ls --color=auto --group-directories-first'
|
||||
|
||||
[ -f "$HOME/.config/wryn/tty-colorscheme" ] \
|
||||
&& source "$HOME/.config/wryn/tty-colorscheme"
|
||||
|
||||
#####################################################################
|
54
zsh/rc
54
zsh/rc
@ -1,51 +1,9 @@
|
||||
#!/bin/zsh
|
||||
source "$HOME/.config/wryn/env.zsh"
|
||||
#####################################################################
|
||||
INTERNAL_PLUGINS=(
|
||||
"$DOTWRYN/zsh/config" # must load first
|
||||
$(find "$DOTWRYN/zsh" -mindepth 1 -maxdepth 1 -type f \
|
||||
| grep -v '/rc$' \
|
||||
| grep -v '/config$' \
|
||||
| grep -v '/\.[^/]\+$' \
|
||||
)
|
||||
)
|
||||
|
||||
SET_PREFERRED_EDITOR() {
|
||||
# load preference from environment
|
||||
[[ ${#PREFERRED_EDITOR[@]} -eq 0 ]] && {
|
||||
echo 'unable to find $PREFERRED_EDITOR environment variable'
|
||||
for RC_FILE in $(find "${0:a:h}/rc.d/" -type f | sort)
|
||||
do
|
||||
source "$RC_FILE" || {
|
||||
echo "something went wrong in '$RC_FILE'; aborting dotwryn load"
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ $EDITOR == "${PREFERRED_EDITOR[-1]}" ]] \
|
||||
&& [[ $VISUAL == "${PREFERENCE[-1]}" ]] \
|
||||
&& return 0
|
||||
|
||||
local AVAILABLE_EDITOR=$EDITOR
|
||||
|
||||
for program in $PREFERRED_EDITOR
|
||||
do
|
||||
which $program >/dev/null 2>&1 \
|
||||
&& AVAILABLE_EDITOR="$program" \
|
||||
&& break
|
||||
done
|
||||
|
||||
export EDITOR="$AVAILABLE_EDITOR"
|
||||
export VISUAL="$AVAILABLE_EDITOR"
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
for p in $INTERNAL_PLUGINS; do source $p; done
|
||||
for p in $EXTERNAL_PLUGINS; do [ -f $p ] && source $p; done
|
||||
SET_PREFERRED_EDITOR
|
||||
WELCOME
|
||||
|
||||
echo $PATH | grep -q "^\\(.*:\\|\\)$HOME/.local/bin\\(:.*\\|\\)$" \
|
||||
|| export PATH="$HOME/.local/bin:$PATH"
|
||||
#####################################################################
|
||||
|
||||
[[ $TERM =~ alacritty ]] \
|
||||
&& [[ $(tmux -L omni.socket list-clients | wc -l) -eq 0 ]] \
|
||||
&& scwrypts tmux omni
|
||||
|
||||
true
|
||||
done
|
||||
return 0
|
||||
|
5
zsh/rc.d/00.config.zsh
Normal file
5
zsh/rc.d/00.config.zsh
Normal file
@ -0,0 +1,5 @@
|
||||
: \
|
||||
&& source "$HOME/.config/wryn/env.zsh" \
|
||||
&& [ "$DOTWRYN" ] \
|
||||
&& [ -d "$DOTWRYN" ] \
|
||||
;
|
@ -1,32 +1,29 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
|
||||
HISTFILE=~/.histfile
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=1000
|
||||
HISTFILE=~/.local/zsh.history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
setopt appendhistory autocd beep notify HIST_IGNORE_SPACE
|
||||
unsetopt nomatch
|
||||
|
||||
bindkey -v
|
||||
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
|
||||
# ESC,v to use $EDITOR to modify the current command
|
||||
autoload edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey -M vicmd v edit-command-line
|
||||
|
||||
#####################################################################
|
||||
|
||||
# zsh auto/tab-completion engine
|
||||
zmodload -i zsh/complist
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
zstyle ':completion:*' completer _complete _ignored _approximate
|
||||
zstyle ':completion:*' max-errors 1
|
||||
zstyle ':completion:*' menu select
|
||||
bindkey -M menuselect '^M' .accept-line
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
#####################################################################
|
||||
|
||||
which kitty >/dev/null && kitty + complete setup zsh | source /dev/stdin
|
||||
return 0
|
19
zsh/rc.d/09.config-misc.zsh
Normal file
19
zsh/rc.d/09.config-misc.zsh
Normal file
@ -0,0 +1,19 @@
|
||||
#####################################################################
|
||||
|
||||
# I hate the default "$HOME/go" go path; hide it away
|
||||
[ $GOPATH ] \
|
||||
|| export GOPATH="$HOME/.local/go"
|
||||
|
||||
# not sure if this is needed anymore since I've moved to alacritty,
|
||||
# but leaving this here since it was obnoxious to find
|
||||
which kitty &>/dev/null \
|
||||
&& kitty + complete setup zsh | source /dev/stdin
|
||||
|
||||
# many tmux workflows like to interact with the X-server; however,
|
||||
# the tmux sessions frequently start before the X-session
|
||||
[[ $TERM =~ tmux ]] && [ ! $DISPLAY ] && export DISPLAY=:0
|
||||
|
||||
#RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config"
|
||||
|
||||
#####################################################################
|
||||
return 0
|
11
zsh/rc.d/10.plugins.zsh
Normal file
11
zsh/rc.d/10.plugins.zsh
Normal file
@ -0,0 +1,11 @@
|
||||
#####################################################################
|
||||
|
||||
ZSH_PLUGINS+=(
|
||||
"$DOTWRYN/colorschemes/active/getty.sh"
|
||||
"$DOTWRYN/zsh/plugins/code-activator/activator.plugin.zsh"
|
||||
"$DOTWRYN/zsh/plugins/z/z.sh"
|
||||
"$DOTWRYN/zsh/alias"
|
||||
)
|
||||
|
||||
#####################################################################
|
||||
return 0
|
17
zsh/rc.d/11.plugins-fzf.zsh
Normal file
17
zsh/rc.d/11.plugins-fzf.zsh
Normal file
@ -0,0 +1,17 @@
|
||||
#####################################################################
|
||||
|
||||
ZSH_PLUGINS+=(
|
||||
'/usr/share/fzf/key-bindings.zsh'
|
||||
'/usr/share/fzf/completion.zsh'
|
||||
"$DOTWRYN/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh"
|
||||
)
|
||||
|
||||
export FZF_DEFAULT_OPTS='--reverse --ansi --height 50% --bind=ctrl-c:cancel'
|
||||
export FZF_DEFAULT_COMMAND='rg --files'
|
||||
|
||||
zstyle ':fzf-tab:*' accept-line enter
|
||||
zstyle ':fzf-tab:*' fzf-bindings 'space:accept' ';:toggle'
|
||||
zstyle ':fzf-tab:*' continuous-trigger '/'
|
||||
|
||||
#####################################################################
|
||||
return 0
|
24
zsh/rc.d/15.plugins-scwrypts.zsh
Normal file
24
zsh/rc.d/15.plugins-scwrypts.zsh
Normal file
@ -0,0 +1,24 @@
|
||||
#####################################################################
|
||||
|
||||
ZSH_PLUGINS+=(
|
||||
"$(scwrypts --root 2>/dev/null)/scwrypts.plugin.zsh"
|
||||
)
|
||||
|
||||
() { # default environment name lookup
|
||||
local ENVIRONMENT_NAME HOSTNAME="$(hostnamectl --static)"
|
||||
|
||||
for ENVIRONMENT_NAME in \
|
||||
"local.${HOSTNAME}.secret" \
|
||||
"local.${HOSTNAME}" \
|
||||
"local" \
|
||||
"dev" \
|
||||
;
|
||||
do
|
||||
[ -f "$HOME/.config/scwrypts/environments/scwrypts/$ENVIRONMENT_NAME" ] \
|
||||
&& export SCWRYPTS_ENV="$ENVIRONMENT_NAME" \
|
||||
&& break
|
||||
done
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
return 0
|
3
zsh/rc.d/19.plugins-local.zsh
Normal file
3
zsh/rc.d/19.plugins-local.zsh
Normal file
@ -0,0 +1,3 @@
|
||||
ZSH_PLUGINS+=($(
|
||||
find "$HOME/.local/zsh" -type f 2>/dev/null
|
||||
))
|
19
zsh/rc.d/20.setup-path.zsh
Normal file
19
zsh/rc.d/20.setup-path.zsh
Normal file
@ -0,0 +1,19 @@
|
||||
() { # create path entries
|
||||
local PATH_ENTRY
|
||||
for PATH_ENTRY in \
|
||||
"$HOME/.local/bin" \
|
||||
"$(go env GOPATH 2>/dev/null)/bin" \
|
||||
"$HOME/.$(hostnamectl --static)" \
|
||||
;
|
||||
do
|
||||
echo "$PATH" | sed 's/:/\n/g' | grep -q "^$PATH_ENTRY$" \
|
||||
&& continue # avoid duplicate PATH entries
|
||||
|
||||
mkdir -p "$PATH_ENTRY" 2>/dev/null \
|
||||
|| continue # avoid invalid PATH entries
|
||||
|
||||
export PATH="$PATH_ENTRY:$PATH"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
16
zsh/rc.d/25.setup-editor.zsh
Normal file
16
zsh/rc.d/25.setup-editor.zsh
Normal file
@ -0,0 +1,16 @@
|
||||
() { # set EDITOR/VISUAL variables
|
||||
[[ ${#PREFERRED_EDITORS[@]} -eq 0 ]] && {
|
||||
echo 'unable to find $PREFERRED_EDITORS environment variable'
|
||||
return 1
|
||||
}
|
||||
|
||||
local PROGRAM PROGRAM_EXECUTABLE
|
||||
for PROGRAM in ${PREFERRED_EDITORS[@]}
|
||||
do
|
||||
PROGRAM_EXECUTABLE="$(which $PROGRAM 2>/dev/null)"
|
||||
[ -f "$PROGRAM_EXECUTABLE" ] \
|
||||
&& export EDITOR="$PROGRAM_EXECUTABLE" \
|
||||
&& export VISUAL="$PROGRAM_EXECUTABLE" \
|
||||
&& break
|
||||
done
|
||||
}
|
13
zsh/rc.d/26.setup-unipicker.zsh
Normal file
13
zsh/rc.d/26.setup-unipicker.zsh
Normal file
@ -0,0 +1,13 @@
|
||||
command -v unipicker &>/dev/null || return 0
|
||||
#####################################################################
|
||||
|
||||
__ZSH_SHORTCUT__UNIPICKER() {
|
||||
LBUFFER+="$(unipicker)"
|
||||
zle reset-prompt
|
||||
}
|
||||
|
||||
zle -N unipicker __ZSH_SHORTCUT__UNIPICKER
|
||||
bindkey unipicker
|
||||
|
||||
#####################################################################
|
||||
return 0
|
10
zsh/rc.d/40.import-plugins.zsh
Normal file
10
zsh/rc.d/40.import-plugins.zsh
Normal file
@ -0,0 +1,10 @@
|
||||
() {
|
||||
local PLUGIN
|
||||
|
||||
for PLUGIN in ${ZSH_PLUGINS[@]}
|
||||
do
|
||||
[ -f "$PLUGIN" ] && source "$PLUGIN"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
|
||||
command -v op >/dev/null 2>&1 && {
|
||||
@ -12,4 +11,4 @@ command -v flux >/dev/null 2>&1 && {
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
true
|
||||
return 0
|
@ -1,4 +1,4 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
|
||||
PS1__GET_DIRECTORY() {
|
||||
local _DIRECTORY="%B%F{yellow}%6~"
|
||||
@ -26,7 +26,7 @@ PS1__GET_GIT_BRANCH() {
|
||||
echo $_GIT_BRANCH
|
||||
}
|
||||
|
||||
GENERATE_PS1() {
|
||||
PS1__GENERATE() {
|
||||
local _INDICATOR="%B%(?.%F{green}.%F{red}) $PS1_INDICATOR_SYMBOL"
|
||||
local _USER="%B%F{magenta}$PS1_USER"
|
||||
local _SEPARATOR="%b%F{red}$PS1_SEPARATOR"
|
||||
@ -39,4 +39,7 @@ GENERATE_PS1() {
|
||||
}
|
||||
|
||||
setopt PROMPT_SUBST
|
||||
export PS1="$(GENERATE_PS1)"
|
||||
export PS1="$(PS1__GENERATE)"
|
||||
|
||||
#####################################################################
|
||||
return 0
|
12
zsh/rc.d/99.welcome.zsh
Normal file
12
zsh/rc.d/99.welcome.zsh
Normal file
@ -0,0 +1,12 @@
|
||||
case $TERM in
|
||||
*kitty* | *alacritty* )
|
||||
# when using desktop terminal emulators, automatically launch tmux/omni
|
||||
# if no active omni client can be found
|
||||
: \
|
||||
&& [[ $(tmux -L omni.socket list-clients 2>/dev/null | wc -l) -eq 0 ]] \
|
||||
&& scwrypts tmux omni \
|
||||
|| WELCOME \
|
||||
;
|
||||
;;
|
||||
* ) WELCOME ;;
|
||||
esac
|
@ -1,10 +0,0 @@
|
||||
#!/bin/zsh
|
||||
command -v unipicker >/dev/null 2>&1 || return 0
|
||||
|
||||
__ZSH_SHORTCUT__UNIPICKER() {
|
||||
LBUFFER+="$(unipicker)"
|
||||
zle reset-prompt
|
||||
}
|
||||
|
||||
zle -N unipicker __ZSH_SHORTCUT__UNIPICKER
|
||||
bindkey unipicker
|
Loading…
Reference in New Issue
Block a user