From ae97c6d6bccdd6e0f5c1be2239194962a2bc8dce Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Thu, 9 May 2024 11:05:54 -0400 Subject: [PATCH] neovim updates --- .../neovim/nvim/lua/plugins/lsp.lua | 16 ++++---- .../neovim/nvim/lua/plugins/neorg.lua | 38 ------------------- .../neovim/nvim/lua/plugins/telekasten.lua | 28 ++++++++++++++ 3 files changed, 37 insertions(+), 45 deletions(-) delete mode 100644 modules/home-manager/neovim/nvim/lua/plugins/neorg.lua create mode 100644 modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua diff --git a/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua b/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua index 7ac7f22..a7c1e88 100644 --- a/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua +++ b/modules/home-manager/neovim/nvim/lua/plugins/lsp.lua @@ -79,21 +79,23 @@ return { }) -- Server configs + local lsp = require('lspconfig') -- vue - require('lspconfig').volar.setup({}) + lsp.volar.setup({}) -- typescript / javascript require'lspconfig'.tsserver.setup{ - filetypes = { - "javascript", - "typescript", - "vue", - }, + filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "vue" } } -- eslint - require('lspconfig').eslint.setup({}) + lsp.eslint.setup({}) + + -- tailwind + lsp.tailwindcss.setup({ + root_dir = lsp.util.root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts') + }) end, } diff --git a/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua b/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua deleted file mode 100644 index ee0af38..0000000 --- a/modules/home-manager/neovim/nvim/lua/plugins/neorg.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "nvim-neorg/neorg", - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-treesitter/nvim-treesitter-textobjects", - "nvim-cmp", - "nvim-lua/plenary.nvim", - }, - lazy = false, - version = "7.0.0", -- Pin Neorg to the latest stable release - build = ":Neorg sync-parsers", - cmd = "Neorg", - config = function() - require('neorg').setup({ - load = { - ["core.defaults"] = {}, - ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Neorg]" } }, - ["core.integrations.nvim-cmp"] = {}, - ["core.concealer"] = { config = { icon_preset = "basic" } }, - ["core.keybinds"] = { - -- https://github.com/nvim-neorg/neorg/blob/main/lua/neorg/modules/core/keybinds/keybinds.lua - config = { - default_keybinds = true, - neorg_leader = "", - }, - }, - ["core.dirman"] = { - config = { - workspaces = { - Notes = "~/Notes", - }, - default_workspace = "Notes" - } - }, - } - }) - end, -} diff --git a/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua b/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua new file mode 100644 index 0000000..1944673 --- /dev/null +++ b/modules/home-manager/neovim/nvim/lua/plugins/telekasten.lua @@ -0,0 +1,28 @@ +return { + 'renerocksai/telekasten.nvim', + dependencies = { + 'nvim-telescope/telescope.nvim', + 'nvim-telekasten/calendar-vim' + }, + config = function() + require("telekasten").setup({ + home = vim.fn.expand("~/zettelkasten"), + }) + + -- Launch panel if nothing is typed after z + vim.keymap.set("n", "z", "Telekasten panel") + + -- Most used functions + vim.keymap.set("n", "zf", "Telekasten find_notes") + vim.keymap.set("n", "zg", "Telekasten search_notes") + vim.keymap.set("n", "zd", "Telekasten goto_today") + vim.keymap.set("n", "zz", "Telekasten follow_link") + vim.keymap.set("n", "zn", "Telekasten new_note") + vim.keymap.set("n", "zc", "Telekasten show_calendar") + vim.keymap.set("n", "zb", "Telekasten show_backlinks") + vim.keymap.set("n", "zI", "Telekasten insert_img_link") + + -- Call insert link automatically when we start typing a link + vim.keymap.set("i", "[[", "Telekasten insert_link") + end, +}