feat(nvim): add firenvim
This commit is contained in:
parent
69f965cdc8
commit
8e45e1e0a0
2 changed files with 50 additions and 2 deletions
38
neovim/firenvim.lua
Normal file
38
neovim/firenvim.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
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
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue