Compare commits

...

10 Commits

9 changed files with 135 additions and 1697 deletions

28
.gitignore vendored
View File

@ -7,15 +7,29 @@
!README.md !README.md
# allow some stuff to be pushed # allow some stuff to be pushed
!tmux
!git
!alacritty !alacritty
!nvim !nvim
!zsh
!.pyenv !.pyenv
# explicity ignore zcoredump # zsh
zsh/.zcomp* !zsh
zsh/*
!zsh/.zshrc
!zsh/.zshenv
!zsh/.zprofile
!zsh/scripts.zsh
!zsh/aliases.zsh
!zsh/completions/.keep
# explicity ignore tmux plugins # tmux
tmux/plugins !tmux
tmux/*
!tmux/tmux.conf
!tmux/tmux-sessionizer
# git
!git
git/*
!git/config
!git/gitignore
!git/aflabs

View File

@ -1,25 +1,16 @@
[user] [user]
name = Matej Janežič name = Matej Janežič
email = janezic.mj@gmail.com email = janezic.mj@gmail.com
signingkey = 4298E230ED37B2C0
[core] [core]
autocrlf = input autocrlf = input
excludesfile = ~/.config/git/gitignore excludesfile = ~/.config/git/gitignore
editor = nvim editor = nvim
[includeIf "gitdir:~/Desktop/git/git.aflabs.org/"]
path = ~/.config/git/aflabs
[commit]
gpgsign = true
[gpg]
program = /opt/homebrew/bin/gpg
[init] [init]
defaultBranch = master defaultBranch = master
[alias] [include]
andraz = commit --amend --no-edit --author=\"Andraž Kladnik <andraz.kladnik@aflabs.si>\" path = ~/.config/git/alias
petra = commit --amend --no-edit --author=\"Petra Podlogar <petra.podlogar@aflabs.si>\" [include]
ziga = commit --amend --no-edit --author=\"Žiga Avbreht <ziga.avbreht@aflabs.si>\" path = ~/.config/git/commitsign
laura = commit --amend --no-edit --author=\"lauraGB <laura.guzelj.blatnik@aflabs.si>\" [includeIf "gitdir:~/Desktop/git/git.aflabs.org/"]
gasper = commit --amend --no-edit --author=\"Gašper Žajdela <gasper.zajdela@aflabs.si>\" path = ~/.config/git/aflabs
luka = commit --amend --no-edit --author=\"Luka Avbreht <luka.avbreht@aflabs.si>\"
koprivec = commit --amend --no-edit --author=\"Filip Koprivec <filip.koprivec@aflabs.si>\"

View File

@ -1,11 +1,11 @@
set -ga terminal-overrides ",xterm-256color:Tc" set -g default-terminal "xterm-256color"
set-option -g default-terminal "screen-256color" set -ag terminal-overrides ",xterm-256color:RGB"
set -s escape-time 0 set -s escape-time 0
unbind C-b unbind C-b
set-option -g prefix C-s set-option -g prefix C-s
bind-key C-s send-prefix bind-key C-s send-prefix
# set -g status-style 'bg=#333333 fg=#5eacd3'
bind r source-file "$XDG_CONFIG_HOME/tmux/tmux.conf" bind r source-file "$XDG_CONFIG_HOME/tmux/tmux.conf"
set -g base-index 1 set -g base-index 1
@ -25,10 +25,12 @@ bind -r h select-pane -L
bind -r l select-pane -R bind -r l select-pane -R
bind -r D neww -c "#{pane_current_path}" "nvim TODO.md" bind -r D neww -c "#{pane_current_path}" "nvim TODO.md"
bind -r t neww -c "~" "nvim ~/.TODO.md"
bind-key -r f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer" bind-key -r f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer"
bind-key -r R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer $XDG_CONFIG_HOME" bind-key -r g run-shell "tmux neww ~/.config/tmux/tmux-sessionizer $XDG_CONFIG_HOME"
bind-key -r T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/Desktop/temp" bind-key -r T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/Desktop/temp"
bind-key -r R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm' run '~/.config/tmux/plugins/tpm/tpm'

File diff suppressed because it is too large Load Diff

39
zsh/.zshenv Normal file
View File

@ -0,0 +1,39 @@
# default configuration as per https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# brew sbin
export PATH="/opt/homebrew/sbin:$PATH"
# brew lib
export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib"
# cargo
source "$HOME/.cargo/env"
# language environment
export LANG=en_US.UTF-8
# editor
export EDITOR=nvim
# go
export GOHOME="$XDG_DATA_HOME/go"
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
export PATH="$GOHOME/bin:$PATH"
# ggman
export GGROOT="$HOME/git"
# neovim
export PATH="$XDG_DATA_HOME/neovim/bin:$PATH"
# pyenv
export PYENV_ROOT="$XDG_DATA_HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
# poetry
export POETRY_HOME="$XDG_DATA_HOME/poetry"
command -v poetry >/dev/null || export PATH="$POETRY_HOME/bin:$PATH"

View File

@ -1,8 +1,5 @@
# default configuration as per https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html # zsh history file
export XDG_CONFIG_HOME="$HOME/.config" export HISTFILE="$XDG_STATE_HOME/zsh/history"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_STATE_HOME="$HOME/.local/state"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n] # Initialization code that may require console input (password prompts, [y/n]
@ -11,65 +8,50 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi fi
# zsh history file # completion
export HISTFILE="$XDG_STATE_HOME/zsh/history" fpath=($ZDOTDIR/completions $fpath)
autoload -Uz compinit
# Path to your oh-my-zsh installation. compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
export ZSH="$HOME/.oh-my-zsh" zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache
# Set name of the theme to load
ZSH_THEME="powerlevel10k/powerlevel10k"
# just remind me to update when it's time
zstyle ':omz:update' mode reminder
zstyle ':omz:update' frequency 7
# pre plugin load # pre plugin load
export NVM_COMPLETION=true export NVM_COMPLETION=true
export NVM_AUTO_USE=true export NVM_AUTO_USE=true
# i don't lazy load nvm because neovim doesn't work well with it
# plugins # load antigen
plugins=(zsh-nvm git zsh-autosuggestions zsh-syntax-highlighting) typeset -a ANTIGEN_CHECK_FILES=(${ZDOTDIR:-~}/.zshrc ${ZDOTDIR:-~}/antigen.zsh)
source $ZDOTDIR/antigen.zsh
# TODO: lose oh my zsh at some point # oh-my-zsh library and git plugin
antigen use oh-my-zsh
antigen bundle git
# oh my zsh # zsh users plugin
source $ZSH/oh-my-zsh.sh antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
# language environment # other
export LANG=en_US.UTF-8 antigen bundle lukechilds/zsh-nvm
# brew sbin # theme
export PATH="/opt/homebrew/sbin:$PATH" antigen theme romkatv/powerlevel10k
# apply plugin load
antigen apply
# pyenv # pyenv
export PYENV_ROOT="$XDG_DATA_HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)" eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)" eval "$(pyenv virtualenv-init -)"
# # nvim
export PATH="$HOME/neovim/bin:$PATH"
# go
export GOHOME="$XDG_DATA_HOME/go"
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
export PATH="$PATH:$GOHOME/bin"
# ggman # ggman
export GGROOT="$HOME/Desktop/git"
eval "$(ggman shellrc)" eval "$(ggman shellrc)"
# gpg # gpg
export GPG_TTY=$(tty) export GPG_TTY=$(tty)
# editor
export EDITOR=nvim
# custom functions and aliases # custom functions and aliases
source "$ZDOTDIR/aliases.zsh" source "$ZDOTDIR/aliases.zsh"
source "$ZDOTDIR/functions.zsh" source "$ZDOTDIR/scripts.zsh"
# opam configuration # opam configuration
[[ ! -r /Users/janezicmatej/.opam/opam-init/init.zsh ]] || source /Users/janezicmatej/.opam/opam-init/init.zsh > /dev/null 2> /dev/null [[ ! -r /Users/janezicmatej/.opam/opam-init/init.zsh ]] || source /Users/janezicmatej/.opam/opam-init/init.zsh > /dev/null 2> /dev/null

View File

@ -1,3 +1,5 @@
alias z="exec zsh"
alias t="tmux a || tmux new-session -s janezicmatej -c ~"
alias n=nvim_ve alias n=nvim_ve
alias vim=nvim_ve alias vim=nvim_ve
@ -11,16 +13,10 @@ alias accenton="defaults write -g ApplePressAndHoldEnabled -bool true"
alias accentoff="defaults write -g ApplePressAndHoldEnabled -bool false" alias accentoff="defaults write -g ApplePressAndHoldEnabled -bool false"
# docker # docker
alias aafh=./helper alias dps="docker ps --format table'{{ .ID }}\t{{ .Image }}\t{{ .Ports}}\t{{ .Names }}'"
# git
alias gcan="git commit -v --amend --no-edit"
alias gros="git reset origin/$(git_current_branch) --soft" alias gros="git reset origin/$(git_current_branch) --soft"
# quick edit .dotfiles
alias zshrc="n $ZDOTDIR/.zshrc && source $ZDOTDIR/.zshrc"
alias addalias="n $ZDOTDIR/aliases.zsh && source $ZDOTDIR/.zshrc"
# unsorted # unsorted
alias ci="glab ci list" alias ci="glab ci list"
alias bm=batman alias bm=batman

0
zsh/completions/.keep Normal file
View File

View File

@ -44,3 +44,39 @@ function nukepip {
pip uninstall $(pip freeze) -y pip uninstall $(pip freeze) -y
pip install -r $(pyenv root)/default-packages pip install -r $(pyenv root)/default-packages
} }
function pyinit {
if [[ -f .python-version ]]; then
echo "found .python-version, stopping"
return
fi
DIRNAME=$(basename "$PWD")
if [[ $(pyenv versions | grep "$DIRNAME") ]]; then
echo "found existing version with this name, setting..."
pyenv local "$DIRNAME"
return
fi
if [[ -z $1 ]]; then
echo "no python version provided, defaulting to $(pyenv version-name)"
VERSION=$(pyenv version-name)
else
VERSION=$1
fi
pyenv virtualenv "$VERSION" "$DIRNAME"
pyenv local "$DIRNAME"
}
function lh {
if [[ -z $1 ]]; then
PORT=8000
else
PORT=$1
fi
open "http://localhost:$PORT"
}