diff --git a/lazy-lock.json b/lazy-lock.json index 960c5b7..8b1c6de 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -44,6 +44,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "20921d33c605ba24c8d0b76b379a54a9c83ba170" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index b588110..26d9be1 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -3,14 +3,15 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then -- bootstrap lazy.nvim -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", + lazypath }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ spec = { -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, { import = "lazyvim.plugins.extras.coding.copilot" }, { import = "lazyvim.plugins.extras.linting.eslint" }, -- { import = "lazyvim.plugins.extras.formatting.prettier" }, diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 7dcf783..2a7fa88 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -5,7 +5,15 @@ return { ensure_installed = { "svelte", }, - servers = { eslint = {} }, + servers = { + eslint = { + settings = { + -- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root + workingDirectories = { mode = "location" }, + }, + + } + }, setup = { eslint = function() require("lazyvim.util").lsp.on_attach(function(client) diff --git a/lua/plugins/outline.lua b/lua/plugins/outline.lua new file mode 100644 index 0000000..e6dbdc9 --- /dev/null +++ b/lua/plugins/outline.lua @@ -0,0 +1,30 @@ +return { + "simrat39/symbols-outline.nvim", + keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, + cmd = "SymbolsOutline", + opts = function() + local Config = require("lazyvim.config") + local defaults = require("symbols-outline.config").defaults + local opts = { + symbols = {}, + symbol_blacklist = {}, + } + local filter = Config.kind_filter + + if type(filter) == "table" then + filter = filter.default + if type(filter) == "table" then + for kind, symbol in pairs(defaults.symbols) do + opts.symbols[kind] = { + icon = Config.icons.kinds[kind] or symbol.icon, + hl = symbol.hl, + } + if not vim.tbl_contains(filter, kind) then + table.insert(opts.symbol_blacklist, kind) + end + end + end + end + return opts + end, +}