diff --git a/config_files/stylua.toml b/.stylua.toml similarity index 100% rename from config_files/stylua.toml rename to .stylua.toml diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index d7a78ae..27e9e06 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -1,11 +1,3 @@ -- Autocmds are automatically loaded on the VeryLazy event -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Add any additional autocmds here -vim.api.nvim_create_autocmd("FileType", { - pattern = { "lua" }, - callback = function() - vim.bo.tabstop = 2 - vim.bo.softtabstop = 2 - vim.bo.shiftwidth = 2 - end, -}) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 79a2e0e..cab8cd1 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -23,6 +23,7 @@ require("lazy").setup({ {import = "plugins.langs.ruby"}, {import = "plugins.langs.biome"}, { import = "plugins.langs.xml" }, + {import ="plugins.langs.lua"}, }, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 96fc639..2e1a8ab 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -12,7 +12,8 @@ return { css = { "biome" }, javascript = { "biome" }, sql = { "pg_format" }, - yaml = {"hydra_lsp"} + yaml = {"hydra_lsp"}, + lua = {"stylua"} }, }, dependencies = { diff --git a/lua/plugins/langs/lua/nvim-lspconfig.lua b/lua/plugins/langs/lua/nvim-lspconfig.lua new file mode 100644 index 0000000..33e4470 --- /dev/null +++ b/lua/plugins/langs/lua/nvim-lspconfig.lua @@ -0,0 +1,43 @@ +return { + "neovim/nvim-lspconfig", + opts = { + servers = { + lua_ls = { + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + format = { + enable = true, + defaultConfig = { + indent_style = "space", + indent_size = "2", + max_line_length = "88", + }, + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = { + vim.env.VIMRUNTIME, + }, + checkThirdParty = false, + }, + telemetry = { + enable = false, + }, + }, + }, + }, + }, + setup = { + lua_ls = function() + require("snacks").util.lsp.on({ name = "lua_ls" }, function(_, client) + client.server_capabilities.hoverProvider = true + end) + end, + }, + }, +}