Initial Commit

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

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,
},
}