From 05cd9d2e6ed489a99c931b0d19c019c9df221168 Mon Sep 17 00:00:00 2001 From: Tim Wundenberg Date: Fri, 8 Aug 2025 23:13:20 +0200 Subject: [PATCH] feat: minor changes --- init.lua | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index cc18247..c61fad2 100644 --- a/init.lua +++ b/init.lua @@ -38,10 +38,24 @@ require('nvim_comment').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({ options = { 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]]) @@ -61,12 +75,15 @@ require('oil').setup({ vim.api.nvim_create_autocmd('LspAttach', { callback = function(ev) 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 vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) end 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, }) @@ -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" }) +-- Enables filtered completions for tailwindcss class names, e.g. "mt-". +-- 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 "nvim-treesitter.configs".setup({ auto_install = true, - highlight = { enable = true } + highlight = { + enable = true, + }, + incremental_selection = { + enable = true, + } }) vim.api.nvim_create_autocmd('TextYankPost', {