Compare commits

...

5 Commits

8 changed files with 77 additions and 19 deletions

2
.gitignore vendored
View File

@@ -41,7 +41,7 @@ tmux/*
!git
git/*
!git/config
!git/gitignore
!git/ignore
!git/aflabs
# ghostty

View File

@@ -1,3 +0,0 @@
[user]
name = Matej Janežič
email = matej.janezic@aflabs.si

View File

@@ -1,18 +1,56 @@
[includeIf "gitdir:~/Desktop/git/git.aflabs.org/"]
path = ~/.config/git/config.d/aflabs.conf
[includeIf "gitdir:~/Desktop/git/gitlab.com/flarenetwork"]
path = ~/.config/git/config.d/aflabs.conf
[includeIf "gitdir:~/Desktop/git/gitlab.com/flare-foundation"]
path = ~/.config/git/flare
[user]
name = Matej Janežič
email = janezic.mj@gmail.com
[core]
autocrlf = input
excludesfile = ~/.config/git/gitignore
editor = nvim
[include]
path = ~/.config/git/alias
[include]
path = ~/.config/git/commitsign
[includeIf "gitdir:~/Desktop/git/git.aflabs.org/"]
path = ~/.config/git/aflabs
[user]
signingkey = AF349EECC849D87B790E88FF6318FFB7DB374B7D
[commit]
gpgsign = true
; NOTE:(@janezicmatej) github/gitlab don't support these
; [push]
; gpgsign = true
[init]
defaultBranch = main
[alias]
blame = "!f() { [ -f .git-blame-ignore-revs ] && git blame --ignore-revs-file .git-blame-ignore-revs \"$@\" || git blame \"$@\"; }; f"
[diff]
tool = "nvimdiff"
[difftool]
prompt = true
[difftool "nvimdiff"]
cmd = nvim -d "$LOCAL" "$REMOTE"
[maintenance]
auto = true
strategy = incremental
[merge]
tool = "nvimdiff"
[mergetool]
prompt = true
keepBackup = false
writeToTemp = true
[mergetool "nvimdiff"]
layout = "LOCAL,BASE,REMOTE / MERGED"

View File

@@ -1,10 +1,6 @@
# mac files
.DS_Store
# i usually make test.* files for local testing
# test.*
# test
# i don't like pushing .vscode and .idea folders, i will force add if needed
.vscode
.idea
@@ -12,6 +8,10 @@
# pyenv
.python-version
# nix venv hook
.nix-venv
.dev
# i use .ignore for nvim
.ignore

View File

@@ -7,6 +7,8 @@ set -g set-clipboard on
set -s escape-time 0
set -g update-environment "SSH_AUTH_SOCK SSH_CONNECTION SSH_TTY DISPLAY"
unbind C-b
set-option -g prefix C-s

View File

@@ -1,9 +1,13 @@
alias z="exec zsh"
alias t="tmux a || ~/.config/tmux/tmux-sessionizer ~"
alias t=tmux_attach
alias n=nvim_ve
# alias vim=nvim_ve
alias s="ssh-menu"
# docker
alias dp="docker ps --format 'table {{.Names}}\t{{.Ports}}'"
alias dcp="docker compose ps --format 'table {{.Name}}\t{{.Ports}}'"
# navigation
alias cdgit="cd $GGROOT"
alias icloud="cd $HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs"
@@ -16,6 +20,7 @@ alias accentoff="defaults write -g ApplePressAndHoldEnabled -bool false"
# git
alias gros="git reset origin/$(git_current_branch) --soft"
alias gcan="git commit -v --amend --no-edit"
alias glogaa="git log --oneline --graph --all --pretty=format:\"%C(auto)%h %C(blue)(%aL/%cL)%C(auto)%(decorate) %s%Creset\""
# unsorted
alias ci="glab ci list"
@@ -24,7 +29,7 @@ alias grow="~/.local/bin/cbonsai -liWC -M 15 -t 2 -w 60 -s $(date +%s)"
alias clean_ds_store='find . -name ".DS_Store" -type f -delete -print'
# ruff
alias ruffme="ruff format && ruff check --fix"
alias ruffme="ruff check --fix && ruff format"
# clipboard
alias xcp="xclip -selection c"

View File

@@ -79,3 +79,19 @@ function tssh {
ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash"
}
function tmux_attach {
tmux_running=$(pgrep tmux)
if ! [[ -z ${TMUX} ]]; then
echo "already attached; refreshing env"
source <(tmux show-environment | sed -n 's/^\(.*\)=\(.*\)$/export \1="\2"/p')
return 1
fi
if [[ -z $tmux_running ]]; then
~/.config/tmux/tmux-sessionizer ~
else
tmux a
fi
}

View File

@@ -49,8 +49,8 @@ EOF
export -f _ssh_menu_preview
function ssh-menu {
selected="$(rg -N --no-heading 'Host .*' ~/.ssh \
| sed 's/Host \(.*\)/\1/' \
selected="$(rg -N --no-heading '^Host .*' ~/.ssh \
| sed 's/Host \(.*\)/\1/' | sort \
| SHELL=$(which bash) fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--delimiter ':' \