Initial Commit

This commit is contained in:
Drew Galbraith 2025-04-05 14:05:32 -07:00
commit bcb5556f7c
10 changed files with 166 additions and 0 deletions

5
init.lua Normal file
View File

@ -0,0 +1,5 @@
require("config.lazy")
require("config.opts")
require("config.lsp")
require("config.keys")

11
lazy-lock.json Normal file
View File

@ -0,0 +1,11 @@
{
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"material.nvim": { "branch": "main", "commit": "96285a62923ea8e38aea7b603099752da2a97e97" },
"mini.icons": { "branch": "main", "commit": "910db5df9724d65371182948f921fce23c2c881e" },
"nord.nvim": { "branch": "main", "commit": "b4863217a6272ecd41862e09fdea0ba7b7e5f8f5" },
"nvim-lspconfig": { "branch": "master", "commit": "cb33dea610b7eff240985be9f6fe219920e630ef" },
"nvim-treesitter": { "branch": "master", "commit": "523a9e148919f58eb5a013f76787e57696e00c93" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

19
lua/config/keys.lua Normal file
View File

@ -0,0 +1,19 @@
require("which-key").add({
{ "<leader>c", group = "code" },
{ "<leader>cd", vim.diagnostic.open_float, name = "diagnostic" },
{ "<leader>e", Snacks.explorer.open, name = "explorer" },
{ "<leader>f", group = "find" },
{ "<leader>ff", Snacks.picker.files, name = "files" },
{ "<leader>u", group = "ui" },
{ "<leader>ut", Snacks.picker.colorschemes, name = "colorschemes" },
{ "g", group = "goto" },
{ "gd", vim.lsp.buf.definition, name = "definition" },
{ "gr", Snacks.picker.lsp_references, nowait = true, name = "references" },
})
Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.inlay_hints():map("<leader>ui")

35
lua/config/lazy.lua Normal file
View File

@ -0,0 +1,35 @@
-- Bootstrap lazy.nvim
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"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = {},
-- automatically check for plugin updates
checker = { enabled = true },
})

34
lua/config/lsp.lua Normal file
View File

@ -0,0 +1,34 @@
require("lspconfig").basedpyright.setup({})
require("lspconfig").ruff.setup({})
require("lspconfig").lua_ls.setup({
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath("config")
and (vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc"))
then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
})
end,
settings = {
Lua = {},
},
})

9
lua/config/opts.lua Normal file
View File

@ -0,0 +1,9 @@
vim.opt.termguicolors = true
vim.cmd("colorscheme tokyonight")
vim.diagnostic.config({
virtual_text = true,
virtual_lines = {
current_line = true,
},
})

7
lua/plugins/lsp.lua Normal file
View File

@ -0,0 +1,7 @@
return {
"neovim/nvim-lspconfig",
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
}

9
lua/plugins/snacks.lua Normal file
View File

@ -0,0 +1,9 @@
return {
"folke/snacks.nvim",
priority = 1000,
opts = {
picker = {},
explorer = {},
toggle = {},
},
}

21
lua/plugins/theme.lua Normal file
View File

@ -0,0 +1,21 @@
return {
{
"marko-cerovac/material.nvim",
lazy = false,
priority = 1000,
config = function()
vim.g.material_style = "darker"
end,
},
{
"folke/tokyonight.nvim",
lazy = true,
opts = { style = "moon" },
},
{
"dupeiran001/nord.nvim",
lazy = false,
priority = 1000,
opts = {},
},
}

16
lua/plugins/ui.lua Normal file
View File

@ -0,0 +1,16 @@
return {
{
"folke/which-key.nvim",
event = "VeryLazy",
},
{
"echasnovski/mini.icons",
version = "*",
init = function()
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
}