Compare commits
5 commits
efdebbc17b
...
4a72ea26b4
Author | SHA1 | Date | |
---|---|---|---|
4a72ea26b4 | |||
0556d7df36 | |||
e11db257e4 | |||
441b1a6c0f | |||
aeac63b7e8 |
46 changed files with 579 additions and 223 deletions
150
extras.sh
150
extras.sh
|
@ -1,150 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
# script to install the extra needed tools programmatically
|
||||
|
||||
# add command line flags and function to govern install?
|
||||
|
||||
MAMBAFORGE_RELEASE="https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh"
|
||||
MAMBAFORGE_INSTALLER="Mambaforge-Linux-x86_64.sh"
|
||||
|
||||
help() {
|
||||
cat <<EOF
|
||||
extras downloaders
|
||||
|
||||
by default will download all packages listed below
|
||||
|
||||
usage: $0 [OPTIONS]
|
||||
|
||||
--help Show this message
|
||||
--force Overwrite current installations
|
||||
|
||||
To install a subset of these
|
||||
use any of the package specific flag:
|
||||
|
||||
--fzf
|
||||
--nvm
|
||||
--mambaforge
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
for opt in "$@"; do
|
||||
case $opt in
|
||||
--help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
--force) force=1 ;;
|
||||
--fzf) fzf=1 ;;
|
||||
--mambaforge) mamba=1 ;;
|
||||
*)
|
||||
echo "unknown option: $opt"
|
||||
help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
check_existing() {
|
||||
pkg=$1
|
||||
install_dir=$2
|
||||
declare -n skip_out=$3
|
||||
|
||||
if [ -d "$install_dir" ]; then
|
||||
echo "found existing $pkg installation"
|
||||
if [[ "$force" ]]; then
|
||||
echo "removing previous installation"
|
||||
rm -rf $install_dir
|
||||
skip_out=0
|
||||
else
|
||||
skip_out=1
|
||||
fi
|
||||
else
|
||||
skip_out=0
|
||||
fi
|
||||
}
|
||||
|
||||
ask() {
|
||||
while true; do
|
||||
read -p "$1 ([y]/n) " -r
|
||||
REPLY=${REPLY:-"y"}
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
return 1
|
||||
elif [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install_fzf() {
|
||||
echo "##############"
|
||||
echo installing fzf
|
||||
echo "##############"
|
||||
|
||||
check_existing "fzf" "$HOME/.fzf" skip
|
||||
|
||||
if [[ $skip -eq 1 ]]; then
|
||||
echo "remove your previous installation or rerun with --force"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "installing fzf using git"
|
||||
|
||||
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
||||
~/.fzf/install --bin
|
||||
}
|
||||
|
||||
install_mambaforge() {
|
||||
echo "#####################"
|
||||
echo installing mambaforge
|
||||
echo "#####################"
|
||||
|
||||
check_existing "mambaforge" "$HOME/mambaforge" skip
|
||||
|
||||
if [[ $skip -eq 1 ]]; then
|
||||
echo "remove your previous installation or rerun with --force"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "fetching install script from github"
|
||||
|
||||
current_dir=$PWD
|
||||
|
||||
cd ~/
|
||||
|
||||
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
|
||||
bash "$MAMBAFORGE_INSTALLER" -s
|
||||
rm "$MAMBAFORGE_INSTALLER"
|
||||
|
||||
echo "cleaning up installer"
|
||||
|
||||
cd $current_dir
|
||||
}
|
||||
|
||||
install_all() {
|
||||
echo "installing all packages..."
|
||||
echo
|
||||
install_fzf
|
||||
echo
|
||||
install_mambaforge
|
||||
|
||||
}
|
||||
|
||||
echo "#################"
|
||||
echo EXTRAS DOWNLOADER
|
||||
echo "#################"
|
||||
echo "warning this script is not well maintained"
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
install_all
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$fzf" ]; then
|
||||
install_fzf
|
||||
fi
|
||||
|
||||
if [ "$mamba" ]; then
|
||||
install_mambaforge
|
||||
fi
|
||||
|
||||
echo "FINISHED!"
|
|
@ -1,6 +0,0 @@
|
|||
# # startx automatically if on first tty
|
||||
# if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
|
||||
# startx
|
||||
# logout
|
||||
# fi
|
||||
|
24
home/dot_zshenv
Normal file
24
home/dot_zshenv
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env zsh
|
||||
#
|
||||
# .zshenv - Zsh environment file, loaded always.
|
||||
#
|
||||
# NOTE: .zshenv has to live at ~/.zshenv, not in $ZDOTDIR! You can get around this by
|
||||
# symlinking .zshenv from your $ZDOTDIR: `ln -sf $ZDOTDIR/.zshenv ~/.zshenv`
|
||||
#
|
||||
|
||||
#
|
||||
# ZDOTDIR
|
||||
#
|
||||
|
||||
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-${HOME}/.config}
|
||||
export ZDOTDIR=${ZDOTDIR:-${XDG_CONFIG_HOME}/zsh}
|
||||
|
||||
#
|
||||
# .zprofile
|
||||
#
|
||||
|
||||
# We use .zprofile for everything else (load for non-login, non-interactive shells).
|
||||
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
|
||||
source "${ZDOTDIR:-$HOME}/.zprofile"
|
||||
fi
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# If not running interactively, don't do anything
|
||||
[ -z "$PS1" ] && return
|
||||
|
||||
if [ -d "$HOME/.dotfiles" ]; then
|
||||
DOTFILES_DIR="$HOME/.dotfiles"
|
||||
else
|
||||
echo "Unable to find dotfiles, exiting."
|
||||
return
|
||||
fi
|
||||
|
||||
# Make utilities available
|
||||
PATH="$DOTFILES_DIR/bin:$PATH"
|
||||
|
||||
src=(
|
||||
'base'
|
||||
'function'
|
||||
'path'
|
||||
'env'
|
||||
'prompt'
|
||||
'alias'
|
||||
'conda'
|
||||
'plugins'
|
||||
)
|
||||
|
||||
for dotfile in $src; do
|
||||
. $DOTFILES_DIR/lib/$dotfile.zsh
|
||||
done
|
||||
|
||||
unset dotfile
|
||||
|
||||
DOTFILES_EXTRA_DIR="$HOME/.extra"
|
||||
|
||||
if [ -d "$DOTFILES_EXTRA_DIR" ]; then
|
||||
for EXTRAFILE in "$DOTFILES_EXTRA_DIR"/runcom/*.sh; do
|
||||
[ -f "$EXTRAFILE" ] && . "$EXTRAFILE"
|
||||
done
|
||||
fi
|
||||
|
||||
unset EXTRAFILE
|
||||
|
||||
export DOTFILES_DIR DOTFILES_EXTRA_DIR
|
||||
|
||||
# welcome art
|
||||
# ! is-tty && $DOTFILES_DIR/bin/print-epoch
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"LazyVim": { "branch": "main", "commit": "27248b0193f0b3a3ce23e4d429a1ebb59974f0bb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "58fbfc627a93281a77f7d161d4ff702e639677b1" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "d35b99e36e32040ba06c48a25b5bd3e75be2a566" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "84b0822b2af478d0b4f7b0f9249ca218855331db" },
|
||||
"catppuccin": { "branch": "main", "commit": "b0ab85552b0f60ab7a0aa46f432e709c124f8153" },
|
||||
"LazyVim": { "branch": "main", "commit": "079c685831fd64ab139b8824db54e76b04724346" },
|
||||
"LuaSnip": { "branch": "master", "commit": "37ffce053d4e20236efd43cecf7800e8ef40a997" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "b3eef69e95674905bf26c7740dd4bbb09b355494" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "cbb798dd2db7841550cd2c6c6dde12dfda055928" },
|
||||
"catppuccin": { "branch": "main", "commit": "fe32c776d86e8ba608e6294c43302c985835bfea" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
|
@ -11,14 +11,14 @@
|
|||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" },
|
||||
"flit.nvim": { "branch": "main", "commit": "980e80e8fe44caaeb9de501c8e97a559b17db2f4" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "1645e7cd98ed99e766c84ab3cf13a1612c77dcee" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5f1451ea7d9a9005b3f0bedeab20cef7a4c65993" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "e916f41df26e33b01f1b3ebe28881090da3a7281" },
|
||||
"leap.nvim": { "branch": "main", "commit": "a2e57b7f8cfd01bb8bfb5abadf5e99acb9559700" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6fa50a94ba5378bb73013a6e163376d8e69bd8a5" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f388995990aba04cfdc7c3ab870c33e280601109" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "8077428e63feb0f3bf795d53b23ba1695b28ab0e" },
|
||||
"leap.nvim": { "branch": "main", "commit": "9a69febb2e5a4f5f5a55dd2d7173098fde917bc5" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" },
|
||||
"mason.nvim": { "branch": "main", "commit": "63ccfe5dd1a9afd16d9d3cdcf0aa59403eef5ef7" },
|
||||
"mason.nvim": { "branch": "main", "commit": "a07a5c644784bdba8bbfd83e78f14c261bb7efe6" },
|
||||
"mini.ai": { "branch": "main", "commit": "d50b4d87e38d21ca2c5facee9f8a205ddb768358" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "351d18d596f7eac4589b67b4b87ed1708c545dd3" },
|
||||
"mini.comment": { "branch": "main", "commit": "9fc3fe43129e8c2611bd21b8f50af8c0d0742533" },
|
||||
|
@ -26,28 +26,28 @@
|
|||
"mini.pairs": { "branch": "main", "commit": "4ebc1ff8d77fe75e8f219432302800ca29e17614" },
|
||||
"mini.surround": { "branch": "main", "commit": "6a4f31e2a380439315729f561d7e7898bde1fd52" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "245cf1e68840defcc75a16297740f6203f5a045d" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "45d2575527c080d6f87fd0b7741d877be88f0d26" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "a5dac25be1e2eb72cf9fe2f4c1a1ae50d157cbbd" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "a81e749d0fe8429cd340b2e40f274b344bef42ac" },
|
||||
"nim.nvim": { "branch": "master", "commit": "87afde2ae995723e0338e1851c3b3c1cbd81d955" },
|
||||
"noice.nvim": { "branch": "main", "commit": "d8a1f3056ad713b5d471048f8d029264828e22c0" },
|
||||
"nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "a75bba0ae5e89df03f01c17a1d913884eeebcc2e" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "208d69f233d65526a22c6497ed57d0c80d99fa5f" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "649137cbc53a044bffde36294ce3160cb18f32c7" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "a82aa08c0063843926947f3688b0e61fd71db680" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "8202df9561b90102b41dbc1ad71945534ef4ea39" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b5db147e28337319331d516a826b00976f3584de" },
|
||||
"nvim-navic": { "branch": "master", "commit": "7e9d2b2b601149fecdccd11b516acb721e571fe6" },
|
||||
"nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "1d8b7a40677fd87da7648d246c4675c3612a7582" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b44871afb59e456bbff4113e416405c06c991cf5" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "15d9c62cb04079cf440ceb6882f2cbfaed66eda1" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "ce73d505fdc45f16c1a04f6a98c1c1e114841708" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "ce0dba96f47cd8bbd46b4c3ac8fd1b9502f1002a" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "2f3583001e2bf793480f38cf0d055571787b0259" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "bb6d4fd1e010300510172b173ab5205d37af084f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4709a504d2cd2680fb511675e64ef2790d491d36" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "d8a3eda0e19b4d5f3180fc832c25baab1709f2a1" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "3915d933dc19d31571d2953ca9461fe6fa117a6e" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "74c7d28cb50b0713c881ef69bcb6cdd77d8907d1" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "a0abe53df53616d13da327636cb0bcac3ea7f5af" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "556ef3089709a6e253df1e500381fec5eb48e48a" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "3b754285635a66a93aeb15fa71a23417d8997217" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" },
|
||||
"vim-nix": { "branch": "master", "commit": "7d23e97d13c40fcc6d603b291fe9b6e5f92516ee" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
|
|
4
home/private_dot_config/zsh/completions/_fnhelp
Normal file
4
home/private_dot_config/zsh/completions/_fnhelp
Normal file
|
@ -0,0 +1,4 @@
|
|||
#compdef fnhelp
|
||||
|
||||
# show files in the functions dir (exclude dirs)
|
||||
_path_files -W "$ZDOTDIR/functions" -g "**/*(.)"
|
1
home/private_dot_config/zsh/completions/_g
Normal file
1
home/private_dot_config/zsh/completions/_g
Normal file
|
@ -0,0 +1 @@
|
|||
#compdef g=git
|
8
home/private_dot_config/zsh/completions/readme.md
Normal file
8
home/private_dot_config/zsh/completions/readme.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Completions
|
||||
|
||||
Add user contributed completions to this directory.
|
||||
|
||||
Read more about how Zsh completions work in this [how-to][1] article.
|
||||
|
||||
|
||||
[1]: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org
|
38
home/private_dot_config/zsh/conf.d/aliases.zsh
Normal file
38
home/private_dot_config/zsh/conf.d/aliases.zsh
Normal file
|
@ -0,0 +1,38 @@
|
|||
#
|
||||
# aliases - Set whatever Zsh aliases you want.
|
||||
#
|
||||
|
||||
# single character aliases - be sparing!
|
||||
alias g=git
|
||||
|
||||
# mask built-ins with better defaults
|
||||
alias vi=vim
|
||||
|
||||
# this one is kinda dangerous
|
||||
alias rr="rm -rf"
|
||||
|
||||
# more ways to ls
|
||||
alias ls="ls --group-directories-first --color=always"
|
||||
alias l='ls -lh'
|
||||
alias la='ls -a'
|
||||
alias ldot='ls -ld .*'
|
||||
alias lr='ls -R'
|
||||
alias lsl="ls -lhFA --color=always | less"
|
||||
alias left='ls -t -1'
|
||||
|
||||
# GNU make
|
||||
alias mkrt='make -C $(git rev-parse --show-toplevel)'
|
||||
alias mk="make"
|
||||
alias mkc="make -C"
|
||||
|
||||
# url encode/decode
|
||||
alias urldecode='python3 -c "import sys, urllib.parse as ul; \
|
||||
print(ul.unquote_plus(sys.argv[1]))"'
|
||||
alias urlencode='python3 -c "import sys, urllib.parse as ul; \
|
||||
print (ul.quote_plus(sys.argv[1]))"'
|
||||
|
||||
# misc
|
||||
alias zshrc='${EDITOR:-vim} "${ZDOTDIR:-$HOME}"/.zshrc'
|
||||
# alias zbench='for i in {1..10}; do /usr/bin/time zsh -lic exit; done'
|
||||
alias zdot='cd ${ZDOTDIR:-~}'
|
||||
|
28
home/private_dot_config/zsh/conf.d/misc.zsh
Normal file
28
home/private_dot_config/zsh/conf.d/misc.zsh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#
|
||||
# misc - Set general Zsh config options here, or change plugin settings.
|
||||
#
|
||||
|
||||
#
|
||||
# Options
|
||||
#
|
||||
|
||||
# Undo options from plugins
|
||||
setopt NO_BEEP # Be quiet!
|
||||
setopt NO_HIST_BEEP # Be quiet!
|
||||
|
||||
#
|
||||
# OMZ
|
||||
#
|
||||
MAGIC_ENTER_GIT_COMMAND="$MAGIC_ENTER_OTHER_COMMAND && git status -sb"
|
||||
|
||||
#
|
||||
# Zsh-Utils
|
||||
#
|
||||
# The belek/zsh-utils completion plugin also introduces compstyles. Let's use that!
|
||||
(( ! $+functions[compstyle_zshzoo_setup] )) || compstyle_zshzoo_setup
|
||||
|
||||
# let make handle it's own shell completion
|
||||
zstyle ':completion::complete:make:*:targets' call-command true
|
||||
|
||||
|
||||
|
33
home/private_dot_config/zsh/dot_editorconfig
Normal file
33
home/private_dot_config/zsh/dot_editorconfig
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# .editorconfig
|
||||
#
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.zsh]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[.{zsh*,zlog*,zprofile}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[**/functions/*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[**/completions/_*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
56
home/private_dot_config/zsh/dot_zprofile
Normal file
56
home/private_dot_config/zsh/dot_zprofile
Normal file
|
@ -0,0 +1,56 @@
|
|||
#
|
||||
# .zprofile - Zsh file loaded on login.
|
||||
#
|
||||
|
||||
#
|
||||
# XDG
|
||||
#
|
||||
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
|
||||
export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||
export XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
|
||||
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.xdg}
|
||||
|
||||
for xdgdir in XDG_{CONFIG,CACHE,DATA,STATE}_HOME XDG_RUNTIME_DIR; do
|
||||
[[ -e ${(P)xdgdir} ]] || mkdir -p ${(P)xdgdir}
|
||||
done
|
||||
|
||||
#
|
||||
# Paths
|
||||
#
|
||||
|
||||
# Ensure path arrays do not contain duplicates.
|
||||
typeset -gU path fpath cdpath mailpath
|
||||
|
||||
# Set the list of directories that zsh searches for commands.
|
||||
path=(
|
||||
$HOME/{go,.cargo}/bin(N)
|
||||
$HOME/.extra/bin(N)
|
||||
$HOME/{,.local/}{,s}bin(N)
|
||||
/opt/{homebrew,local}/{,s}bin(N)
|
||||
/usr/{,local/}{,s}bin(N)
|
||||
$path
|
||||
)
|
||||
|
||||
#
|
||||
# Less
|
||||
#
|
||||
|
||||
# Set default less options.
|
||||
export LESS="${LESS:--g -i -M -R -S -w -z-4}"
|
||||
|
||||
# Set the less input preprocessor.
|
||||
if [[ -z "$LESSOPEN" ]] && (( $#commands[(i)lesspipe(|.sh)] )); then
|
||||
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
|
||||
fi
|
||||
|
||||
#
|
||||
# Misc
|
||||
#
|
||||
|
||||
# Use `< file` to quickly view the contents of any file.
|
||||
[[ -z "$READNULLCMD" ]] || READNULLCMD=$PAGER
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
31
home/private_dot_config/zsh/dot_zsh_plugins.txt
Normal file
31
home/private_dot_config/zsh/dot_zsh_plugins.txt
Normal file
|
@ -0,0 +1,31 @@
|
|||
romkatv/zsh-bench kind:path
|
||||
|
||||
ohmyzsh/ohmyzsh path:lib/clipboard.zsh
|
||||
ohmyzsh/ohmyzsh path:plugins/copybuffer
|
||||
ohmyzsh/ohmyzsh path:plugins/copyfile
|
||||
ohmyzsh/ohmyzsh path:plugins/copypath
|
||||
ohmyzsh/ohmyzsh path:plugins/extract
|
||||
ohmyzsh/ohmyzsh path:plugins/magic-enter
|
||||
ohmyzsh/ohmyzsh path:plugins/fancy-ctrl-z
|
||||
|
||||
belak/zsh-utils path:history
|
||||
belak/zsh-utils path:utility
|
||||
|
||||
zdharma-continuum/fast-syntax-highlighting kind:defer
|
||||
Aloxaf/fzf-tab kind:defer
|
||||
|
||||
zsh-users/zsh-completions path:src kind:fpath
|
||||
# doesn't play well with fzf-tab
|
||||
# belak/zsh-utils path:completion
|
||||
|
||||
junegunn/fzf path:shell/completion.zsh
|
||||
junegunn/fzf path:shell/key-bindings.zsh
|
||||
|
||||
# Source everything in $ZDOTDIR/rc.d prior to wrapping up.
|
||||
mattmc3/zshrc.d
|
||||
~/.config/zsh/plugins/zexists
|
||||
|
||||
# These popular core plugins should be loaded at the end
|
||||
# zsh-users/zsh-autosuggestions kind:defer
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
63
home/private_dot_config/zsh/dot_zshrc
Normal file
63
home/private_dot_config/zsh/dot_zshrc
Normal file
|
@ -0,0 +1,63 @@
|
|||
#!/usr/bin/env zsh
|
||||
#
|
||||
# .zshrc - Zsh file loaded on interactive shell sessions.
|
||||
#
|
||||
|
||||
#
|
||||
# Profiling
|
||||
#
|
||||
|
||||
# Load zprof first if we need to profile.
|
||||
[[ ${ZPROFRC:-0} -eq 0 ]] || zmodload zsh/zprof
|
||||
alias zprofrc="ZPROFRC=1 zsh"
|
||||
|
||||
#
|
||||
# Options
|
||||
#
|
||||
|
||||
# Set general Zsh options needed for config.
|
||||
setopt extended_glob
|
||||
|
||||
#
|
||||
# Lazy-load functions
|
||||
#
|
||||
|
||||
# Autoload functions directory and its subdirs.
|
||||
for funcdir in $ZDOTDIR/functions $ZDOTDIR/functions/*(N/); do
|
||||
fpath=($funcdir $fpath)
|
||||
autoload -Uz $fpath[1]/*(.:t)
|
||||
done
|
||||
unset funcdir
|
||||
|
||||
#
|
||||
# Pre-antidote
|
||||
#
|
||||
|
||||
# Be sure to set any supplemental completions directories before compinit is run.
|
||||
fpath=(${ZDOTDIR}/completions(-/FN) $fpath)
|
||||
|
||||
#
|
||||
# antidote
|
||||
#
|
||||
|
||||
[[ -d ${ZDOTDIR:-~}/.antidote ]] ||
|
||||
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-~}/.antidote
|
||||
|
||||
# Set the name of the static .zsh plugins file antidote will generate.
|
||||
zsh_plugins=${ZDOTDIR:-~}/.zsh_plugins.zsh
|
||||
|
||||
# Ensure you have a .zsh_plugins.txt file where you can add plugins.
|
||||
[[ -f ${zsh_plugins:r}.txt ]] || touch ${zsh_plugins:r}.txt
|
||||
|
||||
# Lazy-load antidote.
|
||||
fpath+=(${ZDOTDIR:-~}/.antidote/functions)
|
||||
autoload -Uz $fpath[-1]/antidote
|
||||
|
||||
# Generate static file in a subshell when .zsh_plugins.txt is updated.
|
||||
if [[ ! $zsh_plugins -nt ${zsh_plugins:r}.txt ]]; then
|
||||
(antidote bundle <${zsh_plugins:r}.txt >|$zsh_plugins)
|
||||
fi
|
||||
|
||||
# Source your static plugins file.
|
||||
source $zsh_plugins
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
##? Post load function for zsh-autosuggestions
|
||||
|
||||
# function autosuggestions-keybinds {
|
||||
|
||||
# https://github.com/zsh-users/zsh-autosuggestions
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
|
||||
if [[ -n "$key_info" ]]; then
|
||||
# vi
|
||||
bindkey -M viins "$key_info[Control]F" vi-forward-word
|
||||
bindkey -M viins "$key_info[Control]E" vi-add-eol
|
||||
fi
|
||||
|
||||
# }
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
13
home/private_dot_config/zsh/functions/envsubst
Normal file
13
home/private_dot_config/zsh/functions/envsubst
Normal file
|
@ -0,0 +1,13 @@
|
|||
##? envsubst - fall-back wrapper in the event the envsubst command does not exist.
|
||||
|
||||
if (( ! $+commands[envsubst] )); then
|
||||
function envsubst {
|
||||
command envsubst "$@"
|
||||
}
|
||||
else
|
||||
function envsubst {
|
||||
python -c 'import os,sys;[sys.stdout.write(os.path.expandvars(l)) for l in sys.stdin]'
|
||||
}
|
||||
fi
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
13
home/private_dot_config/zsh/functions/fnhelp
Normal file
13
home/private_dot_config/zsh/functions/fnhelp
Normal file
|
@ -0,0 +1,13 @@
|
|||
##? fnhelp - use '##?' comments in function files as help docs.
|
||||
##?
|
||||
##? usage: fnhelp <func>
|
||||
|
||||
# function fnhelp {
|
||||
local ZFUNCDIR="${ZFUNCDIR:-${ZDOTDIR:-~/.config/zsh}/functions}"
|
||||
if [[ ! -f "$ZFUNCDIR/$1" ]]; then
|
||||
echo >&2 "fnhelp: function not found '$1'." && return 1
|
||||
fi
|
||||
command grep "^##?" "$ZFUNCDIR/$1" | cut -c 5-
|
||||
# }
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
5
home/private_dot_config/zsh/functions/format-qmd
Normal file
5
home/private_dot_config/zsh/functions/format-qmd
Normal file
|
@ -0,0 +1,5 @@
|
|||
# TODO: add support for outputs
|
||||
|
||||
jupytext --from qmd $1 --pipe black --opt 'notebook_metadata_filter=-all'
|
||||
|
||||
# vim ft=zsh
|
3
home/private_dot_config/zsh/functions/gi
Normal file
3
home/private_dot_config/zsh/functions/gi
Normal file
|
@ -0,0 +1,3 @@
|
|||
curl -sL "https://www.toptal.com/developers/gitignore/api/$@"
|
||||
|
||||
# vim ft=zsh
|
|
@ -0,0 +1,25 @@
|
|||
##? Post load function for zsh-history-substring-search plugin
|
||||
|
||||
# function history-substring-search-keybinds {
|
||||
|
||||
# https://github.com/zsh-users/zsh-history-substring-search
|
||||
if [[ -n "$key_info" ]]; then
|
||||
# Emacs
|
||||
bindkey -M emacs "$key_info[Control]P" history-substring-search-up
|
||||
bindkey -M emacs "$key_info[Control]N" history-substring-search-down
|
||||
|
||||
# Vi
|
||||
bindkey -M vicmd "k" history-substring-search-up
|
||||
bindkey -M vicmd "j" history-substring-search-down
|
||||
|
||||
# Emacs and Vi
|
||||
for keymap in 'emacs' 'viins'; do
|
||||
bindkey -M "$keymap" "$key_info[Up]" history-substring-search-up
|
||||
bindkey -M "$keymap" "$key_info[Down]" history-substring-search-down
|
||||
done
|
||||
|
||||
unset keymap
|
||||
fi
|
||||
# }
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
7
home/private_dot_config/zsh/functions/is-exe
Normal file
7
home/private_dot_config/zsh/functions/is-exe
Normal file
|
@ -0,0 +1,7 @@
|
|||
#? check if executable exists
|
||||
|
||||
if [ -x "$(command -v $1)" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
11
home/private_dot_config/zsh/functions/is-tty
Normal file
11
home/private_dot_config/zsh/functions/is-tty
Normal file
|
@ -0,0 +1,11 @@
|
|||
##? check if running in a tty
|
||||
|
||||
case $(tty) in /dev/tty[0-9]*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
5
home/private_dot_config/zsh/functions/pmodload
Normal file
5
home/private_dot_config/zsh/functions/pmodload
Normal file
|
@ -0,0 +1,5 @@
|
|||
# function pmodload {
|
||||
# if you are using Prezto, you'll need an empty pmodload function
|
||||
# }
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
6
home/private_dot_config/zsh/functions/reload
Normal file
6
home/private_dot_config/zsh/functions/reload
Normal file
|
@ -0,0 +1,6 @@
|
|||
##? reload zshell configs
|
||||
|
||||
source $ZDOTDIR/.zshenv
|
||||
source $ZDOTDIR/.zshrc
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
18
home/private_dot_config/zsh/functions/web
Normal file
18
home/private_dot_config/zsh/functions/web
Normal file
|
@ -0,0 +1,18 @@
|
|||
##? open file in $BROWSER
|
||||
|
||||
if [[ -z "$BROWSER" ]]; then
|
||||
echo 'set $BROWSER'
|
||||
return
|
||||
fi
|
||||
for i
|
||||
do
|
||||
if [[ ! -r $i ]]
|
||||
then
|
||||
echo "$0: file doesn't exist: \`$i'" >&2
|
||||
continue
|
||||
fi
|
||||
$BROWSER "$i" > /dev/null 2>&1 &
|
||||
disown
|
||||
done
|
||||
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
1
home/private_dot_config/zsh/zexists.d/cmd/anit-lsd.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/anit-lsd.zsh
Normal file
|
@ -0,0 +1 @@
|
|||
alias lt="tree -L 3"
|
2
home/private_dot_config/zsh/zexists.d/cmd/anti-nvim.zsh
Normal file
2
home/private_dot_config/zsh/zexists.d/cmd/anti-nvim.zsh
Normal file
|
@ -0,0 +1,2 @@
|
|||
EDITOR=vim
|
||||
VISUAL=vim
|
11
home/private_dot_config/zsh/zexists.d/cmd/anti-starship.zsh
Normal file
11
home/private_dot_config/zsh/zexists.d/cmd/anti-starship.zsh
Normal file
|
@ -0,0 +1,11 @@
|
|||
echo "no starship = dumber prompt"
|
||||
|
||||
autoload -Uz vcs_info
|
||||
precmd() {
|
||||
vcs_info
|
||||
}
|
||||
|
||||
zstyle ':vcs_info:git:*' formats '%b '
|
||||
|
||||
setopt PROMPT_SUBST
|
||||
PROMPT='%F{green}%*%f %F{blue}%~%f %F{red}${vcs_info_msg_0_}%f$ '
|
3
home/private_dot_config/zsh/zexists.d/cmd/bat.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/bat.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
export BAT_THEME=Catppuccin
|
||||
export BAT_STYLE=header,numbers,grid
|
||||
|
1
home/private_dot_config/zsh/zexists.d/cmd/eget.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/eget.zsh
Normal file
|
@ -0,0 +1 @@
|
|||
export EGET_BIN=$HOME/bin
|
1
home/private_dot_config/zsh/zexists.d/cmd/fnm.zsh
Normal file
1
home/private_dot_config/zsh/zexists.d/cmd/fnm.zsh
Normal file
|
@ -0,0 +1 @@
|
|||
eval "$(fnm env --shell zsh)"
|
11
home/private_dot_config/zsh/zexists.d/cmd/fzf.zsh
Normal file
11
home/private_dot_config/zsh/zexists.d/cmd/fzf.zsh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
# catppuccin
|
||||
FZF_COLORS="
|
||||
--color=bg+:#302D41,bg:#1E1E2E,spinner:#F8BD96,hl:#F28FAD
|
||||
--color=fg:#D9E0EE,header:#F28FAD,info:#DDB6F2,pointer:#F8BD96
|
||||
--color=marker:#F8BD96,fg+:#F2CDCD,prompt:#DDB6F2,hl+:#F28FAD
|
||||
"
|
||||
|
||||
export FZF_DEFAULT_OPTS=${FZF_COLORS}${FZF_LAYOUT}
|
||||
|
3
home/private_dot_config/zsh/zexists.d/cmd/lazygit.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/lazygit.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
alias lg=lazygit
|
||||
|
||||
alias dots-git='lazygit -p ~/.dotfiles'
|
3
home/private_dot_config/zsh/zexists.d/cmd/lsd.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/lsd.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
is-tty && alias lsd="lsd --icon never"
|
||||
alias ls="lsd --group-directories-first --color=always"
|
||||
alias lt='lsd --tree --depth=3'
|
19
home/private_dot_config/zsh/zexists.d/cmd/micromamba.zsh
Normal file
19
home/private_dot_config/zsh/zexists.d/cmd/micromamba.zsh
Normal file
|
@ -0,0 +1,19 @@
|
|||
|
||||
alias umamba=micromamba
|
||||
|
||||
# >>> mamba initialize >>>
|
||||
# !! Contents within this block are managed by 'mamba init' !!
|
||||
export MAMBA_EXE="$HOME/bin/micromamba";
|
||||
export MAMBA_ROOT_PREFIX="$HOME/.micromamba";
|
||||
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
|
||||
if [ $? -eq 0 ]; then
|
||||
eval "$__mamba_setup"
|
||||
else
|
||||
if [ -f "$HOME/.micromamba/etc/profile.d/micromamba.sh" ]; then
|
||||
. "$HOME/.micromamba/etc/profile.d/micromamba.sh"
|
||||
else
|
||||
export PATH="$HOME/.micromamba/bin:$PATH" # extra space after export prevents interference from conda init
|
||||
fi
|
||||
fi
|
||||
unset __mamba_setup
|
||||
# <<< mamba initialize <<<
|
3
home/private_dot_config/zsh/zexists.d/cmd/nvim.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/nvim.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
export EDITOR=nvim
|
||||
export VISUAL=nvim
|
||||
alias vim=nvim
|
3
home/private_dot_config/zsh/zexists.d/cmd/pnpm.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/pnpm.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
export PNPM_HOME="$HOME/.local/share/pnpm"
|
||||
path=( "$PNPM_HOME" $path)
|
||||
|
7
home/private_dot_config/zsh/zexists.d/cmd/starship.zsh
Normal file
7
home/private_dot_config/zsh/zexists.d/cmd/starship.zsh
Normal file
|
@ -0,0 +1,7 @@
|
|||
if is-tty; then
|
||||
export STARSHIP_CONFIG=~/.config/starship/plain.toml
|
||||
else
|
||||
export STARSHIP_CONFIG=~/.config/starship/config.toml
|
||||
fi
|
||||
|
||||
eval "$(starship init zsh)"
|
7
home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh
Normal file
7
home/private_dot_config/zsh/zexists.d/cmd/tmux.zsh
Normal file
|
@ -0,0 +1,7 @@
|
|||
alias t-labbook="$DOTFILES_DIR/tmux/labbook.sh"
|
||||
# source custom tmux.conf with older tmux
|
||||
alias tmux="tmux -f ~/.config/tmux/tmux.conf"
|
||||
alias t='tmux'
|
||||
alias tn='tmux new-session'
|
||||
alias tl='tmux list-sessions'
|
||||
|
3
home/private_dot_config/zsh/zexists.d/cmd/zellij.zsh
Normal file
3
home/private_dot_config/zsh/zexists.d/cmd/zellij.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
alias zs="zellij -s"
|
||||
alias zl="zellij ls"
|
||||
alias za="zellij a"
|
5
home/private_dot_config/zsh/zexists.d/cmd/zoxide.zsh
Normal file
5
home/private_dot_config/zsh/zexists.d/cmd/zoxide.zsh
Normal file
|
@ -0,0 +1,5 @@
|
|||
eval "$(zoxide init zsh --cmd cd)"
|
||||
|
||||
if is-exe lsd; then
|
||||
export _ZO_FZF_OPTS="--preview 'command lsd --tree --color always --icon always {2..}'"
|
||||
fi
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
export DENO_INSTALL="$HOME/.deno"; \
|
||||
path=("$DENO_INSTALL/bin" $path)
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
path=("$HOME/.nimble/bin" $path)
|
|
@ -0,0 +1,2 @@
|
|||
source "$HOME/.pkgs/google-cloud-sdk/completion.zsh.inc"
|
||||
path=("$HOME/.pkgs/google-cloud-sdk/bin" $path)
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env zsh
|
||||
# bun completions
|
||||
[[ -s "$HOME/.bun/_bun" ]] && source "$HOME/.bun/_bun"
|
||||
# bun
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
path=("$BUN_INSTALL/bin" $path)
|
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env zsh
|
||||
# Updated to use $HOME
|
||||
|
||||
# >>> conda initialize >>>
|
||||
# !! Contents within this block are managed by 'conda init' !!
|
||||
__conda_setup="$("$HOME/mambaforge/bin/conda" 'shell.zsh' 'hook' 2>/dev/null)"
|
||||
if [ $? -eq 0 ]; then
|
||||
eval "$__conda_setup"
|
||||
else
|
||||
if [ -f "$HOME/mambaforge/etc/profile.d/conda.sh" ]; then
|
||||
. "$HOME/mambaforge/etc/profile.d/conda.sh"
|
||||
else
|
||||
export PATH="$HOME/mambaforge/bin:$PATH"
|
||||
fi
|
||||
fi
|
||||
unset __conda_setup
|
||||
|
||||
if [ -f "$HOME/mambaforge/etc/profile.d/mamba.sh" ]; then
|
||||
. "$HOME/mambaforge/etc/profile.d/mamba.sh"
|
||||
fi
|
||||
|
||||
# <<< conda initialize <<<
|
||||
|
||||
# <<< mamba initialize <<<
|
||||
|
||||
snake() {
|
||||
if [[ $1 == "no" ]]; then
|
||||
if [[ $VIRTUAL_ENV != "" ]]; then
|
||||
echo "deactivate python virtualenv: $VIRTUAL_ENV"
|
||||
deactivate
|
||||
elif [[ $CONDA_DEFAULT_ENV != "" ]]; then
|
||||
echo "deactivating conda env: $CONDA_DEFAULT_ENV"
|
||||
conda deactivate
|
||||
else
|
||||
echo 'no environment to leave'
|
||||
fi
|
||||
else
|
||||
if [[ -d $(pwd)/env ]]; then
|
||||
printf 'activating project-specific env: %s\n' "${PWD##*/}/env"
|
||||
conda activate ./env
|
||||
elif [[ -d $(pwd)/venv ]]; then
|
||||
echo "activating python virtualenv"
|
||||
source ./venv/bin/activate
|
||||
elif [[ -d $(pwd)/.venv ]]; then
|
||||
echo "activating python virtualenv"
|
||||
source ./.venv/bin/activate
|
||||
else
|
||||
echo "is there an environment to activate?"
|
||||
echo "I was expecting either a conda(env) or virtualenv(venv,.venv)"
|
||||
fi
|
||||
fi
|
||||
}
|
Loading…
Reference in a new issue