diff --git a/.gitmodules b/.gitmodules index 7e0bacf..95a093c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [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 8f772cc..37f0487 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -5,6 +5,7 @@ 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 new file mode 160000 index 0000000..3ad5627 --- /dev/null +++ b/neovim/pack/vendor/start/nvim-lspconfig @@ -0,0 +1 @@ +Subproject commit 3ad562700d0615818bf358268ac8914f6ce2b079 diff --git a/sheldon.toml b/sheldon.toml index c131a27..af57878 100644 --- a/sheldon.toml +++ b/sheldon.toml @@ -86,10 +86,6 @@ 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" @@ -98,10 +94,6 @@ 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 da0daad..e93876a 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)" + eval "$(fnm env --use-on-cd --shell zsh)" fi diff --git a/zsh/plugins/github-copilot.plugin.zsh b/zsh/plugins/github-copilot.plugin.zsh deleted file mode 100644 index 677ad77..0000000 --- a/zsh/plugins/github-copilot.plugin.zsh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 deleted file mode 100644 index ce9f8e0..0000000 --- a/zsh/plugins/thefuck.plugin.zsh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env zsh - -# Init the fuck -if (( ${+commands[thefuck]} )); then - eval "$(thefuck --alias)" -fi diff --git a/zshrc.zsh b/zshrc.zsh index 7ba0e12..a1899df 100644 --- a/zshrc.zsh +++ b/zshrc.zsh @@ -119,11 +119,53 @@ export BAT_THEME=$batTheme # Source the untracked `extra` file test -e $HOME/.extra && source $HOME/.extra -# Oh My Posh -if (( ${+commands[oh-my-posh]} )); then - eval "$(oh-my-posh init zsh --config $HOME/.config/jmb.omp.toml)" +# 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 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