From b37fe770530027e7e0a1ae6c6af453e5be5654ac Mon Sep 17 00:00:00 2001 From: pika Date: Tue, 20 Aug 2024 22:42:50 +0200 Subject: [PATCH] addet some usefull zsh stuff --- .gitmodules | 4 ++++ .zsh/autosuggestions | 1 + .zshrc | 48 +++++++++++++++++++++++++------------------- 3 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 .gitmodules create mode 160000 .zsh/autosuggestions diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..88e01ca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule ".zsh/autosuggestions"] + path = .zsh/autosuggestions + url = https://github.com/zsh-users/zsh-autosuggestions + branch = master diff --git a/.zsh/autosuggestions b/.zsh/autosuggestions new file mode 160000 index 0000000..c3d4e57 --- /dev/null +++ b/.zsh/autosuggestions @@ -0,0 +1 @@ +Subproject commit c3d4e576c9c86eac62884bd47c01f6faed043fc5 diff --git a/.zshrc b/.zshrc index bbb7d1e..4ef0fa2 100644 --- a/.zshrc +++ b/.zshrc @@ -56,16 +56,20 @@ setopt autocd notify # End of lines configured by zsh-newuser-install _init (){ -if command_exists oh-my-posh; then + if command_exists oh-my-posh; then # eval "$(oh-my-posh init zsh --config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/amro.omp.json')" eval "$(oh-my-posh init zsh --config 'https://git.k4li.de/dotfiles/oh-my-posh/raw/branch/main/amro.toml')" # eval "$(oh-my-posh init zsh --config '~/gitea/dotfiles/oh-my-posh/amro.toml')" -else - curl -s https://ohmyposh.dev/install.sh | sudo bash --norc -s -- -d /usr/bin/ -fi + else + curl -s https://ohmyposh.dev/install.sh | sudo bash --norc -s -- -d /usr/bin/ + fi if command_exists zoxide; then eval "$(zoxide init zsh)" fi + local zconf="$HOME/.zsh" + local zAutosg="$zconf/autosuggestions/zsh-autosuggestions.zsh" + [[ -f "$zAutosg" ]] && + . $zAutosg } _alias(){ @@ -101,17 +105,17 @@ _alias(){ alias l="exa --long --no-filesize --no-permissions --no-time --git --colour-scale --icons" alias ll="exa --all --long --no-filesize --no-permissions --no-time --git --colour-scale --icons" alias tree="exa --icons -l --tree" - elif command_exists lsd; then - alias ls="lsd -l -1 -h1 --almost-all --git" - alias l="lsd -1" - alias ll="lsd -1 --almost-all" - alias clearl="command clear && l" - alias tree="lsd --tree" - elif command_exists eza; then - alias ls="eza --icons --long --git" - alias l="eza --icons -l" - alias ll="eza --icons -laa" - alias tree="eza --icons -l --tree" + # elif command_exists lsd; then + # alias ls="lsd -l -1 -h1 --almost-all --git" + # alias l="lsd -1" + # alias ll="lsd -1 --almost-all" + # alias clearl="command clear && l" + # alias tree="lsd --tree" + # elif command_exists eza; then + # alias ls="eza --icons --long --git" + # alias l="eza --icons -l" + # alias ll="eza --icons -laa" + # alias tree="eza --icons -l --tree" else alias ls="ls --color=always -lAph" alias l="ls --color=always -lph -w1" @@ -179,8 +183,8 @@ _alias(){ if fastfetch --config os >/dev/null 2>&1; then alias f="fastfetch --config os" else - git clone https://git.k4li.de/mirrors/fastfetch.git $HOME/.local/share/fastfetch >/dev/null 2>&1 - exec $SHELL + git clone https://git.k4li.de/mirrors/fastfetch.git "$HOME/.local/share/fastfetch" >/dev/null 2>&1 + exec "$SHELL" fi command clear & fastfetch @@ -227,9 +231,9 @@ _coding_() { alias hs='hugo server -D --noHTTPCache --disableFastRender' fi # ─< c stands for bin/cake >────────────────────────────────────────────────────────────── - alias cake='bin/cake' - alias c='cake' - alias cs='c server -p 1313' + # alias cake='bin/cake' + # alias c='cake' + # alias cs='c server -p 1313' # ─< VSCodium >───────────────────────────────────────────────────────────────────────────── if command_exists codium; then alias code="codium" @@ -240,9 +244,11 @@ _coding_() { if command_exists neovide; then alias nvim='neovide --fork' else - neovide_path=$(find "$HOME/" -name "*neovide*.appimage" 2>/dev/null) if [ -n "$neovide_path" ]; then alias nvim="$neovide_path --fork" + else + neovide_path=$(find "$HOME/" -name "*neovide*.appimage" 2>/dev/null) + alias nvim="$neovide_path --fork" fi fi fi