feat: updates to neovim config
This commit is contained in:
@@ -5,16 +5,16 @@ vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHo
|
||||
})
|
||||
|
||||
-- get terminal to follow directory
|
||||
vim.api.nvim_create_autocmd({ 'TermRequest' }, {
|
||||
desc = 'Handles OSC 7 dir change requests',
|
||||
callback = function(ev)
|
||||
local pwd, n = string.gsub(ev.data.sequence, '\027]7;file://[^/]*', '')
|
||||
if n <= 0 then return end
|
||||
if vim.fn.isdirectory(pwd) == 0 then return end
|
||||
if vim.api.nvim_get_current_buf() ~= ev.buf then return end
|
||||
vim.cmd.cd(pwd)
|
||||
end
|
||||
})
|
||||
-- vim.api.nvim_create_autocmd({ 'TermRequest' }, {
|
||||
-- desc = 'Handles OSC 7 dir change requests',
|
||||
-- callback = function(ev)
|
||||
-- local pwd, n = string.gsub(ev.data.sequence, '\027]7;file://[^/]*', '')
|
||||
-- if n <= 0 then return end
|
||||
-- if vim.fn.isdirectory(pwd) == 0 then return end
|
||||
-- if vim.api.nvim_get_current_buf() ~= ev.buf then return end
|
||||
-- vim.cmd.cd(pwd)
|
||||
-- end
|
||||
-- })
|
||||
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
|
||||
Reference in New Issue
Block a user