feat: revamp core configuration for improved customizability
This commit is contained in:
1 parent
cee08ee5ec
commit
087a24541f
17 files changed
+604
-129
No files matched your search
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
"GeorgesAlkhouri/nvim-aider",
|
||||
cmd = {
|
||||
"AiderTerminalToggle",
|
||||
"AiderHealth",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>a/", "<cmd>AiderTerminalToggle<cr>", desc = "Open Aider" },
|
||||
{ "<leader>as", "<cmd>AiderTerminalSend<cr>", desc = "Send to Aider", mode = { "n", "v" } },
|
||||
{ "<leader>ac", "<cmd>AiderQuickSendCommand<cr>", desc = "Send Command To Aider" },
|
||||
{ "<leader>ab", "<cmd>AiderQuickSendBuffer<cr>", desc = "Send Buffer To Aider" },
|
||||
{ "<leader>a+", "<cmd>AiderQuickAddFile<cr>", desc = "Add File to Aider" },
|
||||
{ "<leader>a-", "<cmd>AiderQuickDropFile<cr>", desc = "Drop File from Aider" },
|
||||
{ "<leader>ar", "<cmd>AiderQuickReadOnlyFile<cr>", desc = "Add File as Read-Only" },
|
||||
-- Example nvim-tree.lua integration if needed
|
||||
{ "<leader>a+", "<cmd>AiderTreeAddFile<cr>", desc = "Add File from Tree to Aider", ft = "NvimTree" },
|
||||
{ "<leader>a-", "<cmd>AiderTreeDropFile<cr>", desc = "Drop File from Tree from Aider", ft = "NvimTree" },
|
||||
},
|
||||
dependencies = {
|
||||
"folke/snacks.nvim",
|
||||
--- The below dependencies are optional
|
||||
"catppuccin/nvim",
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
--- Neo-tree integration
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = function(_, opts)
|
||||
-- Example mapping configuration (already set by default)
|
||||
opts.window = {
|
||||
mappings = {
|
||||
["+"] = { "nvim_aider_add", desc = "add to aider" },
|
||||
["-"] = { "nvim_aider_drop", desc = "drop from aider" },
|
||||
},
|
||||
}
|
||||
require("nvim_aider.neo_tree").setup(opts)
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = true,
|
||||
}
|
||||
@@ -1,9 +1,3 @@
|
||||
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
|
||||
-- Configuration documentation can be found with `:h astrocore`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
@@ -18,11 +12,17 @@ return {
|
||||
{ ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
|
||||
{
|
||||
"lua",
|
||||
"Taskfile.yml",
|
||||
"devbox.json",
|
||||
"Cargo.toml",
|
||||
"go.work",
|
||||
"Pipfile",
|
||||
"Makefile",
|
||||
"requirements.txt",
|
||||
"README.md",
|
||||
"devbox.json",
|
||||
"package.json",
|
||||
"go.mod",
|
||||
}, -- lastly check for a file named `main`
|
||||
},
|
||||
-- ignore things from root detection
|
||||
@@ -78,7 +78,6 @@ return {
|
||||
["vv"] = { "gg0VG$", desc = "Select all contents in buffer" },
|
||||
["<C-Space>"] = { "<Cmd>Telescope oldfiles<CR>", desc = "Recent Files" },
|
||||
["<C-m>"] = { "<Cmd>OverseerRun<CR>", desc = "Overseer" },
|
||||
["<C-d>"] = { "<Cmd>Telescope diagnostics<CR>", desc = "Show Errors" },
|
||||
["<C-u>"] = { "<Cmd>Telescope lsp_document_symbols<CR>", desc = "Show Symbols" },
|
||||
["<C-c>"] = { function() vim.cmd "bd" end, desc = "Close window" },
|
||||
["<C-q>"] = { "<Cmd>wa<CR><Cmd>qa!<CR>", desc = "Save and Quit Neovim" },
|
||||
@@ -89,8 +88,24 @@ return {
|
||||
v = {
|
||||
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Show Explorer" },
|
||||
},
|
||||
|
||||
t = {
|
||||
["<Esc>"] = { [[<C-\><C-n>]], desc = "Exit terminal mode" },
|
||||
["<Esc>"] = {
|
||||
function()
|
||||
-- Check if we're in an Aider terminal buffer
|
||||
local current_buf = vim.api.nvim_get_current_buf()
|
||||
local buf_name = vim.api.nvim_buf_get_name(current_buf)
|
||||
|
||||
-- If the buffer name contains "Aider" (as seen in the screenshot)
|
||||
if buf_name:match "Aider" then
|
||||
vim.cmd "AiderTerminalToggle"
|
||||
else
|
||||
-- Default behavior: exit terminal mode
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes([[<C-\><C-n>]], true, false, true), "n", false)
|
||||
end
|
||||
end,
|
||||
desc = "Exit terminal mode or toggle Aider terminal",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,15 +1,109 @@
|
||||
-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine
|
||||
-- Configuration documentation can be found with `:h astrolsp`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
-- Configuration table of features provided by AstroLSP
|
||||
features = {
|
||||
codelens = true, -- enable/disable codelens refresh on start
|
||||
inlay_hints = false, -- enable/disable inlay hints on start
|
||||
semantic_tokens = true, -- enable/disable semantic token highlighting
|
||||
signature_help = true, -- enable/disable signature help on start
|
||||
},
|
||||
-- customize lsp formatting options
|
||||
formatting = {
|
||||
-- control auto formatting on save
|
||||
format_on_save = {
|
||||
enabled = true, -- enable or disable
|
||||
enabled = true, -- enable or disable format on save globally
|
||||
allow_filetypes = { -- enable format on save for specified filetypes only
|
||||
"go",
|
||||
"templ",
|
||||
"md",
|
||||
"json",
|
||||
"pkl",
|
||||
"yaml",
|
||||
},
|
||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||
"markdown",
|
||||
"python",
|
||||
-- "python",
|
||||
},
|
||||
},
|
||||
disabled = { -- disable formatting capabilities for the listed language servers
|
||||
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
|
||||
-- "lua_ls",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
-- return true
|
||||
-- end
|
||||
},
|
||||
-- enable servers that you already have installed without mason
|
||||
servers = {
|
||||
-- "pyright"
|
||||
},
|
||||
-- customize language server configuration options passed to `lspconfig`
|
||||
---@diagnostic disable: missing-fields
|
||||
config = {
|
||||
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
|
||||
},
|
||||
-- customize how language servers are attached
|
||||
handlers = {
|
||||
-- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server
|
||||
-- function(server, opts) require("lspconfig")[server].setup(opts) end
|
||||
|
||||
-- the key is the server that is being setup with `lspconfig`
|
||||
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
|
||||
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
|
||||
},
|
||||
-- Configure buffer local auto commands to add when attaching a language server
|
||||
autocmds = {
|
||||
-- first key is the `augroup` to add the auto commands to (:h augroup)
|
||||
lsp_codelens_refresh = {
|
||||
-- Optional condition to create/delete auto command group
|
||||
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
|
||||
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
|
||||
-- the auto commands will be deleted for that buffer
|
||||
cond = "textDocument/codeLens",
|
||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||
-- list of auto commands to set
|
||||
{
|
||||
-- events to trigger
|
||||
event = { "InsertLeave", "BufEnter" },
|
||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||
desc = "Refresh codelens (buffer)",
|
||||
callback = function(args)
|
||||
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- mappings to be set up on attaching of a language server
|
||||
mappings = {
|
||||
n = {
|
||||
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
|
||||
gD = {
|
||||
function() vim.lsp.buf.declaration() end,
|
||||
desc = "Declaration of current symbol",
|
||||
cond = "textDocument/declaration",
|
||||
},
|
||||
["<Leader>uY"] = {
|
||||
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
|
||||
desc = "Toggle LSP semantic highlight (buffer)",
|
||||
cond = function(client)
|
||||
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||
on_attach = function(client, bufnr)
|
||||
-- this would disable semanticTokensProvider for all clients
|
||||
-- client.server_capabilities.semanticTokensProvider = nil
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
-- AstroUI provides the basis for configuring the AstroNvim User Interface
|
||||
-- Configuration documentation can be found with `:h astroui`
|
||||
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
|
||||
-- as this provides autocomplete and documentation while editing
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astroui",
|
||||
@@ -5,5 +10,28 @@ return {
|
||||
opts = {
|
||||
-- change colorscheme
|
||||
colorscheme = "cyberdream",
|
||||
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
|
||||
highlights = {
|
||||
init = { -- this table overrides highlights in all themes
|
||||
-- Normal = { bg = "#000000" },
|
||||
},
|
||||
astrodark = { -- a table of overrides/changes when applying the astrotheme theme
|
||||
-- Normal = { bg = "#000000" },
|
||||
},
|
||||
},
|
||||
-- Icons can be configured throughout the interface
|
||||
icons = {
|
||||
-- configure the loading of the lsp in the status line
|
||||
LSPLoading1 = "⠋",
|
||||
LSPLoading2 = "⠙",
|
||||
LSPLoading3 = "⠹",
|
||||
LSPLoading4 = "⠸",
|
||||
LSPLoading5 = "⠼",
|
||||
LSPLoading6 = "⠴",
|
||||
LSPLoading7 = "⠦",
|
||||
LSPLoading8 = "⠧",
|
||||
LSPLoading9 = "⠇",
|
||||
LSPLoading10 = "⠏",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Mason
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
-- use mason-tool-installer for automatically installing Mason packages
|
||||
{
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
-- overrides `require("mason-tool-installer").setup(...)`
|
||||
opts = {
|
||||
-- Make sure to use the names found in `:Mason`
|
||||
ensure_installed = {
|
||||
-- install language servers
|
||||
"lua-language-server",
|
||||
|
||||
-- install formatters
|
||||
"stylua",
|
||||
|
||||
-- install debuggers
|
||||
"debugpy",
|
||||
|
||||
-- install any other package
|
||||
"tree-sitter-cli",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
+11
-13
@@ -6,11 +6,11 @@ return {
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
sort_case_insensitive = false,
|
||||
auto_expand_width = true,
|
||||
auto_expand_width = false,
|
||||
git_status_async = true, -- Asynchronous git status. Improves performance.
|
||||
hide_root_node = true, -- Hide the root node.
|
||||
retain_hidden_root_indent = true, -- IF the root node is hidden, keep the indentation anyhow.
|
||||
|
||||
use_libuv_file_watcher = true,
|
||||
-- Add custom title function to show host/org/repo
|
||||
window = {
|
||||
position = "left",
|
||||
@@ -86,7 +86,7 @@ return {
|
||||
file_size = {
|
||||
enabled = true,
|
||||
width = 12, -- width of the column
|
||||
required_width = 64, -- min width of window required to show this column
|
||||
required_width = 48, -- min width of window required to show this column
|
||||
},
|
||||
type = {
|
||||
enabled = true,
|
||||
@@ -131,20 +131,18 @@ return {
|
||||
},
|
||||
bind_to_cwd = true,
|
||||
follow_current_file = {
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
filtered_items = {
|
||||
force_visible_in_empty_folder = true,
|
||||
group_empty = true,
|
||||
show_hidden_count = false,
|
||||
hide_dotfiles = false,
|
||||
hide_dotfiles = true,
|
||||
hide_gitignored = true,
|
||||
hide_by_pattern = {
|
||||
".cz.toml",
|
||||
"dist",
|
||||
".python-version",
|
||||
"*_test.go",
|
||||
"*.pb.go",
|
||||
"*_templ.go",
|
||||
"buf.gen.*",
|
||||
@@ -158,23 +156,22 @@ return {
|
||||
hide_by_name = {
|
||||
".github",
|
||||
"settings.json",
|
||||
".taskfiles",
|
||||
".gitignore",
|
||||
"analysis_options.yaml",
|
||||
"decorators",
|
||||
"slumber.yml",
|
||||
"CHANGELOG.md",
|
||||
"devbox.d",
|
||||
"matrix",
|
||||
"env",
|
||||
"package-lock.json",
|
||||
".husky",
|
||||
"translations",
|
||||
"LICENSE.md",
|
||||
"node_modules",
|
||||
".tmuxinator.yml",
|
||||
".envrc",
|
||||
".taskfile.dist.yml",
|
||||
},
|
||||
never_show_by_pattern = {
|
||||
"node_modules",
|
||||
"PULL_REQUEST_TEMPLATE.md",
|
||||
".DocumentRevisions-V100",
|
||||
".Spotlight-V100",
|
||||
@@ -205,7 +202,9 @@ return {
|
||||
"*.ico",
|
||||
"build",
|
||||
"PklProject.deps.json",
|
||||
".aider.tags.cache.v4",
|
||||
"*.iml",
|
||||
"Icon?",
|
||||
},
|
||||
never_show = {
|
||||
".dart_tool",
|
||||
@@ -234,7 +233,7 @@ return {
|
||||
},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
enable = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
@@ -251,7 +250,6 @@ return {
|
||||
-- Main sources
|
||||
sources = {
|
||||
"filesystem",
|
||||
"diagnostics",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize None-ls sources
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
-- opts variable is the default configuration table for the setup function call
|
||||
-- local null_ls = require "null-ls"
|
||||
|
||||
-- Check supported formatters and linters
|
||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
|
||||
-- Only insert new sources, do not replace the existing ones
|
||||
-- (If you wish to replace, use `opts.sources = {}` instead of the `list_insert_unique` function)
|
||||
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
|
||||
-- Set a formatter
|
||||
-- null_ls.builtins.formatting.stylua,
|
||||
-- null_ls.builtins.formatting.prettier,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
-- function for calculating the current session name
|
||||
local get_session_name = function()
|
||||
local name = vim.fn.getcwd()
|
||||
local branch = vim.fn.system "git branch --show-current"
|
||||
if vim.v.shell_error == 0 then
|
||||
return name .. vim.trim(branch --[[@as string]])
|
||||
else
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
sessions = {
|
||||
-- disable the auto-saving of directory sessions
|
||||
autosave = { cwd = false },
|
||||
},
|
||||
mappings = {
|
||||
n = {
|
||||
-- update save dirsession mapping to get the correct session name
|
||||
["<Leader>SS"] = {
|
||||
function() require("resession").save(get_session_name(), { dir = "dirsession" }) end,
|
||||
desc = "Save this dirsession",
|
||||
},
|
||||
-- update load dirsession mapping to get the correct session name
|
||||
["<Leader>S."] = {
|
||||
function() require("resession").load(get_session_name(), { dir = "dirsession" }) end,
|
||||
desc = "Load current dirsession",
|
||||
},
|
||||
},
|
||||
},
|
||||
autocmds = {
|
||||
-- disable alpha autostart
|
||||
alpha_autostart = false,
|
||||
git_branch_sessions = {
|
||||
-- auto save directory sessions on leaving
|
||||
{
|
||||
event = "VimLeavePre",
|
||||
desc = "Save git branch directory sessions on close",
|
||||
callback = vim.schedule_wrap(function()
|
||||
if require("astrocore.buffer").is_valid_session() then
|
||||
require("resession").save(get_session_name(), { dir = "dirsession", notify = false })
|
||||
end
|
||||
end),
|
||||
},
|
||||
-- auto restore previous previous directory session, remove if necessary
|
||||
{
|
||||
event = "VimEnter",
|
||||
desc = "Restore previous directory session if neovim opened with no arguments",
|
||||
nested = true, -- trigger other autocommands as buffers open
|
||||
callback = function()
|
||||
-- Only load the session if nvim was started with no args
|
||||
if vim.fn.argc(-1) == 0 then
|
||||
-- try to load a directory session using the current working directory
|
||||
require("resession").load(get_session_name(), { dir = "dirsession", silence_errors = true })
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
---@param opts AstroLSPOpts
|
||||
opts = function(_, opts)
|
||||
if opts.mappings.n.gd then opts.mappings.n.gd[1] = function() require("snacks.picker").lsp_definitions() end end
|
||||
if opts.mappings.n.gI then opts.mappings.n.gI[1] = function() require("snacks.picker").lsp_implementations() end end
|
||||
if opts.mappings.n.gy then
|
||||
opts.mappings.n.gy[1] = function() require("snacks.picker").lsp_type_definitions() end
|
||||
end
|
||||
if opts.mappings.n["<Leader>lG"] then
|
||||
opts.mappings.n["<Leader>lG"][1] = function() require("snacks.picker").lsp_workspace_symbols() end
|
||||
end
|
||||
if opts.mappings.n["<Leader>lR"] then
|
||||
opts.mappings.n["<Leader>lR"][1] = function() require("snacks.picker").lsp_references() end
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
|
||||
|
||||
-- Customize Treesitter
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
}
|
||||
+93
-24
@@ -1,9 +1,20 @@
|
||||
-- You can also add or configure plugins by creating files in this `plugins/` folder
|
||||
-- PLEASE REMOVE THE EXAMPLES YOU HAVE NO INTEREST IN BEFORE ENABLING THIS FILE
|
||||
-- Here are some examples:
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
|
||||
-- == Examples of Adding Plugins ==
|
||||
|
||||
"andweeb/presence.nvim",
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "BufRead",
|
||||
config = function() require("lsp_signature").setup() end,
|
||||
},
|
||||
|
||||
-- == Examples of Overriding Plugins ==
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
@@ -24,7 +35,25 @@ return {
|
||||
{ "<C-g>", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"brianhuster/live-preview.nvim",
|
||||
dependencies = {
|
||||
-- You can choose one of the following pickers
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"ibhagwan/fzf-lua",
|
||||
"echasnovski/mini.pick",
|
||||
},
|
||||
},
|
||||
{
|
||||
"toppair/peek.nvim",
|
||||
event = { "VeryLazy" },
|
||||
build = "deno task --quiet build:fast",
|
||||
config = function()
|
||||
require("peek").setup()
|
||||
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
|
||||
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"chrisgrieser/nvim-rip-substitute",
|
||||
cmd = "RipSubstitute",
|
||||
@@ -37,33 +66,73 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
-- disable neo-tree
|
||||
-- customize dashboard options
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
enabled = true,
|
||||
opts = function(_, opts)
|
||||
-- customize the dashboard header
|
||||
opts.section.header.val = {
|
||||
" ▗▄████▄▖ ",
|
||||
" ▟███▛███▛▘ ",
|
||||
" ▄███▜▝ ▘▀ ▗ ",
|
||||
" ▗▟██▜▞▘ ▟██▖ ",
|
||||
" ▟██▛█▘ ▄▙▖ ▝▜█▜█▙ ",
|
||||
"▟██▜▀ ▄████▄ ▀██▟▙",
|
||||
"██▟▌ ▐████▟█▜ ▐▟██",
|
||||
"▜▛██▄ ▀▜▟█▛▀ ▄██▛▛",
|
||||
" ▜█▛█▙▖ ▝▀▌▘ ▗▟█▟▙▛ ",
|
||||
" ▝▜█▛▘ ▟██▟█▘ ",
|
||||
" ▘ ▄▄ ▄███▟▀ ",
|
||||
" ▗▟▜▛██▜█▜▞▘ ",
|
||||
" ▝▀████▀▘ ",
|
||||
}
|
||||
return opts
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
dashboard = {
|
||||
preset = {
|
||||
header = table.concat({
|
||||
" ▗▄████▄▖ ",
|
||||
" ▟███▛███▛▘ ",
|
||||
" ▄███▜▝ ▘▀ ▗ ",
|
||||
" ▗▟██▜▞▘ ▟██▖ ",
|
||||
" ▟██▛█▘ ▄▙▖ ▝▜█▜█▙ ",
|
||||
"▟██▜▀ ▄████▄ ▀██▟▙",
|
||||
"██▟▌ ▐████▟█▜ ▐▟██",
|
||||
"▜▛██▄ ▀▜▟█▛▀ ▄██▛▛",
|
||||
" ▜█▛█▙▖ ▝▀▌▘ ▗▟█▟▙▛ ",
|
||||
" ▝▜█▛▘ ▟██▟█▘ ",
|
||||
" ▘ ▄▄ ▄███▟▀ ",
|
||||
" ▗▟▜▛██▜█▜▞▘ ",
|
||||
" ▝▀████▀▘ ",
|
||||
}, "\n"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- You can disable default plugins as follows:
|
||||
{ "max397574/better-escape.nvim", enabled = false },
|
||||
|
||||
-- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function(plugin, opts)
|
||||
require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
|
||||
-- add more custom luasnip configuration such as filetype extend or custom snippets
|
||||
local luasnip = require "luasnip"
|
||||
luasnip.filetype_extend("javascript", { "javascriptreact" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Add SchemaStore.nvim to your plugin
|
||||
{
|
||||
"b0o/SchemaStore.nvim",
|
||||
"windwp/nvim-autopairs",
|
||||
config = function(plugin, opts)
|
||||
require "astronvim.plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
|
||||
-- add more custom autopairs configuration such as custom rules
|
||||
local npairs = require "nvim-autopairs"
|
||||
local Rule = require "nvim-autopairs.rule"
|
||||
local cond = require "nvim-autopairs.conds"
|
||||
npairs.add_rules(
|
||||
{
|
||||
Rule("$", "$", { "tex", "latex" })
|
||||
-- don't add a pair if the next character is %
|
||||
:with_pair(cond.not_after_regex "%%")
|
||||
-- don't add a pair if the previous character is xxx
|
||||
:with_pair(
|
||||
cond.not_before_regex("xxx", 3)
|
||||
)
|
||||
-- don't move right when repeat character
|
||||
:with_move(cond.none())
|
||||
-- don't delete if the next character is xx
|
||||
:with_del(cond.not_after_regex "xx")
|
||||
-- disable adding a newline when you press <cr>
|
||||
:with_cr(cond.none()),
|
||||
},
|
||||
-- disable for .vim files, but it work for another filetypes
|
||||
Rule("a", "a", "-vim")
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user