From 01642018e68ed547cb82bbe7ac7d5806b225f9d6 Mon Sep 17 00:00:00 2001 From: huyjaky Date: Thu, 15 Aug 2024 10:21:48 +0700 Subject: [PATCH] astro-nvim-v3 - archivev8 --- lua/plugins/astrocore.lua | 2 +- lua/plugins/auto-save.lua | 2 +- lua/plugins/motion.lua | 120 ++++++++++++++++---------------- lua/plugins/multiple-visual.lua | 2 - lua/plugins/neo-tree.lua | 10 ++- lua/plugins/todo-comments.lua | 26 +++++++ 6 files changed, 97 insertions(+), 65 deletions(-) create mode 100644 lua/plugins/todo-comments.lua diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index d14d360..7084f2d 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -27,7 +27,7 @@ return { sessions = { -- Configure auto saving autosave = { - last = true, -- auto save last session + last = false, -- auto save last session cwd = false, -- auto save session for each working directory }, -- Patterns to ignore when saving sessions diff --git a/lua/plugins/auto-save.lua b/lua/plugins/auto-save.lua index c737bfe..e7bfa82 100644 --- a/lua/plugins/auto-save.lua +++ b/lua/plugins/auto-save.lua @@ -5,7 +5,7 @@ return { opts = { -- your config goes here -- 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 = { enabled = false, message = function() -- message to print on save diff --git a/lua/plugins/motion.lua b/lua/plugins/motion.lua index 54770c5..fe0b432 100644 --- a/lua/plugins/motion.lua +++ b/lua/plugins/motion.lua @@ -37,68 +37,68 @@ return { { "gs", "TSJToggle", mode = { "n" }, desc = "Toggle splitjoin" }, }, }, - { - "echasnovski/mini.ai", - event = "User AstroFile", - opts = function() - -- Register to which-key - local i = { - [" "] = "Whitespace", - ["?"] = "User Prompt", - _ = "Underscore", - a = "Argument", - b = "Paired ), ], }", - c = "Class", - d = "Digit(s)", - e = "Word in CamelCase & snake_case", - f = "Function", - g = "Entire file", - o = "Block, conditional, loop", - q = "Quote `, \", '", - t = "Tag", - u = "Use/call function & method", - U = "Use/call without dot in name", - } - local a = vim.deepcopy(i) - for k, v in pairs(a) do - a[k] = v:gsub(" including.*", "") - end + -- { + -- "echasnovski/mini.ai", + -- event = "User AstroFile", + -- opts = function() + -- -- Register to which-key + -- local i = { + -- [" "] = "Whitespace", + -- ["?"] = "User Prompt", + -- _ = "Underscore", + -- a = "Argument", + -- b = "Paired ), ], }", + -- c = "Class", + -- d = "Digit(s)", + -- e = "Word in CamelCase & snake_case", + -- f = "Function", + -- g = "Entire file", + -- o = "Block, conditional, loop", + -- q = "Quote `, \", '", + -- t = "Tag", + -- u = "Use/call function & method", + -- U = "Use/call without dot in name", + -- } + -- local a = vim.deepcopy(i) + -- for k, v in pairs(a) do + -- a[k] = v:gsub(" including.*", "") + -- end - local ic = vim.deepcopy(i) - local ac = vim.deepcopy(a) - for key, name in pairs { n = "Next", l = "Last" } do - i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) - a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) - end - require("which-key").register { - mode = { "o", "x" }, - i = i, - a = a, - } + -- local ic = vim.deepcopy(i) + -- local ac = vim.deepcopy(a) + -- for key, name in pairs { n = "Next", l = "Last" } do + -- i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) + -- a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) + -- end + -- require("which-key").register { + -- mode = { "o", "x" }, + -- i = i, + -- a = a, + -- } - -- define custom textobjects - local ai = require "mini.ai" - return { - n_lines = 500, - custom_textobjects = { - o = ai.gen_spec.treesitter { -- code block - a = { "@block.outer", "@conditional.outer", "@loop.outer" }, - i = { "@block.inner", "@conditional.inner", "@loop.inner" }, - }, - f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function - c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class - t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, -- tags - d = { "%f[%d]%d+" }, -- digits - 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 = ai.gen_spec.function_call(), -- u for "Usage" - U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name - }, - } - end, - }, + -- -- define custom textobjects + -- local ai = require "mini.ai" + -- return { + -- n_lines = 500, + -- custom_textobjects = { + -- o = ai.gen_spec.treesitter { -- code block + -- a = { "@block.outer", "@conditional.outer", "@loop.outer" }, + -- i = { "@block.inner", "@conditional.inner", "@loop.inner" }, + -- }, + -- f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function + -- c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class + -- t = { "<([%p%w]-)%f[^<%w][^<>]->.-", "^<.->().*()$" }, -- tags + -- d = { "%f[%d]%d+" }, -- digits + -- 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 = ai.gen_spec.function_call(), -- u for "Usage" + -- U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name + -- }, + -- } + -- end, + -- }, -- Better move by word { "chrisgrieser/nvim-spider", diff --git a/lua/plugins/multiple-visual.lua b/lua/plugins/multiple-visual.lua index ed288ce..ab1b1e3 100644 --- a/lua/plugins/multiple-visual.lua +++ b/lua/plugins/multiple-visual.lua @@ -1,5 +1,3 @@ -if true then return {} end - return { "mg979/vim-visual-multi", event = "VeryLazy", diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 371200a..637600c 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -12,11 +12,19 @@ return { hide_dotfiles = true, hide_gitignored = true, hide_by_name = { - -- '.git', + -- '.zip', + -- '.rar', + -- '.pdf', -- '.DS_Store', -- 'thumbs.db', }, never_show = {}, + + never_show_by_pattern = { -- uses glob style patterns + '*.zip', + '*.rar', + '*.pdf', + }, }, }, enable_git_status = false, diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..3fa25aa --- /dev/null +++ b/lua/plugins/todo-comments.lua @@ -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" } }, + }, + }, +}