From 3e110044f293aadcd22dbeace4e433c3ed181a18 Mon Sep 17 00:00:00 2001 From: Grace Yoder Date: Thu, 19 Feb 2026 15:16:51 -0500 Subject: turing changes --- vim/.config/nvim/init.lua | 15 +++++++++++++-- vim/.config/nvim/lua/remap.lua | 25 +++++++++++-------------- 2 files changed, 24 insertions(+), 16 deletions(-) (limited to 'vim/.config') 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", "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 diff --git a/vim/.config/nvim/lua/remap.lua b/vim/.config/nvim/lua/remap.lua index 974ff11..73b549c 100644 --- a/vim/.config/nvim/lua/remap.lua +++ b/vim/.config/nvim/lua/remap.lua @@ -44,6 +44,7 @@ vim.keymap.set('n', 'fs', ts_builtins.lsp_workspace_symbols, { desc = 'T vim.keymap.set('n', 'fts', ts_builtins.treesitter, { desc = 'Telescope find treesitter' }) vim.keymap.set('n', 'fd', ts_builtins.lsp_definitions, { desc = 'Telescope find definition' }) vim.keymap.set('n', 'ftd', ts_builtins.lsp_type_definitions, { desc = 'Telescope find type definition' }) +vim.keymap.set('n', 'fr', ts_builtins.lsp_references, { desc = 'Telescope find references' }) -- Undo Tree vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) @@ -52,18 +53,18 @@ vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) local betterTerm = require('betterTerm') -- toggle firts term -vim.keymap.set({"n", "t"}, "tt", betterTerm.open, { desc = "Open terminal"}) +vim.keymap.set({ "n", "t" }, "tt", betterTerm.open, { desc = "Open terminal" }) -- Select term focus -- vim.keymap.set({"n"}, "tf", betterTerm.select, { desc = "Select terminal"}) -- Create new term local current = 2 vim.keymap.set( - {"n"}, "tn", - function() - betterTerm.open(current) - current = current + 1 - end, - { desc = "New terminal"} + { "n" }, "tn", + function() + betterTerm.open(current) + current = current + 1 + end, + { desc = "New terminal" } ) -- Neotree @@ -84,15 +85,11 @@ vim.keymap.set('n', '', function() ntc.execute({ action = "focus", -- OPTIONAL, this is the default value source = "filesystem", -- OPTIONAL, this is the default value - position = "right", -- OPTIONAL, this is the default value + position = "right", -- OPTIONAL, this is the default value reveal_file = reveal_file, -- path to file or folder to reveal reveal_force_cwd = true, -- change cwd without asking if needed toggle = true, - }) end, + }) + end, { desc = "Show Sidebar" } ) - - - - - -- cgit v1.3.1