From db50df146990120275b4a95d9f80a2763448bf1f Mon Sep 17 00:00:00 2001 From: Grant Horner Date: Sun, 29 Mar 2026 19:43:53 -0400 Subject: [PATCH] initial commit --- .luarc.json | 7 +++ init.lua | 113 ++++++++++++++++++++++++++++++++++++++++++++ nvim-pack-lock.json | 36 ++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 .luarc.json create mode 100644 init.lua create mode 100644 nvim-pack-lock.json diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..2c36abd --- /dev/null +++ b/.luarc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "workspace.library": [ + "/opt/homebrew/Cellar/neovim/0.12.0/share/nvim/runtime/lua", + "~/.local/share/nvim/lazy/lazy.nvim/lua" + ] +} diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..3340807 --- /dev/null +++ b/init.lua @@ -0,0 +1,113 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = ',' + +vim.o.number = true + +vim.o.mouse = 'a' +vim.o.showmode = false + +vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) + +vim.o.breakindent = true + +vim.o.undofile = true + +vim.o.ignorecase = true +vim.o.smartcase = true + +-- Adds extra space for git diff symbols and stuff +vim.o.signcolumn = 'yes' + +-- Decrease update time +vim.o.updatetime = 250 + +-- Decrease mapped sequence wait time +vim.o.timeoutlen = 300 + +-- Configure how new splits should be opened +vim.o.splitright = true +vim.o.splitbelow = true +vim.o.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +vim.o.inccommand = 'split' + +-- Show which line your cursor is on +vim.o.cursorline = true + +-- Minimal number of screen lines to keep above and below the cursor. +vim.o.scrolloff = 3 + +-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), +-- instead raise a dialog asking if you wish to save the current file(s) +-- See `:help 'confirm'` +vim.o.confirm = true + +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() vim.hl.on_yank() end, +}) + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +vim.keymap.set('n', '', 'nohlsearch') + +-- Diagnostic Config & Keymaps +-- See :help vim.diagnostic.Opts +vim.diagnostic.config { + update_in_insert = false, + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = { min = vim.diagnostic.severity.WARN } }, + + -- Can switch between these as you prefer + virtual_text = false, -- Text shows up at the end of the line + virtual_lines = true, -- Text shows up underneath the line, with virtual lines + + -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` + jump = { float = true }, +} + +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) +vim.keymap.set('n', 'K', function() vim.lsp.buf.hover({border = 'rounded'}) end) + +vim.lsp.enable({'lua_ls'}) + +local github = 'https://github.com/' +vim.pack.add({ + github .. 'nvim-lua/plenary.nvim', + github .. 'nvim-telescope/telescope-fzf-native.nvim', + github .. 'nvim-telescope/telescope.nvim', + github .. 'stevearc/oil.nvim', + github .. 'neovim/nvim-lspconfig', + github .. 'nvim-mini/mini.nvim', + github .. 'lewis6991/gitsigns.nvim', + github .. 'neogitorg/neogit', +}) + +-- Telescope +local builtin = require('telescope.builtin') +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope live grep' }) +vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) +vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + +-- Oil +require('oil').setup({ + default_file_explorer = true, + columns = { + "icon", + } +}) +vim.keymap.set('n', 'rw', 'Oil', { desc = 'Open file explorer' }) + +-- Mini +require('mini.move').setup() +require('mini.surround').setup() + +-- Neogit +vim.keymap.set('n', 'gg', 'Neogit') diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..fe4a340 --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,36 @@ +{ + "plugins": { + "gitsigns.nvim": { + "rev": "50c205548d8b037b7ff6378fca6d21146f0b6161", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, + "mini.nvim": { + "rev": "af5f75c9ce572a4d1f0c77d6fb4ea764d16c1b3c", + "src": "https://github.com/nvim-mini/mini.nvim" + }, + "neogit": { + "rev": "4681c1fdac1b730592ae195576e87406f7255750", + "src": "https://github.com/neogitorg/neogit" + }, + "nvim-lspconfig": { + "rev": "16812abf0e8d8175155f26143a8504e8253e92b0", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "oil.nvim": { + "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "src": "https://github.com/stevearc/oil.nvim" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "telescope-fzf-native.nvim": { + "rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope.nvim": { + "rev": "5255aa27c422de944791318024167ad5d40aad20", + "src": "https://github.com/nvim-telescope/telescope.nvim" + } + } +}