From 1c2d41ac49cd7b975f134a0c87a30676df723500 Mon Sep 17 00:00:00 2001 From: pagedMov Date: Wed, 16 Oct 2024 00:49:25 -0400 Subject: [PATCH] (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 --- flake.lock | 14 +++++++------- pkgs/nixvim/config/autocmd.nix | 10 ++++++++++ pkgs/nixvim/config/options.nix | 6 +++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 8c2b922..b52720f 100644 --- a/flake.lock +++ b/flake.lock @@ -825,11 +825,11 @@ }, "nur": { "locked": { - "lastModified": 1729035911, - "narHash": "sha256-MD81qtqfNYzbKssBk6hmozn3sB/qR+LL1Tx8qQE6+9U=", + "lastModified": 1729051801, + "narHash": "sha256-zh6TN4svngtanJVz2Gsf/ReDNMgOqdDKBOQCcEvvRaw=", "owner": "nix-community", "repo": "NUR", - "rev": "64079c912fb1734bf1f06ba4754ae8a1b6fa6e25", + "rev": "b578d2f4c64c59936403472f503d594a31a91163", "type": "github" }, "original": { @@ -870,7 +870,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-+aYqfRtAoaA4wqPfy4j2biNTVj2TtEmmHXDKOzNoU6g=", + "narHash": "sha256-Cp+apszVyMt3AIJSc7YFfxO2KhPvVQ63s3f8Uzkrfs8=", "path": "./pkgs/nixvim", "type": "path" }, @@ -952,11 +952,11 @@ ] }, "locked": { - "lastModified": 1728965841, - "narHash": "sha256-IwFh7KUJ9saIONcklEkXR3ANtGxkZsNdtpeT6eyF01Q=", + "lastModified": 1729052237, + "narHash": "sha256-9eBLOj83C4WHF1WSZn6NvRo7eat8acYK1G9ajfESYNY=", "owner": "gerg-l", "repo": "spicetify-nix", - "rev": "3dfd050f21568902449939f085e8d1aa28fb9913", + "rev": "a83d478b4512fdb80e2dd5a86c5d67e73e0c8b7e", "type": "github" }, "original": { diff --git a/pkgs/nixvim/config/autocmd.nix b/pkgs/nixvim/config/autocmd.nix index 1c0319f..fef9a03 100644 --- a/pkgs/nixvim/config/autocmd.nix +++ b/pkgs/nixvim/config/autocmd.nix @@ -4,21 +4,31 @@ command = "FloatermNew --wintype=float --name=shadeterm --position=topright --autoclose=0 --silent --cwd= --titleposition=left zsh"; event = ["VimEnter"]; pattern = ["*"]; + desc = "Create a floating terminal, placed in the top right"; } { command = "silent! mkview"; event = ["BufWinLeave"]; 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 &"; event = ["BufWinLeave"]; pattern = ["*"]; + desc = "Play a neat little sound effect when you close neovim"; } { command = "silent! loadview"; event = ["BufWinEnter"]; 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"; + } ]; } diff --git a/pkgs/nixvim/config/options.nix b/pkgs/nixvim/config/options.nix index eb77d19..1310c36 100644 --- a/pkgs/nixvim/config/options.nix +++ b/pkgs/nixvim/config/options.nix @@ -24,8 +24,8 @@ vim.opt.relativenumber = true vim.opt.hlsearch = true vim.opt.incsearch = true - vim.opt.shiftwidth = 4 - vim.opt.tabstop = 4 + vim.opt.shiftwidth = 2 + vim.opt.tabstop = 2 vim.opt.termguicolors = true vim.opt.ruler = true vim.opt.scrolloff = 6 @@ -33,7 +33,7 @@ vim.opt.foldmethod = "manual" vim.opt.wrap = true vim.opt.linebreak = true - vim.opt.textwidth = 135 + vim.opt.textwidth = 0 vim.opt.breakat = " \t!@*-+;:,./?" vim.g.mapleader = "!"