feat(neovim): Add nvim config files

This commit is contained in:
2024-10-29 09:15:26 -05:00
parent a7c36de720
commit 0d8daff023
10 changed files with 157 additions and 0 deletions

2
dot-config/nvim/init.lua Normal file
View File

@@ -0,0 +1,2 @@
require("config.vim-options")
require("config.lazy")

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 = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
})

View File

@@ -0,0 +1,8 @@
vim.cmd.set("expandtab")
vim.cmd.set("tabstop=2")
vim.cmd.set("softtabstop=2")
vim.cmd.set("shiftwidth=2")
vim.opt.swapfile = false
vim.wo.number = true
vim.keymap.set("i", "jj", "<Esc>", { noremap = false })

View File

@@ -0,0 +1,9 @@
return {
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
priority = 1000,
config = function()
vim.cmd.colorscheme("catppuccin-mocha")
end,
}

View File

@@ -0,0 +1,10 @@
return {
"nvim-lualine/lualine.nvim",
config = function()
require("lualine").setup({
options = {
theme = "catppuccin",
},
})
end,
}

View File

@@ -0,0 +1,26 @@
return {
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" },
})
end,
},
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
end,
},
}

View File

@@ -0,0 +1,12 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", "<C-n>", ":Neotree filesystem reveal left toggle<CR>", {})
end,
}

View File

@@ -0,0 +1,13 @@
return {
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
},
})
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}

View File

@@ -0,0 +1,25 @@
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.8",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
},
})
require("telescope").load_extension("ui-select")
end,
},
}

View File

@@ -0,0 +1,17 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local config = require("nvim-treesitter.configs")
config.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query" },
auto_install = true,
highlight = {
enable = true,
},
indent = {
enable = true,
},
})
end,
}