1
0
Fork 0

nvim: replace colorcolumn function with cc='+1'

This commit is contained in:
tastytea 2022-08-17 16:44:32 +02:00
parent d89019ae67
commit 0f50628209
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
3 changed files with 2 additions and 29 deletions

View File

@ -67,32 +67,6 @@ end
vim.api.nvim_create_user_command('ModelineInsert', M.insert_modeline, {})
-- set colorcolumn to textwidth after buffer is displayed or option is changed
function M.set_colorcolumn()
if vim.o.textwidth > 0 then
vim.opt_local.colorcolumn = { vim.o.textwidth }
else
vim.opt_local.colorcolumn = ''
end
end
vim.api.nvim_create_augroup('config_settings', { clear = true })
vim.api.nvim_create_autocmd(
{ 'BufEnter' },
{
group = 'config_settings',
callback = M.set_colorcolumn
}
)
vim.api.nvim_create_autocmd(
{ 'OptionSet' },
{
group = 'config_settings',
pattern = { 'textwidth' },
callback = M.set_colorcolumn
}
)
function M.get_project_root()
local path = vim.api.nvim_buf_get_name(0)
local root_markers = {

View File

@ -21,7 +21,6 @@ if vim.g.started_by_firenvim then
vim.o.wrap = true
vim.o.guifont = 'Source_Code_Pro:h10'
vim.o.textwidth = 0
vim.o.colorcolumn = '0'
local FV_fileprefix = vim.env['XDG_RUNTIME_DIR'] .. '/firenvim/'
vim.api.nvim_create_augroup('firenvim', { clear = true })
@ -39,6 +38,6 @@ if vim.g.started_by_firenvim then
FV_fileprefix .. 'openlibrary\\.org_*',
FV_fileprefix .. 'bugs\\.gentoo\\.org_*',
},
command = [[set filetype=markdown | set tw=0 cc=0]]
command = [[set filetype=markdown | set tw=0]]
})
end

View File

@ -4,7 +4,7 @@ local options = {
list = true, -- show whitespace
listchars = 'tab:▸ ,trail:·,nbsp:+',
textwidth = 80, -- default text width
colorcolumn = tostring(vim.o.textwidth),
colorcolumn = '+1', -- display column 1 char after tw
wrap = false, -- don't wrap long lines
linebreak = true, -- break on word boundaries
cursorline = true, -- highlight row with cursor