From 17d2e02bbb4abe420db94d5a7557a0b13cd6746d Mon Sep 17 00:00:00 2001 From: Ryan Kes Date: Wed, 19 Feb 2020 12:32:46 +0100 Subject: [PATCH] Added fish support --- README.org | 21 ++++++++++- fish/.config/omf/init.fish | 65 +++++++++++++++++++++++++++++++++ install | 30 +++++++++++---- install.fish | 25 +++++++++++++ terminfo/.terminfo/a/alacritty | Bin 0 -> 2407 bytes 5 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 fish/.config/omf/init.fish create mode 100755 install.fish create mode 100644 terminfo/.terminfo/a/alacritty diff --git a/README.org b/README.org index 7eaa5ff..99f3edf 100644 --- a/README.org +++ b/README.org @@ -12,8 +12,12 @@ - [[#theme][Theme]] - [[#plugin-manager][Plugin Manager]] - [[#plugins][Plugins]] +- [[#fish][Fish]] + - [[#theme-1][Theme]] + - [[#package-manager][Package Manager]] + - [[#packages][Packages]] - [[#neovim][Neovim]] - - [[#theme-1][Theme]] + - [[#theme-2][Theme]] - [[#plugin-manager-1][Plugin Manager]] - [[#plugins-1][Plugins]] - [[#general][General]] @@ -34,6 +38,7 @@ A repository of my personal server configuration files. - [[http://www.gnu.org/software/stow/][stow]] * Applications +- [[https://github.com/alacritty/alacritty][alacritty]] - [[https://the.exa.website/][exa]] - [[https://git-scm.com/][git]] - [[https://gnupg.org/][gnupg]] @@ -61,6 +66,20 @@ A repository of my personal server configuration files. - [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vi-mode][vi-mode]] - [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]] - [[https://github.com/zsh-users/zsh-syntax-highlighting][zsh-syntax-highlighting]] + +* Fish +*** Theme +- [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]] +*** Package Manager +- [[https://github.com/oh-my-fish/oh-my-fish][oh-my-fish]] +*** Packages +- [[https://github.com/patrickf3139/Colored-Man-Pages][colored-man-pages]] +- [[https://github.com/oh-my-fish/plugin-extract][extract]] +- [[https://github.com/jethrokuan/fzf][fzf]] +- [[https://github.com/oh-my-fish/plugin-gi][gi]] +- [[https://github.com/oh-my-fish/plugin-git-flow][git-flow]] +- [[https://github.com/oh-my-fish/plugin-sudope.git][sudope]] +- [[https://github.com/oh-my-fish/plugin-wttr][wttr]] * Neovim ** Theme diff --git a/fish/.config/omf/init.fish b/fish/.config/omf/init.fish new file mode 100644 index 0000000..0bd4034 --- /dev/null +++ b/fish/.config/omf/init.fish @@ -0,0 +1,65 @@ +function fish_greeting + neofetch +end + +function path_if_exists + if [ -d "$argv" ] + set PATH $PATH "$argv" + end +end + +# Add paths +path_if_exists ~/.config/yarn/global/node_modules/.bin +path_if_exists ~/.local/bin +path_if_exists ~/.emacs.d/bin + +# Set GPG TTY +set GPG_TTY (tty) + +# pkg editor +set -g VISUAL "nvim" + +# editor +set -g EDITOR "nvim" + +# bobthefish +set -g theme_nerd_fonts yes +set -g theme_color_scheme gruvbox + +# sudope +set -g sudope_sequence \e\e + +# nvim alias +alias v="nvim" +alias sv="sudo nvim" + +# ls alias +alias ls="exa" +alias l="exa -al" + +# vifm alias +alias vifm="vifmrun" + +# Set fzf keybindings here for now as they don't work with stable version of omf https://github.com/jethrokuan/fzf/issues/109 +bind \co '__fzf_find_file' +bind \cr '__fzf_reverse_isearch' +bind \ec '__fzf_cd' +bind \eC '__fzf_cd --hidden' +bind \eO '__fzf_open' +bind \eo '__fzf_open --editor' + +if bind -M insert >/dev/null 2>/dev/null + bind -M insert \co '__fzf_find_file' + bind -M insert \cr '__fzf_reverse_isearch' + bind -M insert \ec '__fzf_cd' + bind -M insert \eC '__fzf_cd --hidden' + bind -M insert \eO '__fzf_open' + bind -M insert \eo '__fzf_open --editor' +end + +if set -q FZF_COMPLETE + bind \t '__fzf_complete' + if bind -M insert >/dev/null 2>/dev/null + bind -M insert \t '__fzf_complete' + end +end diff --git a/install b/install index 1411fd2..9f1cfcc 100755 --- a/install +++ b/install @@ -1,20 +1,30 @@ #!/usr/bin/env bash +function mkdir_if_not_exist() { + if [ ! -d "$1" ]; then + echo "Creating $1" + mkdir -p "$1" + fi +} + +mkdir_if_not_exist ~/.config/nvim +mkdir_if_not_exist ~/.config/fish +mkdir_if_not_exist ~/.config/omf +mkdir_if_not_exist ~/.terminfo + # Create nvim config directory if it doesn't exist -if [ ! -d ~/.config/nvim ]; then - echo "Creating ~/.config/nvim" - mkdir -p ~/.config/nvim -fi for d in $(ls -d */ | cut -f1 -d '/'); do echo "Linking $d..." (stow $d) done -# Install zplug if it doesn't exist yet -if [ ! -d ~/.zplug ]; then - echo "Installing zplug" - curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh +if [ -f /usr/bin/zsh ]; then + # Install zplug if it doesn't exist yet + if [ ! -d ~/.zplug ]; then + echo "Installing zplug" + curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh + fi fi # Install vim plugins & requirements @@ -29,3 +39,7 @@ if [ ! -d ~/.config/nvim/plugged ]; then fi # Install nvim pluugins nvim +PlugInstall +qall + +if [ -f /usr/bin/fish ]; then + ./install.fish +fi diff --git a/install.fish b/install.fish new file mode 100755 index 0000000..c9bb8a4 --- /dev/null +++ b/install.fish @@ -0,0 +1,25 @@ +#!/usr/bin/env fish + +function install_omf_package_if_not_exist + if test (omf list | grep -c "$argv") -eq 0 + omf install "$argv" + end +end + +# Install oh-my-fish if it isn't installed +if [ ! -d ~/.local/share/omf ] + curl -L https://get.oh-my.fish | fish +end + +# Install oh-my-fish plugins +install_omf_package_if_not_exist bobthefish +install_omf_package_if_not_exist colored-man-pages +install_omf_package_if_not_exist extract +install_omf_package_if_not_exist fzf +install_omf_package_if_not_exist gi +install_omf_package_if_not_exist git-flow +install_omf_package_if_not_exist sudope +install_omf_package_if_not_exist wttr + +# Update fish completions (auto generated from man pages) +fish_update_completions diff --git a/terminfo/.terminfo/a/alacritty b/terminfo/.terminfo/a/alacritty new file mode 100644 index 0000000000000000000000000000000000000000..d03958f1eff8ce578fbd89270ba9c90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