nvim
This commit is contained in:
parent
83d6e3f7cf
commit
bda21856b1
10 changed files with 155 additions and 0 deletions
26
.config/nvim/init.lua
Normal file
26
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
-- Setup leader key
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Lazy: Ensure lazy is installed and present
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Load plugin configuration and init Lazy
|
||||
require("lazy").setup("plugins", {
|
||||
install = {
|
||||
missing = true, -- Install missing plugins on startup
|
||||
}
|
||||
})
|
||||
|
||||
-- Keybinds
|
||||
require("keybinds")
|
9
.config/nvim/lazy-lock.json
Normal file
9
.config/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
|
||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "c10b7be7751aee820a02f2d1fafe76bc316fe223" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "d12140c5687a1186b95b3f42dbc6cc769df0cf0d" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "e7ea07e42c478cb466cf96124693b447add84011" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }
|
||||
}
|
17
.config/nvim/lua/config/lspconfig.lua
Normal file
17
.config/nvim/lua/config/lspconfig.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local Util = require("lazy.util")
|
||||
|
||||
---@class PluginLspOpts
|
||||
local opts = {
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
}
|
||||
}
|
||||
|
||||
local configFn = function(_, opts)
|
||||
Util.format.register(Util.lsp.formatter())
|
||||
end
|
||||
|
||||
return {
|
||||
opts = opts,
|
||||
config = configFn,
|
||||
}
|
12
.config/nvim/lua/config/nvim-treesitter.lua
Normal file
12
.config/nvim/lua/config/nvim-treesitter.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "lua", "go" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
|
||||
return config
|
3
.config/nvim/lua/keybinds.lua
Normal file
3
.config/nvim/lua/keybinds.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- Telescope
|
||||
vim.keymap.set('n', '<Leader>ff', '<cmd>:Telescope find_files<cr>')
|
||||
vim.keymap.set('n', '<Leader>fb', '<cmd>:Telescope buffers<cr>')
|
24
.config/nvim/lua/plugins/lsp.lua
Normal file
24
.config/nvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
cmd = "Mason",
|
||||
build = ":MasonUpdate",
|
||||
},
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
lua_ls = {
|
||||
settings = { Lua = { diagnostics = { globals = { "vim" }}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("mason").setup()
|
||||
end
|
||||
}
|
||||
|
17
.config/nvim/lua/plugins/none-ls.lua
Normal file
17
.config/nvim/lua/plugins/none-ls.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "mason.nvim" },
|
||||
opts = function()
|
||||
local null_ls = require("null-ls")
|
||||
local formatting = null_ls.builtins.formatting
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
local code_actions = null_ls.builtins.code_actions
|
||||
local completion = null_ls.builtins.completion
|
||||
return {
|
||||
sources = {
|
||||
formatting.stylua,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
7
.config/nvim/lua/plugins/telescope.lua
Normal file
7
.config/nvim/lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.5',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
}
|
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
14
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function(_, opts)
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "lua", "go" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
}
|
26
.config/nvim/lua/plugins2.lua
Normal file
26
.config/nvim/lua/plugins2.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
local plugins = {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.5',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = require("config.nvim-treesitter"),
|
||||
},
|
||||
-- LSP
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = require("config.lspconfig").opts,
|
||||
config = require("config.lspconfig").config,
|
||||
},
|
||||
-- Quality of life
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
},
|
||||
}
|
||||
|
||||
return plugins
|
Loading…
Add table
Add a link
Reference in a new issue