summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/custom-neovim/config/lua/keymaps.lua12
-rw-r--r--pkgs/custom-neovim/config/lua/lsp.lua2
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/actions-preview.lua9
-rw-r--r--pkgs/custom-neovim/config/lua/plugins/mini-files.lua13
-rw-r--r--pkgs/custom-neovim/default.nix2
-rw-r--r--pkgs/custom-neovim/todo.md17
6 files changed, 37 insertions, 18 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua
index 7601552..5cdeb09 100644
--- a/pkgs/custom-neovim/config/lua/keymaps.lua
+++ b/pkgs/custom-neovim/config/lua/keymaps.lua
@@ -23,6 +23,7 @@ mapkey("n", "<leader>l", "Open tab cd picker", ":Pick cd scope='tab'<cr>", "mini
-- File manager
mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini.files")
+mapkey("n", "<leader>E", "Open file manager at current file", ":lua MiniFiles.open(vim.api.nvim_buf_get_name(0))<cr>", "mini.files")
-- Git
mapkey("n", "<leader>g", "Manage git", "")
@@ -80,7 +81,12 @@ mapkey("n", "<leader>wl", "Leave current session", function()
end)
-- Terminal
-mapkey("n", "<leader>n", "Open terminal", ":botright terminal<cr>")
+mapkey("n", "<leader>n", "Open terminal", function()
+ vim.cmd("botright split")
+ vim.cmd("resize " .. math.floor(vim.o.lines / 3))
+ vim.cmd("terminal")
+ vim.cmd("startinsert")
+end)
-- Toggle spellcheck
mapkey("n", "zq", "Toggle spellcheck", ":set spell!<cr>")
@@ -108,8 +114,4 @@ mapkey({ "n", "v" }, "<up>", "Go up visually", "g<up>")
-- QOL Keys
mapkey("t", "<Esc><Esc>", "Exit terminal insert mode", "<C-\\><C-n>")
--- vim.keymap.set("c", "<cr>", function()
--- if vim.fn.pumvisible() == 1 then return '<c-y>' end
--- return '<cr>'
--- end, { expr = true }) -- Make enter complete command.
mapkey("n", "<esc>", "Clear highlights", ":noh<cr>") -- Make esc clear highlights
diff --git a/pkgs/custom-neovim/config/lua/lsp.lua b/pkgs/custom-neovim/config/lua/lsp.lua
index f4e47df..93d7e41 100644
--- a/pkgs/custom-neovim/config/lua/lsp.lua
+++ b/pkgs/custom-neovim/config/lua/lsp.lua
@@ -72,7 +72,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
end
-- LSP Pickers
- -- mapkey('n', "<leader>a", "Perform code action", ":FzfLua lsp_code_actions<cr>", "fzf-lua")
+ mapkey('n', "<leader>a", "Perform code action", ":lua require('actions-preview').code_actions()<cr>", "actions-preview.nvim")
mapkey("n", "<leader>S", "Open workspace symbol picker", ":lua MiniExtra.pickers.lsp({ scope = 'workspace_symbol' })<cr>", "mini.pick")
mapkey("n", "<leader>s", "Open symbol picker", ":lua MiniExtra.pickers.lsp({ scope = 'document_symbol' })<cr>", "mini.pick")
mapkey("n", "<leader>I", "Open workspace diagnostic picker", ":lua MiniExtra.pickers.diagnostic({ scope = 'all' })<cr>", "mini.pick")
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..e6562df
--- /dev/null
+++ b/pkgs/custom-neovim/config/lua/plugins/actions-preview.lua
@@ -0,0 +1,9 @@
+return {
+ "actions-preview.nvim",
+ lazy = true,
+ after = function ()
+ require("actions-preview").setup {
+ backend = {"minipick"},
+ }
+ end
+}
diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-files.lua b/pkgs/custom-neovim/config/lua/plugins/mini-files.lua
index 9249a6c..b3c35ce 100644
--- a/pkgs/custom-neovim/config/lua/plugins/mini-files.lua
+++ b/pkgs/custom-neovim/config/lua/plugins/mini-files.lua
@@ -14,10 +14,16 @@ return {
-- Add functionality
-- Set focused directory as current working directory
- local set_cwd = function()
+ local cd = function()
local path = (MiniFiles.get_fs_entry() or {}).path
if path == nil then return vim.notify('Cursor is not on valid entry') end
- vim.fn.chdir(vim.fs.dirname(path))
+ vim.cmd.cd(vim.fs.dirname(path))
+ end
+
+ local tcd = function()
+ local path = (MiniFiles.get_fs_entry() or {}).path
+ if path == nil then return vim.notify('Cursor is not on valid entry') end
+ vim.cmd.tcd(vim.fs.dirname(path))
end
-- Yank in register full path of entry under cursor
@@ -34,7 +40,8 @@ return {
pattern = 'MiniFilesBufferCreate',
callback = function(args)
local b = args.data.buf_id
- vim.keymap.set('n', 'g~', set_cwd, { buffer = b, desc = 'Set cwd' })
+ vim.keymap.set('n', 'gl', tcd, { buffer = b, desc = 'Set tab cwd' })
+ vim.keymap.set('n', 'gL', cd, { buffer = b, desc = 'Set cwd' })
vim.keymap.set('n', 'gX', ui_open, { buffer = b, desc = 'OS open' })
vim.keymap.set('n', 'gy', yank_path, { buffer = b, desc = 'Yank path' })
end,
diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix
index 72225a5..5f7ef20 100644
--- a/pkgs/custom-neovim/default.nix
+++ b/pkgs/custom-neovim/default.nix
@@ -29,7 +29,7 @@ in
# UI Plugins
nvim-treesitter.withAllGrammars # All treesitter grammars
- fzf-lua
+ actions-preview-nvim
mini-pick
mini-extra
mini-clue
diff --git a/pkgs/custom-neovim/todo.md b/pkgs/custom-neovim/todo.md
index f040797..f0940c4 100644
--- a/pkgs/custom-neovim/todo.md
+++ b/pkgs/custom-neovim/todo.md
@@ -1,13 +1,6 @@
# Todo
-- Make mini files focus on current file when session loads?
-- Make <space>E open mini files focused on current file
-- make picker for directories to open mini files in
-- add key to change what direction a split is in
-- change mini files addon keybinds to be better
-- make file search obey gitignore
- add mini notifications
-- add code actions picker
- Overhaul markdown workflow
- Add image viewing keybind to open imv
@@ -21,4 +14,12 @@
- each time saved export to svg and link svg below xpp
- add render key to see full note rendered in html with images
-![](assets/neovim.png)
+## Maybe
+
+- make picker for directories to open mini files in
+- change mini files addon keybinds to be better
+- Make mini files focus on current file when session loads?
+
+## Eventually
+
+- Figure out what's wrong with plenary plugin borders and move code actions back to normal picker.