Skip to content

Commit 1ced7ab

Browse files
committed
feat(vim): better wrapping
1 parent 06f1b1a commit 1ced7ab

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

home/.config/nvim/lua/keymaps.lua

+3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ map("n", "<leader>tr", function()
5454
end, { desc = "[T]oggle [R]elative Line Numbers" })
5555

5656
map("n", "<leader>tw", function()
57+
-- Linebreak is wrap, but respecting words.
5758
if vim.api.nvim_get_option_value("wrap", { scope = "local" }) then
5859
vim.api.nvim_set_option_value("wrap", false, { scope = "local" })
60+
vim.api.nvim_set_option_value("linebreak", false, { scope = "local" })
5961
else
6062
vim.api.nvim_set_option_value("wrap", true, { scope = "local" })
63+
vim.api.nvim_set_option_value("linebreak", true, { scope = "local" })
6164
end
6265
end, { desc = "[T]oggle [W]rap" })
6366

home/.config/nvim/lua/plugins/zen.lua

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ return {
1414
opts = {
1515
window = {
1616
backdrop = 1,
17-
width = 100,
17+
width = 80,
1818
height = 1,
1919
options = {
2020
signcolumn = "no",
@@ -23,6 +23,8 @@ return {
2323
cursorcolumn = false,
2424
foldcolumn = "0",
2525
list = false,
26+
wrap = true,
27+
linebreak = true,
2628
},
2729
},
2830
plugins = {

home/.config/nvim/lua/settings.lua

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ vim.opt.termguicolors = true -- Use term GUI colors (needed for notifications)
1111
vim.opt.updatetime = 250 -- Reduce updatetime
1212
vim.opt.virtualedit = "block" -- Allow cursor to move where there is no text in visual block mode
1313
vim.opt.wildmode = "longest:full,full" -- Command-line completion mode
14+
vim.opt.wrap = false -- Do not break words
15+
vim.opt.linebreak = false -- Do not break lines
1416

1517
-- History, 'X,<Y,sZ, where:
1618
-- X: Saves marks for up to X files

0 commit comments

Comments
 (0)