feat: add missing plugins for golang/tailwind/templ
This commit is contained in:
60
init.lua
60
init.lua
@@ -18,9 +18,22 @@ vim.pack.add({
|
|||||||
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
{ src = "https://github.com/neovim/nvim-lspconfig" },
|
||||||
{ src = "https://github.com/sainnhe/everforest" },
|
{ src = "https://github.com/sainnhe/everforest" },
|
||||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||||
|
-- currently not working, see https://github.com/laytan/tailwind-sorter.nvim/issues/114
|
||||||
|
-- { src = "https://github.com/laytan/tailwind-sorter.nvim" },
|
||||||
|
-- { src = "https://github.com/nvim-lua/plenary.nvim" }, -- required by tailwind-sorter
|
||||||
|
{ src = "https://github.com/windwp/nvim-ts-autotag" },
|
||||||
|
{ src = "https://github.com/terrortylor/nvim-comment" },
|
||||||
|
{ src = "https://github.com/JoosepAlviste/nvim-ts-context-commentstring" }, -- required by nvim-comment
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require('nvim_comment').setup({
|
||||||
|
hook = function()
|
||||||
|
require('ts_context_commentstring.internal').update_commentstring()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
require('nvim-ts-autotag').setup()
|
||||||
|
|
||||||
require('lualine').setup({
|
require('lualine').setup({
|
||||||
options = {
|
options = {
|
||||||
@@ -42,8 +55,6 @@ require('oil').setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- require("nvim-lspconfig").setup({ inlay_hints = { enabled = true } })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
@@ -68,7 +79,7 @@ vim.lsp.config('gopls', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.lsp.enable({ "lua_ls", "gopls" })
|
vim.lsp.enable({ "lua_ls", "gopls", "templ", "tailwindcss" })
|
||||||
|
|
||||||
require "mini.pick".setup()
|
require "mini.pick".setup()
|
||||||
require "nvim-treesitter.configs".setup({
|
require "nvim-treesitter.configs".setup({
|
||||||
@@ -76,39 +87,6 @@ require "nvim-treesitter.configs".setup({
|
|||||||
highlight = { enable = true }
|
highlight = { enable = true }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-- 'windwp/nvim-ts-autotag',
|
|
||||||
-- 'terrortylor/nvim-comment',
|
|
||||||
-- config = function()
|
|
||||||
-- require('nvim_comment').setup({
|
|
||||||
-- hook = function()
|
|
||||||
-- require('ts_context_commentstring.internal').update_commentstring()
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
-- end,
|
|
||||||
-- dependencies = {
|
|
||||||
-- -- To customize commentstring for e.g. svelte files, as the commentstring is depending on cursor position
|
|
||||||
-- 'JoosepAlviste/nvim-ts-context-commentstring'
|
|
||||||
-- }
|
|
||||||
-- {
|
|
||||||
-- 'stevearc/conform.nvim',
|
|
||||||
-- opts = {
|
|
||||||
-- notify_on_error = true,
|
|
||||||
-- formatters_by_ft = {
|
|
||||||
-- templ = { "templ" },
|
|
||||||
-- },
|
|
||||||
-- format_on_save = {
|
|
||||||
-- lsp_fallback = true,
|
|
||||||
-- timeout_ms = 1500,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- config = function(_, opts)
|
|
||||||
-- local plug = require('conform')
|
|
||||||
-- plug.setup(opts)
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Hightlight selection on yank',
|
desc = 'Hightlight selection on yank',
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
@@ -125,11 +103,19 @@ vim.api.nvim_create_autocmd('BufWritePre', {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- require('tailwind-sorter').setup({
|
||||||
|
-- on_save_enabled = true,
|
||||||
|
-- on_save_pattern = { '*.html' },
|
||||||
|
-- trim_spaces = false,
|
||||||
|
-- })
|
||||||
|
|
||||||
vim.filetype.add({ extension = { templ = "templ" } })
|
vim.filetype.add({ extension = { templ = "templ" } })
|
||||||
|
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
vim.keymap.set('i', '<C-n>', vim.lsp.completion.get, {})
|
vim.keymap.set('i', '<C-n>', vim.lsp.completion.get, {})
|
||||||
|
vim.keymap.set('i', '<C-z>', "<C-y>", {})
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, {})
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, {})
|
||||||
vim.keymap.set('n', '<F2>', vim.lsp.buf.rename, {})
|
vim.keymap.set('n', '<F2>', vim.lsp.buf.rename, {})
|
||||||
|
|||||||
Reference in New Issue
Block a user