From 7709fef79eb7bd7b9eeaaabf5cd3c02074dd8d5c Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 25 Feb 2023 08:46:56 +0000 Subject: [PATCH] Complete conversion to fish --- ohmyzsh/aliases.zsh => .profile | 19 +++++ Makefile | 39 ++-------- config/tmux/tmux.conf | 20 ----- ...ccin_macchiato-zsh-syntax-highlighting.zsh | 74 ------------------- ohmyzsh/completions.zsh | 6 -- ohmyzsh/hooks.zsh | 8 -- ohmyzsh/paths.zsh | 7 -- pkglist.txt | 3 +- 8 files changed, 27 insertions(+), 149 deletions(-) rename ohmyzsh/aliases.zsh => .profile (50%) delete mode 100644 config/tmux/tmux.conf delete mode 100644 ohmyzsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh delete mode 100644 ohmyzsh/completions.zsh delete mode 100644 ohmyzsh/hooks.zsh delete mode 100644 ohmyzsh/paths.zsh diff --git a/ohmyzsh/aliases.zsh b/.profile similarity index 50% rename from ohmyzsh/aliases.zsh rename to .profile index 17df0991..b8ea0c3a 100644 --- a/ohmyzsh/aliases.zsh +++ b/.profile @@ -1,3 +1,22 @@ +# Start keychain +if [[ -e $HOME/.ssh/id_ed25519 ]] +then + command -v keychain > /dev/null && eval $(keychain --eval --quiet --noask $HOME/.ssh/id_ed25519) +fi + +if [[ -e $HOME/.ssh/id_rsa ]] +then + command -v keychain > /dev/null && eval $(keychain --eval --quiet --noask $HOME/.ssh/id_rsa) +fi + +# Set local paths +LOCAL_BIN="$HOME/.local/bin" +echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN + +DOTFILES_BIN="$(dirname $(dirname $(readlink -f $0)))/bin" +echo $PATH | grep -i "$DOTFILES_BIN" - > /dev/null || export PATH=$PATH:$DOTFILES_BIN + +# Set some useful aliases and functions poetry_installed() { command -v poetry > /dev/null 2>&1 && return 0 || echo "Poetry not installed" diff --git a/Makefile b/Makefile index 520fe415..bedc4c56 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,13 @@ CONFIG_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME), $(HOME)/.config) -FONT_DIR := $(HOME)/.local/share/fonts -ZSH_DIR := $(if $(ZSH), $(ZSH), $(HOME)/.oh-my-zsh) SSH_DIR := $(HOME)/.ssh -ZSH_CUSTOM_DIR := $(if $(ZSH_CUSTOM), $(ZSH_CUSTOM), $(ZSH_DIR)/custom) - -HOME_ITEMS := $(wildcard home/*) -HOME_TARGETS := $(HOME_ITEMS:home/%=$(HOME)/.%) CONFIG_ITEMS := $(wildcard config/*) CONFIG_TARGETS := $(CONFIG_ITEMS:config/%=$(CONFIG_DIR)/%) -ZSH_ITEMS := $(wildcard ohmyzsh/*.zsh) -ZSH_TARGETS := $(ZSH_ITEMS:ohmyzsh/%.zsh=$(ZSH_CUSTOM_DIR)/%.zsh) SSH_ITEMS := $(wildcard ssh/*) SSH_TARGETS := $(SSH_ITEMS:ssh/%=$(SSH_DIR)/%) LAZY_REPO := https://github.com/folke/lazy.nvim.git LAZY_DIR := $(HOME)/.local/share/nvim/lazy/lazy.nvim -POWERLEVEL_REPO := https://github.com/romkatv/powerlevel10k.git -POWERLEVEL_DIR := $(ZSH_CUSTOM_DIR)/themes/powerlevel10k -ZSH_SYNTAX_REPO := https://github.com/zsh-users/zsh-syntax-highlighting.git -ZSH_SYNTAX_DIR := $(ZSH_CUSTOM_DIR)/plugins/zsh-syntax-highlighting -TPM_REPO := https://github.com/tmux-plugins/tpm -TPM_DIR := $(HOME)/.tmux/plugins/tpm .PHONY: all clean link unlink install uninstall pacman @@ -29,18 +15,16 @@ all: link install clean: unlink uninstall -link: $(HOME_TARGETS) $(CONFIG_TARGETS) $(SSH_TARGETS) $(HOME)/.ssh/sockets +link: $(HOME)/.profile $(CONFIG_TARGETS) $(SSH_TARGETS) $(HOME)/.ssh/sockets unlink: - for link in $(HOME_TARGETS); do rm "$$link"; done for link in $(CONFIG_TARGETS); do rm "$$link"; done for link in $(SSH_TARGETS); do rm "$$link"; done rmdir $(HOME)/.ssh/sockets -install: $(ZSH_DIR) $(POWERLEVEL_DIR) $(ZSH_SYNTAX_DIR) $(ZSH_TARGETS) $(LAZY_DIR) $(TPM_DIR) +install: $(LAZY_DIR) uninstall: - rm -rf $(ZSH_DIR) rm -rf $(LAZY_DIR) pacman: @@ -48,27 +32,16 @@ pacman: pacman -T - < pkglist.txt ||\ sudo pacman --needed -S - < pkglist.txt -$(HOME_TARGETS): $(HOME)/.%: home/% $(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/% -$(ZSH_TARGETS): $(ZSH_CUSTOM_DIR)/%.zsh: ohmyzsh/%.zsh $(SSH_TARGETS): $(SSH_DIR)/%: ssh/% -$(HOME_TARGETS) $(CONFIG_TARGETS) $(ZSH_TARGETS) $(SSH_TARGETS): +$(CONFIG_TARGETS) $(SSH_TARGETS): + ln -s $(PWD)/$? $@ + +$(HOME)/.profile: .profile ln -s $(PWD)/$? $@ $(LAZY_DIR): git clone --depth 1 $(LAZY_REPO) $@ -$(POWERLEVEL_DIR): - git clone --depth 1 $(POWERLEVEL_REPO) $@ - -$(ZSH_SYNTAX_DIR): - git clone --depth 1 $(ZSH_SYNTAX_REPO) $@ - -$(TPM_DIR): - git clone --depth 1 $(TPM_REPO) $@ - -$(ZSH_DIR): - sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - $(CONFIG_DIR) $(SSH_DIR) $(HOME)/.ssh/sockets: mkdir -p $@ diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf deleted file mode 100644 index 0c71d5e6..00000000 --- a/config/tmux/tmux.conf +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -g base-index 1 - -# List of plugins -set -g @plugin 'tmux-plugins/tpm' -set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'ofirgall/tmux-window-name' -set -g @plugin 'noscript/tmux-mighty-scroll' -set -g @plugin 'jabirali/tmux-tilish' -set -g @plugin 'catppuccin/tmux' - -# Plugin options. -set -g @tilish-navigator 'on' -set -g @tilish-dmenu 'on' -set -g @tmux_window_name_use_tilde "True" -set -g @catppuccin_flavour 'macchiato' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run '~/.tmux/plugins/tpm/tpm' diff --git a/ohmyzsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh b/ohmyzsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh deleted file mode 100644 index de6f5128..00000000 --- a/ohmyzsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh +++ /dev/null @@ -1,74 +0,0 @@ -# Catppuccin Macchiato Theme (for zsh-syntax-highlighting) -# -# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting -ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor) -typeset -gA ZSH_HIGHLIGHT_STYLES - -# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md -# -## General -### Diffs -### Markup -## Classes -## Comments -ZSH_HIGHLIGHT_STYLES[comment]='fg=#5b6078' -## Constants -## Entitites -## Functions/methods -ZSH_HIGHLIGHT_STYLES[alias]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[function]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[command]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[precommand]='fg=#a6da95,italic' -ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#f5a97f,italic' -ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#f5a97f' -ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#f5a97f' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#c6a0f6' -## Keywords -## Built ins -ZSH_HIGHLIGHT_STYLES[builtin]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#a6da95' -ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#a6da95' -## Punctuation -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#ed8796' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#ed8796' -ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#ed8796' -ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#ed8796' -## Serializable / Configuration Languages -## Storage -## Strings -ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#eed49f' -ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#eed49f' -ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#eed49f' -ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#ee99a0' -ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#eed49f' -ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#ee99a0' -ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#eed49f' -## Variables -ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#ee99a0' -ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[assign]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#cad3f5' -## No category relevant in spec -ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#ee99a0' -ZSH_HIGHLIGHT_STYLES[path]='fg=#cad3f5,underline' -ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#ed8796,underline' -ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#cad3f5,underline' -ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#ed8796,underline' -ZSH_HIGHLIGHT_STYLES[globbing]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#c6a0f6' -#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?' -#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?' -#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?' -#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?' -ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#ee99a0' -ZSH_HIGHLIGHT_STYLES[redirection]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[arg0]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[default]='fg=#cad3f5' -ZSH_HIGHLIGHT_STYLES[cursor]='fg=#cad3f5' diff --git a/ohmyzsh/completions.zsh b/ohmyzsh/completions.zsh deleted file mode 100644 index 21b14a4b..00000000 --- a/ohmyzsh/completions.zsh +++ /dev/null @@ -1,6 +0,0 @@ -autoload -U bashcompinit -bashcompinit -command -v pipx > /dev/null && { - command -v register-python-argcomplete3 > /dev/null && eval "$(register-python-argcomplete3 pipx)" - command -v register-python-argcomplete > /dev/null && eval "$(register-python-argcomplete pipx)" -} diff --git a/ohmyzsh/hooks.zsh b/ohmyzsh/hooks.zsh deleted file mode 100644 index f07413eb..00000000 --- a/ohmyzsh/hooks.zsh +++ /dev/null @@ -1,8 +0,0 @@ -tmux-window-name() { - if [[ -n $TMUX ]] - then - ($TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py &) - fi -} - -add-zsh-hook chpwd tmux-window-name diff --git a/ohmyzsh/paths.zsh b/ohmyzsh/paths.zsh deleted file mode 100644 index 49ac52f0..00000000 --- a/ohmyzsh/paths.zsh +++ /dev/null @@ -1,7 +0,0 @@ -# export PATH=$PATH:$HOME/.local/bin - -LOCAL_BIN="$HOME/.local/bin" -echo $PATH | grep -i "$LOCAL_BIN" - > /dev/null || export PATH=$PATH:$LOCAL_BIN - -DOTFILES_BIN="$(dirname $(dirname $(readlink -f $0)))/bin" -echo $PATH | grep -i "$DOTFILES_BIN" - > /dev/null || export PATH=$PATH:$DOTFILES_BIN diff --git a/pkglist.txt b/pkglist.txt index 40fbffc2..65be4285 100644 --- a/pkglist.txt +++ b/pkglist.txt @@ -1,3 +1,4 @@ +fish fzf neovim npm @@ -7,6 +8,6 @@ python-pynvim python-virtualenv ripgrep rust +starship tree-sitter wezterm -fish