mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
more nvim
This commit is contained in:
parent
48ddc29db1
commit
fc6be19a2d
10 changed files with 337 additions and 273 deletions
17
nvim/lua/utils/oil.lua
Normal file
17
nvim/lua/utils/oil.lua
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue