version 3 refactor
This commit is contained in:
parent
35fc078b0e
commit
67e9710ab0
75
README.md
75
README.md
@ -1,64 +1,49 @@
|
|||||||
# The `.wryn` Directory
|
# The `.wryn` Library
|
||||||
|
|
||||||
This is a compilation of utilities which I use across machines.
|
A compilation of utilities which I use across my machines.
|
||||||
I expect this to be a lifelong struggle to get everything to work the second that I'm on a new machine, but I have yet to have a flawless transfer from one machine to the next.
|
This library represents my lifelong efforts to create a custom, streamlined IDE based on the terminal and terminal-based editors.
|
||||||
Despite my failures (so far) in a *perfect* transfer installation, I have found this project to have sped up my transferring between machines immensely.
|
|
||||||
When I'm working on multiple machines, a simple `git pull` will keep all of my shell and VI scripts in sync.
|
|
||||||
|
|
||||||
So I suppose here is the disclaimer: **this repo is principally for personal utility**.
|
So I suppose here is the disclaimer: **this repo is principally for personal utility**.
|
||||||
Sometimes there are local machine dependencies which will cause (particularly setup) utilities to fail.
|
Although I try to build utilities to be dependency aware, the library is considered to be in a good state when it works on my machine.
|
||||||
Feel free to use or adapt anything you find useful, just leave credit where credit is due :)
|
Feel free to use or adapt anything you find useful :)
|
||||||
|
|
||||||
## File Structure Breakdown
|
## File Structure Breakdown
|
||||||
|
### [bin](./bin)
|
||||||
Here's a little breakdown of what each directory may contain (in no particular order).
|
Program-specific shell utilities used throughout configurations and other `zsh` scripts.
|
||||||
|
These utilities are not used directly by the user and are **not** sourced to the user RC.
|
||||||
### [bash](./bash)
|
|
||||||
It contains `bash` aliases and functions which might be placed in a `~/.bashrc` to be called from the command line.
|
|
||||||
I have found it personally useful to break these out into topical groupings or modules.
|
|
||||||
|
|
||||||
All modules which are found directly within `~/.wryn/bash` will be loaded across all operating systems, while specific operating systems architectures will each have their own specified modules (e.g. [`~/.wryn/bash/linux`](./bash/linux) or [`~/.wryn/bash/osx`](./bash/osx)).
|
|
||||||
|
|
||||||
### [zsh](./zsh)
|
|
||||||
Just like [`~/.wryn/bash`](./bash) but for ZSH.
|
|
||||||
Currently, I'm using ZSH, so these utilities may be more up-to-date than those found in `~/.wryn/bash`
|
|
||||||
|
|
||||||
### [config](./config)
|
### [config](./config)
|
||||||
These are all the sort of files you would expect to find in your `~/.config` directory.
|
Configuration files which are typically symlinked to the `~/.config` directory.
|
||||||
In fact, the [`~/.wryn/setup`](./setup) script is designed to symlink relevant files to your local `~/.config` directory.
|
|
||||||
|
### [env](./env)
|
||||||
|
Default environment variables used by library utilities.
|
||||||
|
Overrides can be set on each machine by editing the appropriate local environment in `~/.config/wryn/`.
|
||||||
|
|
||||||
|
### [freeze](./freeze)
|
||||||
|
A historical list of packages used on personal machines.
|
||||||
|
Also contains machine-specific `systemd` daemons for managing hardware-specific issues.
|
||||||
|
|
||||||
### [latex](./latex)
|
### [latex](./latex)
|
||||||
This directory contains my TeX templates.
|
A compilation of LaTeX templates, used by the [`.wryn/zsh/latex`](./zsh/latex) utility.
|
||||||
Each template is composed of four files: `template.tex`, `body.tex`, `imports.sty`, and `formatting.sty`.
|
|
||||||
|
|
||||||
|
Each template is composed of four files: `template.tex`, `body.tex`, `imports.sty`, and `formatting.sty`.
|
||||||
The `template.tex` file is the parent of the document, and thus the target of the latex compiler.
|
The `template.tex` file is the parent of the document, and thus the target of the latex compiler.
|
||||||
This can be renamed to match the document title, but typically does not contain the document body.
|
This can be renamed to match the document title, but typically does not contain the document body.
|
||||||
Every template will use the same parent `template.tex` file, so this is found at the [`~/.wryn/latex`](./latex) directory root.
|
Every template will use the same parent `template.tex` file, so this is found at the [`~/.wryn/latex`](./latex) directory root.
|
||||||
|
|
||||||
The remaining three files will vary from template to template, but should be copied to the same directory as `template.tex` when creating a working document.
|
### [resume](./resume)
|
||||||
The two style files, `imports.sty` and `formatting.sty` manage external imports and document styling (respectively), while the `body.tex` should contain the document's text and text-specific commands.
|
My working resume in `.tex` format.
|
||||||
|
|
||||||
There are [shell utilities](./zsh/latex) which facilitate their copying for general use.
|
|
||||||
|
|
||||||
### [systemd-utils](./systemd-utils)
|
|
||||||
I started this directory when I installed Arch Linux on a late 2013 macbook pro.
|
|
||||||
Currently these are daemons designed to help fix hardware issues with that machine.
|
|
||||||
|
|
||||||
### [vim](./vim)
|
### [vim](./vim)
|
||||||
This contains all my custom keybindings and vim-scripts.
|
Contains keybindings, dictionary binary, and custom plugins for `vim`.
|
||||||
There is also an installer which pulls down and builds (or rebuilds) the few external plugins which I use with VI.
|
|
||||||
|
|
||||||
### [bin](./bin)
|
The [`setup`](./setup) utility will source the `.wryn/vim/rc.vim` and set up all necessary environment variables.
|
||||||
Non-sourced shell utilities.
|
Local environment overrides are placed in `~/.config/wryn/env/env.vim`.
|
||||||
|
|
||||||
### [env](./env)
|
### [zsh](./zsh)
|
||||||
[`~/.wryn/setup`](./setup) will link these environment variables to your local machine's shell and vim environments.
|
Contains `zsh` aliases and functions used directly by a terminal user.
|
||||||
This is so directories in respective shell/vim modules are not hard-coded to any particular machine.
|
The [`.wryn/zsh/rc`](./zsh/rc), which loads the custom `zsh` modules is sourced directly from the user RC.
|
||||||
The indicated variables should be modified if they cannot be found in the prescribed directory.
|
Any OS specific utilities are nested in appropriately named directories.
|
||||||
|
|
||||||
### [new_computer_setup](./new_computer_setup)
|
The [`setup`](./setup) utility will source the `.wryn/zsh/rc` and set up all necessary environment variables.
|
||||||
Now that I'm writing this, it occurs to me this may be a misnomer.
|
Local environment overrides are placed in `~/.config/wryn/env/env`.
|
||||||
It is actually a historical log of system and python packages I have installed on previous machines.
|
|
||||||
|
|
||||||
### [tmux](./tmux)
|
|
||||||
Contains tmux configuration files for keybindings, status bar settings, etc.
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CONFIG_DIR="$HOME/.wryn/config/kitty"
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
CONFIG_DIR="$DOTWRYN/config/kitty"
|
||||||
|
|
||||||
[ -f "$CONFIG_DIR/temp.conf" ] && return 1 # race condition lock
|
[ -f "$CONFIG_DIR/temp.conf" ] && return 1 # race condition lock
|
||||||
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
ENGINE="$(which canberra-gtk-play) -f"
|
source "$HOME/.config/wryn/env/env"
|
||||||
SFX="$HOME/Personal/sfx";
|
|
||||||
source "$HOME/.config/wryn/env.zsh"
|
|
||||||
|
|
||||||
|
|
||||||
PLAY() {
|
PLAY() {
|
||||||
eval "$ENGINE" "$SFX/$1"
|
eval "$MEDIA_ENGINE" "$SFX_PATH/$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
@ -1 +1,3 @@
|
|||||||
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" next
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
"$DOTWRYN/bin/desktop/youtube-music/controller.sh" next
|
||||||
|
@ -1 +1,3 @@
|
|||||||
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" playpause
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
"$DOTWRYN/bin/desktop/youtube-music/controller.sh" playpause
|
||||||
|
@ -1 +1,3 @@
|
|||||||
"$HOME/.wryn/bin/desktop/youtube-music/controller.sh" prev
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
"$DOTWRYN/bin/desktop/youtube-music/controller.sh" prev
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
[ ! -d "$HOME/.vim" ] && mkdir "$HOME/.vim"
|
[ ! -d "$HOME/.vim" ] && mkdir "$HOME/.vim"
|
||||||
[ ! -d "$HOME/.vim/colors" ] && mkdir "$HOME/.vim/colors"
|
[ ! -d "$HOME/.vim/colors" ] && mkdir "$HOME/.vim/colors"
|
||||||
|
|
||||||
for file in $(find "$HOME/.wryn/config/colorschemes/vim" -name \*.vim); do cp $file ~/.vim/colors/; done
|
for file in $(find "$DOTWRYN/config/colorschemes/vim" -name \*.vim); do
|
||||||
|
cp $file ~/.vim/colors/;
|
||||||
|
done
|
||||||
echo "vim colorschemes updated"
|
echo "vim colorschemes updated"
|
||||||
|
@ -6,10 +6,8 @@ set $mod Mod4
|
|||||||
|
|
||||||
font pango:monospace 20
|
font pango:monospace 20
|
||||||
|
|
||||||
set $CONFIG /home/w0ryn/.config/wryn
|
|
||||||
set $UTILS /home/w0ryn/.config/wryn/i3utils
|
set $UTILS /home/w0ryn/.config/wryn/i3utils
|
||||||
|
|
||||||
|
|
||||||
set $SLACK_CLIENT_CLASS ^Slack$
|
set $SLACK_CLIENT_CLASS ^Slack$
|
||||||
set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$
|
set $MESSAGE_CLIENT_CLASS ^android-messages-desktop$
|
||||||
set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier
|
set $MEDIA_CLIENT_CLASS ^youtubemusic-nativefier
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
UTIL_BIN="$HOME/.wryn/bin/desktop"
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
UTIL_BIN="$DOTWRYN/bin/desktop"
|
||||||
APP_BIN="$HOME/.config/wryn/default-applications"
|
APP_BIN="$HOME/.config/wryn/default-applications"
|
||||||
|
|
||||||
MEDIA__NEXT="$UTIL_BIN/youtube-music/next.sh"
|
MEDIA__NEXT="$UTIL_BIN/youtube-music/next.sh"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
source $HOME/.wryn/env/env.zsh
|
source "$HOME/.config/wryn/env/env"
|
||||||
XSERVER_DIR="$DOTWRYN/config/xserver"
|
XSERVER_DIR="$DOTWRYN/config/xorg"
|
||||||
|
|
||||||
AT_HOME(){
|
AT_HOME(){
|
||||||
xrandr -q | grep -q 'DP2-1 connected' && xrandr -q | grep -q '3840';
|
xrandr -q | grep -q 'DP2-1 connected' && xrandr -q | grep -q '3840';
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
X11_SCRIPTS='/etc/X11/xinit/xinitrc.d';
|
X11_SCRIPTS='/etc/X11/xinit/xinitrc.d';
|
||||||
if [ -d $X11_SCRIPTS ] ; then
|
if [ -d $X11_SCRIPTS ] ; then
|
||||||
for script in $(find "$X11_SCRIPTS" -name \*.sh); do
|
for script in $(find "$X11_SCRIPTS" -name \*.sh); do
|
||||||
@ -14,6 +16,6 @@ CUSTOM_DMENU_COMMANDS="$HOME/.local/custom_dmenu"
|
|||||||
export PATH="$CUSTOM_DMENU_COMMANDS:$PATH"
|
export PATH="$CUSTOM_DMENU_COMMANDS:$PATH"
|
||||||
|
|
||||||
|
|
||||||
"$HOME/.wryn/config/xserver/set_randr_layout" &
|
"$DOTWRYN/config/xorg/set_randr_layout" &
|
||||||
|
|
||||||
exec i3;
|
exec i3;
|
3
env/env
vendored
3
env/env
vendored
@ -1,3 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
DOTWRYN="$HOME/.wryn"
|
DOTWRYN="$HOME/.wryn"
|
||||||
SCHOOL_PATH="$HOME/School"
|
SCHOOL_PATH="$HOME/School"
|
||||||
RD_PATH="$HOME/RentDynamics"
|
RD_PATH="$HOME/RentDynamics"
|
||||||
@ -8,5 +9,3 @@ PREFERRED_EDITOR=(vi vim)
|
|||||||
|
|
||||||
# plays audio files located throughout the system
|
# plays audio files located throughout the system
|
||||||
MEDIA_ENGINE="$(which canberra-gtk-play) -f"
|
MEDIA_ENGINE="$(which canberra-gtk-play) -f"
|
||||||
|
|
||||||
source "$LOCAL_OVERRIDES"
|
|
||||||
|
14
env/env.vim
vendored
14
env/env.vim
vendored
@ -1,11 +1,15 @@
|
|||||||
" -- RC Resources ----------------------------------------------- {{{
|
" -- RC Resources ----------------------------------------------- {{{
|
||||||
let $RC_DIR=expand("$HOME/.wryn")
|
let $DOTWRYN=expand("$HOME/.wryn")
|
||||||
let $VIM_DIR=expand("$RC_DIR/vim")
|
let $WRYNVIMPATH=expand("$DOTWRYN/vim")
|
||||||
let $WRYNVIMRC=expand("$VIM_DIR/rc.vim")
|
let $WRYNVIMRC=expand("$WRYNVIMPATH/rc.vim")
|
||||||
let $BASHRC=expand("$HOME/.bashrc")
|
let $BASHRC=expand("$HOME/.bashrc")
|
||||||
let $ZSHRC=expand("$HOME/.zshrc")
|
let $ZSHRC=expand("$HOME/.zshrc")
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
" -- Leader bindings -------------------------------------------- {{{
|
||||||
|
let mapleader = "\\"
|
||||||
|
"let localmapleader = ',' (not used currently)
|
||||||
|
" }}}
|
||||||
|
|
||||||
" -- Colorscheme Settings --------------------------------------- {{{
|
" -- Colorscheme Settings --------------------------------------- {{{
|
||||||
" favorites : tigrana-256-dark, codedark, lilydjwg_dark, up, skittles_autumn,
|
" favorites : tigrana-256-dark, codedark, lilydjwg_dark, up, skittles_autumn,
|
||||||
@ -19,7 +23,3 @@ let $COLORSCHEME="default"
|
|||||||
" set the webbrowser locally
|
" set the webbrowser locally
|
||||||
"let $WEBBROWSER=""
|
"let $WEBBROWSER=""
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" -- Local Environment Overrides -------------------------------- {{{
|
|
||||||
source $HOME/.config/wryn/env.vim
|
|
||||||
" }}}
|
|
||||||
|
110
setup
110
setup
@ -1,4 +1,19 @@
|
|||||||
#!/bin/bash
|
################################################################################
|
||||||
|
### SETUP VERIFICATION #########################################################
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
DOTWRYN_PATH="$(pwd)"
|
||||||
|
function CHECK_DIR() {
|
||||||
|
read -p "Is DOTWRYN.git installed at '$DOTWRYN_PATH'? [Yn] : " validate;
|
||||||
|
|
||||||
|
case $validate in
|
||||||
|
[nN]* ) exit 1;;
|
||||||
|
* ) ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
CHECK_DIR; # verify install detected correct location before continuing
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
### SHELL SETUP ################################################################
|
### SHELL SETUP ################################################################
|
||||||
@ -10,20 +25,35 @@ function SOURCE_DOTWRYN_RC {
|
|||||||
|
|
||||||
[ ! -f "$HOME/$HOME_RC" ] && touch "$HOME/$HOME_RC";
|
[ ! -f "$HOME/$HOME_RC" ] && touch "$HOME/$HOME_RC";
|
||||||
|
|
||||||
grep -q '\.wryn' "$HOME/$HOME_RC" \
|
grep "$WRYN_RC" "$HOME/$HOME_RC" && {
|
||||||
&& echo "already set up $HOME_RC" \
|
echo "already set up $HOME_RC";
|
||||||
|| {
|
} || {
|
||||||
echo "source $WRYN_RC" >> "$HOME/$HOME_RC";
|
echo "source $WRYN_RC" >> "$HOME/$HOME_RC";
|
||||||
echo "successfully set up $HOME_RC";
|
echo "successfully set up $HOME_RC";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ENV__SETUP_LOCAL_OVERRIDES() {
|
||||||
|
local DEFAULT_SHELL_ENV="$DOTWRYN_PATH/env/env"
|
||||||
|
local LOCAL_SHELL_ENV="$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
|
local DEFAULT_VIM_ENV="$DOTWRYN_PATH/env/env.vim"
|
||||||
|
local LOCAL_VIM_ENV="$HOME/.config/wryn/env/env.vim"
|
||||||
|
|
||||||
|
echo "source $DOTWRYN_PATH/env/env" > "$LOCAL_SHELL_ENV"
|
||||||
|
echo -e '\n#\n# ~/.wryn/env/env local overrides\n#\n' >> "$LOCAL_SHELL_ENV"
|
||||||
|
sed 's/[#]*\(.*\)/#\1/' $DEFAULT_SHELL_ENV >> "$LOCAL_SHELL_ENV"
|
||||||
|
|
||||||
|
echo "source $DOTWRYN_PATH/env/env.vim" > "$LOCAL_VIM_ENV"
|
||||||
|
echo -e '\n"\n" ~/.wryn/env/env.vim local overrides\n"\n' >> "$LOCAL_VIM_ENV"
|
||||||
|
sed 's/["]*\(.*\)/"\1/' $DEFAULT_VIM_ENV >> "$LOCAL_VIM_ENV"
|
||||||
}
|
}
|
||||||
|
|
||||||
function SHELL__SETUP {
|
function SHELL__SETUP {
|
||||||
SOURCE_DOTWRYN_RC '.bashrc' '$HOME/.wryn/bash/rc'
|
SOURCE_DOTWRYN_RC '.bashrc' "$DOTWRYN_PATH/zsh/rc";
|
||||||
which bash >/dev/null && "$HOME/.wryn/env/env.bash";
|
SOURCE_DOTWRYN_RC '.zshrc' "$DOTWRYN_PATH/zsh/rc";
|
||||||
|
|
||||||
SOURCE_DOTWRYN_RC '.zshrc' '$HOME/.wryn/zsh/rc';
|
ENV__SETUP_LOCAL_OVERRIDES;
|
||||||
which zsh >/dev/null && "$HOME/.wryn/env/env.zsh";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -31,21 +61,8 @@ function SHELL__SETUP {
|
|||||||
### VIM SETUP ##################################################################
|
### VIM SETUP ##################################################################
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
function VIM__SETUP_ENVIRONMENT_VARIABLES() {
|
|
||||||
VIM_ENV="$HOME/.config/wryn/env.vim";
|
|
||||||
|
|
||||||
[ ! -f "$VIM_ENV" ] && {
|
|
||||||
touch "$VIM_ENV";
|
|
||||||
which google-chrome-stable \
|
|
||||||
&& echo 'let $WEBBROWSER="'$(which google-chrome-stable)'"' >> $VIM_ENV\
|
|
||||||
|| echo 'let $WEBBROWSER=""' >> $VIM_ENV;
|
|
||||||
} || {
|
|
||||||
echo 'vim environment variables already set up';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function VIM__UPDATE_COLORSCHEMES() {
|
function VIM__UPDATE_COLORSCHEMES() {
|
||||||
$HOME/.wryn/bin/vim/update_colorschemes
|
$DOTWRYN_PATH/bin/vim/update_colorschemes
|
||||||
}
|
}
|
||||||
|
|
||||||
function VIM__INSTALL_VUNDLE_PLUGINS() {
|
function VIM__INSTALL_VUNDLE_PLUGINS() {
|
||||||
@ -60,15 +77,14 @@ function VIM__INSTALL_VUNDLE_PLUGINS() {
|
|||||||
vim +PluginInstall +qall;
|
vim +PluginInstall +qall;
|
||||||
|
|
||||||
echo "building plugins"
|
echo "building plugins"
|
||||||
$HOME/.wryn/bin/vim/rebuild_plugins;
|
$DOTWRYN_PATH/bin/vim/rebuild_plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
function VIM__SETUP() {
|
function VIM__SETUP() {
|
||||||
echo 'setting up vim';
|
echo 'setting up vim';
|
||||||
|
|
||||||
SOURCE_DOTWRYN_RC '.vimrc' '$HOME/.wryn/vim/rc.vim';
|
SOURCE_DOTWRYN_RC '.vimrc' "$DOTWRYN_PATH/vim/rc.vim";
|
||||||
|
|
||||||
VIM__SETUP_ENVIRONMENT_VARIABLES;
|
|
||||||
VIM__UPDATE_COLORSCHEMES;
|
VIM__UPDATE_COLORSCHEMES;
|
||||||
VIM__INSTALL_VUNDLE_PLUGINS;
|
VIM__INSTALL_VUNDLE_PLUGINS;
|
||||||
|
|
||||||
@ -95,7 +111,7 @@ function CONFIG__SYMLINK() {
|
|||||||
local HOME_CONFIG_DIR="$HOME/.config/$CONFIG_DIR";
|
local HOME_CONFIG_DIR="$HOME/.config/$CONFIG_DIR";
|
||||||
local HOME_CONFIG="$HOME_CONFIG_DIR/$FILENAME";
|
local HOME_CONFIG="$HOME_CONFIG_DIR/$FILENAME";
|
||||||
|
|
||||||
local WRYN_CONFIG="$HOME/.wryn/config/$CONFIG_DIR/$FILENAME";
|
local WRYN_CONFIG="$DOTWRYN_PATH/config/$CONFIG_DIR/$FILENAME";
|
||||||
|
|
||||||
[ ! -d "$HOME_CONFIG_DIR" ] && mkdir "$HOME_CONFIG_DIR";
|
[ ! -d "$HOME_CONFIG_DIR" ] && mkdir "$HOME_CONFIG_DIR";
|
||||||
|
|
||||||
@ -105,7 +121,7 @@ function CONFIG__SYMLINK() {
|
|||||||
|
|
||||||
function CONFIG__I3() {
|
function CONFIG__I3() {
|
||||||
CONFIG__SYMLINK "i3" "config";
|
CONFIG__SYMLINK "i3" "config";
|
||||||
CONFIG__BASIC_SYMLINK "$HOME/.config/wryn/i3utils" "$HOME/.wryn/config/i3/utils";
|
CONFIG__BASIC_SYMLINK "$HOME/.config/wryn/i3utils" "$DOTWRYN_PATH/config/i3/utils";
|
||||||
echo "linked i3 configuration";
|
echo "linked i3 configuration";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,34 +152,34 @@ function CONFIG__KITTY() {
|
|||||||
echo "linked kitty configuration"
|
echo "linked kitty configuration"
|
||||||
}
|
}
|
||||||
|
|
||||||
function CONFIG__GIT() {
|
|
||||||
CONFIG__BASIC_SYMLINK "$HOME/.gitconfig" "$HOME/.wryn/config/git/gitconfig";
|
|
||||||
echo "linked global git configuration"
|
|
||||||
}
|
|
||||||
|
|
||||||
function CONFIG__PYLINT() {
|
|
||||||
CONFIG__BASIC_SYMLINK "$HOME/.config/pylintrc" "$HOME/.wryn/config/pylint/pylintrc";
|
|
||||||
echo "linked pylint configuration"
|
|
||||||
}
|
|
||||||
|
|
||||||
function CONFIG__RIPGREP() {
|
function CONFIG__RIPGREP() {
|
||||||
CONFIG__SYMLINK "ripgrep" "config"
|
CONFIG__SYMLINK "ripgrep" "config"
|
||||||
echo "linked ripgrep configuration"
|
echo "linked ripgrep configuration"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function CONFIG__GIT() {
|
||||||
|
CONFIG__BASIC_SYMLINK "$HOME/.gitconfig" "$DOTWRYN_PATH/config/git/gitconfig";
|
||||||
|
echo "linked global git configuration"
|
||||||
|
}
|
||||||
|
|
||||||
|
function CONFIG__PYLINT() {
|
||||||
|
CONFIG__BASIC_SYMLINK "$HOME/.config/pylintrc" "$DOTWRYN_PATH/config/pylint/pylintrc";
|
||||||
|
echo "linked pylint configuration"
|
||||||
|
}
|
||||||
|
|
||||||
function CONFIG__TMUX() {
|
function CONFIG__TMUX() {
|
||||||
CONFIG__BASIC_SYMLINK "$HOME/.tmux.conf" "$HOME/.wryn/tmux/tmux.conf";
|
CONFIG__BASIC_SYMLINK "$HOME/.tmux.conf" "$DOTWRYN_PATH/config/tmux/tmux.conf";
|
||||||
echo "linked tmux configuration"
|
echo "linked tmux configuration"
|
||||||
}
|
}
|
||||||
|
|
||||||
function CONFIG__XINITRC() {
|
function CONFIG__XINITRC() {
|
||||||
CONFIG__BASIC_SYMLINK "$HOME/.xinitrc" "$HOME/.wryn/config/xserver/xinitrc"
|
CONFIG__BASIC_SYMLINK "$HOME/.xinitrc" "$DOTWRYN_PATH/config/xorg/xinitrc"
|
||||||
echo "linked xinitrc"
|
echo "linked xinitrc"
|
||||||
}
|
}
|
||||||
|
|
||||||
function CONFIG__TERMINFO() {
|
function CONFIG__TERMINFO() {
|
||||||
echo "adding terminfo files"
|
echo "adding terminfo files"
|
||||||
for file in $(find "$HOME/.wryn/config/terminfo" -type f); do
|
for file in $(find "$DOTWRYN_PATH/config/terminfo" -type f); do
|
||||||
tic -x $file >/dev/null 2>&1 || echo "failed to add $file" ;
|
tic -x $file >/dev/null 2>&1 || echo "failed to add $file" ;
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -177,6 +193,7 @@ function CONFIG__SETUP() {
|
|||||||
CONFIG__MSSQLCLI;
|
CONFIG__MSSQLCLI;
|
||||||
CONFIG__COMPTON;
|
CONFIG__COMPTON;
|
||||||
CONFIG__KITTY;
|
CONFIG__KITTY;
|
||||||
|
CONFIG__RIPGREP;
|
||||||
|
|
||||||
CONFIG__GIT;
|
CONFIG__GIT;
|
||||||
CONFIG__PYLINT;
|
CONFIG__PYLINT;
|
||||||
@ -192,21 +209,22 @@ function CONFIG__SETUP() {
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
function CLEAN_BACKUP() {
|
function CLEAN_BACKUP() {
|
||||||
read -p "Clean backup files? [yN] : " yn;
|
read -p "Clean backup files? [Yn] : " yn;
|
||||||
|
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* )
|
[nN]* ) echo 'skipping cleanup';;
|
||||||
|
* )
|
||||||
echo 'cleaning backup files';
|
echo 'cleaning backup files';
|
||||||
for file in $(find "$HOME/.config/" -name \*.bak 2>/dev/null); do rm $file && echo cleaned $file; done
|
for file in $(find "$HOME/.config/" -name \*.bak 2>/dev/null); do rm $file && echo cleaned $file; done
|
||||||
for file in $(find "$HOME" -maxdepth 1 -name .\*.bak 2>/dev/null); do rm $file && echo cleaned $file; done
|
for file in $(find "$HOME" -maxdepth 1 -name .\*.bak 2>/dev/null); do rm $file && echo cleaned $file; done
|
||||||
;;
|
;;
|
||||||
* ) echo 'skipping cleanup';;
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[ ! -d "$HOME/.config" ] && mkdir "$HOME/.config";
|
[ ! -d "$HOME/.config" ] && mkdir "$HOME/.config";
|
||||||
[ ! -d "$HOME/.config/wryn" ] && mkdir "$HOME/.config/wryn";
|
[ ! -d "$HOME/.config/wryn" ] && mkdir "$HOME/.config/wryn";
|
||||||
|
[ ! -d "$HOME/.config/wryn/env" ] && mkdir "$HOME/.config/wryn/env";
|
||||||
|
|
||||||
SHELL__SETUP;
|
SHELL__SETUP;
|
||||||
VIM__SETUP;
|
VIM__SETUP;
|
||||||
|
@ -63,7 +63,7 @@ augroup end
|
|||||||
|
|
||||||
|
|
||||||
" -- Format Override Layers ------------------------------ {{{
|
" -- Format Override Layers ------------------------------ {{{
|
||||||
source $VIM_DIR/rentdynamics.vim
|
source $WRYNVIMPATH/rentdynamics.vim
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ set matchtime=0 " -- but don't jump to it.
|
|||||||
|
|
||||||
set t_ZH=[3m t_ZR=[23m " italic start / end characters
|
set t_ZH=[3m t_ZR=[23m " italic start / end characters
|
||||||
|
|
||||||
set spellfile=$VIM_DIR/en.utf-8.add spelllang=en
|
set spellfile=$WRYNVIMPATH/en.utf-8.add spelllang=en
|
||||||
|
|
||||||
set encoding=utf-8
|
set encoding=utf-8
|
||||||
|
|
||||||
|
104
vim/rc.vim
104
vim/rc.vim
@ -1,74 +1,68 @@
|
|||||||
" set the following environment variables:
|
source $HOME/.config/wryn/env/env.vim
|
||||||
" $RC_DIR $VIM_DIR $WRYNVIMRC $BASHRC $ZSHRC $WEBBROWSER
|
|
||||||
source $HOME/.wryn/env/env.vim
|
|
||||||
|
|
||||||
if isdirectory(expand("$HOME/.vim/bundle/Vundle.vim"))
|
if isdirectory(expand("$HOME/.vim/bundle/Vundle.vim"))
|
||||||
source $VIM_DIR/vundle.vim
|
source $WRYNVIMPATH/vundle.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
source $VIM_DIR/options.vim
|
source $WRYNVIMPATH/options.vim
|
||||||
source $VIM_DIR/testing.vim
|
source $WRYNVIMPATH/testing.vim
|
||||||
source $VIM_DIR/formatting.vim
|
source $WRYNVIMPATH/formatting.vim
|
||||||
source $VIM_DIR/abbreviations.vim
|
source $WRYNVIMPATH/abbreviations.vim
|
||||||
source $VIM_DIR/navigation.vim
|
source $WRYNVIMPATH/navigation.vim
|
||||||
source $VIM_DIR/color.vim
|
source $WRYNVIMPATH/color.vim
|
||||||
|
|
||||||
let mapleader = "\\"
|
" -- Bindings --------------------------------------------------- {{{
|
||||||
"let localmapleader = ','
|
|
||||||
|
|
||||||
augroup personal_bindings
|
" <SPACE> to execute macro on q
|
||||||
" {{{
|
nnoremap <Space> @q
|
||||||
|
|
||||||
" <SPACE> to execute macro on q
|
" Q to replace current line/selection with bash execution
|
||||||
nnoremap <Space> @q
|
vnoremap Q !$SHELL<CR>
|
||||||
|
nnoremap Q !!$SHELL<CR>
|
||||||
|
|
||||||
" Q to replace current line/selection with bash execution
|
" \q for `q:`
|
||||||
vnoremap Q !$SHELL<CR>
|
nnoremap <Leader>q q:
|
||||||
nnoremap Q !!$SHELL<CR>
|
|
||||||
|
|
||||||
" \q for `q:`
|
|
||||||
nnoremap <Leader>q q:
|
|
||||||
|
|
||||||
" \s previous selection command
|
" \s previous selection command
|
||||||
nnoremap <Leader>s :'<,'>
|
nnoremap <Leader>s :'<,'>
|
||||||
|
|
||||||
" \f for fold
|
" \f for fold
|
||||||
nnoremap <Leader>f z
|
nnoremap <Leader>f z
|
||||||
nnoremap <Leader>f z
|
nnoremap <Leader>f z
|
||||||
|
|
||||||
" \j for J, but append current line to the line below
|
" \j for J, but append current line to the line below
|
||||||
nnoremap <Leader>j ddpkJ
|
nnoremap <Leader>j ddpkJ
|
||||||
|
|
||||||
" move the current line one below where it is
|
|
||||||
nnoremap - :m +1 <CR>
|
|
||||||
nnoremap _ :m -2 <CR>
|
|
||||||
|
|
||||||
" \t for rerun last 'vimtest' command:
|
" move the current line one below where it is
|
||||||
nnoremap <Leader>t q:?vimtest<CR><CR>
|
nnoremap - :m +1 <CR>
|
||||||
|
nnoremap _ :m -2 <CR>
|
||||||
|
|
||||||
" \b for git blame
|
" \t for rerun last 'vimtest' command:
|
||||||
nnoremap <Leader>b :set termwinsize=15*0<BAR>:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %"<BAR>:set termwinsize&<CR>
|
nnoremap <Leader>t q:?vimtest<CR><CR>
|
||||||
|
|
||||||
" \d to insert formatted date before/after cursor
|
" \b for git blame
|
||||||
nnoremap <Leader>di :let @d = system("date '+%A, %B %-d, %Y'")<CR>i<C-r>d<BS> <esc>
|
nnoremap <Leader>b :set termwinsize=15*0<BAR>:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %"<BAR>:set termwinsize&<CR>
|
||||||
nnoremap <Leader>da :let @d = system("date '+%A, %B %-d, %Y'")<CR>a <C-r>d<BS><esc>
|
|
||||||
|
|
||||||
" - toggle casing for current word
|
" \d to insert formatted date before/after cursor
|
||||||
inoremap <C-u> <esc>viw~ea
|
nnoremap <Leader>di :let @d = system("date '+%A, %B %-d, %Y'")<CR>i<C-r>d<BS> <esc>
|
||||||
|
nnoremap <Leader>da :let @d = system("date '+%A, %B %-d, %Y'")<CR>a <C-r>d<BS><esc>
|
||||||
|
|
||||||
" \c \v to copy/paste from xclip
|
" - toggle casing for current word
|
||||||
" @TODO: learn how to freaking compile vim with x11 compatibility so these
|
inoremap <C-u> <esc>viw~ea
|
||||||
" aren't necessary :)
|
|
||||||
vnoremap <Leader>c :w !xclip<CR><CR>
|
|
||||||
nnoremap <Leader>v o<esc>!!xclip -o<CR>
|
|
||||||
nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
|
|
||||||
|
|
||||||
" ------- available / rarely used bindings -------
|
" \c \v to copy/paste from xclip
|
||||||
|
" @TODO: learn how to freaking compile vim with x11 compatibility so these
|
||||||
|
" aren't necessary :)
|
||||||
|
vnoremap <Leader>c :w !xclip<CR><CR>
|
||||||
|
nnoremap <Leader>v o<esc>!!xclip -o<CR>
|
||||||
|
nnoremap <Leader>sc :'<,'>w !xclip<CR><CR>
|
||||||
|
|
||||||
|
" ------- available / rarely used bindings -------
|
||||||
|
|
||||||
|
" nnoremap <BS>
|
||||||
|
" nnoremap <C-t>
|
||||||
|
" nnoremap <C-b>
|
||||||
|
" nnoremap z
|
||||||
|
" nnoremap ^
|
||||||
|
|
||||||
" nnoremap <BS>
|
|
||||||
" nnoremap <C-t>
|
|
||||||
" nnoremap <C-b>
|
|
||||||
" nnoremap z
|
|
||||||
" nnoremap ^
|
|
||||||
" }}}
|
" }}}
|
||||||
augroup end
|
|
||||||
|
14
zsh/rc
14
zsh/rc
@ -1,21 +1,21 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
source "$HOME/.wryn/env/env.zsh"
|
source "$HOME/.config/wryn/env/env"
|
||||||
|
|
||||||
RC_DIR="$DOTWRYN/zsh"
|
|
||||||
source "$DOTWRYN/zsh/config"
|
|
||||||
|
|
||||||
# --- load custom plugins ------------------------------------------
|
# --- load custom plugins ------------------------------------------
|
||||||
|
|
||||||
for file in $(find $RC_DIR -maxdepth 1 -type f ! -name 'rc' ! -name 'config'); do source $file; done;
|
# zsh config : must load first for zsh-plugins to work
|
||||||
|
source "$DOTWRYN/zsh/config"
|
||||||
|
|
||||||
|
for file in $(find "$DOTWRYN/zsh" -maxdepth 1 -type f ! -name 'rc' ! -name 'config'); do source $file; done;
|
||||||
|
|
||||||
# operating system specific plugins
|
# operating system specific plugins
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
linux-gnu )
|
linux-gnu )
|
||||||
for file in $(find $RC_DIR/linux -type f); do source $file; done;
|
for file in $(find "$DOTWRYN/zsh/linux" -type f); do source $file; done;
|
||||||
;;
|
;;
|
||||||
darwin* )
|
darwin* )
|
||||||
for file in $(find $RC_DIR/osx -type f); do source $file; done;
|
for file in $(find "$DOTWRYN/zsh/osx" -type f); do source $file; done;
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user