1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 11:24:55 +02:00

more nvim

This commit is contained in:
Henrik Hautakoski 2024-06-08 16:50:16 +02:00
parent 48ddc29db1
commit fc6be19a2d
10 changed files with 337 additions and 273 deletions

17
nvim/lua/utils/oil.lua Normal file
View file

@ -0,0 +1,17 @@
local M = {}
-- Hack for making oil.nvim return to
-- the initial cwd on save.
function M.RegisterCWDHackHook()
local cwd = vim.fn.getcwd()
local group = vim.api.nvim_create_augroup("OilCWDHack", {})
vim.api.nvim_create_autocmd("BufWritePost", {
group = group,
pattern = "oil:///*",
callback = function() vim.cmd("cd " .. cwd) end,
})
end
return M