summaryrefslogtreecommitdiff
path: root/pkgs/custom-neovim/config/lua
diff options
context:
space:
mode:
authortriethyl <triethylammonium@pm.me>2025-07-15 14:47:28 -0400
committertriethyl <triethylammonium@pm.me>2025-07-15 14:47:28 -0400
commit4675a023e85fb0c188cbf1916decff43ab95a692 (patch)
tree99aa8660983fea68d4f3c39571bb2d9d7b003411 /pkgs/custom-neovim/config/lua
parente44a859b819c000ed43f03bcdf93ba9dd0e34640 (diff)
working on custom neovim
Diffstat (limited to 'pkgs/custom-neovim/config/lua')
-rw-r--r--pkgs/custom-neovim/config/lua/colorscheme.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/mappings.lua37
-rw-r--r--pkgs/custom-neovim/config/lua/neovide.lua4
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/actions-preview.lua3
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/persisted.lua6
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/which-key.lua9
6 files changed, 46 insertions, 15 deletions
diff --git a/pkgs/custom-neovim/config/lua/colorscheme.lua b/pkgs/custom-neovim/config/lua/colorscheme.lua
index ed03aef..03f0ad3 100644
--- a/pkgs/custom-neovim/config/lua/colorscheme.lua
+++ b/pkgs/custom-neovim/config/lua/colorscheme.lua
@@ -25,7 +25,7 @@ vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, {
link_highlight("TelescopePromptPrefix", "Variable")
-- Snacks-specific highlights
- link_highlight("SnacksPickerDir", "SnacksPickerFile")
+ -- link_highlight("SnacksPickerDir", "SnacksPickerFile")
end
end,
})
diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua
index 15a28e5..dcad4b2 100644
--- a/pkgs/custom-neovim/config/lua/mappings.lua
+++ b/pkgs/custom-neovim/config/lua/mappings.lua
@@ -5,14 +5,21 @@ local mapkey = utils.mapkey
vim.g.mapleader = ' '
-- Pickers
-mapkey("n", "<leader>f", "Open file picker", ":Telescope find_files<cr>")
-mapkey("n", "<leader>c", "Open recent file picker", ":Telescope oldfiles<cr>")
--- mapkey("n", "<leader>e", "Open file explorer", ":Pick explorer<cr>")
-mapkey("n", "<leader>b", "Open buffer picker", ":Telescope buffers<cr>")
-mapkey("n", "<leader>/", "Open live grep picker", ":Telescope live_grep<cr>")
-mapkey("n", "<leader>\\", "Open command palette", ":Telescope commands<cr>")
-mapkey("n", "<leader>?", "Open help picker", ":Telescope help<cr>")
-mapkey("n", "<leader>'", "Open last picker", ":Telescope resume<cr>")
+mapkey("n", "<leader>f", "Open file picker", Snacks.picker.files)
+mapkey("n", "<leader>c", "Open recent file picker", Snacks.picker.recent)
+mapkey("n", "<leader>e", "Open file explorer", Snacks.picker.explorer)
+mapkey("n", "<leader>b", "Open buffer picker", Snacks.picker.buffers)
+mapkey("n", "<leader>B", "Open buffer live grep picker", Snacks.picker.grep_buffers)
+mapkey("n", "<leader>y", "Open clipboard history picker", Snacks.picker.cliphist)
+mapkey("n", "<leader>/", "Open live grep picker", Snacks.picker.grep)
+mapkey("n", "<leader>\\", "Open command palette", Snacks.picker.commands)
+mapkey("n", "<leader>?", "Open help picker", Snacks.picker.help)
+mapkey("n", "<leader>p", "Open picker picker", Snacks.picker.pickers)
+mapkey("n", "<leader>'", "Open last picker", Snacks.picker.resume)
+
+-- Commenting.
+mapkey("n", "<C-c>", "Comment line", ":norm gcc<cr>")
+mapkey("v", "<C-c>", "Comment line", ":norm gc<cr>")
-- Tabs
mapkey("n", "<leader>t", "Manage tabs", "")
@@ -21,6 +28,10 @@ mapkey("n", "<leader>tq", "Close tab", ":tabclose<cr>")
mapkey("n", "<leader>tn", "Go to next tab", ":tabnext<cr>")
mapkey("n", "<leader>tp", "Go to previous tab", ":tabprev<cr>")
+-- Sessions
+mapkey("n", "<leader>s", "Manage sessions", "")
+mapkey("n", "<leader>ss", "Open session picker", ":SessionSelect<cr")
+
-- QOL Keys
mapkey("t", "<Esc><Esc>", "Exit terminal insert mode", "<C-\\><C-n>")
vim.keymap.set("c", "<cr>", function()
@@ -28,3 +39,13 @@ vim.keymap.set("c", "<cr>", function()
return '<cr>'
end, { expr = true }) -- Make enter complete command.
mapkey("n", "<esc>", "Clear highlights", ":noh<cr>") -- Make esc clear highlights
+
+-- Visual Movement Keys.
+mapkey({"n", "v"}, "j", "Go down visually", "gj")
+mapkey({"n", "v"}, "k", "Go up visually", "gk")
+
+-- Learn hjkl.
+mapkey({"n", "v"}, "<left>", "Correct the keypress", function() print("Try pressing h instead.") end)
+mapkey({"n", "v"}, "<down>", "Correct the keypress", function() print("Try pressing j instead.") end)
+mapkey({"n", "v"}, "<up>", "Correct the keypress", function() print("Try pressing k instead.") end)
+mapkey({"n", "v"}, "<right>", "Correct the keypress", function() print("Try pressing l instead.") end)
diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua
index dc804fc..d088413 100644
--- a/pkgs/custom-neovim/config/lua/neovide.lua
+++ b/pkgs/custom-neovim/config/lua/neovide.lua
@@ -8,10 +8,10 @@ if vim.g.neovide then
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + delta
end
vim.keymap.set("n", "<C-=>", function()
- change_scale_factor(1)
+ change_scale_factor(0.05)
end)
vim.keymap.set("n", "<C-->", function()
- change_scale_factor(-1)
+ change_scale_factor(-0.05)
end)
-- Standard terminal emulator keymaps.
diff --git a/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua b/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua
new file mode 100644
index 0000000..0e3cc02
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua
@@ -0,0 +1,3 @@
+require("actions-preview").setup {
+ backend = {"snacks"}
+}
diff --git a/pkgs/custom-neovim/config/lua/plugins/persisted.lua b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
index d3a5814..6f0273e 100644
--- a/pkgs/custom-neovim/config/lua/plugins/persisted.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/persisted.lua
@@ -1,3 +1,3 @@
-require("persisted").setup()
-
-require("telescope").load_extension("persisted")
+require("persisted").setup {
+ autostart = true,
+}
diff --git a/pkgs/custom-neovim/config/lua/plugins/which-key.lua b/pkgs/custom-neovim/config/lua/plugins/which-key.lua
index 612af14..3d31fa7 100644
--- a/pkgs/custom-neovim/config/lua/plugins/which-key.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/which-key.lua
@@ -1,3 +1,10 @@
require("which-key").setup {
- preset = "modern",
+ preset = "helix",
+ delay = 0,
}
+
+-- Show hydra mode for changing windows
+-- require("which-key").show({
+-- keys = {"<c-w>", modes = {"n"}},
+-- loop = true, -- this will keep the popup open until you hit <esc>
+-- })