fix(config): new config, it's been a while

This commit is contained in:
devaine 2025-10-26 19:41:13 -05:00
commit 1fe92c532b
Signed by: devaine
GPG key ID: 954B1DCAC6FF84EE
11 changed files with 385 additions and 0 deletions

28
lua/config/lazy.lua Normal file
View file

@ -0,0 +1,28 @@
-- 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)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- plugin import
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
install = {},
-- automatically check for plugin updates
checker = { enabled = true },
})

54
lua/config/vim.lua Normal file
View file

@ -0,0 +1,54 @@
-- set the leader
vim.g.mapleader = " "
-- neovim/vim variables
local opt = vim.opt
local keybind = vim.keymap.set
-- basic
opt.relativenumber = true
opt.number = true
opt.termguicolors = true
-- indentation
opt.tabstop = 2
opt.softtabstop = 0
opt.shiftwidth = 2
opt.smarttab = true
opt.smartindent = true
-- searches
opt.incsearch = true
-- mapleader
vim.g.mapleader = " "
-- keybinds
keybind("n", "<leader>hh", "<cmd>lua vim.diagnostic.setqflist()<CR>", { desc = "LSP Diagonistics" })
-- buffer keybinds
keybind("n", "<leader>bb", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
keybind("n", "<leader>nn", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
keybind("n", "<leader>,,", "<cmd>bdel<CR>", { desc = "Delete Buffer" })
-- visual mode keybinds
keybind("v", "<leader>ii", '"+y', { desc = "Copy to clipboard ( + yank)" })
keybind("v", "<", "<gv", { desc = "Indent left and reselect" })
keybind("v", ">", ">gv", { desc = "Indent right and reselect" })
keybind("v", "<S-Up>", ":m '<-2<CR>gv", { desc = "Move selection up" })
keybind("v", "<S-Down>", ":m '>+1<CR>gv", { desc = "Move selection down" })
-- friend keybinds
keybind("i", "jk", "<Esc>", { desc = "Keybind set for Justin" })
-- file explorer
keybind("n", "<leader>mm", "<Cmd>Neotree toggle<CR>", { desc = "Toggle File Explorer" })
keybind("n", "<leader>jj", "<Cmd>Neotree action=focus<CR>", { desc = "Focus on file explorer" })
-- file handling
opt.backup = false
opt.writebackup = false
opt.swapfile = false
opt.undofile = true
opt.undodir = vim.fn.expand("~/.nvim/undodir")
opt.autoread = true

View file

@ -0,0 +1,39 @@
return {
{
"saghen/blink.cmp",
dependencies = {
{ "rafamadriz/friendly-snippets" },
},
version = "1.*",
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
preset = "none",
['<Tab>'] = { 'select_next', 'fallback' },
['<S-Tab>'] = { 'select_prev', 'fallback' },
["<CR>"] = { 'select_and_accept', 'fallback' },
['<C-e>'] = { 'hide', 'fallback' }
},
completion = {
documentation = {
auto_show = true,
treesitter_highlighting = true
},
menu = { auto_show = true },
ghost_text = { enabled = true }
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
signature = { enabled = true },
fuzzy = { implementation = "prefer_rust_with_warning" }
}
}
}

84
lua/plugins/dev-utils.lua Normal file
View file

@ -0,0 +1,84 @@
return {
-- Parser that does syntax highlighting
{
"nvim-treesitter/nvim-treesitter",
branch = 'master',
lazy = false,
build = ":TSUpdate",
config = function ()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"lua",
"cpp",
"java",
"javascript",
"bash",
"python",
"typescript",
"css",
"html",
"jsdoc",
"http",
"sql",
"ssh_config",
"json",
"tsx",
"xml",
"yaml",
"nginx",
"gitcommit",
"gitignore",
"cmake"
},
indent = { enable = true },
highlight = { enable = true }
})
end
},
-- Allows pairs for {}, '', "", ()
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = true,
opts = {}
},
-- Allows automatic tagging on HTML or JSON (E.g: <div>test</div> )
{
"windwp/nvim-ts-autotag",
config = function()
require("nvim-ts-autotag").setup()
end,
},
-- Provides highlighting on TODO's, E.g:
-- NOTE: This is a note.
-- WARN: This is warning note.
-- TODO: This is a to-do note.
-- FIX: This is a fix note.
-- PERF: This is a performance note.
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("todo-comments").setup()
end,
},
-- Allows highlighting for hexadecimal colors for RGB characters.
-- E.g: #FFFFFF
{
"brenoprata10/nvim-highlight-colors",
config = function()
require("nvim-highlight-colors").setup()
end,
},
-- Shows line(s) indicating indentation.
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
},
}

16
lua/plugins/discord.lua Normal file
View file

@ -0,0 +1,16 @@
-- Just Discord Rich Presence for Neovim, neat huh?
return {
"vyfor/cord.nvim",
build = ":Cord update",
config = function()
require("cord").setup({
display = {
flavor = "dark",
},
text = {
default = "programming most likely",
workspace = "",
},
})
end,
}

View file

@ -0,0 +1,18 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
},
lazy = false,
opts = {
window = {
mappings = {
["P"] = "toggle_preview",
}
}
},
}

38
lua/plugins/formatter.lua Normal file
View file

@ -0,0 +1,38 @@
-- Formatter plugin, helps with formatting code on saving the file.
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
formatters_by_ft = {
lua = { "stylua" },
python = { "black" },
javascript = { "prettier" }, -- add stop_after_first for n > 1
typescript = { "prettier" },
sh = { "shfmt", "shellcheck" },
bash = { "shfmt", "shellcheck" },
},
formatters = {
prettier = {
prepend_args = function()
return { "" }
end,
},
},
default_format_opts = {
lsp_format = "fallback",
},
format_on_save = {
timeout_ms = 500,
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}

75
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,75 @@
return {
{
"mason-org/mason.nvim",
dependencies = {
"mason-org/mason-lspconfig.nvim",
},
opts = function()
require("mason").setup()
require("mason-lspconfig").setup({
-- Ensure the install of these language servers
ensure_installed = {
"lua_ls",
"clangd",
"bashls",
"ts_ls",
"cssls",
"html",
"tailwindcss",
"pylsp",
},
})
end,
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
local caps = vim.lsp.protocol.make_client_capabilities()
local capabilities = require("blink.cmp").get_lsp_capabilities(caps)
capabilities.textDocument.completion.completionItem.snippetSupport = true
vim.lsp.config("*", {
capabilities = capabilities,
})
vim.lsp.config("lua_ls", {
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
},
},
})
vim.lsp.config("ts_ls", {
init_options = { preferences = { disableSuggestions = false } },
})
vim.lsp.enable({
"lua_ls",
"clangd",
"bashls",
"ts_ls",
"cssls",
"html",
"tailwindcss",
"pylsp",
})
end,
},
{
"esmuellert/nvim-eslint",
config = function()
require("nvim-eslint").setup({
settings = {
workingDirectory = function(bufnr)
return { directory = vim.fs.root(bufnr, { "package.json" }) }
end,
},
})
end,
},
}

9
lua/plugins/ui.lua Normal file
View file

@ -0,0 +1,9 @@
return {
-- Colorscheme
{
"rebelot/kanagawa.nvim",
config = function()
vim.cmd([[colorscheme kanagawa-dragon]])
end,
}
}