1
0
Fork 0

nvim: add firenvim

This commit is contained in:
tastytea 2022-08-12 03:33:18 +02:00
parent 769af64a86
commit 1c8e621d5d
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
3 changed files with 55 additions and 0 deletions

View File

@ -7,6 +7,7 @@ require('my/lsp')
require('my/completion')
require('my/ui')
require('my/coding')
require('my/net')
if packer_bootstrap then
require('packer').sync()

View File

@ -0,0 +1,52 @@
require('my/plugins')
-- embed nvim in browsers
packer.use {
'https://github.com/glacambre/firenvim',
run = function()
vim.fn['firenvim#install'](0)
end,
config = function()
vim.g.firenvim_config = {
localSettings = {
[".*"] = {
takeover = 'never',
}
}
}
if vim.g.started_by_firenvim then
vim.o.wrap = true
vim.o.guifont = 'Source_Code_Pro:h10'
end
vim.api.nvim_create_augroup('firenvim', { clear = true })
vim.api.nvim_create_autocmd(
{ 'BufWinEnter' },
{
group = 'firenvim',
pattern = { '*/firenvim/*.txt' },
callback = function()
vim.o.textwidth = 0
-- FIXME: my_set_colorcolumn() should set that automatically
vim.o.colorcolumn = 0
vim.cmd([[startinsert]])
end
}
)
vim.api.nvim_create_autocmd(
{ 'BufEnter' },
{
group = 'firenvim',
pattern = {
'schlomp.space_*',
'codeberg.org_*',
'gitlab.com_*',
'github.com_*',
'very.tastytea.de_*'
},
command = [[set filetype=markdown | set tw=0]]
}
)
end
}

View File

@ -4,6 +4,8 @@ vim.o.listchars = 'tab:▸ ,trail:·,nbsp:+'
vim.o.textwidth = 80 -- default text width
vim.o.colorcolumn = tostring(vim.o.textwidth)
vim.o.wrap = false -- don't wrap long lines
vim.o.linebreak = true -- break on word boundaries
vim.o.cursorline = true -- highlight row with cursor
vim.o.scrolloff = 5 -- show 5 lines below/above cursor
vim.o.sidescrolloff = 5 -- same fore left/right