diff --git a/.gitmodules b/.gitmodules index 95a093c..7e0bacf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,6 +31,3 @@ [submodule "neovim/pack/vendor/start/gitsigns.nvim"] path = neovim/pack/vendor/start/gitsigns.nvim url = https://github.com/lewis6991/gitsigns.nvim -[submodule "neovim/pack/vendor/start/nvim-lspconfig"] - path = neovim/pack/vendor/start/nvim-lspconfig - url = https://github.com/neovim/nvim-lspconfig diff --git a/neovim/init.lua b/neovim/init.lua index 37f0487..8f772cc 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -5,7 +5,6 @@ My NeoVim configuration require('nvim-web-devicons').setup() require('oil').setup() require('gitsigns').setup() -require('lspconfig').phpactor.setup({}) -- Editor options vim.wo.number = true diff --git a/neovim/pack/vendor/start/nvim-lspconfig b/neovim/pack/vendor/start/nvim-lspconfig deleted file mode 160000 index 3ad5627..0000000 --- a/neovim/pack/vendor/start/nvim-lspconfig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3ad562700d0615818bf358268ac8914f6ce2b079 diff --git a/sheldon.toml b/sheldon.toml index af57878..c131a27 100644 --- a/sheldon.toml +++ b/sheldon.toml @@ -86,6 +86,10 @@ apply = ["defer"] local = "~/.zsh/plugins" apply = ["defer"] +[plugins.thefuck] +local = "~/.zsh/plugins" +apply = ["defer"] + # This works best if it is placed last. [plugins.compinit] local = "~/.zsh/plugins" @@ -94,6 +98,10 @@ apply = ["defer"] # Plugins that are even more deferred # ----------------------------------- +[plugins.github-copilot] +local = "~/.zsh/plugins" +apply = ["defer-more"] + [plugins.ngrok] local = "~/.zsh/plugins" apply = ["defer-more"] diff --git a/zsh/plugins/fnm.plugin.zsh b/zsh/plugins/fnm.plugin.zsh index e93876a..da0daad 100644 --- a/zsh/plugins/fnm.plugin.zsh +++ b/zsh/plugins/fnm.plugin.zsh @@ -2,5 +2,5 @@ # Setup Fast Node Manager if (( ${+commands[fnm]} )); then - eval "$(fnm env --use-on-cd --shell zsh)" + eval "$(fnm env --use-on-cd)" fi diff --git a/zsh/plugins/github-copilot.plugin.zsh b/zsh/plugins/github-copilot.plugin.zsh new file mode 100644 index 0000000..677ad77 --- /dev/null +++ b/zsh/plugins/github-copilot.plugin.zsh @@ -0,0 +1,10 @@ +#!/usr/bin/env zsh + +# Setup GitHub Copilot +# first check we even have the genereic `gh` command +if (( ${+commands[gh]} )); then + # Now check we have the copilot plugin installed with `gh` + if gh extension list | rg copilot -c > /dev/null; then + eval "$(gh copilot alias -- zsh)" + fi +fi diff --git a/zsh/plugins/thefuck.plugin.zsh b/zsh/plugins/thefuck.plugin.zsh new file mode 100644 index 0000000..ce9f8e0 --- /dev/null +++ b/zsh/plugins/thefuck.plugin.zsh @@ -0,0 +1,6 @@ +#!/usr/bin/env zsh + +# Init the fuck +if (( ${+commands[thefuck]} )); then + eval "$(thefuck --alias)" +fi diff --git a/zshrc.zsh b/zshrc.zsh index a1899df..7ba0e12 100644 --- a/zshrc.zsh +++ b/zshrc.zsh @@ -119,53 +119,11 @@ export BAT_THEME=$batTheme # Source the untracked `extra` file test -e $HOME/.extra && source $HOME/.extra -# Set the prompt -# We need zsh git integration -# Autoload zsh's `add-zsh-hook` and `vcs_info` functions -# (-U autoload w/o substition, -z use zsh style) -autoload -Uz add-zsh-hook vcs_info - -# Set prompt substitution so we can use the vcs_info_message variable -setopt prompt_subst - -# Run the `vcs_info` hook to grab git info before displaying the prompt -add-zsh-hook precmd vcs_info - -# Style the vcs_info message -zstyle ':vcs_info:*' enable git -zstyle ':vcs_info:git*' formats '⎇ %b%u%c' -# Format when the repo is in an action (merge, rebase, etc) -zstyle ':vcs_info:git*' actionformats '%F{14}⏱ %*%f' -zstyle ':vcs_info:git*' unstagedstr '*' -zstyle ':vcs_info:git*' stagedstr '+' -# This enables %u and %c (unstaged/staged changes) to work, -# but can be slow on large repos -zstyle ':vcs_info:*:*' check-for-changes true - -# First show the Loading indicator in the right prompt if shell plugins are still loading -RPROMPT='%F{8}$(if [[ -n $SHELL_LOADING ]]; then echo "Loading... "; fi)' - -# Then we can also show the git branch -RPROMPT+='${vcs_info_msg_0_}' - -# First set a dot that changes colour on success/fail or previous command -PROMPT='%(?.%F{blue}⏺.%F{red}⏺)%f ' -# Show a symbol for the OS -# First we set the os_symbol variable we will use in the prompt -if [[ "$OSTYPE" == "darwin"* ]]; then - os_symbol="" -elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - os_symbol="󰣇" -else - os_symbol="" # Fallback symbol if OS is neither macOS nor Linux +# Oh My Posh +if (( ${+commands[oh-my-posh]} )); then + eval "$(oh-my-posh init zsh --config $HOME/.config/jmb.omp.toml)" fi -PROMPT+='${os_symbol} ' -# Then show the working directory -PROMPT+='%2~ ' -# Finally we can adjust the prompt to show if we are a user or sudo -PROMPT+='%(!.#.$) ' - # Finally we can have zsh auto source this rc file on command # attribution: https://www.reddit.com/r/commandline/comments/12g76v/ trap "source $HOME/.zshrc" USR1