diff --git a/lua/keymaps.lua b/lua/keymaps.lua index da992a2..6d640a1 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -81,4 +81,32 @@ vim.keymap.set('n', 'd', 'tabclose', { desc = 'Close Tab' vim.keymap.set('n', ']', 'tabnext', { desc = 'Next Tab' }) vim.keymap.set('n', '[', 'tabprevious', { desc = 'Previous Tab' }) +-- Toggle LLM Suggestions +vim.keymap.set('n', 'tt', function() + local cp = require 'copilot.suggestion' + + cp.toggle_auto_trigger() + + if vim.b.copilot_suggestion_auto_trigger then + vim.notify 'Suggestions Enabled' + else + vim.notify 'Suggestions Disabled' + end +end, { desc = '[T]oggle LLM Suggestion Auto-[T]rigger' }) + +-- Define a function to wrap lines to 80 columns +vim.keymap.set('n', 'dw', function() + -- Save the current 'textwidth' setting + local current_tw = vim.o.textwidth + + -- Set 'textwidth' to 80 temporarily + vim.o.textwidth = 80 + + -- Reformat all lines in the buffer + vim.api.nvim_command 'normal! ggVGgq' + + -- Restore the original 'textwidth' + vim.o.textwidth = current_tw +end, { desc = '[D]ocument [W]rap to 80 column width' }) + -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 4e0cfd0..135227e 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -16,6 +16,9 @@ require('lazy').setup({ -- Remember position { 'vladdoster/remember.nvim', opts = {} }, + -- Terminal + {'akinsho/toggleterm.nvim', version = "*", config = true}, + -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc.