diff options
| author | Grace Yoder <grace_yoder@outlook.com> | 2026-02-19 15:16:51 -0500 |
|---|---|---|
| committer | Grace Yoder <grace_yoder@outlook.com> | 2026-02-19 15:16:51 -0500 |
| commit | 3e110044f293aadcd22dbeace4e433c3ed181a18 (patch) | |
| tree | 365ae780d4d5c63a0b2016253a8d8e7612e78d98 /vim/.config/nvim/init.lua | |
| parent | a01bb5c0ed3c1a05a00bab07558b20097293dda4 (diff) | |
turing changes
Diffstat (limited to 'vim/.config/nvim/init.lua')
| -rw-r--r-- | vim/.config/nvim/init.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vim/.config/nvim/init.lua b/vim/.config/nvim/init.lua index 7b1ba87..f79088f 100644 --- a/vim/.config/nvim/init.lua +++ b/vim/.config/nvim/init.lua @@ -71,12 +71,23 @@ vim.api.nvim_create_autocmd("FileType", { callback = function() -- Line wrapping settings vim.opt_local.textwidth = 80 - vim.opt_local.formatoptions = "atcqjnl" + vim.opt_local.formatoptions = "tcqjnl" vim.opt_local.wrap = true vim.opt_local.linebreak = true - -- Show column guide vim.opt_local.colorcolumn = "80" + + -- Toggle 'a' in formatoptions + vim.keymap.set("n", "<leader>a", function() + local fo = vim.opt_local.formatoptions:get() + if fo.a then + vim.opt_local.formatoptions:remove("a") + print("Auto-formatting disabled") + else + vim.opt_local.formatoptions:append("a") + print("Auto-formatting enabled") + end + end, { buffer = true, desc = "Toggle auto-formatting" }) end, }) -- Setup formatting on LSP attach |
