chore: add outline

pull/121/head
shepherdwind 2024-05-03 22:22:52 +08:00
parent ab1dc72b5d
commit 9eda510221
4 changed files with 43 additions and 3 deletions

View File

@ -44,6 +44,7 @@
"nvim-web-devicons": { "branch": "master", "commit": "20921d33c605ba24c8d0b76b379a54a9c83ba170" }, "nvim-web-devicons": { "branch": "master", "commit": "20921d33c605ba24c8d0b76b379a54a9c83ba170" },
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },

View File

@ -3,14 +3,15 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- bootstrap lazy.nvim -- bootstrap lazy.nvim
-- stylua: ignore -- 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 end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath) vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
-- add LazyVim and import its plugins -- 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.coding.copilot" },
{ import = "lazyvim.plugins.extras.linting.eslint" }, { import = "lazyvim.plugins.extras.linting.eslint" },
-- { import = "lazyvim.plugins.extras.formatting.prettier" }, -- { import = "lazyvim.plugins.extras.formatting.prettier" },

View File

@ -5,7 +5,15 @@ return {
ensure_installed = { ensure_installed = {
"svelte", "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 = { setup = {
eslint = function() eslint = function()
require("lazyvim.util").lsp.on_attach(function(client) require("lazyvim.util").lsp.on_attach(function(client)

View File

@ -0,0 +1,30 @@
return {
"simrat39/symbols-outline.nvim",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", 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,
}