feat: minor changes
This commit is contained in:
47
init.lua
47
init.lua
@@ -38,10 +38,24 @@ require('nvim_comment').setup({
|
|||||||
|
|
||||||
require('nvim-ts-autotag').setup()
|
require('nvim-ts-autotag').setup()
|
||||||
|
|
||||||
|
-- local function hello()
|
||||||
|
-- local x = vim.fn["nvim_treesitter#statusline(90)"]()
|
||||||
|
-- -- print(x)
|
||||||
|
-- return "test"
|
||||||
|
-- end
|
||||||
require('lualine').setup({
|
require('lualine').setup({
|
||||||
options = {
|
options = {
|
||||||
theme = "everforest",
|
theme = "everforest",
|
||||||
},
|
},
|
||||||
|
-- sections = {
|
||||||
|
-- -- lualine_a = { 'mode' },
|
||||||
|
-- -- lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||||
|
-- -- lualine_c = { 'filename' },
|
||||||
|
-- lualine_c = { 'filename', hello },
|
||||||
|
-- -- lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||||
|
-- -- lualine_y = { 'progress' },
|
||||||
|
-- -- lualine_z = { 'location' }
|
||||||
|
-- },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd([[colorscheme everforest]])
|
vim.cmd([[colorscheme everforest]])
|
||||||
@@ -61,12 +75,15 @@ require('oil').setup({
|
|||||||
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)
|
||||||
|
if client == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
if client:supports_method('textDocument/completion') then
|
if client:supports_method('textDocument/completion') then
|
||||||
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
if client:supports_method("textDocument/inlayHint") or client.server_capabilities.inlayHintProvider then
|
if client:supports_method("textDocument/inlayHint") or client.server_capabilities.inlayHintProvider then
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
vim.lsp.inlay_hint.enable(true, { bufnr = ev.buf })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
@@ -89,12 +106,38 @@ vim.lsp.config('tailwindcss', {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
vim.lsp.enable({ "lua_ls", "gopls", "templ", "tailwindcss" })
|
vim.lsp.enable({ "lua_ls", "gopls", "templ", "tailwindcss" })
|
||||||
|
|
||||||
|
-- Enables filtered completions for tailwindcss class names, e.g. "mt-<C-n>".
|
||||||
|
-- Otherwise the completion contains EVERYTHING
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "html", "templ", "javascript", "typescript", "css" },
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.iskeyword:append("-")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
require "mini.pick".setup()
|
require "mini.pick".setup()
|
||||||
require "nvim-treesitter.configs".setup({
|
require "nvim-treesitter.configs".setup({
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = { enable = true }
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
|||||||
Reference in New Issue
Block a user