diff --git a/nvim/.config/nvim/lua/romanzy/custom/wrap.lua b/nvim/.config/nvim/lua/romanzy/custom/wrap.lua index 2ca9db5..7241467 100644 --- a/nvim/.config/nvim/lua/romanzy/custom/wrap.lua +++ b/nvim/.config/nvim/lua/romanzy/custom/wrap.lua @@ -1,18 +1,18 @@ local M = {} --- Toggle wrapping, or force it to the provided state. ---- This plugin is buggy, so it does nothing --- @param enabled? boolean function M.toggle(enabled) - -- if enabled == nil then - -- enabled = not vim.wo.wrap - -- end - -- - -- vim.wo.wrap = enabled - -- vim.wo.linebreak = enabled - -- vim.wo.breakindent = enabled - -- vim.bo.textwidth = enabled and 80 or 0 - -- vim.bo.wrapmargin = 0 + if enabled == nil then + enabled = not vim.wo.wrap + end + + vim.wo.wrap = enabled + vim.wo.linebreak = enabled + vim.wo.breakindent = enabled + vim.wo.colorcolumn = enabled and "" or "80" + vim.bo.textwidth = enabled and 0 or 80 + vim.bo.wrapmargin = 0 end return M diff --git a/nvim/.config/nvim/lua/romanzy/options.lua b/nvim/.config/nvim/lua/romanzy/options.lua index b088850..efc8622 100644 --- a/nvim/.config/nvim/lua/romanzy/options.lua +++ b/nvim/.config/nvim/lua/romanzy/options.lua @@ -1,6 +1,5 @@ local g = vim.g local o = vim.opt - g.mapleader = " " -- Uses space as the global leader key. g.maplocalleader = " " -- Uses space as the local leader key. g.clipboard = "osc52" -- Routes the + and * registers through OSC52 in terminal Neovim. @@ -11,7 +10,8 @@ o.cursorline = true -- Highlights the line under the cursor. o.textwidth = 80 -- Wraps inserted text after 80 columns when formatting is active. o.scrolloff = 8 -- Keeps context lines visible around the cursor. o.signcolumn = "yes" -- Always reserves space for signs in the gutter. -o.colorcolumn = "+1" -- Highlights the preferred maximum line width. +o.colorcolumn = "80" -- Highlights the preferred maximum line width. +o.wrap = false -- Prevents long lines from wrapping on screen. o.list = true -- Displays whitespace characters using listchars. o.listchars = { tab = "ยป ",