feat(neovim): Add nvim config files
This commit is contained in:
2
dot-config/nvim/init.lua
Normal file
2
dot-config/nvim/init.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
require("config.vim-options")
|
||||
require("config.lazy")
|
||||
35
dot-config/nvim/lua/config/lazy.lua
Normal file
35
dot-config/nvim/lua/config/lazy.lua
Normal 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 },
|
||||
})
|
||||
8
dot-config/nvim/lua/config/vim-options.lua
Normal file
8
dot-config/nvim/lua/config/vim-options.lua
Normal 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 })
|
||||
9
dot-config/nvim/lua/plugins/catpuccin.lua
Normal file
9
dot-config/nvim/lua/plugins/catpuccin.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
lazy = false,
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme("catppuccin-mocha")
|
||||
end,
|
||||
}
|
||||
10
dot-config/nvim/lua/plugins/lualine.lua
Normal file
10
dot-config/nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
26
dot-config/nvim/lua/plugins/mason.lua
Normal file
26
dot-config/nvim/lua/plugins/mason.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
12
dot-config/nvim/lua/plugins/neo-tree.lua
Normal file
12
dot-config/nvim/lua/plugins/neo-tree.lua
Normal 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,
|
||||
}
|
||||
13
dot-config/nvim/lua/plugins/none-ls.lua
Normal file
13
dot-config/nvim/lua/plugins/none-ls.lua
Normal 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,
|
||||
}
|
||||
25
dot-config/nvim/lua/plugins/telescope.lua
Normal file
25
dot-config/nvim/lua/plugins/telescope.lua
Normal 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,
|
||||
},
|
||||
}
|
||||
17
dot-config/nvim/lua/plugins/treesitter.lua
Normal file
17
dot-config/nvim/lua/plugins/treesitter.lua
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user