update astronvim to v3
This commit is contained in:
parent
5ff843d62d
commit
72fe433bc2
19 changed files with 432 additions and 413 deletions
|
|
@ -1,5 +1,21 @@
|
|||
return {
|
||||
n = {
|
||||
|
||||
-- Buffers
|
||||
["H"] = {
|
||||
|
||||
function()
|
||||
require("astronvim.utils.buffer").nav( -(vim.v.count > 0 and vim.v.count or 1))
|
||||
end,
|
||||
desc = "Previous buffer",
|
||||
},
|
||||
["L"] = {
|
||||
function()
|
||||
require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1)
|
||||
end,
|
||||
desc = "Next buffer",
|
||||
},
|
||||
|
||||
["<C-t>"] = { "<cmd>ToggleTerm<cr>", desc = "Toggle terminal" },
|
||||
["<leader>fn"] = false,
|
||||
["<leader>fo"] = false,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
local alpha_button = astronvim.alpha_button
|
||||
return {
|
||||
layout = {
|
||||
{ type = "padding", val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }) },
|
||||
{
|
||||
type = "text",
|
||||
val = astronvim.user_plugin_opts("header", {
|
||||
"goolord/alpha-nvim",
|
||||
opts = function()
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
" ████ ███ █████ █████ ",
|
||||
" ░░███ ░░░ ░░███ ░░███ ",
|
||||
" ██████ ░███ ██████ ████ ███████ ░███ █████",
|
||||
|
|
@ -13,19 +11,24 @@ return {
|
|||
" ███░░███ ░███ ░███░░░ ░███ ░███ ░███ ░███░░███ ",
|
||||
"░░████████ █████░░██████ █████░░████████ ████ █████",
|
||||
" ░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░ ░░░░░ ",
|
||||
}, false),
|
||||
opts = { position = "center", hl = "DashboardHeader" },
|
||||
},
|
||||
{ type = "padding", val = 5 },
|
||||
{
|
||||
type = "group",
|
||||
val = {
|
||||
alpha_button("LDR f p", " Recent Project "),
|
||||
alpha_button("LDR f f", " Find File "),
|
||||
alpha_button("LDR o", "פּ File Explorer "),
|
||||
alpha_button("LDR m a", " Bookmarks "),
|
||||
},
|
||||
opts = { spacing = 1 },
|
||||
},
|
||||
},
|
||||
}
|
||||
dashboard.section.header.opts.hl = "DashboardHeader"
|
||||
|
||||
local button = require("astronvim.utils").alpha_button
|
||||
dashboard.section.buttons.val = {
|
||||
button("LDR f p", " Recent Project "),
|
||||
button("LDR f f", " Find File "),
|
||||
button("LDR o", "פּ File Explorer "),
|
||||
button("LDR m a", " Bookmarks "),
|
||||
}
|
||||
|
||||
dashboard.section.footer.val =
|
||||
{ " ", " ", " ", "AstroNvim loaded " .. require("lazy").stats().count .. " plugins " }
|
||||
dashboard.section.footer.opts.hl = "DashboardFooter"
|
||||
|
||||
dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
|
||||
dashboard.config.layout[3].val = 5
|
||||
dashboard.config.opts.noautocmd = true
|
||||
return dashboard
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
local catppuccin = require("catppuccin")
|
||||
|
||||
-- configure it
|
||||
catppuccin.setup({
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
-- configure it
|
||||
opts = {
|
||||
transparent_background = true,
|
||||
term_colors = false,
|
||||
styles = {
|
||||
|
|
@ -52,10 +53,10 @@ catppuccin.setup({
|
|||
show_root = true,
|
||||
transparent_panel = false,
|
||||
},
|
||||
dap = { enabled = false, enable_ui = false },
|
||||
dap = { enabled = true, enable_ui = false },
|
||||
which_key = true,
|
||||
dashboard = true,
|
||||
neogit = false,
|
||||
neogit = true,
|
||||
vim_sneak = false,
|
||||
fern = false,
|
||||
barbar = true,
|
||||
|
|
@ -65,8 +66,9 @@ catppuccin.setup({
|
|||
ts_rainbow = true,
|
||||
hop = false,
|
||||
notify = true,
|
||||
telekasten = true,
|
||||
telekasten = false,
|
||||
symbols_outline = true,
|
||||
mini = false,
|
||||
},
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
require("harpoon").setup({
|
||||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
config = function()
|
||||
require("harpoon").setup({
|
||||
global_settings = {
|
||||
-- sets the marks upon calling `toggle` on the ui, instead of require `:w`.
|
||||
save_on_toggle = true,
|
||||
|
|
@ -28,47 +31,38 @@ require("harpoon").setup({
|
|||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
local tmux = require("harpoon.tmux")
|
||||
local telescope = require("telescope")
|
||||
})
|
||||
|
||||
local command_prompt = "Enter command: "
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
local telescope = require("telescope")
|
||||
|
||||
telescope.load_extension("harpoon")
|
||||
telescope.load_extension("harpoon")
|
||||
|
||||
local function map(key, func, desc)
|
||||
local function map(key, func, desc)
|
||||
vim.keymap.set("n", "<leader><leader>" .. key, func, { desc = desc })
|
||||
end
|
||||
end
|
||||
|
||||
map("n", mark.add_file, "Add mark")
|
||||
map("n", mark.add_file, "Add mark")
|
||||
|
||||
map("t", ui.toggle_quick_menu, "Toogle UI")
|
||||
map("t", ui.toggle_quick_menu, "Toogle UI")
|
||||
|
||||
map("j", function()
|
||||
map("j", function()
|
||||
ui.nav_file(1)
|
||||
end, "Navigate to file 1")
|
||||
end, "Navigate to file 1")
|
||||
|
||||
map("k", function()
|
||||
map("k", function()
|
||||
ui.nav_file(2)
|
||||
end, "Navigate to file 2")
|
||||
end, "Navigate to file 2")
|
||||
|
||||
map("l", function()
|
||||
map("l", function()
|
||||
ui.nav_file(3)
|
||||
end, "Navigate to file 3")
|
||||
end, "Navigate to file 3")
|
||||
|
||||
map("ñ", function()
|
||||
map("ñ", function()
|
||||
ui.nav_file(4)
|
||||
end, "Navigate to file 4")
|
||||
end, "Navigate to file 4")
|
||||
|
||||
map("g", function()
|
||||
local input = vim.fn.input(command_prompt)
|
||||
tmux.sendCommand("{next}", input)
|
||||
end, "Send command to tmux pane 1")
|
||||
|
||||
map("G", function()
|
||||
tmux.sendCommand("{next}", "\3")
|
||||
end, "Send command to tmux pane 1")
|
||||
|
||||
map("T", "<CMD>Telescope harpoon marks<CR>", "Open marks in telescope")
|
||||
map("T", "<CMD>Telescope harpoon marks<CR>", "Open marks in telescope")
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,80 +1,39 @@
|
|||
return {
|
||||
["/nvim-neo-tree/neo-tree.nvim"] = { disable = true },
|
||||
["rcarriga/nvim-notify"] = { disable = true },
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
{ "rcarriga/nvim-notify", enabled = false },
|
||||
--
|
||||
["catppuccin/nvim"] = {
|
||||
as = "catppuccin",
|
||||
config = function()
|
||||
require("user.plugins.catppuccin")
|
||||
end,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
},
|
||||
["nvim-treesitter/nvim-treesitter-context"] = {
|
||||
config = function()
|
||||
require("treesitter-context").setup()
|
||||
end,
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
},
|
||||
["kyazdani42/nvim-tree.lua"] = {
|
||||
config = function()
|
||||
require("user.plugins.nvim-tree")
|
||||
end,
|
||||
},
|
||||
["kylechui/nvim-surround"] = {
|
||||
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end,
|
||||
},
|
||||
["s1n7ax/nvim-comment-frame"] = {
|
||||
requires = {
|
||||
{ "nvim-treesitter" },
|
||||
},
|
||||
config = function()
|
||||
require("nvim-comment-frame").setup({
|
||||
{
|
||||
"s1n7ax/nvim-comment-frame",
|
||||
dependencies = { "nvim-treesitter" },
|
||||
config = {
|
||||
disable_default_keymap = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
["danymat/neogen"] = {
|
||||
config = function()
|
||||
require("neogen").setup({ snippet_engine = "luasnip" })
|
||||
end,
|
||||
requires = "nvim-treesitter/nvim-treesitter",
|
||||
tag = "*", -- stable releases
|
||||
},
|
||||
["folke/todo-comments.nvim"] = {
|
||||
requires = "nvim-lua/plenary.nvim",
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
end,
|
||||
{
|
||||
"danymat/neogen",
|
||||
config = { snippet_engine = "luasnip" },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
version = "*", -- stable releases
|
||||
},
|
||||
["folke/trouble.nvim"] = {
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
config = function()
|
||||
require("user.plugins.trouble")
|
||||
end,
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
["anuvyklack/pretty-fold.nvim"] = {
|
||||
config = function()
|
||||
require("user.plugins.pretty-fold")
|
||||
end,
|
||||
},
|
||||
["simrat39/rust-tools.nvim"] = {
|
||||
after = "mason-lspconfig.nvim", -- make sure to load after mason-lspconfig
|
||||
{
|
||||
"simrat39/rust-tools.nvim",
|
||||
dependencies = { "mason-lspconfig.nvim" }, -- make sure to load after mason-lspconfig
|
||||
config = function()
|
||||
local lsp = require("astronvim.utils.lsp")
|
||||
require("rust-tools").setup({
|
||||
server = astronvim.lsp.server_settings("rust_analyzer"), -- get the server settings and built in capabilities/on_attach
|
||||
server = lsp.config("rust_analyzer"), -- get the server settings and built in capabilities/on_attach
|
||||
})
|
||||
end,
|
||||
},
|
||||
["ThePrimeagen/harpoon"] = {
|
||||
config = function()
|
||||
require("user.plugins.harpoon")
|
||||
end,
|
||||
},
|
||||
["ckolkey/ts-node-action"] = {
|
||||
requires = { "nvim-treesitter" },
|
||||
config = function()
|
||||
require("user.plugins.ts-node-action")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
return {
|
||||
ensure_installed = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function(plugin, opts)
|
||||
opts["ensure_installed"] = {
|
||||
"bashls",
|
||||
"cssls",
|
||||
"dockerls",
|
||||
|
|
@ -11,5 +13,7 @@ return {
|
|||
"sumneko_lua",
|
||||
"tsserver",
|
||||
"yamlls",
|
||||
},
|
||||
}
|
||||
require("plugins.configs.mason-lspconfig")(plugin, opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
return {
|
||||
ensure_installed = {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
config = function(plugin, opts)
|
||||
opts["ensure_installed"] = {
|
||||
"blade_formatter",
|
||||
"blue",
|
||||
"eslint_d",
|
||||
|
|
@ -15,5 +17,7 @@ return {
|
|||
"sql-formatter",
|
||||
"stylua",
|
||||
"yamlint",
|
||||
},
|
||||
}
|
||||
require("plugins.configs.mason-null-ls")(plugin, opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
return function(config)
|
||||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
opts = function(opts)
|
||||
local null_ls = require("null-ls")
|
||||
config.sources = {
|
||||
opts.sources = {
|
||||
null_ls.builtins.formatting.prettierd.with({
|
||||
disabled_filetypes = { "markdown" },
|
||||
}),
|
||||
|
|
@ -12,5 +14,5 @@ return function(config)
|
|||
},
|
||||
}),
|
||||
}
|
||||
return config
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
local tree = require("nvim-tree")
|
||||
local tree_cb = require("nvim-tree.config").nvim_tree_callback
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
-- enabled = false,
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
lazy = false,
|
||||
config = function()
|
||||
local tree = require("nvim-tree")
|
||||
local tree_cb = require("nvim-tree.config").nvim_tree_callback
|
||||
|
||||
tree.setup({
|
||||
tree.setup({
|
||||
hijack_unnamed_buffer_when_opening = true,
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
|
|
@ -39,11 +48,11 @@ tree.setup({
|
|||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
-- Auto open when a dir is opened
|
||||
-- Auto open when a dir is opened
|
||||
|
||||
local function open_nvim_tree(data)
|
||||
local function open_nvim_tree(data)
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
|
|
@ -62,10 +71,12 @@ local function open_nvim_tree(data)
|
|||
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
|
||||
-- bindings
|
||||
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
vim.keymap.set("n", "<C-e>", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
-- bindings
|
||||
vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
vim.keymap.set("n", "<C-e>", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
require("pretty-fold").setup({
|
||||
return {
|
||||
"anuvyklack/pretty-fold.nvim",
|
||||
config = {
|
||||
sections = {
|
||||
left = {
|
||||
"+",
|
||||
|
|
@ -36,4 +38,5 @@ require("pretty-fold").setup({
|
|||
},
|
||||
|
||||
ft_ignore = { "neorg" },
|
||||
})
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
local telescope_actions = require("telescope.actions")
|
||||
|
||||
return {
|
||||
defaults = {
|
||||
mappings = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = function(plugin, opts)
|
||||
local actions = require("telescope.actions")
|
||||
opts.defaults.mappings = {
|
||||
i = {
|
||||
["<C-j>"] = telescope_actions.move_selection_next,
|
||||
["<C-k>"] = telescope_actions.move_selection_previous,
|
||||
["<C-s>"] = telescope_actions.file_vsplit,
|
||||
["<C-v>"] = telescope_actions.file_split,
|
||||
["<ESC>"] = telescope_actions.close,
|
||||
},
|
||||
},
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-s>"] = actions.file_vsplit,
|
||||
["<C-v>"] = actions.file_split,
|
||||
["<ESC>"] = actions.close,
|
||||
},
|
||||
}
|
||||
require("plugins.configs.telescope")(plugin, opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
return {
|
||||
ensure_installed = { "javascript", "typescript", "php", "python", "lua", "bash", "sql", "yaml", "json" },
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = function(plugin, opts)
|
||||
opts.ensure_installed = { "javascript", "typescript", "php", "python", "lua", "bash", "sql", "yaml", "json" }
|
||||
require("plugins.configs.nvim-treesitter")(plugin, opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
require("trouble").setup({
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
-- dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("trouble").setup({
|
||||
mode = "document_diagnostics",
|
||||
action_keys = { -- key mappings for actions in the trouble list
|
||||
-- map to {} to remove a mapping, for example:
|
||||
|
|
@ -21,6 +25,8 @@ require("trouble").setup({
|
|||
previous = "k", -- previous item
|
||||
next = "j", -- next item
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fd", "<cmd>TroubleToggle<cr>", { silent = true, desc = "Search diagnostics" })
|
||||
vim.keymap.set("n", "<leader>fd", "<cmd>TroubleToggle<cr>", { silent = true, desc = "Search diagnostics" })
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
require("ts-node-action").setup({})
|
||||
return {
|
||||
"ckolkey/ts-node-action",
|
||||
dependencies = { "nvim-treesitter", "null-ls" },
|
||||
config = function()
|
||||
require("ts-node-action").setup({})
|
||||
|
||||
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Trigger Node Action" })
|
||||
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Trigger Node Action" })
|
||||
|
||||
require("null-ls").register({
|
||||
require("null-ls").register({
|
||||
name = "more_actions",
|
||||
method = { require("null-ls").methods.CODE_ACTION },
|
||||
filetypes = { "_all" },
|
||||
generator = {
|
||||
fn = require("ts-node-action").available_actions,
|
||||
},
|
||||
})
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
return {
|
||||
use_winbar = "always",
|
||||
"s1n7ax/nvim-window-picker",
|
||||
config = function(plugin, opts)
|
||||
opts.use_winbar = "always"
|
||||
require("plugins.configs.nvim-window-picker")(plugin, opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ return function()
|
|||
local function alpha_on_bye(cmd)
|
||||
local bufs = vim.fn.getbufinfo({ buflisted = true })
|
||||
vim.cmd(cmd)
|
||||
if require("core.utils").is_available("alpha-nvim") and not bufs[2] then
|
||||
if require("astronvim.utils").is_available("alpha-nvim") and not bufs[2] then
|
||||
require("alpha").start(true)
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.del("n", "<leader>C")
|
||||
|
||||
if require("core.utils").is_available("bufdelete.nvim") then
|
||||
if require("astronvim.utils").is_available("bufdelete.nvim") then
|
||||
vim.keymap.set("n", "<leader>C", function()
|
||||
alpha_on_bye("Bdelete!")
|
||||
end, { desc = "Close buffer" })
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -27,5 +27,5 @@ sidebar_config = 1
|
|||
|
||||
; DO NOT CHANGE!
|
||||
[Backup]
|
||||
version = 1.1.84.716.gc5f8b819
|
||||
version = 1.2.8.923.g4f94bf0d
|
||||
with = 2.16.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue