(desktop) Gen 494: disabled auto linebreak by default in nixvim, made it only activate in plain text files like .md or .txt where linebreak formatting actually matters

This commit is contained in:
pagedMov
2024-10-16 00:49:25 -04:00
parent bd1add14bb
commit 1c2d41ac49
3 changed files with 20 additions and 10 deletions

14
flake.lock generated
View File

@@ -825,11 +825,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1729035911, "lastModified": 1729051801,
"narHash": "sha256-MD81qtqfNYzbKssBk6hmozn3sB/qR+LL1Tx8qQE6+9U=", "narHash": "sha256-zh6TN4svngtanJVz2Gsf/ReDNMgOqdDKBOQCcEvvRaw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "64079c912fb1734bf1f06ba4754ae8a1b6fa6e25", "rev": "b578d2f4c64c59936403472f503d594a31a91163",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -870,7 +870,7 @@
}, },
"locked": { "locked": {
"lastModified": 1, "lastModified": 1,
"narHash": "sha256-+aYqfRtAoaA4wqPfy4j2biNTVj2TtEmmHXDKOzNoU6g=", "narHash": "sha256-Cp+apszVyMt3AIJSc7YFfxO2KhPvVQ63s3f8Uzkrfs8=",
"path": "./pkgs/nixvim", "path": "./pkgs/nixvim",
"type": "path" "type": "path"
}, },
@@ -952,11 +952,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728965841, "lastModified": 1729052237,
"narHash": "sha256-IwFh7KUJ9saIONcklEkXR3ANtGxkZsNdtpeT6eyF01Q=", "narHash": "sha256-9eBLOj83C4WHF1WSZn6NvRo7eat8acYK1G9ajfESYNY=",
"owner": "gerg-l", "owner": "gerg-l",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "3dfd050f21568902449939f085e8d1aa28fb9913", "rev": "a83d478b4512fdb80e2dd5a86c5d67e73e0c8b7e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -4,21 +4,31 @@
command = "FloatermNew --wintype=float --name=shadeterm --position=topright --autoclose=0 --silent --cwd=<buffer> --titleposition=left zsh"; command = "FloatermNew --wintype=float --name=shadeterm --position=topright --autoclose=0 --silent --cwd=<buffer> --titleposition=left zsh";
event = ["VimEnter"]; event = ["VimEnter"];
pattern = ["*"]; pattern = ["*"];
desc = "Create a floating terminal, placed in the top right";
} }
{ {
command = "silent! mkview"; command = "silent! mkview";
event = ["BufWinLeave"]; event = ["BufWinLeave"];
pattern = ["*"]; pattern = ["*"];
desc = "Save session window settings to be loaded next time the file is opened";
} }
{ {
command = "silent! !aplay ~/sound/sys/cd.wav > /dev/null 2>&1 &"; command = "silent! !aplay ~/sound/sys/cd.wav > /dev/null 2>&1 &";
event = ["BufWinLeave"]; event = ["BufWinLeave"];
pattern = ["*"]; pattern = ["*"];
desc = "Play a neat little sound effect when you close neovim";
} }
{ {
command = "silent! loadview"; command = "silent! loadview";
event = ["BufWinEnter"]; event = ["BufWinEnter"];
pattern = ["*"]; pattern = ["*"];
desc = "Load previous session window settings for the opened file (folds, cursor pos, etc)";
}
{
command = "setlocal textwidth = 135";
event = ["BufWinEnter" "BufEnter"];
pattern = ["*.md" "*.wiki" "*.txt"];
desc = "Set automatic linebreaks in plain text file formats";
} }
]; ];
} }

View File

@@ -24,8 +24,8 @@
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.hlsearch = true vim.opt.hlsearch = true
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 2
vim.opt.tabstop = 4 vim.opt.tabstop = 2
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.ruler = true vim.opt.ruler = true
vim.opt.scrolloff = 6 vim.opt.scrolloff = 6
@@ -33,7 +33,7 @@
vim.opt.foldmethod = "manual" vim.opt.foldmethod = "manual"
vim.opt.wrap = true vim.opt.wrap = true
vim.opt.linebreak = true vim.opt.linebreak = true
vim.opt.textwidth = 135 vim.opt.textwidth = 0
vim.opt.breakat = " \t!@*-+;:,./?" vim.opt.breakat = " \t!@*-+;:,./?"
vim.g.mapleader = "!" vim.g.mapleader = "!"