diff --git a/.gitignore b/.gitignore index 005b535b..cad24e47 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ tags test.sh .luarc.json nvim +node_modules/ spell/ lazy-lock.json diff --git a/init.lua b/init.lua index 3bdb5e36..d367057c 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, for help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -533,7 +533,10 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = { filetypes = { 'templ', 'go' } }, + htmx = { filetypes = { 'htmx', 'templ' } }, + tailwindcss = { filetypes = { 'templ' } }, + templ = { filetypes = { 'templ' } }, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -785,7 +788,7 @@ require('lazy').setup({ ---@diagnostic disable-next-line: missing-fields require('nvim-treesitter.configs').setup { - ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'go', 'templ' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { enable = true }, @@ -801,6 +804,12 @@ require('lazy').setup({ end, }, + vim.filetype.add { + extension = { + templ = 'templ', + }, + }, + -- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- put them in the right spots if you want. diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..894243c0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "nvim", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "tree-sitter-cli": "^0.21.0" + } + }, + "node_modules/tree-sitter-cli": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.21.0.tgz", + "integrity": "sha512-wA7wT5724fNQW82XDH6zT6ZcYonjrAKLCHHuhLsPcAKULrhp3rNuMvlgBdB5FUBvmjHNhtTZF/qpHenMoRJPBw==", + "hasInstallScript": true, + "bin": { + "tree-sitter": "cli.js" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..6ff65272 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "tree-sitter-cli": "^0.21.0" + } +}