diff --git a/init.lua b/init.lua index e8c5b3e..f95ec48 100644 --- a/init.lua +++ b/init.lua @@ -24,7 +24,7 @@ vim.g.sysname = vim.g.os_uname.sysname -- "Linux, FreeBSD, ..." vim.g.arch = vim.g.os_uname.machine -- "x86_64, ..." -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = true +vim.g.have_nerd_font = false -- [[ Setting options ]] require 'options' diff --git a/lua/keymaps.lua b/lua/keymaps.lua index de9aecd..1b1a144 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -5,6 +5,8 @@ vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') +-- FIXME: Port to current API + -- Diagnostic keymaps ---@diagnostic disable-next-line: deprecated vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) @@ -15,6 +17,9 @@ vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagn vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', 'l', 'Lazy', { desc = 'Lazy plugin manager' }) + +-- This is useful for quickly rerunning make or other similar tools +-- TODO: Reconsider binds vim.keymap.set('n', '1', '!!', { desc = 'Run last command' }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier @@ -81,35 +86,16 @@ 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' }) +-- FIXME: These binds are not well considered vim.keymap.set('n', '\\', 'Neotree toggle', { desc = 'Toggle Neotree' }) vim.keymap.set('n', '0', 'ToggleTerm', { desc = 'Toggle Terminal' }) --- 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 +-- Wraps document to specified column width 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 + local current_tw = vim.o.textwidth -- Save the current 'textwidth' setting + vim.o.textwidth = 80 -- Set 'textwidth' to 80 temporarily + vim.api.nvim_command 'normal! ggVGgq' -- Reformat all lines in the buffer + vim.o.textwidth = current_tw -- Restore the original 'textwidth' end, { desc = '[D]ocument [W]rap to 80 column width' }) -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/lazy-bootstrap.lua b/lua/lazy-bootstrap.lua index 5ea6ffc..8dc96c8 100644 --- a/lua/lazy-bootstrap.lua +++ b/lua/lazy-bootstrap.lua @@ -1,9 +1,12 @@ -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.loop.fs_stat(lazypath) then +if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath)