From 536677058ba5c88881a7faf9bb69c410657f49e6 Mon Sep 17 00:00:00 2001 From: Roel de Cort <63876068+dc-tec@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:26:19 +0200 Subject: [PATCH] feat: add Markdown Preview and Obsidian, update startup screen and cleanup lsp config (#8) Added Markdown Preview and the Obsidian plugins. Updated the Startup screen with links to Github Copilot and Obsidian Moved the helm-vim plugin from a seperate file into the lsp.nix file. --- README.md | 3 ++- config/default.nix | 3 ++- config/plugins/lsp/lsp.nix | 14 ++++++++++++- config/plugins/lsp/vim-helm.nix | 5 ----- config/plugins/ui/startup.nix | 10 +++++++++ config/plugins/utils/markdown-preview.nix | 18 ++++++++++++++++ config/plugins/utils/obsidian.nix | 25 +++++++++++++++++++++++ 7 files changed, 70 insertions(+), 8 deletions(-) delete mode 100644 config/plugins/lsp/vim-helm.nix create mode 100644 config/plugins/utils/markdown-preview.nix create mode 100644 config/plugins/utils/obsidian.nix diff --git a/README.md b/README.md index 63c9e4c..abf2da8 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ This repository contains the configuration for NixVim, a Neovim configuration ma - `lsp.nix`: Configures the Neovim LSP client. - `conform.nix`: Configures the Conform plugin for automatic code formatting. - `fidget.nix`: Configures the Fidget plugin for displaying LSP diagnostics in the status line. -- `vim-helm.nix`: Configures Vim-Helm plugin for helm template syntax ## Git @@ -57,6 +56,8 @@ This repository contains the configuration for NixVim, a Neovim configuration ma - `whichkey.nix`: Configures the WhichKey plugin for displaying key mappings. - `extra_plugins.nix`: Configures additional plugins. - `mini.nix`: Configures the Mini plugin. +- `obsidian.nix`: Confiugres the Obsidian plugin, for note-taking purposes. +- `markdown-preview.nix`: Configures the Markdown Preview plugin. Please refer to the individual `.nix` files for more detailed configuration information. diff --git a/config/default.nix b/config/default.nix index 708e060..eeaa3b3 100644 --- a/config/default.nix +++ b/config/default.nix @@ -35,7 +35,6 @@ _: { ./plugins/lsp/lsp.nix ./plugins/lsp/conform.nix ./plugins/lsp/fidget.nix - ./plugins/lsp/vim-helm.nix # Git ./plugins/git/lazygit.nix @@ -46,5 +45,7 @@ _: { ./plugins/utils/whichkey.nix ./plugins/utils/extra_plugins.nix ./plugins/utils/mini.nix + ./plugins/utils/markdown-preview.nix + ./plugins/utils/obsidian.nix ]; } diff --git a/config/plugins/lsp/lsp.nix b/config/plugins/lsp/lsp.nix index 51d6e3f..77b7bf1 100644 --- a/config/plugins/lsp/lsp.nix +++ b/config/plugins/lsp/lsp.nix @@ -2,6 +2,7 @@ plugins = { lsp-lines = {enable = true;}; lsp-format = {enable = true;}; + helm = {enable = true;}; lsp = { enable = true; servers = { @@ -15,7 +16,18 @@ tsserver = {enable = true;}; ansiblels = {enable = true;}; jsonls = {enable = true;}; - helm-ls = {enable = true;}; + helm-ls = { + enable = true; + extraOptions = { + settings = { + "helm-ls" = { + yamlls = { + path = "${pkgs.yaml-language-server}/bin/yaml-language-server"; + }; + }; + }; + }; + }; yamlls = { enable = true; extraOptions = { diff --git a/config/plugins/lsp/vim-helm.nix b/config/plugins/lsp/vim-helm.nix deleted file mode 100644 index ceb2729..0000000 --- a/config/plugins/lsp/vim-helm.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - plugins.helm = { - enable = true; - }; -} diff --git a/config/plugins/ui/startup.nix b/config/plugins/ui/startup.nix index f65ce28..ad77e8d 100644 --- a/config/plugins/ui/startup.nix +++ b/config/plugins/ui/startup.nix @@ -56,6 +56,16 @@ "Telescope file_browser" "fe" ] + [ + " Copilot Chat" + "CopilotChat" + "Chat with Github Copilot" + ] + [ + "󰧑 SecondBrain" + "edit ~/projects/personal/SecondBrain" + "Note taking with Obsidian" + ] ]; highlight = "string"; defaultColor = ""; diff --git a/config/plugins/utils/markdown-preview.nix b/config/plugins/utils/markdown-preview.nix new file mode 100644 index 0000000..12b4744 --- /dev/null +++ b/config/plugins/utils/markdown-preview.nix @@ -0,0 +1,18 @@ +_: { + plugins = { + markdown-preview = { + enable = true; + settings = { + browser = "firefox"; + echo_preview_url = true; + port = "6969"; + preview_options = { + disable_filename = true; + disable_sync_scroll = true; + sync_scroll_type = "middle"; + }; + theme = "dark"; + }; + }; + }; +} diff --git a/config/plugins/utils/obsidian.nix b/config/plugins/utils/obsidian.nix new file mode 100644 index 0000000..57bc852 --- /dev/null +++ b/config/plugins/utils/obsidian.nix @@ -0,0 +1,25 @@ +{ + plugins.obsidian = { + enable = true; + settings = { + workspaces = [ + { + name = "SecondBrain"; + path = "~/projects/personal/SecondBrain"; + } + ]; + templates = { + subdir = "templates"; + dateFormat = "%Y-%m-%d"; + timeFormat = "%H:%M"; + substitutions = {}; + }; + + dailyNotes = { + folder = "0_Daily_Notes"; + dateFormat = "%Y-%m-%d"; + aliasFormat = "%B %-d, %Y"; + }; + }; + }; +}