diff --git a/init.lua b/init.lua index d2599900..7182f351 100644 --- a/init.lua +++ b/init.lua @@ -8,42 +8,29 @@ vim.g.maplocalleader = ' ' vim.g.have_nerd_font = true -vim.opt.shiftwidth = 4 -vim.opt.tabstop = 4 - -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' - -vim.g.have_nerd_font = true - --- tabs appear as 4 spaces -vim.opt.tabstop = 4 -vim.opt.shiftwidth = 4 - -- Make line numbers default vim.opt.number = true vim.opt.relativenumber = true +vim.opt.signcolumn = 'yes' + vim.opt.mouse = 'a' vim.opt.showmode = true +-- Supposedly reduces load time vim.schedule(function() vim.opt.clipboard = 'unnamedplus' end) -vim.opt.breakindent = true -vim.opt.undofile = true +vim.opt.tabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.undofile = true vim.opt.ignorecase = true vim.opt.smartcase = true -vim.opt.signcolumn = 'yes' - vim.opt.updatetime = 250 vim.opt.timeoutlen = 300 -vim.opt.splitright = true -vim.opt.splitbelow = true - vim.opt.list = true vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '·' } @@ -51,7 +38,6 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '·' } vim.opt.inccommand = 'split' vim.opt.cursorline = true - vim.opt.scrolloff = 6 -- Clear highlights on search when pressing in normal mode @@ -60,9 +46,6 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) @@ -77,6 +60,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- highlight on yank vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), @@ -85,6 +69,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- bootstrap lazy local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' @@ -96,11 +81,9 @@ end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) require('lazy').setup({ - -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', - -- See `:help gitsigns` to understand what the configuration keys do - { -- Adds git related signs to the gutter, as well as utilities for managing changes + { 'lewis6991/gitsigns.nvim', opts = { signs = { diff --git a/lazy-lock.json b/lazy-lock.json index f9a51ee2..a0a0a58e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -7,7 +7,7 @@ "debugpy": { "branch": "main", "commit": "02723de14048aaa414cd4be01268b0a0f4c786ad" }, "fidget.nvim": { "branch": "main", "commit": "a0abbf18084b77d28bc70e24752e4f4fd54aea17" }, "gitsigns.nvim": { "branch": "main", "commit": "2eaa30537365f6889c850bd46ef6f18ddf8fac70" }, - "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, "luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },