From 7204a5c739e3ecfcf10984a5883d0d42cd5910d0 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 11 Jul 2024 18:34:41 +0930 Subject: [PATCH] fix: dartls in lspconfig.lua --- .config/nvim/lua/tovi/plugins/lspconfig.lua | 15 ++++++--------- .zshrc | 12 +++++++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.config/nvim/lua/tovi/plugins/lspconfig.lua b/.config/nvim/lua/tovi/plugins/lspconfig.lua index b41803c..ee58794 100644 --- a/.config/nvim/lua/tovi/plugins/lspconfig.lua +++ b/.config/nvim/lua/tovi/plugins/lspconfig.lua @@ -252,14 +252,11 @@ return { run_on_start = false, }) - require("mason-lspconfig").setup({ - handlers = { - function(server_name) - local server = servers[server_name] or {} - server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) - require("lspconfig")[server_name].setup(server) - end, - }, - }) + require("mason-lspconfig").setup() + + for server_name, server in pairs(servers) do + server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) + require("lspconfig")[server_name].setup(server) + end end, } diff --git a/.zshrc b/.zshrc index a765a0c..49d872b 100644 --- a/.zshrc +++ b/.zshrc @@ -21,7 +21,17 @@ export EDITOR=nvim export GIT_EDITOR=nvim export PATH="${HOME}/.local/bin/:${HOME}/go/bin:${HOME}/.cargo/bin:${PATH}" -PROMPT="%{$fg[blue]%}%1~ %{$fg[green]%}>%{$reset_color%} " +# Enable substitution in the prompt. +setopt prompt_subst + +function git_branch_name() { + branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}') + if [[ $branch != "" ]]; then + echo "- ${branch} " + fi +} + +PROMPT='%{$fg[blue]%}%1~ %{$fg[magenta]%}$(git_branch_name)%{$fg[green]%}>%{$reset_color%} ' # Set some options if running on mac if [[ $(uname) == 'Darwin' ]]; then