initial commit

This commit is contained in:
hgranthorner
2026-09-14 16:09:15 -04:00
commit 0485e97fd2
13 changed files with 270 additions and 0 deletions

1
after/ftplugin/lua.lua Normal file
View File

@@ -0,0 +1 @@
vim.keymap.set("n", "<localleader>x", "<CMD>source<CR>", { buf = 0 })

131
init.lua Normal file
View File

@@ -0,0 +1,131 @@
vim.opt.swapfile = false
vim.g.mapleader = " "
vim.g.maplocalleader = ","
vim.opt.expandtab = true -- Convert tabs to spaces
vim.opt.tabstop = 4 -- Number of spaces per tab
vim.opt.shiftwidth = 4 -- Spaces used for autoindent
vim.opt.softtabstop = 4 -- Spaces inserted when pressing Tab
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 = false
-- 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
-- Neovim 0.12+ improvements
vim.o.winborder = "rounded"
vim.o.pumborder = "rounded"
vim.opt.completeopt:append("fuzzy")
-- vim.o.autocomplete = 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.hl_op()
end,
})
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- Diagnostic Config & Keymaps
-- See :help vim.diagnostic.Opts
vim.diagnostic.config({
update_in_insert = false,
severity_sort = true,
float = { source = "if_many" },
underline = { severity = { min = vim.diagnostic.severity.WARN } },
-- Can switch between these as you prefer
virtual_text = true, -- Text shows up at the end of the line
virtual_lines = false, -- 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 = {
on_jump = function(_, bufnr)
-- Open diagnostic float when you jump
vim.diagnostic.open_float({ bufnr = bufnr, scope = "cursor", focus = false })
end,
},
})
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
vim.keymap.set("n", "<leader>so", "<CMD>so<CR>")
vim.keymap.set("n", "<leader>ei", function()
vim.cmd([[edit $MYVIMRC]])
end)
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
vim.pack.add({
"https://github.com/tjdevries/colorbuddy.nvim",
"https://github.com/hgranthorner/ghosttybuddy.nvim",
})
vim.cmd.colorscheme("ghostty")
local nmap_leader = function(suffix, rhs, desc)
vim.keymap.set("n", "<Leader>" .. suffix, rhs, { desc = desc })
end
nmap_leader("fs", function()
vim.cmd([[write]])
end, "Save")
local function add_mcursor_to_selection()
vim.cmd([[normal! Q *]])
vim.cmd.nohl()
vim.cmd([[normal! 1q=]])
end
vim.keymap.set({ "n", "v" }, "<C-g>", add_mcursor_to_selection)
require("plugins.mini")
require("plugins.oil")
require("plugins.fugitive")
require("plugins.conform")
require("settings.lsp")

5
lsp/gopls.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'gopls' },
filetypes = { 'go' },
root_markers = { 'go.mod', '.git' },
}

24
lsp/lua_ls.lua Normal file
View File

@@ -0,0 +1,24 @@
return {
cmd = { "lua-language-server" },
filetypes = { "lua" },
root_markers = { ".luarc.json", ".luarc.jsonc", ".git" },
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
telemetry = {
enable = false,
},
},
},
}

5
lsp/ruby_lsp.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { "mise", "x", "--", "ruby-lsp" },
filetypes = { "ruby" },
root_markers = { ".git", "Gemfile" }
}

5
lsp/tsc.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { 'tsc', '--lsp', '--stdio' },
filetypes = { 'javascript', 'typescript', 'typescriptreact', 'javascriptreact' },
root_markers = { '.git', 'package.json' }
}

5
lsp/tsserver.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
cmd = { "npx", "typescript-language-server", "--stdio" },
filetypes = { 'javascript', 'typescript', 'typescriptreact', 'javascriptreact' },
root_markers = { '.git', 'package.json' }
}

18
lua/plugins/conform.lua Normal file
View File

@@ -0,0 +1,18 @@
vim.pack.add({
"https://github.com/stevearc/conform.nvim",
})
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run the first available formatter
javascript = { "prettierd", "prettier", stop_after_first = true },
},
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*",
callback = function(args)
require("conform").format({ bufnr = args.buf })
end,
})

5
lua/plugins/fugitive.lua Normal file
View File

@@ -0,0 +1,5 @@
vim.pack.add({
'https://github.com/tpope/vim-fugitive',
})
vim.keymap.set("n", "<leader>gg", "<CMD>Git<CR>")

25
lua/plugins/mini.lua Normal file
View File

@@ -0,0 +1,25 @@
local nmap_leader = function(suffix, rhs, desc)
vim.keymap.set('n', '<Leader>' .. suffix, rhs, { desc = desc })
end
vim.pack.add({
'https://github.com/nvim-mini/mini.nvim',
})
require('mini.pick').setup()
nmap_leader('ff', '<Cmd>Pick files<CR>', 'Files')
nmap_leader('fc', function()
MiniPick.builtin.files({}, {source = {cwd = vim.fn.stdpath('config')}})
end, 'Config')
nmap_leader('fb', '<Cmd>Pick buffers<CR>', 'Buffers')
nmap_leader('fh', '<Cmd>Pick help<CR>', 'Help')
nmap_leader('fg', '<Cmd>Pick grep_live<CR>', 'Grep')
require('mini.diff').setup()
require('mini.move').setup()
require('mini.surround').setup()
MiniFiles = require('mini.files')
MiniFiles.setup()
nmap_leader('ft', MiniFiles.open, 'Tree')

12
lua/plugins/oil.lua Normal file
View File

@@ -0,0 +1,12 @@
vim.pack.add({
'https://github.com/stevearc/oil.nvim',
})
require("oil").setup()
local nmap_leader = function(suffix, rhs, desc)
vim.keymap.set('n', '<Leader>' .. suffix, rhs, { desc = desc })
end
nmap_leader('rw', function() vim.cmd[[Oil]] end)

6
lua/settings/lsp.lua Normal file
View File

@@ -0,0 +1,6 @@
vim.keymap.set("n", "K", function()
vim.lsp.buf.hover({ border = "rounded" })
end)
vim.keymap.set("n", "grd", vim.lsp.buf.definition)
vim.lsp.enable({'gopls', 'tsserver', 'lua_ls', 'ruby_lsp'})

28
nvim-pack-lock.json Normal file
View File

@@ -0,0 +1,28 @@
{
"plugins": {
"colorbuddy.nvim": {
"rev": "8b968581e5c19d22a861d5f3fe5dbd83394fa681",
"src": "https://github.com/tjdevries/colorbuddy.nvim"
},
"conform.nvim": {
"rev": "016802de402556da54c36bd7359b441266b01cdd",
"src": "https://github.com/stevearc/conform.nvim"
},
"ghosttybuddy.nvim": {
"rev": "1aea43228171a123424559002e13a2310c25ec0e",
"src": "https://github.com/hgranthorner/ghosttybuddy.nvim"
},
"mini.nvim": {
"rev": "8cef23520832134c05e4524e49f0468623501053",
"src": "https://github.com/nvim-mini/mini.nvim"
},
"oil.nvim": {
"rev": "b73018b75affd13fa38e2fc94ef753b465f770d7",
"src": "https://github.com/stevearc/oil.nvim"
},
"vim-fugitive": {
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
"src": "https://github.com/tpope/vim-fugitive"
}
}
}