astro-nvim-v3 - archivev8

This commit is contained in:
huyjaky
2024-08-15 10:21:48 +07:00
parent ff0d28d168
commit 01642018e6
6 changed files with 97 additions and 65 deletions

View File

@@ -27,7 +27,7 @@ return {
sessions = { sessions = {
-- Configure auto saving -- Configure auto saving
autosave = { autosave = {
last = true, -- auto save last session last = false, -- auto save last session
cwd = false, -- auto save session for each working directory cwd = false, -- auto save session for each working directory
}, },
-- Patterns to ignore when saving sessions -- Patterns to ignore when saving sessions

View File

@@ -5,7 +5,7 @@ return {
opts = { opts = {
-- your config goes here -- your config goes here
-- or just leave it empty :) -- or just leave it empty :)
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) enabled = false, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
execution_message = { execution_message = {
enabled = false, enabled = false,
message = function() -- message to print on save message = function() -- message to print on save

View File

@@ -37,68 +37,68 @@ return {
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" }, { "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
}, },
}, },
{ -- {
"echasnovski/mini.ai", -- "echasnovski/mini.ai",
event = "User AstroFile", -- event = "User AstroFile",
opts = function() -- opts = function()
-- Register to which-key -- -- Register to which-key
local i = { -- local i = {
[" "] = "Whitespace", -- [" "] = "Whitespace",
["?"] = "User Prompt", -- ["?"] = "User Prompt",
_ = "Underscore", -- _ = "Underscore",
a = "Argument", -- a = "Argument",
b = "Paired ), ], }", -- b = "Paired ), ], }",
c = "Class", -- c = "Class",
d = "Digit(s)", -- d = "Digit(s)",
e = "Word in CamelCase & snake_case", -- e = "Word in CamelCase & snake_case",
f = "Function", -- f = "Function",
g = "Entire file", -- g = "Entire file",
o = "Block, conditional, loop", -- o = "Block, conditional, loop",
q = "Quote `, \", '", -- q = "Quote `, \", '",
t = "Tag", -- t = "Tag",
u = "Use/call function & method", -- u = "Use/call function & method",
U = "Use/call without dot in name", -- U = "Use/call without dot in name",
} -- }
local a = vim.deepcopy(i) -- local a = vim.deepcopy(i)
for k, v in pairs(a) do -- for k, v in pairs(a) do
a[k] = v:gsub(" including.*", "") -- a[k] = v:gsub(" including.*", "")
end -- end
local ic = vim.deepcopy(i) -- local ic = vim.deepcopy(i)
local ac = vim.deepcopy(a) -- local ac = vim.deepcopy(a)
for key, name in pairs { n = "Next", l = "Last" } do -- for key, name in pairs { n = "Next", l = "Last" } do
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) -- i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) -- a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
end -- end
require("which-key").register { -- require("which-key").register {
mode = { "o", "x" }, -- mode = { "o", "x" },
i = i, -- i = i,
a = a, -- a = a,
} -- }
-- define custom textobjects -- -- define custom textobjects
local ai = require "mini.ai" -- local ai = require "mini.ai"
return { -- return {
n_lines = 500, -- n_lines = 500,
custom_textobjects = { -- custom_textobjects = {
o = ai.gen_spec.treesitter { -- code block -- o = ai.gen_spec.treesitter { -- code block
a = { "@block.outer", "@conditional.outer", "@loop.outer" }, -- a = { "@block.outer", "@conditional.outer", "@loop.outer" },
i = { "@block.inner", "@conditional.inner", "@loop.inner" }, -- i = { "@block.inner", "@conditional.inner", "@loop.inner" },
}, -- },
f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function -- f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function
c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class -- c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags -- t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
d = { "%f[%d]%d+" }, -- digits -- d = { "%f[%d]%d+" }, -- digits
e = { -- Word with case -- e = { -- Word with case
{ "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" }, -- { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
"^().*()$", -- "^().*()$",
}, -- },
u = ai.gen_spec.function_call(), -- u for "Usage" -- u = ai.gen_spec.function_call(), -- u for "Usage"
U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name -- U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name
}, -- },
} -- }
end, -- end,
}, -- },
-- Better move by word -- Better move by word
{ {
"chrisgrieser/nvim-spider", "chrisgrieser/nvim-spider",

View File

@@ -1,5 +1,3 @@
if true then return {} end
return { return {
"mg979/vim-visual-multi", "mg979/vim-visual-multi",
event = "VeryLazy", event = "VeryLazy",

View File

@@ -12,11 +12,19 @@ return {
hide_dotfiles = true, hide_dotfiles = true,
hide_gitignored = true, hide_gitignored = true,
hide_by_name = { hide_by_name = {
-- '.git', -- '.zip',
-- '.rar',
-- '.pdf',
-- '.DS_Store', -- '.DS_Store',
-- 'thumbs.db', -- 'thumbs.db',
}, },
never_show = {}, never_show = {},
never_show_by_pattern = { -- uses glob style patterns
'*.zip',
'*.rar',
'*.pdf',
},
}, },
}, },
enable_git_status = false, enable_git_status = false,

View File

@@ -0,0 +1,26 @@
if true then return {} end
return {
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
},
}