Compare commits

..

56 Commits

Author SHA1 Message Date
360afecb75 feat(starship): always display on hostname 2025-01-19 23:39:18 +01:00
5fb9b3618b feat(ghostty): disable paste protection 2025-01-18 20:10:50 +01:00
41fb0c639a fix(zsh): revert pyenv-virtualenv precmd change 2025-01-06 17:26:15 +01:00
4b17d5db2d feat(ghostty): force dark theme and disable ligatures 2025-01-06 17:24:53 +01:00
cf85fb6372 feat(starship): move user@host to left and add command time 2025-01-02 22:42:22 +01:00
475c183ff7 feat(starship): write user@host at the end of right prompt when ssh 2024-12-30 03:18:25 +01:00
f39f21b624 feat(zsh): switch to starship prompt 2024-12-30 03:04:47 +01:00
afef09e9a8 feat(starship): add basic starship configuration 2024-12-30 03:03:06 +01:00
290ed36719 feat(zsh): custom zsh-autosuggestions highlight 2024-12-29 17:48:35 +01:00
5fbc0bca6b feat(ghostty): add initial ghostty config 2024-12-29 17:48:15 +01:00
6120bd900f feat(zsh): add ssh-menu and get-dump 2024-12-29 17:45:41 +01:00
71fa00e26b feat(nvim): bump version 2024-12-29 13:49:30 +01:00
1507b0c3c4 feat(zsh): remove unneded variables add ~/.local/bin to path 2024-12-29 13:43:54 +01:00
9837828c72 feat(tmux): sessionizer and ssher fzf preview and hashed names 2024-12-29 13:42:34 +01:00
dbc860d89d feat(git): git-blame respect .git-blame-ignore-revs 2024-12-29 13:41:06 +01:00
5cc4dac594 feat(alacritty): send option as alt for macos 2024-12-29 13:39:51 +01:00
5de5edca67 feat(zsh): switch from antigen to antidote 2024-09-24 22:40:41 +02:00
875ee44e7c feat(tmux): unbind c-b 2024-03-26 19:35:03 +01:00
781edd5bf2 feat(nvim): bump version 2024-02-19 15:57:01 +01:00
90c71a0316 feat(git): change default branch name to main 2024-02-19 15:55:08 +01:00
d7f8b52c98 feat(zsh): add ssh-menu and run shmft 2024-02-19 15:54:50 +01:00
a9fe95254a feat(zsh): add exported NAME to .zshenv 2024-02-19 15:54:23 +01:00
0cadba2ad4 feat(tmux): add new project script 2024-02-19 15:51:48 +01:00
a1b422e29e feat(tmux): add second prefix for nested in ssh 2024-02-19 15:43:17 +01:00
62ccbf5d4b feat(zsh): disable autocd 2024-02-01 14:50:39 +01:00
fc639f1fe4 feat(tmux): tmux-ssher wip 2024-02-01 14:50:19 +01:00
791500431a feat: change fontsize to 15, chore: remove .yml config 2024-02-01 14:47:37 +01:00
66bb08a653 feat(tmux): tab cycling in fzf menu 2024-01-25 23:18:54 +01:00
d3bf12cd5e feat(nvim): bump version 2024-01-25 21:03:57 +01:00
170c3acb55 feat(tmux): set-option -g focus-events on 2024-01-25 21:03:47 +01:00
c269c6e175 feat(nvim): bump version 2024-01-25 20:03:58 +01:00
aeaedd8411 feat(zsh): various fixes 2024-01-25 20:03:58 +01:00
3fd73e311a feat(.pyenv): update pyenv-default-packages config 2024-01-25 20:03:58 +01:00
17b524edf4 feat(alacritty): migrate to .toml config 2024-01-25 20:03:58 +01:00
afc6af93ca feat(tmux): add tmux-ggclone and copy support for linux and mac 2024-01-25 20:03:57 +01:00
f1e8dc27e5 feat(nvim): bump submodule 2023-10-08 16:54:35 +02:00
adde03a577 feat(nvim): update submodule 2023-10-08 16:43:18 +02:00
97843e8958 chore: update README.md 2023-10-08 16:39:12 +02:00
22de7135d6 feat(alacritty): change font 2023-10-08 16:38:40 +02:00
27a4e03a65 feat(zsh): add p10k to repo and add some aliases and scripts 2023-10-06 14:49:46 +02:00
4040342a3c feat(tmux): compile tmux sessionizer and remove tpm 2023-10-06 14:47:53 +02:00
e37c74db15 feat(zsh): limit zsh history to 100 2023-07-03 15:58:21 +02:00
a15ae06486 feat(zsh): fix go setup 2023-07-03 15:17:33 +02:00
e266c8ab7c feat(tmux): tab cycling in fzf menu 2023-07-03 14:58:43 +02:00
a4800db0f5 chore(nvim): move submodule to git.janezic.dev 2023-06-16 17:27:08 +02:00
bd8ff47bf2 feat(zsh): add some scripts and aliases 2023-06-16 17:23:38 +02:00
60a32a46bd feat(zsh): remove p10k config from repo, update .gitignore 2023-06-16 11:12:23 +02:00
df08ddeaf5 feat(tmux): fix italics inside tmux 2023-06-16 10:29:33 +02:00
bb00825a6c feat(zsh): move GGROOT to $HOME 2023-06-14 14:22:21 +02:00
21f99827df feat(tmux): add keybind for todo file 2023-06-14 12:38:36 +02:00
b3d8482220 feat: move neovim to XDG 2023-06-14 12:37:37 +02:00
02892635c8 feat: seperate gitconfig into multiple files 2023-06-14 12:37:29 +02:00
64529e8fd2 feat: move relevant things from .zshrc to .zshenv 2023-06-14 11:54:47 +02:00
ceff9db86f feat: remove/add some aliases and scripts 2023-06-14 11:52:56 +02:00
7aa60dad77 feat: change some tmux keybinds 2023-06-02 16:02:48 +02:00
3f01e4c7b5 feat: update zsh to use antigen instead of oh-my-zsh 2023-06-02 16:02:26 +02:00
28 changed files with 838 additions and 1953 deletions

45
.gitignore vendored
View File

@@ -7,15 +7,46 @@
!README.md
# allow some stuff to be pushed
!tmux
!git
!alacritty
!nvim
!zsh
!.pyenv
# explicity ignore zcoredump
zsh/.zcomp*
# zsh
!zsh
zsh/*
!zsh/.zshrc
!zsh/.zshenv
!zsh/.zprofile
!zsh/.zsh_plugins.txt
!zsh/scripts.zsh
!zsh/aliases.zsh
!zsh/completions/.keep
!zsh/ssh-menu
!zsh/get-dump
# explicity ignore tmux plugins
tmux/plugins
# starship
!starship
starship/*
!starship/config.toml
# tmux
!tmux
tmux/*
!tmux/tmux.conf
!tmux/tmux-new-project
!tmux/tmux-sessionizer
!tmux/tmux-ggclone
!tmux/tmux-ssher
# git
!git
git/*
!git/config
!git/gitignore
!git/aflabs
# ghostty
!ghostty
ghostty/*
!ghostty/config
!ghostty/themes

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "nvim"]
path = nvim
url = git@github.com:janezicmatej/nvim.git
url = git@git.janezic.dev:janezicmatej/nvim.git

View File

@@ -1,5 +1,5 @@
# Neovim should be able to run anywhere
neovim
pynvim
# Upgrade pip while we're at it.
pip

View File

@@ -1,21 +1,62 @@
# .dotfiles
## setup cheat sheet
## Alacritty
- install [alacritty](https://github.com/alacritty/alacritty)
- install `JetBrainsMonoNL` font from [nerd-fonts](https://github.com/ryanoasis/nerd-fonts)
- install [zsh](https://www.zsh.org/)
- install [oh-my-zsh](https://ohmyz.sh/)
- install [zsh-nvm](https://github.com/lukechilds/zsh-nvm)
- install [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)
- install [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting)
- install [go](https://go.dev/)
- install [ggman](https://github.com/tkw1536/ggman)
- install [pyenv](https://github.com/pyenv/pyenv) to $XDG_DATA_HOME/.pyenv
- set `PYENV_ROOT` and use [pyenv-installer](https://github.com/pyenv/pyenv-installer)
- install [pyenv-default-packages](https://github.com/jawshooah/pyenv-default-packages.git)
- symlink `.pyenv/default-packages` to `$PYENV_ROOT/default-packages`
- install [neovim](https://neovim.io/)
- follow `README.md` in [janezicmatej/nvim](https://github.com/janezicmatej/nvim/)
- install [tmux](https://github.com/tmux/tmux)
- install [tmp](https://github.com/tmux-plugins/tpm) for plugins
Install [alacritty](https://github.com/alacritty/alacritty) and `JetBrainsMono` font from [nerd-fonts](https://github.com/ryanoasis/nerd-fonts)
## ZSH
Install [zsh](https://www.zsh.org/).
### $ZDOTDIR
To change the location of zsh config files run one of these
```sh
# for linux
echo 'export ZDOTDIR="$HOME/.config/zsh"' > /etc/zsh/zshenv
# for macos
echo 'export ZDOTDIR="$HOME/.config/zsh"' > /etc/zshenv
```
### Antigen
Install [antigen](https://github.com/zsh-users/antigen)
```sh
curl -L git.io/antigen > antigen.zsh
# or use git.io/antigen-nightly for the latest version
```
## Go
Install [go](https://go.dev/) as it is required for building `ggman`
## ggman
Create `$HOME/git` directory (`$GGROOT` is set to here) and install [ggman](https://github.com/tkw1536/ggman)
```sh
git clone https://github.com/tkw1536/ggman $HOME/git/ggman
cd $HOME/git/ggman
make
make install
```
## pyenv
Install [pyenv](https://github.com/pyenv/pyenv) to `$XDG_DATA_HOME/.pyenv` (this is already taken care for in `.zshenv`) using [pyenv-installer](https://github.com/pyenv/pyenv-installer) and install [build-dependencies](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
### pyenv-default-packages
Install [pyenv-default-packages](https://github.com/jawshooah/pyenv-default-packages.git) as pyenv plugin and symlink `.pyenv/default-packages` to `$PYENV_ROOT`
```sh
git clone https://github.com/jawshooah/pyenv-default-packages.git $(pyenv root)/plugins/pyenv-default-packages
ln -s "$XDG_CONFIG_HOME/.pyenv/default-packages" "$(pyenv root)/default-packages"
```
## neovim
Install [neovim](https://neovim.io/) and follow `README.md` in [git.janezic.dev/janezicmatej/nvim](https://git.janezic.dev/janezicmatej/nvim/)
## tmux
Install [tmux](https://github.com/tmux/tmux) and [`fzf`](https://github.com/junegunn/fzf) for `tmux-sessionizer`

82
alacritty/alacritty.toml Normal file
View File

@@ -0,0 +1,82 @@
[colors]
draw_bold_text_with_bright_colors = true
[colors.bright]
black = "0x45403d"
blue = "0x7daea3"
cyan = "0x89b482"
green = "0xa9b665"
magenta = "0xd3869b"
red = "0xea6962"
white = "0xd4be98"
yellow = "0xd8a657"
[colors.normal]
black = "0x45403d"
blue = "0x7daea3"
cyan = "0x89b482"
green = "0xa9b665"
magenta = "0xd3869b"
red = "0xea6962"
white = "0xd4be98"
yellow = "0xd8a657"
[colors.primary]
background = "0x32302f"
foreground = "0xd4be98"
[cursor]
unfocused_hollow = true
[cursor.style]
blinking = "On"
shape = "Block"
[env]
TERM = "xterm-256color"
[font]
size = 15
[font.bold]
family = "JetBrainsMono Nerd Font"
style = "Bold"
[font.bold_italic]
family = "JetBrainsMono Nerd Font"
style = "Bold Italic"
[font.italic]
family = "JetBrainsMono Nerd Font"
style = "Italic"
[font.normal]
family = "JetBrainsMono Nerd Font"
style = "Regular"
[[keyboard.bindings]]
chars = "\f"
key = "R"
mode = "~Vi|~Search"
mods = "Command"
[[keyboard.bindings]]
action = "ScrollPageUp"
key = "PageUp"
mode = "~Alt"
[[keyboard.bindings]]
action = "ScrollPageDown"
key = "PageDown"
mode = "~Alt"
[scrolling]
history = 10000
[window]
dynamic_title = true
option_as_alt = "Both"
[window.dimensions]
columns = 150
lines = 36

View File

@@ -1,152 +0,0 @@
# https://gist.github.com/sainnhe/ad5cbc4f05c4ced83f80e54d9a75d22f
colors:
primary:
background: '0x32302f'
foreground: '0xd4be98'
normal:
black: '0x45403d'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xd8a657'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xd4be98'
bright:
black: '0x45403d'
red: '0xea6962'
green: '0xa9b665'
yellow: '0xd8a657'
blue: '0x7daea3'
magenta: '0xd3869b'
cyan: '0x89b482'
white: '0xd4be98'
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
TERM: xterm-256color
window:
# window dimensions
dimensions:
columns: 150
lines: 36
# allow programs to dynamically change title
dynamic_title: true
scrolling:
# Maximum number of lines in the scrollback buffer.
history: 10000
# https://github.com/ryanoasis/nerd-fonts
font:
size: 14
normal:
family: JetBrainsMonoNL Nerd Font
style: Regular
italic:
family: JetBrainsMonoNL Nerd Font
style: Italic
bold:
family: JetBrainsMonoNL Nerd Font
style: Bold
bold_italic:
family: JetBrainsMonoNL Nerd Font
style: Bold Italic
draw_bold_text_with_bright_colors: true
cursor:
unfocused_hollow: true
style:
shape: Block
blinking: On
key_bindings:
- { key: R, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
- { key: PageUp, mode: ~Alt, action: ScrollPageUp }
- { key: PageDown, mode: ~Alt, action: ScrollPageDown }
# remap option to alt for mac
- { key: A, mods: Alt, chars: "\x1ba" }
- { key: B, mods: Alt, chars: "\x1bb" }
- { key: C, mods: Alt, chars: "\x1bc" }
- { key: D, mods: Alt, chars: "\x1bd" }
- { key: E, mods: Alt, chars: "\x1be" }
- { key: F, mods: Alt, chars: "\x1bf" }
- { key: G, mods: Alt, chars: "\x1bg" }
- { key: H, mods: Alt, chars: "\x1bh" }
- { key: I, mods: Alt, chars: "\x1bi" }
- { key: J, mods: Alt, chars: "\x1bj" }
- { key: K, mods: Alt, chars: "\x1bk" }
- { key: L, mods: Alt, chars: "\x1bl" }
- { key: M, mods: Alt, chars: "\x1bm" }
- { key: N, mods: Alt, chars: "\x1bn" }
- { key: O, mods: Alt, chars: "\x1bo" }
- { key: P, mods: Alt, chars: "\x1bp" }
- { key: Q, mods: Alt, chars: "\x1bq" }
- { key: R, mods: Alt, chars: "\x1br" }
- { key: S, mods: Alt, chars: "\x1bs" }
- { key: T, mods: Alt, chars: "\x1bt" }
- { key: U, mods: Alt, chars: "\x1bu" }
- { key: V, mods: Alt, chars: "\x1bv" }
- { key: W, mods: Alt, chars: "\x1bw" }
- { key: X, mods: Alt, chars: "\x1bx" }
- { key: Y, mods: Alt, chars: "\x1by" }
- { key: Z, mods: Alt, chars: "\x1bz" }
- { key: A, mods: Alt|Shift, chars: "\x1bA" }
- { key: B, mods: Alt|Shift, chars: "\x1bB" }
- { key: C, mods: Alt|Shift, chars: "\x1bC" }
- { key: D, mods: Alt|Shift, chars: "\x1bD" }
- { key: E, mods: Alt|Shift, chars: "\x1bE" }
- { key: F, mods: Alt|Shift, chars: "\x1bF" }
- { key: G, mods: Alt|Shift, chars: "\x1bG" }
- { key: H, mods: Alt|Shift, chars: "\x1bH" }
- { key: I, mods: Alt|Shift, chars: "\x1bI" }
- { key: J, mods: Alt|Shift, chars: "\x1bJ" }
- { key: K, mods: Alt|Shift, chars: "\x1bK" }
- { key: L, mods: Alt|Shift, chars: "\x1bL" }
- { key: M, mods: Alt|Shift, chars: "\x1bM" }
- { key: N, mods: Alt|Shift, chars: "\x1bN" }
- { key: O, mods: Alt|Shift, chars: "\x1bO" }
- { key: P, mods: Alt|Shift, chars: "\x1bP" }
- { key: Q, mods: Alt|Shift, chars: "\x1bQ" }
- { key: R, mods: Alt|Shift, chars: "\x1bR" }
- { key: S, mods: Alt|Shift, chars: "\x1bS" }
- { key: T, mods: Alt|Shift, chars: "\x1bT" }
- { key: U, mods: Alt|Shift, chars: "\x1bU" }
- { key: V, mods: Alt|Shift, chars: "\x1bV" }
- { key: W, mods: Alt|Shift, chars: "\x1bW" }
- { key: X, mods: Alt|Shift, chars: "\x1bX" }
- { key: Y, mods: Alt|Shift, chars: "\x1bY" }
- { key: Z, mods: Alt|Shift, chars: "\x1bZ" }
- { key: Key1, mods: Alt, chars: "\x1b1" }
- { key: Key2, mods: Alt, chars: "\x1b2" }
- { key: Key3, mods: Alt, chars: "\x1b3" }
- { key: Key4, mods: Alt, chars: "\x1b4" }
- { key: Key5, mods: Alt, chars: "\x1b5" }
- { key: Key6, mods: Alt, chars: "\x1b6" }
- { key: Key7, mods: Alt, chars: "\x1b7" }
- { key: Key8, mods: Alt, chars: "\x1b8" }
- { key: Key9, mods: Alt, chars: "\x1b9" }
- { key: Key0, mods: Alt, chars: "\x1b0" }
- { key: Space, mods: Control, chars: "\x00" } # Ctrl + Space
- { key: Grave, mods: Alt, chars: "\x1b`" } # Alt + `
- { key: Grave, mods: Alt|Shift, chars: "\x1b~" } # Alt + ~
- { key: Period, mods: Alt, chars: "\x1b." } # Alt + .
- { key: Key8, mods: Alt|Shift, chars: "\x1b*" } # Alt + *
- { key: Key3, mods: Alt|Shift, chars: "\x1b#" } # Alt + #
- { key: Period, mods: Alt|Shift, chars: "\x1b>" } # Alt + >
- { key: Comma, mods: Alt|Shift, chars: "\x1b<" } # Alt + <
- { key: Minus, mods: Alt|Shift, chars: "\x1b_" } # Alt + _
- { key: Key5, mods: Alt|Shift, chars: "\x1b%" } # Alt + %
- { key: Key6, mods: Alt|Shift, chars: "\x1b^" } # Alt + ^
- { key: Backslash, mods: Alt, chars: "\x1b\\" } # Alt + \
- { key: Backslash, mods: Alt|Shift, chars: "\x1b|" } # Alt + |

46
ghostty/config Normal file
View File

@@ -0,0 +1,46 @@
# theme
# theme = light:gruvbox-material-soft-light,dark:gruvbox-material-soft-dark
theme = gruvbox-material-soft-dark
# cursor
cursor-style = block
cursor-style-blink = true
# mouse
mouse-hide-while-typing = true
# font stuff
font-family = JetBrainsMono Nerd Font
font-size = 15
font-thicken = true
bold-is-bright = true
# disable ligatures
font-feature=-calt
font-feature=-liga
font-feature=-dlig
# window
window-theme = dark
window-height = 36
window-width = 150
# macos send option as alt
macos-option-as-alt = true
# no warning full close
confirm-close-surface = false
# quit-after-last-window-closed = true
# keybinds
keybind = global:cmd+enter=new_window
# shell integrations for zsh
# https://ghostty.org/docs/features/shell-integration
shell-integration = zsh
# gtk
gtk-titlebar = false
# paste protection
clipboard-paste-protection = false

View File

@@ -0,0 +1,21 @@
palette = 0=252423
palette = 1=#ea6962
palette = 2=#a9b665
palette = 3=#d8a657
palette = 4=#7daea3
palette = 5=#d3869b
palette = 6=#89b482
palette = 7=#d4be98
palette = 8=#32302f
palette = 9=#ea6962
palette = 10=#a9b665
palette = 11=#d8a657
palette = 12=#7daea3
palette = 13=#d3869b
palette = 14=#89b482
palette = 15=#d4be98
background = #32302f
foreground = #d4be98
cursor-color = #d4be98
selection-background = #45403d
selection-foreground = #d4be98

View File

@@ -0,0 +1,21 @@
palette = 0=#ebdbb2
palette = 1=#c14a4a
palette = 2=#6c782e
palette = 3=#b47109
palette = 4=#45707a
palette = 5=#945e80
palette = 6=#4c7a5d
palette = 7=#654735
palette = 8=#f3eac7
palette = 9=#c14a4a
palette = 10=#6c782e
palette = 11=#b47109
palette = 12=#45707a
palette = 13=#945e80
palette = 14=#4c7a5d
palette = 15=#654735
background = #f2e5bc
foreground = #654735
cursor-color = #654735
selection-background = #ebdbb2
selection-foreground = #654735

View File

@@ -1,25 +1,18 @@
[user]
name = Matej Janežič
email = janezic.mj@gmail.com
signingkey = 4298E230ED37B2C0
[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
[commit]
gpgsign = true
[gpg]
program = /opt/homebrew/bin/gpg
[init]
defaultBranch = master
[alias]
andraz = commit --amend --no-edit --author=\"Andraž Kladnik <andraz.kladnik@aflabs.si>\"
petra = commit --amend --no-edit --author=\"Petra Podlogar <petra.podlogar@aflabs.si>\"
ziga = commit --amend --no-edit --author=\"Žiga Avbreht <ziga.avbreht@aflabs.si>\"
laura = commit --amend --no-edit --author=\"lauraGB <laura.guzelj.blatnik@aflabs.si>\"
gasper = commit --amend --no-edit --author=\"Gašper Žajdela <gasper.zajdela@aflabs.si>\"
luka = commit --amend --no-edit --author=\"Luka Avbreht <luka.avbreht@aflabs.si>\"
koprivec = commit --amend --no-edit --author=\"Filip Koprivec <filip.koprivec@aflabs.si>\"
[init]
defaultBranch = main
[alias]
blame = "!f() { [ -f .git-blame-ignore-revs ] && git blame --ignore-revs-file .git-blame-ignore-revs \"$@\" || git blame \"$@\"; }; f"

2
nvim

Submodule nvim updated: 47d786ff47...d97244ca10

58
starship/config.toml Normal file
View File

@@ -0,0 +1,58 @@
add_newline = false
format = """\
$hostname\
[$directory](cyan)\
$git_branch\
$git_commit\
$git_state\
$git_status\
$character\
"""
right_format = """\
$golang\
$lua\
$nodejs\
$python\
$rust\
$cmd_duration\
"""
[character]
success_symbol = '[>](bold green)'
error_symbol = '[>](bold red)'
[directory]
truncation_length = 1
truncate_to_repo = false
fish_style_pwd_dir_length = 1
[git_commit]
tag_symbol = ''
[git_branch]
symbol = ''
[git_status]
format = '[$all_status$ahead_behind]($style)'
ahead = '[↑${count}](green) '
diverged = '[↑${ahead_count}↓${behind_count}](red) '
behind = '[↓${count}](green) '
modified = '[!${count}](yellow) '
untracked = '[?${count}](blue) '
staged = '[+${count}](yellow) '
stashed = '[*${count}](green) '
deleted = '[x${count}](red) '
renamed = '[r${count}](yellow) '
[python]
format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'
python_binary = 'python'
pyenv_version_name = false
detect_files = [ '.python-version' ]
[hostname]
ssh_only = false
style = 'bold yellow'
format = '[$hostname]($style) on '

16
tmux/tmux-ggclone Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
source "$XDG_CONFIG_HOME/zsh/scripts.zsh"
if [[ $# -eq 1 ]]; then
selected=$1
else
read -p "ssh url: " selected
fi
if [[ -z $selected ]]; then
exit 0
fi
ggman clone "$selected"
ggcompile

50
tmux/tmux-new-project Executable file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
if [[ -z ${NAME:+x} ]]; then
echo "missing name"
sleep 2
exit 1
fi
source "$XDG_CONFIG_HOME/zsh/scripts.zsh"
read -p "name: " project_name
if [[ -z $project_name ]]; then
exit 0
fi
if [[ -d "$GGROOT/no-remote/$project_name" ]]; then
exit 0
fi
project="$GGROOT/no-remote/$project_name"
git init $project
echo "# $project_name" >>"$project/README.md"
gitignore_template=$(
find "$GGROOT"/github.com/github/gitignore/*.gitignore -exec basename {} \; \
| sed 's/\(.*\)\.gitignore/\1/' \
| fzf --cycle --bind 'tab:toggle-up,btab:toggle-down'
)
if ! [[ -z $gitignore_template ]]; then
gitignore="$GGROOT/github.com/github/gitignore/$gitignore_template.gitignore"
echo "$gitignore"
echo "$project/.gitignore"
cat "$gitignore" >>"$project/.gitignore"
fi
license_template=$(
find "$GGROOT"/git.janezic.dev/janezicmatej/license/*.license -exec basename {} \; \
| sed 's/\(.*\)\.license/\1/' \
| fzf --cycle --bind 'tab:toggle-up,btab:toggle-down'
)
if ! [[ -z $license_template ]]; then
license="$GGROOT/git.janezic.dev/janezicmatej/license/$license_template.license"
export YEAR="$(date '+%Y')"
envsubst <"$license" >"$project/LICENSE"
fi
ggcompile

View File

@@ -3,15 +3,27 @@
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(find -L $GGROOT -mindepth 1 -maxdepth 5 -type d -name .git -prune | xargs -n 1 dirname | fzf)
selected=$(ggman exec pwd 2>&1 >/dev/null \
| fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--header "Navigate with ARROW KEYS or TAB/S-TAB. Select with ENTER." \
--border "double" \
--border-label "tmux-sessionizer" \
--ansi \
--highlight-line \
)
fi
if [[ -z $selected ]]; then
exit 0
fi
path=$selected
while [[ "$path" != "" && ! -e "$path/.sessionizer" ]]; do
path=${path%/*}
done
selected_name=$(basename "$selected" | tr . _)
selected_name="$(cat $path/.sessionizer)_$(basename $selected | tr . _ | head -c 10)_$(echo $selected | shasum -a 256 | head -c 4)"
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then

77
tmux/tmux-ssher Executable file
View File

@@ -0,0 +1,77 @@
#!/usr/bin/env bash
function _preview {
file=$1; shift
host=$1; shift
j=$(cat $file \
| jc --ssh-conf \
| jq -r ".[] \
| select(.host == \"$host\") \
| .jumps = (if (.proxyjump | type == \"array\" and length > 0) then (.proxyjump | join(\",\")) else \"null\" end)" \
)
user=$(jq -r '.user' <<<$j)
port=$(jq -r '.port' <<<$j)
hostname=$(jq -r '.hostname' <<<$j)
jumps=$(jq -r '.jumps' <<<$j)
echo "$(cat <<EOF
User $user
HostName $hostname\
$([[ $port != "null" ]] && echo -e "\nPort $port")\
$([[ $jumps != "null" ]] && echo -e "\nProxyJump $jumps")
command:
ssh $user@$hostname$([[ $port != "null" ]] && echo -n " -p $port")$([[ $jumps != "null" ]] && echo -n " -J $jumps")
EOF)"
echo ""
host $hostname
echo ""
ping -c 1 -W 1 $hostname &>/dev/null \
&& echo "Host is reachable!" \
|| echo "Host is not reachable!"
}
export -f _preview
function main() {
if [[ $# -eq 1 ]]; then
selected=$1
else
selected="$(rg -N --no-heading 'Host .*' ~/.ssh \
| sed 's/Host \(.*\)/\1/' \
| SHELL=$(which bash) fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--delimiter ':' \
--with-nth 2 \
--preview "_preview {1} {2}" \
| cut -d ":" -f2
)"
fi
if [[ -z $selected ]]; then
exit 0
fi
selected_name="ssh_$selected"
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
tmux new-session -s $selected_name -c $selected ssh "$selected"
exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux new-session -ds $selected_name -c $selected ssh "$selected"
fi
tmux switch-client -t $selected_name
}
main "$@"

View File

@@ -1,34 +1,49 @@
set -ga terminal-overrides ",xterm-256color:Tc"
set-option -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -s escape-time 0
set-option -g focus-events on
unbind C-b
set-option -g prefix C-s
bind-key C-s send-prefix
# set -g status-style 'bg=#333333 fg=#5eacd3'
bind r source-file "$XDG_CONFIG_HOME/tmux/tmux.conf"
set -g base-index 1
set -g status-style 'bg=#45403d fg=#d4be98'
set -g status-left-length 30
set -g status-left-length 20
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
# differentiate copy on linux and max
if-shell -b '[ "$(uname -s)" = "Linux" ]' {
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
if-shell -b '[ "$(uname -s)" = "Darwin" ]' {
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
}
# vim-like pane switching
bind -r ^ last-window
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
bind ^ last-window
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
bind -r D neww -c "#{pane_current_path}" "nvim TODO.md"
# sessionizer
bind-key f run-shell "tmux neww ~/.config/tmux/tmux-sessionizer"
bind-key R run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~"
bind-key g run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/.config"
bind-key T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/temp"
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 T run-shell "tmux neww ~/.config/tmux/tmux-sessionizer ~/Desktop/temp"
# clone
bind-key G run-shell "tmux neww ~/.config/tmux/tmux-ggclone"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'
# ssh
bind-key F run-shell "tmux neww ~/.config/tmux/tmux-ssher"
# project
bind-key N run-shell "tmux neww ~/.config/tmux/tmux-new-project"

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,2 @@
export PATH="/usr/local/bin:/opt/homebrew/bin:$Home/neovim/bin:${PATH}"
export PATH="/usr/local/bin:/opt/homebrew/bin:$HOME/neovim/bin:$HOME/bin:${PATH}"

14
zsh/.zsh_plugins.txt Normal file
View File

@@ -0,0 +1,14 @@
# set up Zsh completions with plugins
# mattmc3/ez-compinit
zsh-users/zsh-completions kind:fpath path:src
# frameworks like oh-my-zsh are supported
getantidote/use-omz # handle OMZ dependencies
ohmyzsh/ohmyzsh path:lib # load OMZ's library
ohmyzsh/ohmyzsh path:plugins/git
# popular fish-like plugins
zsh-users/zsh-autosuggestions
# nvm
lukechilds/zsh-nvm

59
zsh/.zshenv Normal file
View File

@@ -0,0 +1,59 @@
# 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"
# ~/.local/bin
export PATH="$HOME/.local/bin:$PATH"
# 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 GOPATH="$XDG_DATA_HOME/go"
export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
export PATH="$GOPATH/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"
# pyenv-virtualenv
# leave python promt to starship
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
# poetry
export POETRY_HOME="$XDG_DATA_HOME/poetry"
command -v poetry >/dev/null || export PATH="$POETRY_HOME/bin:$PATH"
# gnupg
export GPG_TTY=$TTY
# aflabs
export USER_UID=$(id -u)
export USER_GID=$(id -g)
# name
export NAME="Matej Janežič"
# starship nest config into a folder, default is ~/.config/startship.toml
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/config.toml"

View File

@@ -1,78 +1,37 @@
# 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"
# 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]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# zsh history file
export HISTFILE="$XDG_STATE_HOME/zsh/history"
export HISTSIZE=100
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# 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
# nvm
export NVM_COMPLETION=true
export NVM_AUTO_USE=true
# i don't lazy load nvm because neovim doesn't work well with it
# zsh autosugestions
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ffffff,bg=cyan,bold,underline"
# plugins
plugins=(zsh-nvm git zsh-autosuggestions zsh-syntax-highlighting)
# source antidote
source $ZDOTDIR/.antidote/antidote.zsh
antidote load
# TODO: lose oh my zsh at some point
# oh my zsh
source $ZSH/oh-my-zsh.sh
# language environment
export LANG=en_US.UTF-8
# brew sbin
export PATH="/opt/homebrew/sbin:$PATH"
unsetopt autocd
# pyenv
export PYENV_ROOT="$XDG_DATA_HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv 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"
eval "$(pyenv init - zsh)"
eval "$(pyenv virtualenv-init - zsh)"
# ggman
export GGROOT="$HOME/Desktop/git"
eval "$(ggman shellrc)"
# gpg
export GPG_TTY=$(tty)
# editor
export EDITOR=nvim
# custom functions and aliases
source "$ZDOTDIR/aliases.zsh"
source "$ZDOTDIR/functions.zsh"
source "$ZDOTDIR/scripts.zsh"
# completion
fpath=($ZDOTDIR/completions $fpath)
autoload -Uz compinit
compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
zstyle ':completion:*' cache-path $XDG_CACHE_HOME/zsh/zcompcache
# 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
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
eval "$(starship init zsh)"

View File

@@ -1,5 +1,8 @@
alias z="exec zsh"
alias t="tmux a || ~/.config/tmux/tmux-sessionizer ~"
alias n=nvim_ve
alias vim=nvim_ve
# alias vim=nvim_ve
alias s="ssh-menu"
# navigation
alias cdgit="cd $GGROOT"
@@ -10,19 +13,18 @@ alias temp="cd $HOME/Desktop/temp"
alias accenton="defaults write -g ApplePressAndHoldEnabled -bool true"
alias accentoff="defaults write -g ApplePressAndHoldEnabled -bool false"
# docker
alias aafh=./helper
# git
alias gcan="git commit -v --amend --no-edit"
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"
alias gcan="git commit -v --amend --no-edit"
# unsorted
alias ci="glab ci list"
alias bm=batman
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"
# clipboard
alias xcp="xclip -selection c"

0
zsh/completions/.keep Normal file
View File

View File

@@ -1,46 +0,0 @@
function nvim_ve {
if [[ -e "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then
source "$VIRTUAL_ENV/bin/activate"
command nvim $@
deactivate
else
command nvim $@
fi
}
alias nvim=nvim_ve
function ffb {
if ! [[ -f package.json ]]; then
echo "no package.json"
return
fi
if [[ -f yarn.lock ]]; then
PACKAGE_MANAGER=yarn
else
PACKAGE_MANAGER=npm
fi
if [[ -n $(grep "react-scripts" package.json) ]]; then
BROWSER=none FORCE_COLOR=true "$PACKAGE_MANAGER" start | cat
fi
}
function afm {
RES=$(curl -s "https://$1/api/monitoring/requirements")
COUNT=$(echo "$RES" | grep -c $2)
if [[ $COUNT -ge 0 ]]; then
VER=$(echo "$RES" | jq '.[] | select(.name | contains("'"$2"'")).version')
# OP=$(echo "$RES" | jq '.[] | select(.name | contains("'"$2"'")).requirement?[0][0]')
# echo "$2""$(echo "$OP" | tr -d '"')""$(echo "$VER" | tr -d '"')"
echo "$2""==""$(echo "$VER" | tr -d '"')"
fi
}
function nukepip {
pip uninstall $(pip freeze) -y
pip install -r $(pyenv root)/default-packages
}

51
zsh/get-dump Executable file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env bash
function get-dump {
if [[ -z $1 ]]; then
host="$(rg -N --no-heading 'Host .*' ~/.ssh \
| sed 's/Host \(.*\)/\1/' \
| fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--delimiter ':' \
--with-nth 2 \
--header "Navigate with ARROW KEYS or TAB/S-TAB. Select with ENTER." \
--border "double" \
--border-label "get-dump" \
--ansi \
--highlight-line \
| cut -d ":" -f2
)"
if [[ -z $host ]]; then
return
fi
else
host=$1
fi
selected=$(ssh "$host" docker ps --format "{{.Names}}" \
| fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--header "Navigate with ARROW KEYS or TAB/S-TAB. Select with ENTER." \
--border "double" \
--border-label "get-dump" \
--ansi \
--highlight-line \
)
if [[ -z $selected ]]; then
echo "not provided"
return
fi
if ! [[ -d "./dumps" ]]; then
mkdir "./dumps"
fi
location="./dumps/${host}_${selected}_$(date +'%s')"
echo "dumping to $location"
ssh "$host" docker exec "$selected" pg_dump -U db --format=c db >"$location"
}
get-dump "$@"

81
zsh/scripts.zsh Normal file
View File

@@ -0,0 +1,81 @@
function nvim_ve {
if [[ -e $VIRTUAL_ENV && -f "$VIRTUAL_ENV/bin/activate" ]]; then
source "$VIRTUAL_ENV/bin/activate"
command nvim $@
deactivate
else
command nvim $@
fi
}
alias nvim=nvim_ve
function afm {
RES=$(curl -s "https://$1/api/monitoring/requirements")
COUNT=$(echo "$RES" | grep -c $2)
if [[ $COUNT -ge 0 ]]; then
VER=$(echo "$RES" | jq '.[] | select(.name | contains("'"$2"'")).version')
# OP=$(echo "$RES" | jq '.[] | select(.name | contains("'"$2"'")).requirement?[0][0]')
# echo "$2""$(echo "$OP" | tr -d '"')""$(echo "$VER" | tr -d '"')"
echo "${2}==$(echo "$VER" | tr -d '"')"
fi
}
function nukepip {
pip uninstall $(pip freeze) -y
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 -E "/${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=7999
else
PORT=$1
fi
open "http://localhost:$PORT"
}
function dps {
if [[ -z $1 ]]; then
docker ps --format table'{{ .ID }}\t{{ .Image }}\t{{ .Ports}}\t{{ .Names }}'
else
docker ps --format table'{{ .ID }}\t{{ .Image }}\t{{ .Ports}}\t{{ .Names }}' | grep $1
fi
}
function tssh {
if [[ -z $1 ]]; then
echo "provide ssh host"
return
fi
ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash"
}

75
zsh/ssh-menu Executable file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
function _ssh_menu_preview {
file=$1; shift
host=$1; shift
j=$(cat $file \
| jc --ssh-conf \
| jq -r ".[] \
| select(.host == \"$host\") \
| .jumps = (\
if (.proxyjump | type == \"array\" and length > 0) then \
(.proxyjump | join(\",\")) \
else \
\"null\" \
end \
)" \
)
user=$(jq -r '.user' <<<$j)
port=$(jq -r '.port' <<<$j)
hostname=$(jq -r '.hostname' <<<$j)
jumps=$(jq -r '.jumps' <<<$j)
echo "$(cat <<EOF
User $user
HostName $hostname\
$([[ $port != "null" ]] && echo -e "\nPort $port")\
$([[ $jumps != "null" ]] && echo -e "\nProxyJump $jumps")
command:
ssh $user@$hostname$([[ $port != "null" ]] && echo -n " -p $port")$([[ $jumps != "null" ]] && echo -n " -J $jumps")
EOF
)"
echo ""
if command -v host 2>&1 >/dev/null; then
host $hostname
echo ""
fi
ping -c 1 -W 1 $hostname &>/dev/null \
&& echo "Host is reachable!" \
|| echo "Host is not reachable!"
}
export -f _ssh_menu_preview
function ssh-menu {
selected="$(rg -N --no-heading 'Host .*' ~/.ssh \
| sed 's/Host \(.*\)/\1/' \
| SHELL=$(which bash) fzf --cycle \
--bind 'tab:toggle-up,btab:toggle-down' \
--delimiter ':' \
--with-nth 2 \
--preview "_ssh_menu_preview {1} {2}" \
--preview-label "ssh config info" \
--header "Navigate with ARROW KEYS or TAB/S-TAB. Select with ENTER." \
--border "double" \
--border-label "ssh-menu" \
--ansi \
--highlight-line \
| cut -d ":" -f2
)"
if [[ -z $selected ]]; then
return
fi
ssh "$selected"
}
ssh-menu