39 lines
831 B
Lua
39 lines
831 B
Lua
|
if vim.g.started_by_firenvim ~= true then
|
||
|
return
|
||
|
end
|
||
|
|
||
|
vim.g.firenvim_config = {
|
||
|
globalSettings = { alt = "all" },
|
||
|
localSettings = {
|
||
|
[".*"] = {
|
||
|
cmdline = "neovim",
|
||
|
content = "text",
|
||
|
priority = 0,
|
||
|
selector = "textarea",
|
||
|
takeover = "never"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
vim.api.nvim_create_autocmd('UIEnter', {
|
||
|
callback = function()
|
||
|
local client = vim.api.nvim_get_chan_info(vim.v.event.chan).client
|
||
|
if client ~= nil and client.name == "Firenvim" then
|
||
|
vim.o.laststatus = 0
|
||
|
end
|
||
|
end
|
||
|
})
|
||
|
|
||
|
vim.api.nvim_create_autocmd({ 'TextChanged', 'TextChangedI' }, {
|
||
|
callback = function()
|
||
|
if vim.g.timer_started == true then
|
||
|
return
|
||
|
end
|
||
|
vim.g.timer_started = true
|
||
|
vim.fn.timer_start(500, function()
|
||
|
vim.g.timer_started = false
|
||
|
vim.cmd('silent write')
|
||
|
end)
|
||
|
end
|
||
|
})
|