Compare commits

...

5 Commits

Author SHA1 Message Date
f357d23559 zsh: export GEM_PATH and WAKATIME_HOME 2023-03-03 16:10:50 +02:00
Ismo Vuorinen
b183fcbdb2 nvim: update astronvim 2023-02-27 10:20:58 +02:00
17ce1c6ee6 zshrc: More configurations! 2023-02-27 03:34:33 +02:00
66de4b3323 zsh: Update main and lakka zshrc 2023-02-27 02:04:41 +02:00
b55c1a17ba dfm: Reset nvim command fixes 2023-02-27 01:35:54 +02:00
4 changed files with 106 additions and 46 deletions

View File

@@ -1,33 +1,72 @@
PATH=$HOME/.local/bin:$HOME/bin:$HOME/.gem/bin:$HOME/.rvm/bin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH # Lakka zsh configuration.
#
# shellcheck shell=bash
export PATH="/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
# Defaults
export DOTFILES="$HOME/.dotfiles"
# Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
# z, https://github.com/rupa/z
export _Z_DATA="$XDG_STATE_HOME/z"
# composer, https://getcomposer.org/
if command -v composer &> /dev/null; then
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
export PATH="$COMPOSER_BIN:$PATH"
fi
# gem, rubygems
if command -v gem &>/dev/null; then
export GEM_HOME="$XDG_STATE_HOME/gem"
export PATH="$GEM_HOME/bin:$PATH"
fi
export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH"
export LC_ALL=fi_FI.utf8 export LC_ALL=fi_FI.utf8
source $HOME/.local/bin/antigen # Antigen configuration
# https://github.com/zsh-users/antigen/wiki/Configuration
export ADOTDIR="$XDG_DATA_HOME/antigen"
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
antigen use oh-my-zsh # Try to load antigen, if present
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
antigen bundle git # If antigen was loaded
antigen bundle php if command -v antigen &> /dev/null; then
# antigen bundle rvm antigen use oh-my-zsh
antigen bundle autojump
antigen bundle command-not-found
antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle unixorn/rvm-plugin
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai hash git 2>/dev/null && antigen bundle git
hash php 2>/dev/null && antigen bundle php
antigen apply antigen bundle autojump
antigen bundle command-not-found
antigen bundle jreese/zsh-titles
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle unixorn/rvm-plugin
antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen apply
fi
alias t='tail -f' alias t='tail -f'
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state' alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
alias dn='du -chd1' alias dn='du -chd1'
alias nano='nano -wS -$' alias nano='nano -wS -$'
alias cat=bat
alias gpg=gpg2 alias gpg=gpg2
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" ]] # Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" ]] # Load RVM into a shell session *as a function*
. "/home/users/viir/.acme.sh/acme.sh.env" . "$HOME/.acme.sh/acme.sh.env"

View File

@@ -26,16 +26,15 @@ function section_reset
;; ;;
nvim) nvim)
rm -rf ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim ~/.config/astronvim ~/.config/nvim rm -rf ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim ~/.config/astronvim ~/.config/nvim
msg_done "Deleted old nvim files" msg_ok "Deleted old nvim files"
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
ln -s ~/.dotfiles/config/nvim ~/.config/nvim ln -s ~/.dotfiles/config/nvim ~/.config/nvim
msg_done "Linked nvim and astronvim" msg_ok "Linked nvim and astronvim"
$0 install brew $0 install brew
$0 install ext_go $0 install ext_go
$0 install ext_npm $0 install ext_npm
msg_done "Installed brew, and packages for go and npm" msg_ok "Installed brew, and packages for go and npm"
nvim --headless -c 'autocmd User PackerComplete quitall' msg_done "...and we are done!"
msg_done "Installed nvim packages and we are now ready"
;; ;;
*) *)
menu_section "$USAGE_PREFIX" "all | nvim" menu_section "$USAGE_PREFIX" "all | nvim"

66
zshrc
View File

@@ -1,21 +1,28 @@
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# shellcheck shell=bash # shellcheck shell=bash
autoload -U colors zsh/terminfo autoload -U colors zsh/terminfo
colors colors
export HOMEBREW="/opt/homebrew" # Defaults
export DOTFILES="$HOME/.dotfiles" export DOTFILES="$HOME/.dotfiles"
export PATH="$HOMEBREW/opt/ruby/bin:$HOMEBREW/bin:$HOMEBREW/sbin:/usr/local/sbin:$PATH"
export HOMEBREW_NO_ENV_HINTS=1
# Explicitely set XDG folders # Explicitly set XDG folders
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_DATA_HOME="$HOME/.local/share" export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config" export XDG_CONFIG_HOME="$HOME/.config"
export XDG_STATE_HOME="$HOME/.local/state" export XDG_STATE_HOME="$HOME/.local/state"
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
# Homebrew configuration
export HOMEBREW="/opt/homebrew"
export HOMEBREW_BIN="$HOMEBREW/bin"
export HOMEBREW_SBIN="$HOMEBREW/sbin"
export HOMEBREW_PKG="$HOMEBREW/opt"
export HOMEBREW_NO_ENV_HINTS=1
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
# brew, https://brew.sh
if [ command -v brew &> /dev/null ]; then if [ command -v brew &> /dev/null ]; then
BREW_BIN=$(brew --prefix)/bin BREW_BIN=$(brew --prefix)/bin
BREW_SBIN=$(brew --prefix)/sbin BREW_SBIN=$(brew --prefix)/sbin
@@ -40,22 +47,38 @@ if command -v nvim &> /dev/null; then
export EDITOR="nvim" export EDITOR="nvim"
fi fi
LOCAL_BIN="$HOME/.local/bin" # z, https://github.com/rupa/z
COMPOSER_DIR="$HOME/.composer/vendor/bin" export _Z_DATA="$XDG_STATE_HOME/z"
export PATH="$LOCAL_BIN:$COMPOSER_DIR:$PATH"
export NVM_DIR="$HOME/.nvm" # composer, https://getcomposer.org/
if command -v composer &> /dev/null; then
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
export PATH="$COMPOSER_BIN:$PATH"
fi
# gem, rubygems
if command -v gem &>/dev/null; then
export GEM_HOME="$XDG_STATE_HOME/gem"
export GEM_PATH="$XDG_STATE_HOME/gem"
fi
# nvm, the node version manager
export NVM_DIR="$XDG_STATE_HOME/nvm"
export NVM_LAZY_LOAD=true export NVM_LAZY_LOAD=true
export NVM_COMPLETION=true export NVM_COMPLETION=true
export NVM_AUTO_USE=true export NVM_AUTO_USE=true
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" [ -s "$HOMEBREW_PKG/nvm/nvm.sh" ] && \. "$HOMEBREW_PKG/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" [ -s "$HOMEBREW_PKG/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PKG/nvm/etc/bash_completion.d/nvm"
# wakatime, https://github.com/wakatime/wakatime-cli
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
# Run x-load-configs in your terminal to reload the files. # Run x-load-configs in your terminal to reload the files.
function x-load-configs() function x-load-configs()
{ {
# Load the shell dotfiles, and then some: # Load the shell dotfiles, and then some:
for file in ~/.dotfiles/config/{exports,alias,functions}; do for file in $DOTFILES/config/{exports,alias,functions}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file" [ -r "$file" ] && [ -f "$file" ] && source "$file"
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret" [ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME" [ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
@@ -67,15 +90,19 @@ x-load-configs
# Import ssh keys in keychain # Import ssh keys in keychain
ssh-add -A 2>/dev/null; ssh-add -A 2>/dev/null;
# Antigen configuration
# https://github.com/zsh-users/antigen/wiki/Configuration
export ADOTDIR="$XDG_DATA_HOME/antigen"
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
# Try to load antigen, if present # Try to load antigen, if present
[[ -f "$HOME/.local/bin/antigen.zsh" ]] && source "$HOME/.local/bin/antigen.zsh" [[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
# antigen is present # antigen is present
if command -v antigen &> /dev/null; then if command -v antigen &> /dev/null; then
antigen use oh-my-zsh antigen use oh-my-zsh
# antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen bundle ssh-agent antigen bundle ssh-agent
antigen bundle colored-man-pages antigen bundle colored-man-pages
antigen bundle jreese/zsh-titles antigen bundle jreese/zsh-titles
@@ -84,16 +111,14 @@ if command -v antigen &> /dev/null; then
antigen bundle MichaelAquilina/zsh-you-should-use antigen bundle MichaelAquilina/zsh-you-should-use
antigen bundle unixorn/autoupdate-antigen.zshplugin antigen bundle unixorn/autoupdate-antigen.zshplugin
antigen bundle Sparragus/zsh-auto-nvm-use antigen bundle Sparragus/zsh-auto-nvm-use
# antigen bundle git-auto-fetch
hash php 2>/dev/null && antigen bundle php hash php 2>/dev/null && antigen bundle php
hash nvm 2>/dev/null && antigen bundle nvm hash nvm 2>/dev/null && antigen bundle nvm
hash docker 2>/dev/null && antigen bundle docker hash docker 2>/dev/null && antigen bundle docker
# hash ruby 2>/dev/null && antigen bundle ruby # hash ruby 2>/dev/null && antigen bundle ruby
# hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
# antigen bundle voronkovich/phpcs.plugin.zsh
# Platform dependant bundles # Platform dependant bundles
if [[ $(uname) == 'Linux' ]]; then if [[ $(uname) == 'Linux' ]]; then
@@ -124,6 +149,3 @@ fi
#fi #fi
eval "$(starship init zsh)" eval "$(starship init zsh)"
# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"