Compare commits
43 Commits
Author | SHA1 | Date | |
---|---|---|---|
9f04e1e20d | |||
edff9b1a25 | |||
38d2c8aab0 | |||
50a358bc1e | |||
b1d456cda7 | |||
b9f3cada8a | |||
777be2fabd | |||
5c5e7c65c7 | |||
5b51df3f39 | |||
204be37843 | |||
f98c4a26b3 | |||
94de32c598 | |||
118ca3309d | |||
8597c2085f | |||
c38c3bf407 | |||
f535fb6891 | |||
cb6832d8ad | |||
c555e17e48 | |||
20d36ccd84 | |||
13366c6488 | |||
d6bc320f20 | |||
7bbd48caa0 | |||
761171a872 | |||
092b1fd802 | |||
d2d5d9f53c | |||
38b530d33d | |||
739409cd4b | |||
058089d0d6 | |||
03c5aa71f3 | |||
0f0a81c175 | |||
286a6fb8ae | |||
b72a5c2dfa | |||
704e85183b | |||
b5495eb38a | |||
27ceb433a9 | |||
171a843edf | |||
5538ab2d64 | |||
65874d161a | |||
90a8200e7c | |||
1599edd10a | |||
eac18246d4 | |||
aa0e4f52e4 | |||
b304db9236 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -59,6 +59,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
release-type: simple
|
release-type: simple
|
||||||
package-name: LazyVim
|
package-name: LazyVim
|
||||||
|
extra-files: |
|
||||||
|
lua/lazyvim/config/init.lua
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: tag stable versions
|
- name: tag stable versions
|
||||||
if: ${{ steps.release.outputs.release_created }}
|
if: ${{ steps.release.outputs.release_created }}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -95,18 +95,19 @@ end
|
|||||||
|
|
||||||
-- formatting
|
-- formatting
|
||||||
map({ "n", "v" }, "<leader>cf", function()
|
map({ "n", "v" }, "<leader>cf", function()
|
||||||
require("lazyvim.plugins.lsp.format").format({ force = true })
|
Util.format({ force = true })
|
||||||
end, { desc = "Format" })
|
end, { desc = "Format" })
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
|
|
||||||
-- toggle options
|
-- toggle options
|
||||||
map("n", "<leader>uf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
|
map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
|
||||||
|
map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
|
||||||
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||||
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||||
map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||||
map("n", "<leader>ul", function() Util.toggle_number() end, { desc = "Toggle Line Numbers" })
|
map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||||
map("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
|
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||||
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||||
if vim.lsp.inlay_hint then
|
if vim.lsp.inlay_hint then
|
||||||
@ -114,8 +115,8 @@ if vim.lsp.inlay_hint then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- lazygit
|
-- lazygit
|
||||||
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
||||||
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
||||||
|
|
||||||
-- quit
|
-- quit
|
||||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||||
@ -127,9 +128,9 @@ map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
|||||||
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
|
map("n", "<leader>L", Util.changelog, {desc = "LazyVim Changelog"})
|
||||||
|
|
||||||
-- floating terminal
|
-- floating terminal
|
||||||
local lazyterm = function() Util.float_term(nil, { cwd = Util.get_root() }) end
|
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
|
||||||
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
||||||
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
|
map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
|
||||||
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
||||||
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
||||||
|
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = "\\"
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
-- Enable LazyVim auto format
|
||||||
|
vim.g.autoformat = true
|
||||||
|
|
||||||
|
-- LazyVim root dir detection
|
||||||
|
-- Each entry can be:
|
||||||
|
-- * the name of a detector function like `lsp` or `cwd`
|
||||||
|
-- * a pattern or array of patterns like `.git` or `lua`.
|
||||||
|
-- * a function with signature `function(buf) -> string|string[]`
|
||||||
|
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
opt.autowrite = true -- Enable auto write
|
opt.autowrite = true -- Enable auto write
|
||||||
@ -63,10 +73,10 @@ end
|
|||||||
|
|
||||||
-- Folding
|
-- Folding
|
||||||
vim.opt.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"
|
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
|
||||||
|
|
||||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||||
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
|
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
|
||||||
end
|
end
|
||||||
|
|
||||||
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
|
||||||
|
@ -11,7 +11,7 @@ return {
|
|||||||
{
|
{
|
||||||
"<leader>fe",
|
"<leader>fe",
|
||||||
function()
|
function()
|
||||||
require("neo-tree.command").execute({ toggle = true, dir = require("lazyvim.util").get_root() })
|
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
||||||
end,
|
end,
|
||||||
desc = "Explorer NeoTree (root dir)",
|
desc = "Explorer NeoTree (root dir)",
|
||||||
},
|
},
|
||||||
@ -29,7 +29,7 @@ return {
|
|||||||
vim.cmd([[Neotree close]])
|
vim.cmd([[Neotree close]])
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
if vim.fn.argc() == 1 then
|
if vim.fn.argc(-1) == 1 then
|
||||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||||
if stat and stat.type == "directory" then
|
if stat and stat.type == "directory" then
|
||||||
require("neo-tree")
|
require("neo-tree")
|
||||||
@ -60,7 +60,7 @@ return {
|
|||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local function on_move(data)
|
local function on_move(data)
|
||||||
Util.on_rename(data.source, data.destination)
|
Util.lsp.on_rename(data.source, data.destination)
|
||||||
end
|
end
|
||||||
|
|
||||||
local events = require("neo-tree.events")
|
local events = require("neo-tree.events")
|
||||||
@ -150,42 +150,20 @@ return {
|
|||||||
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
|
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
|
||||||
{
|
{
|
||||||
"<leader>ss",
|
"<leader>ss",
|
||||||
Util.telescope("lsp_document_symbols", {
|
function()
|
||||||
symbols = {
|
require("telescope.builtin").lsp_document_symbols({
|
||||||
"Class",
|
symbols = require("lazyvim.config").get_kind_filter(),
|
||||||
"Function",
|
})
|
||||||
"Method",
|
end,
|
||||||
"Constructor",
|
|
||||||
"Interface",
|
|
||||||
"Module",
|
|
||||||
"Struct",
|
|
||||||
"Trait",
|
|
||||||
"Field",
|
|
||||||
"Property",
|
|
||||||
"Enum",
|
|
||||||
"Constant",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
desc = "Goto Symbol",
|
desc = "Goto Symbol",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>sS",
|
"<leader>sS",
|
||||||
Util.telescope("lsp_dynamic_workspace_symbols", {
|
function()
|
||||||
symbols = {
|
require("telescope.builtin").lsp_dynamic_workspace_symbols({
|
||||||
"Class",
|
symbols = require("lazyvim.config").get_kind_filter(),
|
||||||
"Function",
|
})
|
||||||
"Method",
|
end,
|
||||||
"Constructor",
|
|
||||||
"Interface",
|
|
||||||
"Module",
|
|
||||||
"Struct",
|
|
||||||
"Trait",
|
|
||||||
"Field",
|
|
||||||
"Property",
|
|
||||||
"Enum",
|
|
||||||
"Constant",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
desc = "Goto Symbol (Workspace)",
|
desc = "Goto Symbol (Workspace)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -270,7 +248,7 @@ return {
|
|||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if not require("lazyvim.util").has("flash.nvim") then
|
if not Util.has("flash.nvim") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local function flash(prompt_bufnr)
|
local function flash(prompt_bufnr)
|
||||||
|
@ -49,9 +49,9 @@ return {
|
|||||||
|
|
||||||
local Util = require("lazyvim.util")
|
local Util = require("lazyvim.util")
|
||||||
local colors = {
|
local colors = {
|
||||||
ok = Util.fg("Special"),
|
ok = Util.ui.fg("Special"),
|
||||||
error = Util.fg("DiagnosticError"),
|
error = Util.ui.fg("DiagnosticError"),
|
||||||
pending = Util.fg("DiagnosticWarn"),
|
pending = Util.ui.fg("DiagnosticWarn"),
|
||||||
}
|
}
|
||||||
table.insert(opts.sections.lualine_x, 2, {
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
function()
|
function()
|
||||||
|
@ -21,10 +21,10 @@ return {
|
|||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local Util = require("lazyvim.util")
|
local Util = require("lazyvim.util")
|
||||||
local colors = {
|
local colors = {
|
||||||
[""] = Util.fg("Special"),
|
[""] = Util.ui.fg("Special"),
|
||||||
["Normal"] = Util.fg("Special"),
|
["Normal"] = Util.ui.fg("Special"),
|
||||||
["Warning"] = Util.fg("DiagnosticError"),
|
["Warning"] = Util.ui.fg("DiagnosticError"),
|
||||||
["InProgress"] = Util.fg("DiagnosticWarn"),
|
["InProgress"] = Util.ui.fg("DiagnosticWarn"),
|
||||||
}
|
}
|
||||||
table.insert(opts.sections.lualine_x, 2, {
|
table.insert(opts.sections.lualine_x, 2, {
|
||||||
function()
|
function()
|
||||||
@ -36,7 +36,7 @@ return {
|
|||||||
if not package.loaded["copilot"] then
|
if not package.loaded["copilot"] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local ok, clients = pcall(require("lazyvim.util").get_clients, { name = "copilot", bufnr = 0 })
|
local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 })
|
||||||
if not ok then
|
if not ok then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -66,7 +66,7 @@ return {
|
|||||||
copilot_cmp.setup(opts)
|
copilot_cmp.setup(opts)
|
||||||
-- attach cmp source whenever copilot attaches
|
-- attach cmp source whenever copilot attaches
|
||||||
-- fixes lazy-loading issues with the copilot cmp source
|
-- fixes lazy-loading issues with the copilot cmp source
|
||||||
require("lazyvim.util").on_attach(function(client)
|
require("lazyvim.util").lsp.on_attach(function(client)
|
||||||
if client.name == "copilot" then
|
if client.name == "copilot" then
|
||||||
copilot_cmp._on_insert_enter({})
|
copilot_cmp._on_insert_enter({})
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---@param config {args?:string[]|fun():string[]?}
|
---@param config {args?:string[]|fun():string[]?}
|
||||||
local function get_args(config)
|
local function get_args(config)
|
||||||
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
|
local args = type(config.args) == "function" and (config.args() or {}) or config.args or {}
|
||||||
|
config = vim.deepcopy(config)
|
||||||
---@cast args string[]
|
---@cast args string[]
|
||||||
config.args = function()
|
config.args = function()
|
||||||
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
|
local new_args = vim.fn.input("Run with args: ", table.concat(args, " ")) --[[@as string]]
|
||||||
@ -54,7 +55,6 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
defaults = {
|
defaults = {
|
||||||
["<leader>d"] = { name = "+debug" },
|
["<leader>d"] = { name = "+debug" },
|
||||||
["<leader>da"] = { name = "+adapters" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,24 +1,40 @@
|
|||||||
return {
|
return {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"jbyuki/one-small-step-for-vimkind",
|
"jbyuki/one-small-step-for-vimkind",
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
|
||||||
{ "<leader>daL", function() require("osv").launch({ port = 8086 }) end, desc = "Adapter Lua Server", ft = "lua" },
|
|
||||||
{ "<leader>dal", function() require("osv").run_this() end, desc = "Adapter Lua", ft = "lua" },
|
|
||||||
},
|
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
dap.adapters.nlua = function(callback, config)
|
dap.adapters.nlua = function(callback, conf)
|
||||||
callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
|
local adapter = {
|
||||||
|
type = "server",
|
||||||
|
host = conf.host or "127.0.0.1",
|
||||||
|
port = conf.port or 8086,
|
||||||
|
}
|
||||||
|
if conf.start_neovim then
|
||||||
|
local dap_run = dap.run
|
||||||
|
dap.run = function(c)
|
||||||
|
adapter.port = c.port
|
||||||
|
adapter.host = c.host
|
||||||
|
end
|
||||||
|
require("osv").run_this()
|
||||||
|
dap.run = dap_run
|
||||||
|
end
|
||||||
|
callback(adapter)
|
||||||
end
|
end
|
||||||
dap.configurations.lua = {
|
dap.configurations.lua = {
|
||||||
{
|
{
|
||||||
type = "nlua",
|
type = "nlua",
|
||||||
request = "attach",
|
request = "attach",
|
||||||
name = "Attach to running Neovim instance",
|
name = "Run this file",
|
||||||
|
start_neovim = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "nlua",
|
||||||
|
request = "attach",
|
||||||
|
name = "Attach to running Neovim instance (port = 8086)",
|
||||||
|
port = 8086,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
134
lua/lazyvim/plugins/extras/editor/aerial.lua
Normal file
134
lua/lazyvim/plugins/extras/editor/aerial.lua
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
local Config = require("lazyvim.config")
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/aerial.nvim",
|
||||||
|
event = "LazyFile",
|
||||||
|
opts = function()
|
||||||
|
---@diagnostic disable-next-line: no-unknown
|
||||||
|
local lualine = require("lualine.components.aerial")
|
||||||
|
|
||||||
|
-- Strip trailing spaces from symbols in statusline
|
||||||
|
---@param _ any
|
||||||
|
---@param symbols {icon?:string}[]
|
||||||
|
lualine.format_status = Util.inject.args(lualine.format_status, function(_, symbols)
|
||||||
|
for _, s in ipairs(symbols) do
|
||||||
|
s.icon = s.icon and s.icon:gsub("%s*$", "") or nil
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
local icons = vim.deepcopy(Config.icons.kinds)
|
||||||
|
|
||||||
|
-- HACK: fix lua's weird choice for `Package` for control
|
||||||
|
-- structures like if/else/for/etc.
|
||||||
|
icons.lua = { Package = icons.Control }
|
||||||
|
|
||||||
|
---@type table<string, string[]>|false
|
||||||
|
local filter_kind = false
|
||||||
|
if Config.kind_filter then
|
||||||
|
filter_kind = assert(vim.deepcopy(Config.kind_filter))
|
||||||
|
filter_kind._ = filter_kind.default
|
||||||
|
filter_kind.default = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local opts = {
|
||||||
|
attach_mode = "global",
|
||||||
|
backends = { "lsp", "treesitter", "markdown", "man" },
|
||||||
|
show_guides = true,
|
||||||
|
layout = {
|
||||||
|
resize_to_content = false,
|
||||||
|
win_opts = {
|
||||||
|
winhl = "Normal:NormalFloat,FloatBorder:NormalFloat,SignColumn:SignColumnSB",
|
||||||
|
signcolumn = "yes",
|
||||||
|
statuscolumn = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
icons = icons,
|
||||||
|
filter_kind = filter_kind,
|
||||||
|
-- stylua: ignore
|
||||||
|
guides = {
|
||||||
|
mid_item = "├╴",
|
||||||
|
last_item = "└╴",
|
||||||
|
nested_top = "│ ",
|
||||||
|
whitespace = " ",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>cs", "<cmd>AerialToggle<cr>", desc = "Aerial (Symbols)" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Telescope integration
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("aerial")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>ss",
|
||||||
|
"<cmd>Telescope aerial<cr>",
|
||||||
|
desc = "Goto Symbol (Aerial)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- edgy integration
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||||
|
local aerial_idx = Util.plugin.extra_idx("editor.aerial")
|
||||||
|
|
||||||
|
if edgy_idx and edgy_idx > aerial_idx then
|
||||||
|
Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
|
||||||
|
title = "LazyVim",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Aerial",
|
||||||
|
ft = "aerial",
|
||||||
|
pinned = true,
|
||||||
|
open = "AerialOpen",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine integration
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, {
|
||||||
|
"aerial",
|
||||||
|
-- The separator to be used to separate symbols in status line.
|
||||||
|
sep = " ",
|
||||||
|
|
||||||
|
-- The number of symbols to render top-down. In order to render only 'N' last
|
||||||
|
-- symbols, negative numbers may be supplied. For instance, 'depth = -1' can
|
||||||
|
-- be used in order to render only current symbol.
|
||||||
|
depth = 5,
|
||||||
|
|
||||||
|
-- When 'dense' mode is on, icons are not rendered near their symbols. Only
|
||||||
|
-- a single icon that represents the kind of current symbol is rendered at
|
||||||
|
-- the beginning of status line.
|
||||||
|
dense = false,
|
||||||
|
|
||||||
|
-- The separator to be used to separate symbols in dense mode.
|
||||||
|
dense_sep = ".",
|
||||||
|
|
||||||
|
-- Color the symbol icons.
|
||||||
|
colored = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -57,7 +57,7 @@ return {
|
|||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "MiniFilesActionRename",
|
pattern = "MiniFilesActionRename",
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
require("lazyvim.util").on_rename(event.data.from, event.data.to)
|
require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
return {
|
||||||
|
-- lsp symbol navigation for lualine. This shows where
|
||||||
|
-- in the code structure you are - within functions, classes,
|
||||||
|
-- etc - in the statusline.
|
||||||
|
{
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
lazy = true,
|
||||||
|
init = function()
|
||||||
|
vim.g.navic_silence = true
|
||||||
|
require("lazyvim.util").lsp.on_attach(function(client, buffer)
|
||||||
|
if client.supports_method("textDocument/documentSymbol") then
|
||||||
|
require("nvim-navic").attach(client, buffer)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
separator = " ",
|
||||||
|
highlight = true,
|
||||||
|
depth_limit = 5,
|
||||||
|
icons = require("lazyvim.config").icons.kinds,
|
||||||
|
lazy_update_context = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine integration
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, {
|
||||||
|
function()
|
||||||
|
return require("nvim-navic").get_location()
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
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 = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
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(Config.kind_filter.default, kind) then
|
||||||
|
table.insert(opts.symbol_blacklist, kind)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- edgy integration
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||||
|
local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline")
|
||||||
|
|
||||||
|
if edgy_idx and edgy_idx > symbols_idx then
|
||||||
|
Util.warn(
|
||||||
|
"The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.",
|
||||||
|
{
|
||||||
|
title = "LazyVim",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Symbols Outline",
|
||||||
|
ft = "Outline",
|
||||||
|
pinned = true,
|
||||||
|
open = "SymbolsOutline",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -10,6 +10,7 @@ return {
|
|||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
table.insert(opts.sources, nls.builtins.formatting.black)
|
table.insert(opts.sources, nls.builtins.formatting.black)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -10,6 +10,7 @@ return {
|
|||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
table.insert(opts.sources, nls.builtins.formatting.prettierd)
|
table.insert(opts.sources, nls.builtins.formatting.prettierd)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -12,8 +12,7 @@ return {
|
|||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
|
||||||
nls.builtins.diagnostics.cmake_lint,
|
nls.builtins.diagnostics.cmake_lint,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
@ -19,8 +19,7 @@ return {
|
|||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
|
||||||
nls.builtins.diagnostics.hadolint,
|
nls.builtins.diagnostics.hadolint,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
@ -37,8 +37,7 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
|
||||||
nls.builtins.diagnostics.credo,
|
nls.builtins.diagnostics.credo,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
@ -61,7 +61,7 @@ return {
|
|||||||
gopls = function(_, opts)
|
gopls = function(_, opts)
|
||||||
-- workaround for gopls not supporting semanticTokensProvider
|
-- workaround for gopls not supporting semanticTokensProvider
|
||||||
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
|
||||||
require("lazyvim.util").on_attach(function(client, _)
|
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||||
if client.name == "gopls" then
|
if client.name == "gopls" then
|
||||||
if not client.server_capabilities.semanticTokensProvider then
|
if not client.server_capabilities.semanticTokensProvider then
|
||||||
local semantic = client.config.capabilities.textDocument.semanticTokens
|
local semantic = client.config.capabilities.textDocument.semanticTokens
|
||||||
@ -86,14 +86,12 @@ return {
|
|||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if type(opts.sources) == "table" then
|
local nls = require("null-ls")
|
||||||
local nls = require("null-ls")
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
nls.builtins.code_actions.gomodifytags,
|
||||||
nls.builtins.code_actions.gomodifytags,
|
nls.builtins.code_actions.impl,
|
||||||
nls.builtins.code_actions.impl,
|
nls.builtins.formatting.goimports,
|
||||||
nls.builtins.formatting.goimports,
|
})
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ return {
|
|||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
|
opts.sources = opts.sources or {}
|
||||||
table.insert(opts.sources, nls.builtins.formatting.csharpier)
|
table.insert(opts.sources, nls.builtins.formatting.csharpier)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -16,7 +16,7 @@ return {
|
|||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
ruff_lsp = function()
|
ruff_lsp = function()
|
||||||
require("lazyvim.util").on_attach(function(client, _)
|
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||||
if client.name == "ruff_lsp" then
|
if client.name == "ruff_lsp" then
|
||||||
-- Disable hover in favor of Pyright
|
-- Disable hover in favor of Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
|
@ -28,13 +28,11 @@ return {
|
|||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
if type(opts.sources) == "table" then
|
local null_ls = require("null-ls")
|
||||||
local null_ls = require("null-ls")
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
vim.list_extend(opts.sources, {
|
null_ls.builtins.formatting.terraform_fmt,
|
||||||
null_ls.builtins.formatting.terraform_fmt,
|
null_ls.builtins.diagnostics.terraform_validate,
|
||||||
null_ls.builtins.diagnostics.terraform_validate,
|
})
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ return {
|
|||||||
yamlls = function()
|
yamlls = function()
|
||||||
-- Neovim < 0.10 does not have dynamic registration for formatting
|
-- Neovim < 0.10 does not have dynamic registration for formatting
|
||||||
if vim.fn.has("nvim-0.10") == 0 then
|
if vim.fn.has("nvim-0.10") == 0 then
|
||||||
require("lazyvim.util").on_attach(function(client, _)
|
require("lazyvim.util").lsp.on_attach(function(client, _)
|
||||||
if client.name == "yamlls" then
|
if client.name == "yamlls" then
|
||||||
client.server_capabilities.documentFormattingProvider = true
|
client.server_capabilities.documentFormattingProvider = true
|
||||||
end
|
end
|
||||||
|
@ -14,22 +14,37 @@ return {
|
|||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
eslint = function()
|
eslint = function()
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
local function get_client(buf)
|
||||||
callback = function(event)
|
return require("lazyvim.util").lsp.get_clients({ name = "eslint", bufnr = buf })[1]
|
||||||
if not require("lazyvim.plugins.lsp.format").enabled() then
|
end
|
||||||
-- exit early if autoformat is not enabled
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local client = require("lazyvim.util").get_clients({ bufnr = event.buf, name = "eslint" })[1]
|
local formatter = require("lazyvim.util").lsp.formatter({
|
||||||
|
name = "eslint: lsp",
|
||||||
|
primary = false,
|
||||||
|
priority = 200,
|
||||||
|
filter = "eslint",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use EslintFixAll on Neovim < 0.10.0
|
||||||
|
if not pcall(require, "vim.lsp._dynamic") then
|
||||||
|
formatter.name = "eslint: EslintFixAll"
|
||||||
|
formatter.sources = function(buf)
|
||||||
|
local client = get_client(buf)
|
||||||
|
return client and { "eslint" } or {}
|
||||||
|
end
|
||||||
|
formatter.format = function(buf)
|
||||||
|
local client = get_client(buf)
|
||||||
if client then
|
if client then
|
||||||
local diag = vim.diagnostic.get(event.buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
|
local diag = vim.diagnostic.get(buf, { namespace = vim.lsp.diagnostic.get_namespace(client.id) })
|
||||||
if #diag > 0 then
|
if #diag > 0 then
|
||||||
vim.cmd("EslintFixAll")
|
vim.cmd("EslintFixAll")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end
|
||||||
})
|
end
|
||||||
|
|
||||||
|
-- register the formatter with LazyVim
|
||||||
|
require("lazyvim.util").format.register(formatter)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
45
lua/lazyvim/plugins/extras/lsp/none-ls.lua
Normal file
45
lua/lazyvim/plugins/extras/lsp/none-ls.lua
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- none-ls
|
||||||
|
{
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
event = "LazyFile",
|
||||||
|
dependencies = { "mason.nvim" },
|
||||||
|
init = function()
|
||||||
|
Util.on_very_lazy(function()
|
||||||
|
-- register the formatter with LazyVim
|
||||||
|
require("lazyvim.util").format.register({
|
||||||
|
name = "none-ls.nvim",
|
||||||
|
priority = 200, -- set higher than conform, the builtin formatter
|
||||||
|
primary = true,
|
||||||
|
format = function(buf)
|
||||||
|
return Util.lsp.format({
|
||||||
|
bufnr = buf,
|
||||||
|
filter = function(client)
|
||||||
|
return client.name == "null-ls"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
sources = function(buf)
|
||||||
|
local ret = require("null-ls.sources").get_available(vim.bo[buf].filetype, "NULL_LS_FORMATTING") or {}
|
||||||
|
return vim.tbl_map(function(source)
|
||||||
|
return source.name
|
||||||
|
end, ret)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local nls = require("null-ls")
|
||||||
|
opts.root_dir = opts.root_dir
|
||||||
|
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
|
||||||
|
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||||
|
nls.builtins.formatting.fish_indent,
|
||||||
|
nls.builtins.diagnostics.fish,
|
||||||
|
nls.builtins.formatting.stylua,
|
||||||
|
nls.builtins.formatting.shfmt,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
79
lua/lazyvim/plugins/extras/ui/alpha.lua
Normal file
79
lua/lazyvim/plugins/extras/ui/alpha.lua
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
return {
|
||||||
|
|
||||||
|
{ "glepnir/dashboard-nvim", enabled = false },
|
||||||
|
{ "echasnovski/mini.starter", enabled = false },
|
||||||
|
-- Dashboard. This runs when neovim starts, and is what displays
|
||||||
|
-- the "LAZYVIM" banner.
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
enabled = true,
|
||||||
|
init = false,
|
||||||
|
opts = function()
|
||||||
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
|
local logo = [[
|
||||||
|
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||||
|
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||||
|
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||||
|
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||||
|
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||||
|
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||||
|
]]
|
||||||
|
|
||||||
|
dashboard.section.header.val = vim.split(logo, "\n")
|
||||||
|
-- stylua: ignore
|
||||||
|
dashboard.section.buttons.val = {
|
||||||
|
dashboard.button("f", " " .. " Find file", "<cmd> Telescope find_files <cr>"),
|
||||||
|
dashboard.button("n", " " .. " New file", "<cmd> ene <BAR> startinsert <cr>"),
|
||||||
|
dashboard.button("r", " " .. " Recent files", "<cmd> Telescope oldfiles <cr>"),
|
||||||
|
dashboard.button("g", " " .. " Find text", "<cmd> Telescope live_grep <cr>"),
|
||||||
|
dashboard.button("c", " " .. " Config", "<cmd> e $MYVIMRC <cr>"),
|
||||||
|
dashboard.button("s", " " .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
|
||||||
|
dashboard.button("e", " " .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
|
||||||
|
dashboard.button("l", " " .. " Lazy", "<cmd> Lazy <cr>"),
|
||||||
|
dashboard.button("q", " " .. " Quit", "<cmd> qa <cr>"),
|
||||||
|
}
|
||||||
|
for _, button in ipairs(dashboard.section.buttons.val) do
|
||||||
|
button.opts.hl = "AlphaButtons"
|
||||||
|
button.opts.hl_shortcut = "AlphaShortcut"
|
||||||
|
end
|
||||||
|
dashboard.section.header.opts.hl = "AlphaHeader"
|
||||||
|
dashboard.section.buttons.opts.hl = "AlphaButtons"
|
||||||
|
dashboard.section.footer.opts.hl = "AlphaFooter"
|
||||||
|
dashboard.opts.layout[1].val = 8
|
||||||
|
return dashboard
|
||||||
|
end,
|
||||||
|
config = function(_, dashboard)
|
||||||
|
-- close Lazy and re-open when the dashboard is ready
|
||||||
|
if vim.o.filetype == "lazy" then
|
||||||
|
vim.cmd.close()
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
once = true,
|
||||||
|
pattern = "AlphaReady",
|
||||||
|
callback = function()
|
||||||
|
require("lazy").show()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
require("alpha").setup(dashboard.opts)
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
once = true,
|
||||||
|
pattern = "LazyVimStarted",
|
||||||
|
callback = function()
|
||||||
|
local stats = require("lazy").stats()
|
||||||
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
|
dashboard.section.footer.val = "⚡ Neovim loaded "
|
||||||
|
.. stats.loaded
|
||||||
|
.. "/"
|
||||||
|
.. stats.count
|
||||||
|
.. " plugins in "
|
||||||
|
.. ms
|
||||||
|
.. "ms"
|
||||||
|
pcall(vim.cmd.AlphaRedraw)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -1,64 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "goolord/alpha-nvim", enabled = false },
|
|
||||||
{ "echasnovski/mini.starter", enabled = false },
|
|
||||||
{
|
|
||||||
"glepnir/dashboard-nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
opts = function()
|
|
||||||
local logo = [[
|
|
||||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
|
||||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
|
||||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
|
||||||
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
|
||||||
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
|
||||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
|
||||||
]]
|
|
||||||
|
|
||||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
|
||||||
|
|
||||||
local opts = {
|
|
||||||
theme = "doom",
|
|
||||||
hide = {
|
|
||||||
-- this is taken care of by lualine
|
|
||||||
-- enabling this messes up the actual laststatus setting after loading a file
|
|
||||||
statusline = false,
|
|
||||||
},
|
|
||||||
config = {
|
|
||||||
header = vim.split(logo, "\n"),
|
|
||||||
center = {
|
|
||||||
{ action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
|
|
||||||
{ action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
|
|
||||||
{ action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
|
|
||||||
{ action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
|
|
||||||
{ action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" },
|
|
||||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
|
||||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
|
||||||
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
|
||||||
},
|
|
||||||
footer = function()
|
|
||||||
local stats = require("lazy").stats()
|
|
||||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
|
||||||
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, button in ipairs(opts.config.center) do
|
|
||||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- close Lazy and re-open when the dashboard is ready
|
|
||||||
if vim.o.filetype == "lazy" then
|
|
||||||
vim.cmd.close()
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "DashboardLoaded",
|
|
||||||
callback = function()
|
|
||||||
require("lazy").show()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
return opts
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
@ -105,15 +105,6 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
local Util = require("lazyvim.util")
|
|
||||||
if Util.has("symbols-outline.nvim") then
|
|
||||||
table.insert(opts.left, {
|
|
||||||
title = "Outline",
|
|
||||||
ft = "Outline",
|
|
||||||
pinned = true,
|
|
||||||
open = "SymbolsOutline",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
@ -29,13 +29,14 @@ return {
|
|||||||
evaluate_single = true,
|
evaluate_single = true,
|
||||||
header = logo,
|
header = logo,
|
||||||
items = {
|
items = {
|
||||||
new_section("Find file", "Telescope find_files", "Telescope"),
|
new_section("Find file", "Telescope find_files", "Telescope"),
|
||||||
new_section("Recent files", "Telescope oldfiles", "Telescope"),
|
new_section("Recent files", "Telescope oldfiles", "Telescope"),
|
||||||
new_section("Grep text", "Telescope live_grep", "Telescope"),
|
new_section("Grep text", "Telescope live_grep", "Telescope"),
|
||||||
new_section("init.lua", "e $MYVIMRC", "Config"),
|
new_section("init.lua", "e $MYVIMRC", "Config"),
|
||||||
new_section("Lazy", "Lazy", "Config"),
|
new_section("Extras", "LazyExtras", "Config"),
|
||||||
new_section("New file", "ene | startinsert", "Built-in"),
|
new_section("Lazy", "Lazy", "Config"),
|
||||||
new_section("Quit", "qa", "Built-in"),
|
new_section("New file", "ene | startinsert", "Built-in"),
|
||||||
|
new_section("Quit", "qa", "Built-in"),
|
||||||
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
|
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
|
||||||
},
|
},
|
||||||
content_hooks = {
|
content_hooks = {
|
||||||
|
@ -18,9 +18,20 @@ return {
|
|||||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
-- Install the conform formatter on VeryLazy
|
-- Install the conform formatter on VeryLazy
|
||||||
require("lazyvim.util").on_very_lazy(function()
|
require("lazyvim.util").on_very_lazy(function()
|
||||||
require("lazyvim.plugins.lsp.format").custom_format = function(buf)
|
require("lazyvim.util").format.register({
|
||||||
return require("conform").format({ bufnr = buf })
|
name = "conform.nvim",
|
||||||
end
|
priority = 100,
|
||||||
|
primary = true,
|
||||||
|
format = function(buf)
|
||||||
|
require("conform").format({ bufnr = buf })
|
||||||
|
end,
|
||||||
|
sources = function(buf)
|
||||||
|
local ret = require("conform").list_formatters(buf)
|
||||||
|
return vim.tbl_map(function(v)
|
||||||
|
return v.name
|
||||||
|
end, ret)
|
||||||
|
end,
|
||||||
|
})
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user