From 20d1a2429239180776a221fe99634448e21a6d73 Mon Sep 17 00:00:00 2001 From: winston Date: Mon, 21 Aug 2023 07:05:47 +0200 Subject: [PATCH] feat(nvim): dlang support --- home/apps/neovim/ftplugin/d.lua | 1 + home/apps/neovim/lua/lsp/init.lua | 1 + home/apps/neovim/lua/lsp/null-ls.lua | 1 + home/apps/neovim/lua/plugins/presence.lua | 6 +++++- machines/sashimi/brew.nix | 12 +++++++++++- 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 home/apps/neovim/ftplugin/d.lua diff --git a/home/apps/neovim/ftplugin/d.lua b/home/apps/neovim/ftplugin/d.lua new file mode 100644 index 0000000..75320a6 --- /dev/null +++ b/home/apps/neovim/ftplugin/d.lua @@ -0,0 +1 @@ +vim.bo.commentstring = "//%s" diff --git a/home/apps/neovim/lua/lsp/init.lua b/home/apps/neovim/lua/lsp/init.lua index 9a674c7..2c53caa 100644 --- a/home/apps/neovim/lua/lsp/init.lua +++ b/home/apps/neovim/lua/lsp/init.lua @@ -189,6 +189,7 @@ local servers = { "helm_ls", "jqls", "lua_ls", + "serve_d", "taplo", "teal_ls", } diff --git a/home/apps/neovim/lua/lsp/null-ls.lua b/home/apps/neovim/lua/lsp/null-ls.lua index fccd07e..63a7293 100644 --- a/home/apps/neovim/lua/lsp/null-ls.lua +++ b/home/apps/neovim/lua/lsp/null-ls.lua @@ -10,6 +10,7 @@ null.setup({ sources = { null.builtins.formatting.alejandra, null.builtins.formatting.black, + null.builtins.formatting.dfmt, null.builtins.formatting.deno_fmt.with({ filetypes = { "javascript", diff --git a/home/apps/neovim/lua/plugins/presence.lua b/home/apps/neovim/lua/plugins/presence.lua index b03bd6d..8ad57d2 100644 --- a/home/apps/neovim/lua/plugins/presence.lua +++ b/home/apps/neovim/lua/plugins/presence.lua @@ -2,7 +2,6 @@ return { { "andweeb/presence.nvim", - enabled = true, config = function() local presence = require("presence") @@ -43,6 +42,7 @@ return { -- Main image display (either "neovim" or "file") main_image = "file", show_time = true, + enable_line_number = true, buttons = function(_, repo_url) local concealed = conceal().state @@ -63,6 +63,10 @@ return { end end, file_assets = { + ["d"] = { + "Dlang", + "https://github.com/dlang.png", + }, ["astro"] = { "Astro", "https://github.com/withastro.png", diff --git a/machines/sashimi/brew.nix b/machines/sashimi/brew.nix index 2c73f99..aee7b9d 100644 --- a/machines/sashimi/brew.nix +++ b/machines/sashimi/brew.nix @@ -1,4 +1,7 @@ -{ +{config, ...}: { + # make brew available in PATH + environment.systemPath = [config.homebrew.brewPrefix]; + homebrew = { enable = true; caskArgs.require_sha = true; @@ -7,6 +10,13 @@ cleanup = "uninstall"; upgrade = true; }; + brews = [ + # D development, might make these Nix packages someday when the ecosystem isn't as horrid + "dfmt" + "dcd" + "dub" + "ldc" + ]; casks = let skipSha = name: { inherit name;