refactor to use scwrypts in setup; use scwrypts everywhere
This commit is contained in:
parent
6157bfe8f9
commit
2b4511739c
@ -1,44 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
source $ZSH_COLOR_UTIL
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
TARGET='https://github.com/vim/vim.git'
|
|
||||||
LOCAL_PATH="$HOME/.packages/vim"
|
|
||||||
|
|
||||||
STATUS 'setting up vim'
|
|
||||||
[ -d $LOCAL_PATH/.git ] && {
|
|
||||||
USER_PROMPT 'vim already compiled; update? [y/N]'
|
|
||||||
read -k yn; echo
|
|
||||||
[[ $yn =~ [^yY] ]] && return 0
|
|
||||||
cd $LOCAL_PATH
|
|
||||||
|
|
||||||
CHECK 'updating vim to latest'
|
|
||||||
git pull >/dev/null 2>&1 \
|
|
||||||
&& OK || FAIL 'unable to update vim'
|
|
||||||
} || {
|
|
||||||
CHECK 'getting vim source'
|
|
||||||
git clone $TARGET $LOCAL_PATH >/dev/null 2>&1 \
|
|
||||||
&& OK || FAIL 'unable to download vim'
|
|
||||||
}
|
|
||||||
cd $LOCAL_PATH
|
|
||||||
|
|
||||||
CHECK 'configuring vim'
|
|
||||||
./configure \
|
|
||||||
--with-features=huge \
|
|
||||||
--enable-cscope \
|
|
||||||
--enable-gtk2-check \
|
|
||||||
--enable-gtk3-check \
|
|
||||||
--enable-gui=auto \
|
|
||||||
--enable-luainterp=yes \
|
|
||||||
--enable-perlinterp=yes \
|
|
||||||
--enable-python3interp=yes \
|
|
||||||
--enable-rubyinterp=yes \
|
|
||||||
--enable-terminal \
|
|
||||||
>/dev/null 2>&1 && OK || FAIL
|
|
||||||
|
|
||||||
CHECK 'building vim'
|
|
||||||
sudo make >/dev/null 2>&1 && OK || FAIL
|
|
||||||
|
|
||||||
CHECK 'installing vim'
|
|
||||||
sudo make install >/dev/null 2>&1 && OK || FAIL
|
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
source $ZSH_COLOR_UTIL
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
TARGET='https://github.com/VundleVim/Vundle.vim.git'
|
|
||||||
VUNDLE_DIR="$HOME/.vim/bundle/Vundle.vim"
|
|
||||||
|
|
||||||
[ ! -d "$VUNDLE_DIR" ] && {
|
|
||||||
CHECK 'installing Vundle.vim'
|
|
||||||
git clone $TARGET $VUNDLE_DIR >>$LOG 2>&1 \
|
|
||||||
&& OK || FAIL
|
|
||||||
} || {
|
|
||||||
CHECK 'updating Vundle.vim'
|
|
||||||
cd $VUNDLE_DIR >>$LOG 2>&1 \
|
|
||||||
&& git pull >>$LOG 2>&1 \
|
|
||||||
&& OK || WARN 'unable to pull latest Vundle.vim'
|
|
||||||
|
|
||||||
cd $PREV_DIR >>$LOG 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
STATUS 'installing Vundle.vim plugins'
|
|
||||||
vim +PluginInstall +qall \
|
|
||||||
&& SUCCESS 'successfully installed Vundle.vim plugins' \
|
|
||||||
|| WARN 'failed to install one or more Vundle.vim plugins' \
|
|
||||||
;
|
|
||||||
|
|
||||||
STATUS 'building plugins (this may take a minute)'
|
|
||||||
$DOTWRYN/bin/vim/rebuild-plugins
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
source $ZSH_COLOR_UTIL
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
function INSTALL() {
|
|
||||||
local CMD_NAME="$1"
|
|
||||||
local BUILD_DIR="$2"
|
|
||||||
local BUILD="$3"
|
|
||||||
|
|
||||||
[ ! -d $BUILD_DIR ] && FATAL "unable to locate $CMD_NAME build files"
|
|
||||||
|
|
||||||
CHECK "Installing $CMD_NAME"
|
|
||||||
$BUILD >/dev/null 2>&1 \
|
|
||||||
&& OK || WARN "failed automated build"
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
function INSTALL_YCM() {
|
|
||||||
local CMD_NAME='YouCompleteMe'
|
|
||||||
local BUILD_DIR="$HOME/.vim/bundle/YouCompleteMe"
|
|
||||||
|
|
||||||
function BUILD() {
|
|
||||||
python3 $BUILD_DIR/install.py
|
|
||||||
}
|
|
||||||
|
|
||||||
INSTALL $CMD_NAME $BUILD_DIR BUILD
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
INSTALL_YCM
|
|
@ -2,15 +2,16 @@
|
|||||||
### Path References #################################################
|
### Path References #################################################
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
DOTWRYN="$HOME/.wryn"
|
export DOTWRYN="$HOME/.wryn"
|
||||||
SFX_PATH="$HOME/Media/sfx"
|
export SFX_PATH="$HOME/Media/sfx"
|
||||||
WALLPAPER_PATH="$HOME/Pictures/bg"
|
export WALLPAPER_PATH="$HOME/Pictures/bg"
|
||||||
|
export SOURCE_PACKAGES="$HOME/.local/share/source-packages"
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
### Application Settings ############################################
|
### Application Settings ############################################
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
PREFERRED_EDITOR=(vim vi)
|
export PREFERRED_EDITOR=(vim vi)
|
||||||
|
|
||||||
# should play an audio file argument
|
# should play an audio file argument
|
||||||
MEDIA_ENGINE='canberra-gtk-play -f'
|
MEDIA_ENGINE='canberra-gtk-play -f'
|
||||||
@ -65,6 +66,8 @@ EXTERNAL_PLUGINS=(
|
|||||||
"$DOTWRYN/zsh/plugins/ssh/ssh.plugin.zsh"
|
"$DOTWRYN/zsh/plugins/ssh/ssh.plugin.zsh"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export SCWRYPTS_ENV='local'
|
||||||
|
|
||||||
FZF_DEFAULT_OPTS='--reverse'
|
FZF_DEFAULT_OPTS='--reverse'
|
||||||
FZF_DEFAULT_COMMAND='rg --files'
|
FZF_DEFAULT_COMMAND='rg --files'
|
||||||
|
|
||||||
@ -72,4 +75,4 @@ zstyle ':fzf-tab:*' accept-line enter
|
|||||||
zstyle ':fzf-tab:*' fzf-bindings 'space:accept' ';:toggle'
|
zstyle ':fzf-tab:*' fzf-bindings 'space:accept' ';:toggle'
|
||||||
zstyle ':fzf-tab:*' continuous-trigger '/'
|
zstyle ':fzf-tab:*' continuous-trigger '/'
|
||||||
|
|
||||||
export ZSH_COLOR_UTIL="$DOTWRYN/zsh/plugins/color/color.module.zsh"
|
LOAD_ZSH_UTILS() { source "$DOTWRYN/zsh/plugins/scwrypts/zsh/utils/utils.module.zsh"; }
|
33
config/scwrypts.dotfile.conf
Normal file
33
config/scwrypts.dotfile.conf
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# scwrypts dot-files config
|
||||||
|
#
|
||||||
|
|
||||||
|
TERMINFO_PATH="$DOTWRYN/config/terminfo"
|
||||||
|
SAFE_SYMLINKS=0
|
||||||
|
|
||||||
|
# lines which begin with '#' are ignored
|
||||||
|
SYMLINKS="
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
# fully qualified path ~/.config/THE-REST
|
||||||
|
# --------------------------------------------------------------------------
|
||||||
|
$DOTWRYN/config/../bin/i3/utils i3/utils
|
||||||
|
$DOTWRYN/config/../colorschemes/kitty.main kitty/theme.conf
|
||||||
|
$DOTWRYN/config/bat.conf bat/config
|
||||||
|
$DOTWRYN/config/code-activator.conf code-activator-zsh/settings.zsh
|
||||||
|
$DOTWRYN/config/compton.conf compton/compton.conf
|
||||||
|
$DOTWRYN/config/git.conf git/config
|
||||||
|
$DOTWRYN/config/i3.conf i3/config
|
||||||
|
$DOTWRYN/config/i3status.conf i3status/config
|
||||||
|
$DOTWRYN/config/kitty.conf kitty/kitty.conf
|
||||||
|
$DOTWRYN/config/mssqlcli.conf mssqlci/config
|
||||||
|
$DOTWRYN/config/pgcli.conf pgcli/config
|
||||||
|
$DOTWRYN/config/pylint.conf pylintrc
|
||||||
|
$DOTWRYN/config/ripgrep.conf ripgrep/config
|
||||||
|
$DOTWRYN/config/scwrypts.conf scwrypts/config
|
||||||
|
$DOTWRYN/config/scwrypts.dotfile.conf scwrypts/config.dotfile.zsh
|
||||||
|
$DOTWRYN/config/scwrypts.local.env scwrypts/env/local
|
||||||
|
$DOTWRYN/config/tmux.conf tmux/tmux.conf
|
||||||
|
$DOTWRYN/config/xcompose.conf X11/xcompose
|
||||||
|
$DOTWRYN/config/xconfig.conf X11/xconfig
|
||||||
|
$DOTWRYN/config/xinitrc X11/xinitrc
|
||||||
|
"
|
10
config/scwrypts.local.env
Normal file
10
config/scwrypts.local.env
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
export AWS_ACCOUNT=088935110352
|
||||||
|
export AWS_PROFILE=yage
|
||||||
|
export AWS_REGION=us-east-2
|
||||||
|
export AWS__EFS__LOCAL_MOUNT_POINT=/mnt/efs/yage
|
||||||
|
export AWS__S3__MEDIA_BUCKET=
|
||||||
|
export AWS__S3__MEDIA_TARGETS=
|
||||||
|
export REDIS_AUTH=
|
||||||
|
export REDIS_HOST=
|
||||||
|
export REDIS_PORT=
|
@ -1,28 +0,0 @@
|
|||||||
APPS__PACKAGE_DIR="$HOME/.packages"
|
|
||||||
|
|
||||||
function SETUP__APPS() {
|
|
||||||
STATUS 'starting application source-build installs'
|
|
||||||
|
|
||||||
APPS__SIMPLE_INSTALL 'https://github.com/tiyn/dmenu' 'patched-dmenu'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function APPS__SIMPLE_INSTALL() {
|
|
||||||
[ ! -d $APPS__PACKAGE_DIR ] && mkdir $APPS__PACKAGE_DIR
|
|
||||||
|
|
||||||
local TARGET="$1"
|
|
||||||
local NAME="$2"
|
|
||||||
local LOCAL_BUILD="$APPS__PACKAGE_DIR/$NAME"
|
|
||||||
|
|
||||||
CHECK "Downloading $NAME"
|
|
||||||
git clone $TARGET $LOCAL_BUILD >>$LOG 2>&1 \
|
|
||||||
&& { OK; cd $LOCAL_BUILD; } || { WARN; return 1; }
|
|
||||||
|
|
||||||
CHECK "Building $NAME"
|
|
||||||
make clean >>$LOG 2>&1 \
|
|
||||||
&& OK || { WARN; return 2; }
|
|
||||||
|
|
||||||
CHECK "Installing $NAME"
|
|
||||||
sudo make install >>$LOG 2>&1 \
|
|
||||||
&& OK || { WARN; return 3; }
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
function SETUP__AWS() {
|
|
||||||
STATUS 'starting aws setup'
|
|
||||||
"$DOTWRYN_PATH/bin/aws/configure"
|
|
||||||
|
|
||||||
STATUS 'getting media from s3'
|
|
||||||
"$DOTWRYN_PATH/bin/aws/s3/sync-media" pull
|
|
||||||
}
|
|
11
setup/cleanup.zsh
Normal file
11
setup/cleanup.zsh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
__yN 'keep logfile?' || {
|
||||||
|
rm "$LOGFILE" \
|
||||||
|
|| __ERROR "unable to remote '$LOGFILE'" \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
__SUCCESS
|
||||||
|
__SUCCESS '.wryn setup complete; have a nice day :)'
|
||||||
|
__SUCCESS
|
||||||
|
|
||||||
|
exit 0
|
@ -1,88 +0,0 @@
|
|||||||
function SETUP__CONFIG() {
|
|
||||||
############################################################################################
|
|
||||||
# ~/.config/THE_REST .wryn/config/THE_REST
|
|
||||||
CONFIG__SYMLINK '../.XCompose' 'xcompose.conf'
|
|
||||||
CONFIG__SYMLINK '../.XConfig' 'xconfig.conf'
|
|
||||||
CONFIG__SYMLINK '../.tmux.conf' 'tmux.conf'
|
|
||||||
CONFIG__SYMLINK '../.xinitrc' 'xinitrc'
|
|
||||||
CONFIG__SYMLINK 'bat/config' 'bat.conf'
|
|
||||||
CONFIG__SYMLINK 'code-activator-zsh/settings.zsh' 'code-activator.conf'
|
|
||||||
CONFIG__SYMLINK 'compton/compton.conf' 'compton.conf'
|
|
||||||
CONFIG__SYMLINK 'git/config' 'git.conf'
|
|
||||||
CONFIG__SYMLINK 'i3/config' 'i3.conf'
|
|
||||||
CONFIG__SYMLINK 'i3/utils' '../bin/i3/utils'
|
|
||||||
CONFIG__SYMLINK 'i3status/config' 'i3status.conf'
|
|
||||||
CONFIG__SYMLINK 'kitty/kitty.conf' 'kitty.conf'
|
|
||||||
CONFIG__SYMLINK 'kitty/theme.conf' '../colorschemes/kitty.main'
|
|
||||||
CONFIG__SYMLINK 'mssqlcli/config' 'mssqlcli.conf'
|
|
||||||
CONFIG__SYMLINK 'pgcli/config' 'pgcli.conf'
|
|
||||||
CONFIG__SYMLINK 'pylintrc' 'pylint.conf'
|
|
||||||
CONFIG__SYMLINK 'ripgrep/config' 'ripgrep.conf'
|
|
||||||
CONFIG__SYMLINK 'scwrypts/config' 'scwrypts.conf'
|
|
||||||
############################################################################################
|
|
||||||
|
|
||||||
CONFIG__TERMINFO
|
|
||||||
|
|
||||||
CONFIG__RC 'zsh'
|
|
||||||
CONFIG__RC 'vim'
|
|
||||||
}
|
|
||||||
|
|
||||||
function CONFIG__SYMLINK() {
|
|
||||||
local LOCAL_CONFIG="$HOME/.config/$1"
|
|
||||||
local DOTWRYN_CONFIG="$DOTWRYN_PATH/config/$2"
|
|
||||||
local FRIENDLY_NAME=$(echo $2 | sed 's/\.conf$//')
|
|
||||||
|
|
||||||
CHECK "linking $FRIENDLY_NAME"
|
|
||||||
{
|
|
||||||
[ ! -d $(dirname $LOCAL_CONFIG) ] && mkdir -p $(dirname $LOCAL_CONFIG)
|
|
||||||
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak"
|
|
||||||
ln -s "$DOTWRYN_CONFIG" "$LOCAL_CONFIG"
|
|
||||||
} >>$LOG 2>&1 && OK || WARN
|
|
||||||
}
|
|
||||||
|
|
||||||
function CONFIG__TERMINFO() {
|
|
||||||
for file in $(find "$DOTWRYN_PATH/setup/terminfo" -type f); do
|
|
||||||
CHECK "adding $(basename $file)"
|
|
||||||
tic -x $file >>$LOG 2>&1 \
|
|
||||||
&& OK || WARN
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function CONFIG__RC() {
|
|
||||||
local DEFAULT_CONFIG="$DOTWRYN_PATH/setup/env/env.$1"
|
|
||||||
local LOCAL_CONFIG="$HOME/.config/wryn/env.$1"
|
|
||||||
|
|
||||||
[ -f $LOCAL_CONFIG ] && {
|
|
||||||
WARNING "local $1 configuration exists ($LOCAL_CONFIG)"
|
|
||||||
USER_PROMPT 'overwrite? [y/N]'
|
|
||||||
READ_K yn
|
|
||||||
[[ $yn =~ ^[yY] ]] && {
|
|
||||||
CHECK "backing up local copy ($LOCAL_CONFIG.bak)"
|
|
||||||
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak" && OK || WARN
|
|
||||||
} || {
|
|
||||||
STATUS 'skipping'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CHECK "setting up $1 configuration ($LOCAL_CONFIG)"
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
vim ) COMMENT='"' ;;
|
|
||||||
zsh ) COMMENT='#' ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "source $DEFAULT_CONFIG"
|
|
||||||
echo -e "\\n$COMMENT\n$COMMENT .wryn configuration overrides\n$COMMENT\n"
|
|
||||||
sed "s/^[^$COMMENT].*/$COMMENT&/" $DEFAULT_CONFIG
|
|
||||||
} > $LOCAL_CONFIG && OK || WARN
|
|
||||||
|
|
||||||
USER_PROMPT 'change local configuration options? [y/N]'
|
|
||||||
READ_K yn
|
|
||||||
|
|
||||||
[[ $yn =~ ^[yY] ]] && {
|
|
||||||
[ ! $EDITOR ] && EDITOR=vi
|
|
||||||
$EDITOR "$HOME/.config/wryn/env.$1"
|
|
||||||
}
|
|
||||||
}
|
|
117
setup/config.zsh
Normal file
117
setup/config.zsh
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
function SETUP__CONFIG() {
|
||||||
|
__STATUS 'starting application configuration'
|
||||||
|
|
||||||
|
CONFIG_USER_SETTINGS="$DOTWRYN_PATH/config/scwrypts.dotfile.conf" \
|
||||||
|
SCWRYPTS zsh/config/update || return 1
|
||||||
|
|
||||||
|
CONFIG__ZSH || return 2
|
||||||
|
CONFIG__VIM || return 3
|
||||||
|
|
||||||
|
__SUCCESS 'finished application configuration'
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
CONFIG__ZSH() {
|
||||||
|
CONFIG__ENV zsh || return 1
|
||||||
|
CONFIG__RC zsh || return 2
|
||||||
|
CONFIG__SET_DEFAULT_SHELL || return 3
|
||||||
|
}
|
||||||
|
|
||||||
|
CONFIG__SET_DEFAULT_SHELL() {
|
||||||
|
local DEFAULT_SHELL=$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd)
|
||||||
|
[[ $DEFAULT_SHELL =~ zsh ]] && return 0
|
||||||
|
|
||||||
|
__STATUS 'setting zsh as default shell'
|
||||||
|
sudo chsh -s $(which zsh) $(whoami) 2>&1 \
|
||||||
|
&& __SUCCESS "set zsh as default shell for '$USER'" \
|
||||||
|
|| __FAIL 1 'failed to set zsh as default shell' \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
CONFIG__VIM() {
|
||||||
|
CONFIG__ENV vim || return 1
|
||||||
|
CONFIG__RC vim || return 2
|
||||||
|
|
||||||
|
__STATUS 'starting vim setup'
|
||||||
|
"$DOTWRYN_PATH/vim/update" \
|
||||||
|
&& __SUCCESS 'completed vim setup' \
|
||||||
|
|| __FAIL 1 'error detected in vim setup (see above)' \
|
||||||
|
;
|
||||||
|
|
||||||
|
CONFIG__VIM_OPEN_IN_PANES_BY_DEFAULT || return 3
|
||||||
|
|
||||||
|
SCWRYPTS zsh/vim/vundle/install || return 4
|
||||||
|
}
|
||||||
|
|
||||||
|
CONFIG__VIM_OPEN_IN_PANES_BY_DEFAULT() {
|
||||||
|
which vim | grep "$HOME/.local/bin/vim" && return 0
|
||||||
|
|
||||||
|
__STATUS 'updating vim to open in panes by default'
|
||||||
|
|
||||||
|
touch "$HOME/.local/bin/vim" \
|
||||||
|
&& chmod +x "$HOME/.local/bin/vim" \
|
||||||
|
|| __FAIL 1 "unable to create '$HOME/.local/bin/vim' executable; does it already exist?" \
|
||||||
|
;
|
||||||
|
|
||||||
|
{ echo '#!/bin/sh'; echo "exec $(which vim) -p "'"$@"'; } > "$HOME/.local/bin/vim" \
|
||||||
|
|| __FAIL 2 "unable to set panes-by-default option" \
|
||||||
|
|
||||||
|
__SUCCESS 'successfully set vim to open in panes by default'
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
CONFIG__ENV() {
|
||||||
|
local DEFAULT_CONFIG="$DOTWRYN_PATH/config/dotwryn.env.$1"
|
||||||
|
local LOCAL_CONFIG="$HOME/.config/wryn/env.$1"
|
||||||
|
|
||||||
|
[ -f $LOCAL_CONFIG ] && {
|
||||||
|
__WARNING "local $1 configuration exists ($LOCAL_CONFIG)"
|
||||||
|
__yN 'overwrite this configuration?' || return 0
|
||||||
|
|
||||||
|
mv "$LOCAL_CONFIG" "$LOCAL_CONFIG.bak" >/dev/null 2>&1 \
|
||||||
|
&& __INFO "created backup of local configuration ($LOCAL_CONFIG.bak)"
|
||||||
|
}
|
||||||
|
|
||||||
|
__STATUS "setting up $1 configuration ($LOCAL_CONFIG)"
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
vim ) COMMENT='"' ;;
|
||||||
|
zsh ) COMMENT='#' ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "source $DEFAULT_CONFIG"
|
||||||
|
echo -e "\\n$COMMENT\n$COMMENT .wryn configuration overrides\n$COMMENT\n"
|
||||||
|
sed "s/^[^$COMMENT].*/$COMMENT&/" $DEFAULT_CONFIG
|
||||||
|
} > $LOCAL_CONFIG \
|
||||||
|
&& __SUCCESS "created $1 configuration" \
|
||||||
|
|| __FAIL 1 "unable to create $1 configuration" \
|
||||||
|
;
|
||||||
|
|
||||||
|
__EDIT "$LOCAL_CONFIG"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CONFIG__RC() {
|
||||||
|
local TYPE="$1"
|
||||||
|
local RC="$HOME/.${TYPE}rc";
|
||||||
|
|
||||||
|
local SOURCE_LINE
|
||||||
|
case $TYPE in
|
||||||
|
zsh ) SOURCE_LINE="source $DOTWRYN_PATH/zsh/rc" ;;
|
||||||
|
vim ) SOURCE_LINE="source $DOTWRYN_PATH/vim/rc.vim" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
grep -q "^$SOURCE_LINE$" "$RC" \
|
||||||
|
|| echo "$SOURCE_LINE" >> $RC
|
||||||
|
|
||||||
|
grep -q "^$SOURCE_LINE$" "$RC" \
|
||||||
|
&& __SUCCESS "${TYPE}rc is configured correctly" \
|
||||||
|
|| __FAIL 1 "failed to configure ${TYPE}rc" \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
156
setup/linux
156
setup/linux
@ -1,156 +0,0 @@
|
|||||||
#!/usr/bin/zsh
|
|
||||||
[[ $EUID -eq 0 ]] && { echo 'ERROR::Setup cannot be run as root'; exit 1; }
|
|
||||||
command -v zsh >/dev/null || { echo 'ERROR::`zsh` required'; exit 1; }
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
### Pre/Post Processing ########################################################
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
cd "${0:a:h}"
|
|
||||||
export DOTWRYN_PATH="$(git rev-parse --show-toplevel)"
|
|
||||||
cd $DOTWRYN_PATH
|
|
||||||
|
|
||||||
SOURCE_ZSH_SUBMODULE() {
|
|
||||||
local NAME="$1"
|
|
||||||
|
|
||||||
local SUBMODULE_PATH=$(\
|
|
||||||
git config --file "$DOTWRYN_PATH/.gitmodules" --get-regexp "$NAME.path"\
|
|
||||||
| awk '{print $2;}'\
|
|
||||||
)
|
|
||||||
local MODULE="$(ls $DOTWRYN_PATH/$SUBMODULE_PATH/*.module.zsh)"
|
|
||||||
|
|
||||||
source $MODULE
|
|
||||||
}
|
|
||||||
|
|
||||||
INIT() {
|
|
||||||
printf 'initializing required submodules...'
|
|
||||||
git submodule update --init --remote --recursive >/dev/null 2>&1 || {
|
|
||||||
echo 'failed!'
|
|
||||||
echo 'unable to initialize required submodules'
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
SOURCE_ZSH_SUBMODULE 'color-zsh'
|
|
||||||
echo 'done!'
|
|
||||||
source "$DOTWRYN_PATH/zsh/utils"
|
|
||||||
clear
|
|
||||||
STATUS 'starting .wryn install'
|
|
||||||
|
|
||||||
export LOG="$HOME/dotwryn-install.log"
|
|
||||||
echo "install start : $(date)" > $LOG
|
|
||||||
STATUS "subprocess log can be found here : $LOG"
|
|
||||||
}
|
|
||||||
|
|
||||||
CLEANUP() {
|
|
||||||
local ERROR="$1"
|
|
||||||
CLEAN_BACKUP
|
|
||||||
|
|
||||||
[ ! $ERROR ] \
|
|
||||||
&& USER_PROMPT "keep logfile ($LOG)? [y/N]" \
|
|
||||||
|| USER_PROMPT "keep logfile ($LOG)? [Y/n]" \
|
|
||||||
;
|
|
||||||
|
|
||||||
READ_K yn
|
|
||||||
case $yn in
|
|
||||||
y | Y )
|
|
||||||
STATUS 'keeping logfile'
|
|
||||||
;;
|
|
||||||
n | N )
|
|
||||||
CHECK 'removing logfile'
|
|
||||||
rm $LOG && OK || WARN "unable to remove '$LOG'"
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
[ $ERROR ] && { STATUS 'keeping logfile'; return; }
|
|
||||||
CHECK 'removing logfile'
|
|
||||||
rm $LOG && OK || WARN "unable to remove '$LOG'"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
CLEAN_BACKUP() {
|
|
||||||
USER_PROMPT 'clean backup files? [Y/n]'
|
|
||||||
READ_K yn
|
|
||||||
|
|
||||||
case $yn in
|
|
||||||
[nN]* ) STATUS 'skipping cleanup' ;;
|
|
||||||
* )
|
|
||||||
STATUS 'cleaning backup files'
|
|
||||||
for file in $(find "$HOME/.config/" -name \*.bak 2>/dev/null)
|
|
||||||
do
|
|
||||||
CHECK "removing '$file'"
|
|
||||||
rm -- "$file" >>$LOG 2>&1 && OK || WARN
|
|
||||||
done
|
|
||||||
for file in $(find "$HOME" -maxdepth 1 -name .\*.bak 2>/dev/null)
|
|
||||||
do
|
|
||||||
CHECK "removing '$file'"
|
|
||||||
rm -- "$file" >>$LOG 2>&1 && OK || WARN
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
### General Setup Utilities ####################################################
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
GET_SUDO_PASSWORD() {
|
|
||||||
sudo echo hi >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
MAKE_REQUIRED_DIRECTORY_STRUCTURE() {
|
|
||||||
DIRECTORIES=(
|
|
||||||
"$HOME/.config/wryn"
|
|
||||||
"$HOME/.local/bin"
|
|
||||||
"$HOME/.packages"
|
|
||||||
"$HOME/.vim/bundle"
|
|
||||||
"$HOME/.vim/colors"
|
|
||||||
)
|
|
||||||
FILES=(
|
|
||||||
"$HOME/.vimrc"
|
|
||||||
"$HOME/.zshrc"
|
|
||||||
)
|
|
||||||
|
|
||||||
for D in $DIRECTORIES; do [ ! -d $D ] && mkdir -p $D; done
|
|
||||||
for F in $FILES; do [ ! -f $F ] && touch $F; done
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
source "$DOTWRYN_PATH/setup/os.setup.zsh"
|
|
||||||
source "$DOTWRYN_PATH/setup/config.setup.zsh"
|
|
||||||
source "$DOTWRYN_PATH/setup/zsh.setup.zsh"
|
|
||||||
source "$DOTWRYN_PATH/setup/vim.setup.zsh"
|
|
||||||
source "$DOTWRYN_PATH/setup/apps.setup.zsh"
|
|
||||||
source "$DOTWRYN_PATH/setup/aws.setup.zsh"
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
### Full Setup #################################################################
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
INIT
|
|
||||||
|
|
||||||
GET_SUDO_PASSWORD
|
|
||||||
SETUP__OS_DEPENDENCY || FATAL 'user abort'
|
|
||||||
MAKE_REQUIRED_DIRECTORY_STRUCTURE
|
|
||||||
|
|
||||||
SETUP__CONFIG || ERROR=1
|
|
||||||
|
|
||||||
SETUP__ZSH || ERROR=2
|
|
||||||
SETUP__VIM || ERROR=3
|
|
||||||
SETUP__APPS || ERROR=4
|
|
||||||
SETUP__AWS || ERROR=5
|
|
||||||
|
|
||||||
CLEANUP $ERROR
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
SUCCESS
|
|
||||||
SUCCESS '.wryn setup complete; have a nice day :)'
|
|
||||||
SUCCESS
|
|
||||||
echo
|
|
||||||
echo
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,85 +0,0 @@
|
|||||||
source "$DOTWRYN_PATH/setup/yay.setup.zsh"
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
### Automated System Dependency Install ########################################
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
[ $DOTWRYN_PATH ]\
|
|
||||||
&& DEPENDENCY_DIR="$DOTWRYN_PATH/setup/os-dependencies" \
|
|
||||||
|| DEPENDENCY_DIR="${0:a:h}/os-dependencies"
|
|
||||||
|
|
||||||
function SETUP__OS_DEPENDENCY() {
|
|
||||||
local ERROR=0
|
|
||||||
STATUS 'checking os dependencies'
|
|
||||||
|
|
||||||
local OS_NAME=$(lsb_release -is 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
|
||||||
[ ! $OS_NAME ] && {
|
|
||||||
OS_NAME=$(cat /etc/os-release | grep ^ID= | sed 's/^ID=//')
|
|
||||||
}
|
|
||||||
STATUS "detected os '$OS_NAME'"
|
|
||||||
|
|
||||||
case $OS_NAME in
|
|
||||||
arch )
|
|
||||||
OS_INSTALL() { OS_INSTALL__ARCH $@; }
|
|
||||||
WARNING 'base-devel is required; make sure it is installed'
|
|
||||||
YAY__INSTALL_FROM_SOURCE
|
|
||||||
;;
|
|
||||||
debian | ubuntu )
|
|
||||||
OS_INSTALL() { OS_INSTALL__DEBIAN $@; }
|
|
||||||
OS_NAME='debian'
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
WARNING
|
|
||||||
WARNING "no automated installer available for '$OS_NAME'"
|
|
||||||
WARNING "if dependency shows a warning, install the indicated package"
|
|
||||||
WARNING
|
|
||||||
OS_INSTALL() { OS_INSTALL__GENERIC $@; }
|
|
||||||
OS_NAME='generic'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
for DEPENDENCY in $(cat "$DEPENDENCY_DIR/$OS_NAME.txt")
|
|
||||||
do
|
|
||||||
OS_INSTALL $DEPENDENCY || ERROR=1
|
|
||||||
done
|
|
||||||
unset -f OS_INSTALL
|
|
||||||
|
|
||||||
[[ $ERROR -eq 0 ]] && {
|
|
||||||
SUCCESS 'all dependencies satisfied'
|
|
||||||
USER_PROMPT 'continue with install? [Y/n]'
|
|
||||||
READ_K yn
|
|
||||||
[[ $yn =~ ^[nN] ]] && ERROR=1; true
|
|
||||||
} || {
|
|
||||||
WARNING 'detected errors; double check warnings before proceeding!'
|
|
||||||
USER_PROMPT 'continue with install? [y/N]'
|
|
||||||
READ_K yn
|
|
||||||
[[ $yn =~ ^[yY] ]] && ERROR=0
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ERROR
|
|
||||||
}
|
|
||||||
|
|
||||||
function OS_INSTALL__ARCH() {
|
|
||||||
local TARGET="$1"
|
|
||||||
CHECK "checking for $TARGET"
|
|
||||||
pacman -Qq | grep -q "^$TARGET$\|^$TARGET-git$" && OK || {
|
|
||||||
WARN "$TARGET not found"
|
|
||||||
CHECK "installing $TARGET"
|
|
||||||
sudo pacman -Syu --noconfirm $TARGET >>$LOG 2>&1 \
|
|
||||||
&& OK || { WARN "failed to install $TARGET"; return 1; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function OS_INSTALL__DEBIAN() {
|
|
||||||
local TARGET="$1"
|
|
||||||
CHECK "checking / installing $PACKAGE"
|
|
||||||
sudo apt-get install --yes $PACKAGE >>$LOG 2>&1 \
|
|
||||||
&& OK || { WARN "failed to install $TARGET"; return 1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
function OS_INSTALL__GENERIC() {
|
|
||||||
local COMMAND="$1"
|
|
||||||
CHECK "checking for $COMMAND"
|
|
||||||
command -v $COMMAND >/dev/null 2>&1 \
|
|
||||||
&& OK || { WARN; return 1; }
|
|
||||||
}
|
|
144
setup/os.zsh
Normal file
144
setup/os.zsh
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
#####################################################################
|
||||||
|
|
||||||
|
SETUP__OS() {
|
||||||
|
__GETSUDO
|
||||||
|
|
||||||
|
local OS_NAME=$(OS__GET_OS)
|
||||||
|
[ ! $OS_NAME ] && __ABORT
|
||||||
|
|
||||||
|
OS__INSTALL_SOURCE_DEPENDENCIES || return 1
|
||||||
|
OS__INSTALL_MANAGED_DEPENDENCIES || return 2
|
||||||
|
OS__MAKE_REQUIRED_RESOURCES || return 3
|
||||||
|
}
|
||||||
|
|
||||||
|
OS__GET_OS() {
|
||||||
|
local OS_NAME=$(lsb_release -is 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
[ ! $OS_NAME ] \
|
||||||
|
&& OS_NAME=$(cat /etc/os-release 2>/dev/null | grep '^ID=' | sed 's/^ID=//')
|
||||||
|
|
||||||
|
[ ! $OS_NAME ] \
|
||||||
|
&& __WARNING 'failed to detect operating system' \
|
||||||
|
&& OS_NAME=$(echo -e "arch\ndebian\nother" | __FZF 'select an operating system') \
|
||||||
|
;
|
||||||
|
|
||||||
|
[[ $OS_NAME =~ ^ubuntu$ ]] && OS_NAME=debian
|
||||||
|
|
||||||
|
echo $OS_NAME
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
OS__INSTALL_SOURCE_DEPENDENCIES() {
|
||||||
|
case $OS_NAME in
|
||||||
|
arch )
|
||||||
|
SCWRYPTS zsh/git/package/install \
|
||||||
|
'https://aur.archlinux.org/yay.git' \
|
||||||
|
--local-name 'yay' \
|
||||||
|
;
|
||||||
|
;;
|
||||||
|
debian ) ;;
|
||||||
|
* ) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
SCWRYPTS zsh/git/package/install \
|
||||||
|
'https://github.com/tiyn/dmenu' \
|
||||||
|
--local-name 'patched-dmenu' \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
OS__INSTALL_MANAGED_DEPENDENCIES() {
|
||||||
|
local ERRORS=0
|
||||||
|
|
||||||
|
__STATUS 'checking os dependencies'
|
||||||
|
case $OS_NAME in
|
||||||
|
arch )
|
||||||
|
__REMINDER "package 'base-devel' is required"
|
||||||
|
;;
|
||||||
|
debian ) ;;
|
||||||
|
* )
|
||||||
|
OS_NAME='generic'
|
||||||
|
__WARNING "no automated installer available for '$OS_NAME'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
for DEPENDENCY in $(cat "$DOTWRYN_PATH/setup/os-dependencies/$OS_NAME.txt")
|
||||||
|
do
|
||||||
|
INSTALL_MANAGED__$OS_NAME $DEPENDENCY
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ $ERRORS -ne 0 ]] && {
|
||||||
|
__WARNING "detected $ERRORS errors; double check warnings before proceeding!"
|
||||||
|
__yN 'continue with install?' && return 0 || __ABORT
|
||||||
|
}
|
||||||
|
|
||||||
|
__SUCCESS 'all dependencies satisfied'
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTALL_MANAGED__arch() {
|
||||||
|
local TARGET="$1"
|
||||||
|
|
||||||
|
__STATUS "checking for $TARGET"
|
||||||
|
|
||||||
|
pacman -Qq | grep -q "^$TARGET$\|^$TARGET-git$" && {
|
||||||
|
__SUCCESS "found installation of '$TARGET'"
|
||||||
|
} || {
|
||||||
|
__WARNING "'$TARGET' not found"
|
||||||
|
|
||||||
|
__STATUS "installing '$TARGET'"
|
||||||
|
sudo pacman -Syu --noconfirm $TARGET \
|
||||||
|
&& __SUCCESS "successfully installed '$TARGET'" \
|
||||||
|
|| __ERROR "failed to install '$TARGET'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTALL_MANAGED__debian() {
|
||||||
|
__STATUS "checking / installing '$1'"
|
||||||
|
sudo apt-get install --yes $1 \
|
||||||
|
&& __SUCCESS "'$1' installed" \
|
||||||
|
|| __ERROR "failed to install $TARGET" \
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTALL_MANAGED__generic() {
|
||||||
|
command -v $1 >/dev/null 2>&1 \
|
||||||
|
|| __ERROR "could not find '$1'; it's up to you to install this one!"
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
OS__MAKE_REQUIRED_RESOURCES() {
|
||||||
|
local ERRORS=0
|
||||||
|
local DIRECTORIES=(
|
||||||
|
"$HOME/.config/wryn"
|
||||||
|
"$HOME/.local/bin"
|
||||||
|
"$HOME/.vim/bundle"
|
||||||
|
"$HOME/.vim/colors"
|
||||||
|
)
|
||||||
|
|
||||||
|
local FILES=(
|
||||||
|
"$HOME/.vimrc"
|
||||||
|
"$HOME/.zshrc"
|
||||||
|
)
|
||||||
|
|
||||||
|
__STATUS 'making required system resources'
|
||||||
|
for D in $DIRECTORIES
|
||||||
|
do
|
||||||
|
[ ! -d $D ] && { mkdir -p $D || __ERROR "failed to create directory '$D'"; }
|
||||||
|
done
|
||||||
|
|
||||||
|
for F in $FILES
|
||||||
|
do
|
||||||
|
[ ! -f $F ] && { touch $F || __ERROR "failed to create file '$F'"; }
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ $ERRORS -eq 0 ]] \
|
||||||
|
&& __SUCCESS 'finished creating system resources' \
|
||||||
|
|| __ERROR 'failed to create system resources' \
|
||||||
|
;
|
||||||
|
|
||||||
|
return $ERRORS
|
||||||
|
}
|
33
setup/requirements.zsh
Normal file
33
setup/requirements.zsh
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[[ $EUID -eq 0 ]] && { echo 'ERROR::Setup cannot be run as root'; exit 1; }
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
#printf 'initializing required submodules...' >&2
|
||||||
|
#git submodule update --init --remote --recursive >/dev/null 2>&1 || {
|
||||||
|
# echo 'failed!' >&2
|
||||||
|
# echo 'unable to initialize required submodules' >&2
|
||||||
|
# exit 2
|
||||||
|
#}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
# normally "DOTWRYN", but uses "DOTWRYN_PATH" to avoid conflict during setup
|
||||||
|
cd "${0:a:h}"
|
||||||
|
export DOTWRYN_PATH="$(git rev-parse --show-toplevel)"
|
||||||
|
cd "$DOTWRYN_PATH"
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
_DEPENDENCIES+=(zsh fzf)
|
||||||
|
_REQUIRED_ENV+=()
|
||||||
|
source "$DOTWRYN_PATH/zsh/plugins/scwrypts/zsh/utils/utils.module.zsh" || exit 3
|
||||||
|
|
||||||
|
SCWRYPTS() { CI=1 "$DOTWRYN_PATH/zsh/plugins/scwrypts/scwrypts" -n $1 -- ${@:2}; }
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
source "$DOTWRYN_PATH/setup/os.zsh"
|
||||||
|
source "$DOTWRYN_PATH/setup/config.zsh"
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
clear
|
16
setup/run
Executable file
16
setup/run
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
source ${0:a:h}/requirements.zsh || exit 1
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
LOGFILE="$HOME/dotwryn-install.log"
|
||||||
|
|
||||||
|
__INFO "installation start : $(date)" 2>> "$LOGFILE"
|
||||||
|
{
|
||||||
|
SETUP__OS || __FAIL 1 'failed to set up os-dependencies (see above)'
|
||||||
|
SETUP__CONFIG || __FAIL 2 'failed to set up program configuration (see above)'
|
||||||
|
} 2>&1 | tee --append "$LOGFILE"
|
||||||
|
|
||||||
|
__INFO "installation complete: $(date)" 2>> "$LOGFILE"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
source "$DOTWRYN_PATH/setup/cleanup.zsh"
|
@ -1,34 +0,0 @@
|
|||||||
function SETUP__VIM() {
|
|
||||||
STATUS 'starting vim setup'
|
|
||||||
"$DOTWRYN_PATH/bin/vim/compile"
|
|
||||||
VIM__SOURCE_RC
|
|
||||||
"$DOTWRYN_PATH/bin/vim/install-plugins"
|
|
||||||
VIM__CREATE_PANE_DEFAULT_APP
|
|
||||||
STATUS 'finished vim setup'
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
function VIM__SOURCE_RC() {
|
|
||||||
local LOCAL_VIMRC="$HOME/.vimrc";
|
|
||||||
local SOURCE_LINE="source $DOTWRYN_PATH/vim/rc.vim";
|
|
||||||
|
|
||||||
grep -q "^$SOURCE_LINE$" $LOCAL_VIMRC && {
|
|
||||||
STATUS 'already set up vimrc'
|
|
||||||
} || {
|
|
||||||
CHECK 'setting up vimrc'
|
|
||||||
echo $SOURCE_LINE >> $LOCAL_VIMRC \
|
|
||||||
&& OK || WARN
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function VIM__CREATE_PANE_DEFAULT_APP() {
|
|
||||||
which vim | grep "$HOME/.local/bin/vim" && return 0
|
|
||||||
|
|
||||||
CHECK 'updating vim to open in panes by default'
|
|
||||||
{
|
|
||||||
echo '#!/bin/sh'
|
|
||||||
echo "exec $(which vim) -p "'"$@"'
|
|
||||||
} > "$HOME/.local/bin/vim" && OK || WARN
|
|
||||||
chmod +x "$HOME/.local/bin/vim"
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
YAY__SOURCE_TARGET='https://aur.archlinux.org/yay.git'
|
|
||||||
YAY__LOCAL_PATH="$HOME/.packages/yay"
|
|
||||||
|
|
||||||
YAY__INSTALL_FROM_SOURCE() {
|
|
||||||
CHECK 'verifying yay install'
|
|
||||||
[ -d $YAY__LOCAL_PATH ] \
|
|
||||||
&& { OK; return 0; } || WARN
|
|
||||||
|
|
||||||
CHECK 'downloading yay'
|
|
||||||
git clone $ARCH__YAY_TARGET $YAY__LOCAL_PATH >>$LOG 2>&1\
|
|
||||||
&& OK || { WARN; return 1; }
|
|
||||||
|
|
||||||
cd $YAY__LOCAL_PATH
|
|
||||||
CHECK 'installing yay'
|
|
||||||
yes | makepkg -si >>$LOG 2>&1 \
|
|
||||||
&& OK || { WARN; return 1; }
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
#####################################################################
|
|
||||||
|
|
||||||
function SETUP__ZSH() {
|
|
||||||
ZSH__SET_DEFAULT_SHELL
|
|
||||||
ZSH__SOURCE_RC
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################################################
|
|
||||||
|
|
||||||
function ZSH__SET_DEFAULT_SHELL() {
|
|
||||||
local DEFAULT_SHELL=$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd)
|
|
||||||
CHECK 'setting zsh as default shell'
|
|
||||||
sudo chsh -s $(which zsh) $(whoami)>>$LOG 2>&1 \
|
|
||||||
&& OK || WARN 'failed to set zsh as default shell'
|
|
||||||
}
|
|
||||||
|
|
||||||
function ZSH__SOURCE_RC() {
|
|
||||||
local LOCAL_ZSHRC="$HOME/.zshrc";
|
|
||||||
local SOURCE_LINE="source $DOTWRYN_PATH/zsh/rc";
|
|
||||||
|
|
||||||
grep -q "^$SOURCE_LINE$" $LOCAL_ZSHRC && {
|
|
||||||
STATUS 'already set up zshrc'
|
|
||||||
} || {
|
|
||||||
CHECK 'setting up zshrc'
|
|
||||||
echo $SOURCE_LINE >> $LOCAL_ZSHRC \
|
|
||||||
&& OK || WARN
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,6 +9,10 @@ nnoremap <C-l> <C-w>l
|
|||||||
nnoremap <C-h> <C-w>h
|
nnoremap <C-h> <C-w>h
|
||||||
nnoremap <C-j> <C-w>j
|
nnoremap <C-j> <C-w>j
|
||||||
nnoremap <C-k> <C-w>k
|
nnoremap <C-k> <C-w>k
|
||||||
|
tnoremap <C-l> <C-w>l
|
||||||
|
tnoremap <C-h> <C-w>h
|
||||||
|
tnoremap <C-j> <C-w>j
|
||||||
|
tnoremap <C-k> <C-w>k
|
||||||
|
|
||||||
" (ctrl + n/p) for buffers
|
" (ctrl + n/p) for buffers
|
||||||
nnoremap <C-n> :n<CR>
|
nnoremap <C-n> :n<CR>
|
||||||
|
41
vim/update
Executable file
41
vim/update
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
source "$HOME/.config/wryn/env.zsh" && LOAD_ZSH_UTILS
|
||||||
|
#####################################################################
|
||||||
|
|
||||||
|
UPDATE() {
|
||||||
|
local VIM_PATH="$HOME/.local/share/source-packages/vim"
|
||||||
|
|
||||||
|
VIM_INSTALL --only-pull || return 1
|
||||||
|
|
||||||
|
cd "$VIM_PATH"
|
||||||
|
__STATUS 'configuring vim'
|
||||||
|
./configure \
|
||||||
|
--with-features=huge \
|
||||||
|
--enable-cscope \
|
||||||
|
--enable-gtk2-check \
|
||||||
|
--enable-gtk3-check \
|
||||||
|
--with-x \
|
||||||
|
--enable-gui=auto \
|
||||||
|
--enable-luainterp=yes \
|
||||||
|
--enable-perlinterp=yes \
|
||||||
|
--enable-python3interp=yes \
|
||||||
|
--enable-rubyinterp=yes \
|
||||||
|
--enable-terminal \
|
||||||
|
&& __SUCCESS 'finished configuring vim' \
|
||||||
|
|| __FAIL 3 'failed to configure vim (see above)' \
|
||||||
|
;
|
||||||
|
|
||||||
|
VIM_INSTALL $@ --only-build || __FAIL 2 'vim build failed (try with --clean for make clean)'
|
||||||
|
}
|
||||||
|
|
||||||
|
VIM_INSTALL() {
|
||||||
|
"$DOTWRYN/zsh/plugins/scwrypts/scwrypts" --env local --no-log \
|
||||||
|
zsh/git/package/install -- \
|
||||||
|
--target-url 'https://github.com/vim/vim.git' \
|
||||||
|
--local-name 'vim' \
|
||||||
|
--update \
|
||||||
|
$@
|
||||||
|
}
|
||||||
|
|
||||||
|
#####################################################################
|
||||||
|
UPDATE $@
|
@ -9,10 +9,13 @@ Plugin 'VundleVim/Vundle.vim'
|
|||||||
" {{{
|
" {{{
|
||||||
Plugin 'tpope/vim-surround'
|
Plugin 'tpope/vim-surround'
|
||||||
Plugin 'tpope/vim-fugitive'
|
Plugin 'tpope/vim-fugitive'
|
||||||
Plugin 'https://github.com/scrooloose/nerdtree.git'
|
Plugin 'scrooloose/nerdtree'
|
||||||
Plugin 'fatih/vim-go'
|
Plugin 'fatih/vim-go'
|
||||||
Plugin 'https://github.com/Valloric/YouCompleteMe.git'
|
Plugin 'w0rp/ale'
|
||||||
Plugin 'https://github.com/w0rp/ale'
|
|
||||||
|
Plugin 'valloric/youcompleteme', {'oninstall': 'python3 install.py --all', 'onupdate': 'python3 install.py --all'}
|
||||||
|
|
||||||
|
Plugin 'rrethy/vim-hexokinase', {'oninstall': 'make hexokinase', 'onupdate': 'make hexokinase'}
|
||||||
" }}}
|
" }}}
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
call vundle#end()
|
call vundle#end()
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit a40f9e2602d22bcbe30f3871e9c811999cb84d17
|
Subproject commit 938eef72e93ddb0609205a663bf0783f4e1b5fae
|
@ -1 +1 @@
|
|||||||
Subproject commit a740a6687012e1173e625a7e7813785fe1de3aad
|
Subproject commit 6333a2f6b84c737a587257a50bcef7c2a8d75a19
|
Loading…
Reference in New Issue
Block a user