Compare commits

..

No commits in common. "c5903dd53319b42e2e6ec152a988a1b9149a9c19" and "60737db7b26f7ced001d2879458f9049912aba4f" have entirely different histories.

3 changed files with 28 additions and 17 deletions

View file

@ -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 = false
vim.g.have_nerd_font = true
-- [[ Setting options ]]
require 'options'

View file

@ -5,8 +5,6 @@
vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- 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' })
@ -17,9 +15,6 @@ vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagn
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
vim.keymap.set('n', '<leader>l', '<cmd>Lazy<CR>', { desc = 'Lazy plugin manager' })
-- This is useful for quickly rerunning make or other similar tools
-- TODO: Reconsider binds
vim.keymap.set('n', '<leader>1', '<cmd>!!<CR>', { desc = 'Run last command' })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@ -86,16 +81,35 @@ vim.keymap.set('n', '<leader><tab>d', '<cmd>tabclose<cr>', { desc = 'Close Tab'
vim.keymap.set('n', '<leader><tab>]', '<cmd>tabnext<cr>', { desc = 'Next Tab' })
vim.keymap.set('n', '<leader><tab>[', '<cmd>tabprevious<cr>', { desc = 'Previous Tab' })
-- FIXME: These binds are not well considered
vim.keymap.set('n', '\\', '<cmd>Neotree toggle<cr>', { desc = 'Toggle Neotree' })
vim.keymap.set('n', '0', '<cmd>ToggleTerm<cr>', { desc = 'Toggle Terminal' })
-- Wraps document to specified column width
-- Toggle LLM Suggestions
vim.keymap.set('n', '<leader>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', '<leader>dw', function()
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'
-- 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

View file

@ -1,12 +1,9 @@
-- [[ 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.uv or vim.loop).fs_stat(lazypath) then
if not vim.loop.fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
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
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)