summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/custom-neovim/config/lua')
-rw-r--r--pkgs/custom-neovim/config/lua/keymaps.lua23
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/auto-session.lua10
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/completion.lua7
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/markdown.lua43
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/markview.lua8
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/zoxide.lua6
-rw-r--r--pkgs/custom-neovim/config/lua/winbar.lua3
7 files changed, 71 insertions, 29 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua
index fd3bb15..6831834 100644
--- a/pkgs/custom-neovim/config/lua/keymaps.lua
+++ b/pkgs/custom-neovim/config/lua/keymaps.lua
@@ -39,9 +39,12 @@ mapkey("n", "<leader>tc", "Close current tab", ":tabclose<cr>")
mapkey("n", "<leader>w", "Manage sessions", "")
mapkey("n", "<leader>ww", "Open a session", ":Autosession search<cr>", "mini.pick")
mapkey("n", "<leader>wd", "Delete a session", ":Autosession delete<cr>", "mini.pick")
+mapkey("n", "<leader>wr", "Restore last session", ":SessionRestore<cr>")
+mapkey("n", "<leader>wp", "Purge orphaned sessions", ":SessionPurgeOrphaned<cr>")
+mapkey("n", "<leader>ws", "Save session", ":SessionSave<cr>")
-- Terminal
-mapkey("n", "<leader>c", "Open terminal", ":botright terminal<cr>")
+mapkey("n", "<leader>n", "Open terminal", ":botright terminal<cr>")
-- Markview
mapkey("n", "<leader>v", "Toggle markview", ":Markview<cr>", "markview.nvim")
@@ -49,9 +52,17 @@ mapkey("n", "<leader>v", "Toggle markview", ":Markview<cr>", "markview.nvim")
-- Toggle spellcheck
mapkey("n", "zq", "Toggle spellcheck", ":set spell!<cr>")
--- Really delete
-mapkey({"n", "v"}, "<leader>d", "Really delete", [["_d]])
-mapkey({"n", "v"}, "<leader>x", "Really delete character", [["_x]])
+-- Spelling suggestions
+mapkey("n", "z=", "Pick spelling suggestions", ":Pick spellsuggest<cr>")
+
+-- Do operations without yanking
+mapkey({"n", "v"}, "<leader>d", "Fully delete", [["_d]])
+mapkey({"n", "v"}, "<leader>D", "Fully delete line", [["_D]])
+mapkey({"n", "v"}, "<leader>x", "Fully delete character", [["_x]])
+mapkey({"n", "v"}, "<leader>X", "Fully delete previous character", [["_X]])
+mapkey({"n", "v"}, "<leader>c", "Fully change", [["_c]])
+mapkey({"n", "v"}, "<leader>C", "Fully change line", [["_C]])
+mapkey({"v"}, "<leader>p", "Fully put", [[P]])
-- Paste on newline
mapkey("n", "<leader>p", "Paste on newline", ":pu<cr>")
@@ -59,8 +70,8 @@ mapkey("n", "<leader>p", "Paste on newline", ":pu<cr>")
-- Visual Movement Keys
mapkey({"n", "v"}, "j", "Go down visually", "gj")
mapkey({"n", "v"}, "k", "Go up visually", "gk")
-mapkey({"n", "v"}, "<down>", "Go down visually", "gj")
-mapkey({"n", "v"}, "<up>", "Go up visually", "gk")
+mapkey({"n", "v"}, "<down>", "Go down visually", "g<down>")
+mapkey({"n", "v"}, "<up>", "Go up visually", "g<up>")
-- Falling key
mapkey("n", "<leader>u", "Make it rain", ":CellularAutomaton make_it_rain<cr>", "cellular-automaton.nvim")
diff --git a/pkgs/custom-neovim/config/lua/plugins/auto-session.lua b/pkgs/custom-neovim/config/lua/plugins/auto-session.lua
index b5a7a07..efbd416 100644
--- a/pkgs/custom-neovim/config/lua/plugins/auto-session.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/auto-session.lua
@@ -2,6 +2,14 @@ return {
"auto-session",
lazy = false,
after = function ()
- require("auto-session").setup()
+ vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
+ require("auto-session").setup {
+ suppressed_dirs = {
+ "~/",
+ "/",
+ },
+ auto_restore_last_session = true,
+ cwd_change_handling = true,
+ }
end
}
diff --git a/pkgs/custom-neovim/config/lua/plugins/completion.lua b/pkgs/custom-neovim/config/lua/plugins/completion.lua
index 3228662..678b3e2 100644
--- a/pkgs/custom-neovim/config/lua/plugins/completion.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/completion.lua
@@ -13,11 +13,12 @@ return {
require("blink.cmp").setup {
snippets = { preset = 'luasnip' },
sources = {
- default = { 'lsp', 'path', 'snippets', 'buffer' },
+ default = { 'lsp', 'path', 'snippets'},
},
cmdline = {
- keymap = { preset = 'inherit' },
- completion = { menu = { auto_show = true } },
+ keymap = { preset = 'none' },
+ -- keymap = { preset = 'inherit' },
+ -- completion = { menu = { auto_show = true } },
},
}
end,
diff --git a/pkgs/custom-neovim/config/lua/plugins/markdown.lua b/pkgs/custom-neovim/config/lua/plugins/markdown.lua
index 56f5e18..a8baf81 100644
--- a/pkgs/custom-neovim/config/lua/plugins/markdown.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/markdown.lua
@@ -7,7 +7,15 @@ return {
vim.cmd.packadd "mini.icons"
end,
after = function ()
- require('render-markdown').setup({})
+ require('render-markdown').setup({
+ completions = { lsp = { enabled = true } },
+ heading = { border = true },
+ indent = { enabled = true },
+ pipe_table = {
+ preset = "round",
+ border_enabled = true,
+ },
+ })
end
},
{
@@ -15,25 +23,30 @@ return {
lazy = true,
ft = "markdown",
after = function ()
- require("markdown").setup {}
+ require("markdown").setup {
+ on_attach = function(bufnr)
+ -- Create keymap function
+ local mapkey = function(mode, key, desc, action, plugin)
+ local keymapper = plugin and require("lz.n").keymap(plugin).set or vim.keymap.set
+ keymapper(mode, key, action, {noremap = true, silent = true, desc = desc, buffer = bufnr})
+ end
+
+ mapkey({"n", "v"}, "<leader>m", "Manage markdown", "")
+ mapkey("n", "<leader>mo", "Create list item below", ":MDListItemBelow<cr>")
+ mapkey("n", "<leader>mO", "Create list item above", ":MDListItemAbove<cr>")
+ mapkey("n", "<leader>mr", "Reset list numbering", ":MDResetListNumbering<cr>")
+ mapkey("n", "<leader>mt", "Toggle table mode", ":Mtm<cr>")
+ mapkey({"n", "v"}, "<leader>mm", "Toggle checkbox", ":MDTaskToggle<cr>")
+ end,
+ }
end
},
{
- "peek.nvim",
+ "markdown-table-mode.nvim",
lazy = true,
ft = "markdown",
- after = 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,
- },
- {
- "vim-table-mode",
- lazy = true,
- ft = "markdown",
- before = function ()
- vim.g.table_mode_corner = '|'
+ after = function ()
+ require('markdown-table-mode').setup()
end
},
}
diff --git a/pkgs/custom-neovim/config/lua/plugins/markview.lua b/pkgs/custom-neovim/config/lua/plugins/markview.lua
index b2f3775..0832390 100644
--- a/pkgs/custom-neovim/config/lua/plugins/markview.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/markview.lua
@@ -1,5 +1,13 @@
return {
"markview.nvim",
+ enabled = false,
lazy = false,
priority = 45, -- Load before treesitter.
+ after = function ()
+ require("markview").setup {
+ preview = {
+ hybrid_modes = {"n"},
+ },
+ }
+ end
}
diff --git a/pkgs/custom-neovim/config/lua/plugins/zoxide.lua b/pkgs/custom-neovim/config/lua/plugins/zoxide.lua
index c705705..433313e 100644
--- a/pkgs/custom-neovim/config/lua/plugins/zoxide.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/zoxide.lua
@@ -9,7 +9,7 @@ return {
"Lzi",
"Tzi",
},
- -- after = function ()
- -- require("zoxide")
- -- end
+ before = function ()
+ vim.g.zoxide_use_select = 1
+ end
}
diff --git a/pkgs/custom-neovim/config/lua/winbar.lua b/pkgs/custom-neovim/config/lua/winbar.lua
index 1e68c9d..8750ce4 100644
--- a/pkgs/custom-neovim/config/lua/winbar.lua
+++ b/pkgs/custom-neovim/config/lua/winbar.lua
@@ -156,7 +156,7 @@ local gaps = " "
-- Process and apply statusline.
Winbar_builder = function ()
- --get a table of all the winbar strings
+ -- get a table of all the winbar strings
local winbar_strings = winbar()
-- Remove empty strings to prevent concat issues
@@ -170,4 +170,5 @@ Winbar_builder = function ()
return table.concat(winbar_strings, gaps)
end
+-- Set winbar
vim.o.winbar = "%{%v:lua.Winbar_builder()%}"