summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/core/options.lua1
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua10
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua97
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua189
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua78
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua1
6 files changed, 317 insertions, 59 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/options.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/options.lua
index 6fb4afa..b51b8a7 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/options.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/options.lua
@@ -9,6 +9,7 @@ vim.g.have_nerd_font = true
-- vim.g.loaded_netrwPlugin = 1
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
+vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.opt.backup = false
vim.opt.breakindent = true
vim.opt.conceallevel = 1
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
index 9f856b6..3788279 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/git.lua
@@ -133,6 +133,7 @@ return {
wk.add({
mode = { "n", "v", "x" },
{ "<leader>g", group = "Git" },
+ { "<leader>gt", group = "Toggle" },
})
end,
},
@@ -157,15 +158,8 @@ return {
},
{
"mbbill/undotree",
- init = function()
- local wk = require("which-key")
- wk.add({
- mode = { "n", "v" },
- { "<leader>gt", group = "Toggle" },
- })
- end,
config = function()
- vim.keymap.set("n", "<leader>gtu", vim.cmd.UndotreeToggle, { desc = "Toggle undo tree" })
+ vim.keymap.set("n", "<leader>gu", vim.cmd.UndotreeToggle, { desc = "Undo tree" })
end,
},
{
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua
index 51e3d50..8f73a06 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/markdown.lua
@@ -142,6 +142,13 @@ return {
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {},
+ init = function()
+ local wk = require("which-key")
+ wk.add({
+ mode = { "n", "v" },
+ { "<leader>mr", group = "Markdown render" },
+ })
+ end,
config = function()
-- require("obsidian").get_client().opts.ui.enable = false
-- vim.api.nvim_buf_clear_namespace(0, vim.api.nvim_get_namespaces()["ObsidianUI"], 0, -1)
@@ -165,32 +172,65 @@ return {
end,
})
vim.treesitter.language.register("markdown", "vimwiki")
-
- vim.keymap.set("n", "<leader>mrt", function()
- require("render-markdown").buf_toggle()
- end, { desc = "Toggle render-markdown" })
- vim.keymap.set("n", "<leader>mre", function()
- require("render-markdown").buf_enable()
- end, { desc = "Enable render-markdown" })
- vim.keymap.set("n", "<leader>mrx", function()
- require("render-markdown").buf_disable()
- end, { desc = "Disable render-markdown" })
- vim.keymap.set("n", "<leader>mr+", function()
- require("render-markdown").expand()
- end, { desc = "Expand conceal margin" })
- vim.keymap.set("n", "<leader>mr-", function()
- require("render-markdown").contract()
- end, { desc = "Contract conceal margin" })
- vim.keymap.set("n", "<leader>mrl", function()
- require("render-markdown").log()
- end, { desc = "Open render-markdown log" })
- vim.keymap.set("n", "<leader>mrc", function()
- require("render-markdown").config()
- end, { desc = "Show render-markdown config diff" })
- vim.keymap.set("n", "<leader>mrd", function()
- require("render-markdown").debug()
- end, { desc = "Debug render-markdown marks" })
end,
+ keys = {
+ {
+ "<leader>mrt",
+ function()
+ require("render-markdown").buf_toggle()
+ end,
+ desc = "Toggle render-markdown",
+ },
+ {
+ "<leader>mre",
+ function()
+ require("render-markdown").buf_enable()
+ end,
+ desc = "Enable render-markdown",
+ },
+ {
+ "<leader>mrx",
+ function()
+ require("render-markdown").buf_disable()
+ end,
+ desc = "Disable render-markdown",
+ },
+ {
+ "<leader>mr+",
+ function()
+ require("render-markdown").expand()
+ end,
+ desc = "Expand conceal margin",
+ },
+ {
+ "<leader>mr-",
+ function()
+ require("render-markdown").contract()
+ end,
+ desc = "Contract conceal margin",
+ },
+ {
+ "<leader>mrl",
+ function()
+ require("render-markdown").log()
+ end,
+ desc = "Open render-markdown log",
+ },
+ {
+ "<leader>mrc",
+ function()
+ require("render-markdown").config()
+ end,
+ desc = "Show render-markdown config diff",
+ },
+ {
+ "<leader>mrd",
+ function()
+ require("render-markdown").debug()
+ end,
+ desc = "Debug render-markdown marks",
+ },
+ },
},
{
-- Install markdown preview, use npx if available.
@@ -249,8 +289,13 @@ return {
},
{
"ellisonleao/glow.nvim",
- config = true,
cmd = "Glow",
+ config = function()
+ require("glow").setup({
+ border = "single", -- floating window border config
+ style = "dark", -- filled automatically with your current editor background, you can override using glow json style
+ })
+ end,
keys = {
{ "<leader>mf", "<cmd>Glow<CR>", desc = "Floating markdown preview" },
},
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
index 6911076..73cde53 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua
@@ -966,4 +966,193 @@ return {
})
end,
},
+ {
+ "echasnovski/mini.indentscope",
+ version = false, -- wait till new 0.7.0 release to put it back on semver
+ event = "VeryLazy",
+ opts = {
+ mappings = {
+ -- Textobjects
+ object_scope = "i-",
+ object_scope_with_border = "a-",
+
+ -- Motions (jump to respective border line; if not present - body line)
+ goto_top = "g,",
+ goto_bottom = "g;",
+ },
+ draw = {
+ animation = function()
+ return 0
+ end,
+ },
+ options = { try_as_border = true },
+ symbol = "│",
+ },
+ init = function()
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = {
+ "help",
+ "Trouble",
+ "trouble",
+ "lazy",
+ "mason",
+ },
+ callback = function()
+ vim.b.miniindentscope_disable = true
+ end,
+ })
+ end,
+ },
+ {
+ "echasnovski/mini.map",
+ version = false,
+ config = function()
+ require("mini.map").setup(
+ -- No need to copy this inside `setup()`. Will be used automatically.
+ {
+ -- Highlight integrations (none by default)
+ integrations = nil,
+
+ -- Symbols used to display data
+ symbols = {
+ -- Encode symbols. See `:h MiniMap.config` for specification and
+ -- `:h MiniMap.gen_encode_symbols` for pre-built ones.
+ -- Default: solid blocks with 3x2 resolution.
+ encode = nil,
+
+ -- Scrollbar parts for view and line. Use empty string to disable any.
+ scroll_line = "█",
+ scroll_view = "┃",
+ },
+
+ -- Window options
+ window = {
+ -- Whether window is focusable in normal way (with `wincmd` or mouse)
+ focusable = true,
+
+ -- Side to stick ('left' or 'right')
+ side = "right",
+
+ -- Whether to show count of multiple integration highlights
+ show_integration_count = true,
+
+ -- Total width
+ width = 10,
+
+ -- Value of 'winblend' option
+ winblend = 25,
+
+ -- Z-index
+ zindex = 10,
+ },
+ }
+ )
+ end,
+ init = function()
+ local wk = require("which-key")
+ wk.add({
+ mode = { "n", "v" },
+ { "<leader>m", group = "Markdown/Map" },
+ { "<leader>mt", group = "Toggle" },
+ })
+ end,
+ keys = {
+ { "<leader>mo", "<cmd>lua MiniMap.open()<cr>", desc = "Open map" },
+ { "<leader>mm", "<cmd>lua MiniMap.refresh()<cr>", desc = "Refresh map" },
+ { "<leader>mc", "<cmd>lua MiniMap.close()<cr>", desc = "Close map" },
+ { "<leader>mtm", "<cmd>lua MiniMap.toggle()<cr>", desc = "Toggle map" },
+ { "<leader>mts", "<cmd>lua MiniMap.toggle_side()<cr>", desc = "Toggle side map" },
+ },
+ },
+ {
+ "echasnovski/mini.move",
+ version = false,
+ config = function()
+ -- No need to copy this inside `setup()`. Will be used automatically.
+ require("mini.move").setup({
+ -- Module mappings. Use `''` (empty string) to disable one.
+ mappings = {
+ -- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
+ left = "<M-m>",
+ right = "<M-/>",
+ down = "<M-,>",
+ up = "<M-.>",
+
+ -- Move current line in Normal mode
+ line_left = "<M-m>",
+ line_right = "<M-/>",
+ line_down = "<M-,>",
+ line_up = "<M-.>",
+ },
+
+ -- Options which control moving behavior
+ options = {
+ -- Automatically reindent selection during linewise vertical move
+ reindent_linewise = true,
+ },
+ })
+ end,
+ },
+ {
+ "echasnovski/mini.pairs",
+ version = false,
+ event = "VeryLazy",
+ config = function()
+ require("mini.pairs").setup()
+ end,
+ keys = {
+ {
+ "<leader>zp",
+ function()
+ vim.g.minipairs_disable = not vim.g.minipairs_disable
+ end,
+ desc = "Toggle auto pairs",
+ },
+ },
+ },
+ {
+ "echasnovski/mini.splitjoin",
+ version = false,
+ config = function()
+ require("mini.splitjoin").setup()
+
+ vim.keymap.set(
+ "n",
+ "<leader>zj",
+ ":lua MiniSplitjoin.toggle()<cr>",
+ { noremap = true, silent = true, desc = "Toggle split-join" }
+ )
+ vim.keymap.set(
+ "n",
+ "<leader>J",
+ ":lua MiniSplitjoin.join()<cr>",
+ { noremap = true, silent = true, desc = "Join" }
+ )
+ vim.keymap.set(
+ "n",
+ "<leader><cr>",
+ ":lua MiniSplitjoin.split()<cr>",
+ { noremap = true, silent = true, desc = "Split" }
+ )
+ end,
+ },
+ {
+ "echasnovski/mini.trailspace",
+ version = false,
+ config = function()
+ require("mini.trailspace").setup()
+ vim.keymap.set(
+ "n",
+ "<leader>zt",
+ ":lua MiniTrailspace.trim()<cr>",
+ { noremap = true, silent = true, desc = "Trim trailing whitespace" }
+ )
+ vim.keymap.set(
+ "n",
+ "<leader>zl",
+ ":lua MiniTrailspace.trim_last_lines()<cr>",
+ { noremap = true, silent = true, desc = "Trim trailing empty lines" }
+ )
+ end,
+ },
}
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua
index c0be47b..ab55441 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/sessions.lua
@@ -1,32 +1,60 @@
return {
- "folke/persistence.nvim",
- event = "BufReadPre", -- this will only start session saving when an actual file was opened
+ "rmagatti/auto-session",
+ lazy = false,
config = function()
- require("persistence").setup({
- dir = vim.fn.stdpath("state") .. "/sessions/", -- directory where session files are saved
- -- minimum number of file buffers that need to be open to save
- -- Set to 0 to always save
- need = 0,
- branch = true, -- use git branch to save session
- })
-
- vim.keymap.set("n", "<leader>qs", function()
- require("persistence").load()
- end, { desc = "Load session" })
+ require("auto-session").setup({
+ enabled = true, -- Enables/disables auto creating, saving and restoring
+ root_dir = vim.fn.stdpath("data") .. "/sessions/", -- Root dir where sessions will be stored
+ auto_save = true, -- Enables/disables auto saving session on exit
+ auto_restore = false, -- Enables/disables auto restoring session on start
+ auto_create = true, -- Enables/disables auto creating new session files. Can take a function that should return true/false if a new session file should be created or not
+ suppressed_dirs = nil, -- Suppress session restore/create in certain directories
+ allowed_dirs = nil, -- Allow session restore/create in certain directories
+ auto_restore_last_session = false, -- On startup, loads the last saved session if session for cwd does not exist
+ git_use_branch_name = true, -- Include git branch name in session name
+ git_auto_restore_on_branch_change = true, -- Should we auto-restore the session when the git branch changes. Requires git_use_branch_name
+ lazy_support = true, -- Automatically detect if Lazy.nvim is being used and wait until Lazy is done to make sure session is restored correctly. Does nothing if Lazy isn't being used. Can be disabled if a problem is suspected or for debugging
+ bypass_save_filetypes = nil, -- List of filetypes to bypass auto save when the only buffer open is one of the file types listed, useful to ignore dashboards
+ close_unsupported_windows = true, -- Close windows that aren't backed by normal file before autosaving a session
+ args_allow_single_directory = true, -- Follow normal sesion save/load logic if launched with a single directory as the only argument
+ args_allow_files_auto_save = false, -- Allow saving a session even when launched with a file argument (or multiple files/dirs). It does not load any existing session first. While you can just set this to true, you probably want to set it to a function that decides when to save a session when launched with file args. See documentation for more detail
+ continue_restore_on_error = true, -- Keep loading the session even if there's an error
+ show_auto_restore_notif = false, -- Whether to show a notification when auto-restoring
+ cwd_change_handling = false, -- Follow cwd changes, saving a session before change and restoring after
+ lsp_stop_on_restore = false, -- Should language servers be stopped when restoring a session. Can also be a function that will be called if set. Not called on autorestore from startup
+ restore_error_handler = nil, -- Called when there's an error restoring. By default, it ignores fold errors otherwise it displays the error and returns false to disable auto_save
+ purge_after_minutes = nil, -- Sessions older than purge_after_minutes will be deleted asynchronously on startup, e.g. set to 14400 to delete sessions that haven't been accessed for more than 10 days, defaults to off (no purging), requires >= nvim 0.10
+ log_level = "error", -- Sets the log level of the plugin (debug, info, warn, error).
- -- select a session to load
- vim.keymap.set("n", "<leader>fs", function()
- require("persistence").select()
- end, { desc = "Find session" })
+ session_lens = {
+ load_on_setup = true, -- Initialize on startup (requires Telescope)
+ theme_conf = { -- Pass through for Telescope theme options
+ layout_config = { -- As one example, can change width/height of picker
+ -- width = 0.8, -- percent of window
+ -- height = 0.5,
+ },
+ },
+ previewer = false, -- File preview for session picker
- -- load the last session
- vim.keymap.set("n", "<leader>ql", function()
- require("persistence").load({ last = true })
- end, { desc = "Last session" })
+ mappings = {
+ -- Mode can be a string or a table, e.g. {"i", "n"} for both insert and normal mode
+ delete_session = { "i", "<C-X>" },
+ alternate_session = { "i", "<C-S>" },
+ copy_session = { "i", "<C-Y>" },
+ },
- -- stop Persistence => session won't be saved on exit
- vim.keymap.set("n", "<leader>qx", function()
- require("persistence").stop()
- end, { desc = "Stop session" })
+ session_control = {
+ control_dir = vim.fn.stdpath("data") .. "/auto_session/", -- Auto session control dir, for control files, like alternating between two sessions with session-lens
+ control_filename = "session_control.json", -- File name of the session control file
+ },
+ },
+ })
end,
+ keys = {
+ { "<leader>fs", "<cmd>SessionSearch<CR>", desc = "Session search" },
+ { "<leader>ws", "<cmd>SessionSave<CR>", desc = "Save session" },
+ { "<leader>wd", "<cmd>SessionDisableAutoSave<CR>", desc = "Disable autosave" },
+ { "<leader>wp", "<cmd>SessionPurgeOrphaned<CR>", desc = "Purge autosave" },
+ { "<leader>wa", "<cmd>SessionToggleAutoSave<CR>", desc = "Toggle autosave" },
+ },
}
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua
index 3c94532..f244171 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/wiki.lua
@@ -29,6 +29,7 @@ return {
end,
keys = {
{ "<leader>ww", ":VimwikiIndex<CR>", desc = "Vimwiki index" },
+ { "<leader>wu", ":VimwikiUISelect<CR>", desc = "Vimwiki UI" },
},
},
{