Fix % in cmdline mode for oil

This commit is contained in:
2025-01-30 10:36:08 +01:00
parent ff9b4f45e3
commit 0b17063da0
2 changed files with 6 additions and 22 deletions
+2 -1
View File
@@ -3,7 +3,7 @@ return {
"oil.nvim",
lazy = false,
keys = {
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory" },
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory" },
{ "<BS>", "<CMD>Oil<CR>", desc = "Open parent directory" },
},
opts = {
@@ -17,6 +17,7 @@ return {
},
after = function(plug)
require("oil").setup(plug.opts)
vim.cmd.cabbr({ args = { "<expr>", "%", "&filetype == 'oil' ? bufname('%')[6:] : '%'" } })
end
}
}
+4 -21
View File
@@ -45,13 +45,15 @@ vim.opt.spell = true
-- Can't specify this in wordmotion's config due to race conditions
vim.g.wordmotion_nomap = true
-- Disable builtin sql completions which are bound to <C-c>
vim.g.omni_sql_no_default_maps = 1
-- for all modes except terminal
vim.keymap.set({ "i", "n", "o", "x", "v", "s", "l", "c" }, "<C-c>", "<esc>")
-- i don't use terminal that much so not having esc is okay
vim.keymap.set("t", "<esc>", "<C-\\><C-N>", { desc = "Normal mode" })
-- Disable builtin sql completions which are bound to <C-c>
vim.g.omni_sql_no_default_maps = 1
-- Why is this not the default?
vim.keymap.set("c", "<c-a>", "<home>", { desc = "Begining" })
-- Stay in indent mode
vim.keymap.set("v", "<", "<gv")
@@ -63,25 +65,6 @@ vim.keymap.set({ "n", "x" }, "<leader>Y", '"+y$', { desc = "Yank line to system
vim.keymap.set({ "n", "x" }, "<leader>p", '"+p', { desc = "Past from system clipboard" })
vim.keymap.set({ "n", "x" }, "<leader>P", '"+P', { desc = "Past line from system clipboard" })
-- use osc52 so it works in ssh sessions
-- see https://github.com/tmux/tmux/issues/4048 for more info
if vim.env.TMUX ~= nil then
-- tmux osc52 is lame, we need to run `tmux refresh-client -l` before copying
-- vim.g.clipboard = {
-- name = "tmux",
-- copy = {
-- ["+"] = { "tmux", "load-buffer", "-w", "-" },
-- ["*"] = { "tmux", "load-buffer", "-w", "-" },
-- },
-- paste = {
-- ["+"] = { "bash", "-c", "tmux refresh-client -l && sleep 0.05 && tmux save-buffer -" },
-- ["*"] = { "bash", "-c", "tmux refresh-client -l && sleep 0.05 && tmux save-buffer -" },
-- },
-- cache_enabled = 0,
-- }
end
-- Quickfix list
vim.keymap.set("n", "<leader>q", "<cmd>cclose<cr>", { desc = "Close quickfix" })