From 6151dfa7def5a96b20c5715534f826a6eb5848f4 Mon Sep 17 00:00:00 2001 From: talksik Date: Thu, 18 Jul 2024 17:21:39 -0700 Subject: [PATCH 1/4] annoying error that wouldn't go away --- lua/custom/plugins/init.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 2bec093..121331b 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -97,17 +97,4 @@ return { end, {}) end, }, - - -- add in shortcuts for next and previous buffer - { - 'romgrk/barbar.nvim', - config = function() - vim.keymap.set('n', '9', function() - vim.cmd 'BufferPrevious' - end, {}) - vim.keymap.set('n', '0', function() - vim.cmd 'BufferNext' - end, {}) - end, - }, } From c3e9862735b9b6f936b909459e5541614ea1abd2 Mon Sep 17 00:00:00 2001 From: talksik Date: Tue, 23 Jul 2024 07:50:13 -0700 Subject: [PATCH 2/4] beautiful rendering of markdown with icons --- lua/custom/plugins/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 121331b..d106dbb 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -97,4 +97,14 @@ return { end, {}) end, }, + + { + 'MeanderingProgrammer/markdown.nvim', + main = "render-markdown", + opts = {}, + name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim + dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + } } From ac47429df889da8f5b1fbc936b14661c242ebd35 Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 14 Sep 2024 09:45:10 -0700 Subject: [PATCH 3/4] adding in templ golang configuration --- init.lua | 39 +++++++++++++++++++++++++++++++------ lua/custom/plugins/init.lua | 10 ---------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index b4530d4..91b86c4 100644 --- a/init.lua +++ b/init.lua @@ -258,7 +258,7 @@ require('lazy').setup({ -- require('Comment').setup({}) -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: @@ -293,7 +293,7 @@ require('lazy').setup({ -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. + { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading @@ -339,7 +339,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -517,7 +517,7 @@ require('lazy').setup({ -- See `:help K` for why this keymap. map('K', vim.lsp.buf.hover, 'Hover Documentation') - -- run :ClangdSwitchSourceHeader to switch between source/header files + -- run :ClangdSwitchSourceHeader to switch between source/header files map('hh', 'ClangdSwitchSourceHeader', '[S]witch [H]eader <> Source') -- WARN: This is not Goto Definition, this is Goto Declaration. @@ -554,6 +554,8 @@ require('lazy').setup({ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + vim.filetype.add({ extension = { templ = "templ" } }) + -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -578,7 +580,29 @@ require('lazy').setup({ }, filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'hpp', 'h', 'cc' }, }, - gopls = {}, + -- gopls = {}, + templ = { + cmd = { 'templ', 'lsp' }, + filetypes = { 'templ' }, + -- root_dir = require('lspconfig').util.root_pattern('go.mod', 'go.sum'), + }, + html = { + filetypes = { 'html', 'templ' }, + }, + htmx = { + filetypes = { 'htmx', 'templ' }, + }, + tailwindcss = { + filetypes = { "templ", "astro", "javascript", "typescript", "react" }, + settings = { + tailwindCSS = { + includeLanguages = { + templ = "html", + }, + }, + }, + }, + -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -839,8 +863,11 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', + dependencies = { + 'vrischmann/tree-sitter-templ', + }, opts = { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'templ' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index d106dbb..121331b 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -97,14 +97,4 @@ return { end, {}) end, }, - - { - 'MeanderingProgrammer/markdown.nvim', - main = "render-markdown", - opts = {}, - name = 'render-markdown', -- Only needed if you have another plugin named markdown.nvim - dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons - } } From cc2c6063b1712abac683af671933f53d4ffd302f Mon Sep 17 00:00:00 2001 From: talksik Date: Sat, 12 Oct 2024 12:35:24 -0700 Subject: [PATCH 4/4] taking out annoying tab handling --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 91b86c4..d5948a8 100644 --- a/init.lua +++ b/init.lua @@ -246,7 +246,7 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + -- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -589,9 +589,9 @@ require('lazy').setup({ html = { filetypes = { 'html', 'templ' }, }, - htmx = { - filetypes = { 'htmx', 'templ' }, - }, + -- htmx = { + -- filetypes = { 'htmx', 'templ' }, + -- }, tailwindcss = { filetypes = { "templ", "astro", "javascript", "typescript", "react" }, settings = {