nvim/lua/plugins/init.lua

177 lines
3.7 KiB
Lua
Raw Normal View History

2023-12-12 12:16:58 +00:00
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)
require("lazy").setup({
-- completions.lua
{
"hrsh7th/nvim-cmp", -- Auto completion
dependencies = {
"neovim/nvim-lspconfig",
-- Snippet Engine & its associated nvim-cmp source
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
-- Adds LSP completion capabilities
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
-- Adds a number of user-friendly snippets
"rafamadriz/friendly-snippets",
},
},
-- lspconfig.lua
{
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
},
2024-02-20 12:22:00 +00:00
{
-- I didn't figure out how to use null-ls/none-ls...
"sbdchd/neoformat",
init = function()
-- Prefer Alejandra for Nix files
vim.g.neoformat_enabled_nix = { "alejandra" }
end,
keys = {
{ "<Space>lf", "<cmd>Neoformat<CR>", desc = "Format file" },
},
},
2023-12-12 12:16:58 +00:00
-- nvim-tree.lua
2024-02-19 19:26:04 +00:00
{
"nvim-tree/nvim-tree.lua",
opts = {
view = {
adaptive_size = true,
},
},
init = function()
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
end,
keys = {
{ "<Space>e", "<cmd>NvimTreeFindFileToggle<CR>", desc = "File Explorer" },
},
},
2023-12-12 12:16:58 +00:00
-- telescope.lua
2024-02-21 02:52:04 +00:00
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {},
keys = {
{ "<Space>f", "<cmd>Telescope find_files<CR>", desc = "Find files" },
{ "<Space><Space>", "<cmd>Telescope oldfiles<CR>", desc = "Recent files" },
{ "<Space>sg", "<cmd>Telescope live_grep<CR>", desc = "Live grep" },
},
},
2023-12-12 12:16:58 +00:00
-- treesitter.lua
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
-- misc
{
"folke/tokyonight.nvim", -- theme
lazy = false,
priority = 1000,
opts = {},
init = function()
vim.cmd([[ colorscheme tokyonight-night ]])
end,
},
{
2024-02-19 19:26:04 +00:00
"nvim-lualine/lualine.nvim", -- status line
2023-12-12 12:16:58 +00:00
dependencies = {
"kyazdani42/nvim-web-devicons", -- for filetype icons
},
opts = {
options = {
-- disable separators
section_separators = "",
component_separators = "",
-- color scheme
theme = "tokyonight",
},
2024-02-19 17:47:28 +00:00
-- hide filename
sections = {
lualine_c = {},
},
2023-12-12 12:16:58 +00:00
},
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {}, -- this is equalent to setup({}) function
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeoutlen = 300
end,
opts = {},
},
{
"glepnir/lspsaga.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter", -- optional
2024-02-19 19:26:04 +00:00
"nvim-tree/nvim-web-devicons", -- optional
2023-12-12 12:16:58 +00:00
},
opts = {
lightbulb = {
2024-02-19 19:27:06 +00:00
virtual_text = false,
2023-12-12 12:16:58 +00:00
},
},
2024-02-19 19:27:06 +00:00
keys = {
{ "<Space>a", "<cmd>Lspsaga code_action<CR>", desc = "Code Action" },
},
2023-12-12 12:16:58 +00:00
},
{
"romgrk/barbar.nvim",
dependencies = {
2024-02-19 19:26:04 +00:00
"lewis6991/gitsigns.nvim", -- OPTIONAL: for git status
2023-12-12 12:16:58 +00:00
"nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons
},
init = function()
vim.g.barbar_auto_setup = false
end,
2024-02-19 17:44:26 +00:00
opts = {
auto_hide = 1,
},
2023-12-12 12:16:58 +00:00
},
2024-02-19 19:26:04 +00:00
{ "lewis6991/gitsigns.nvim", opts = {} },
2023-12-12 12:16:58 +00:00
})
-- LSP related
2024-02-19 19:26:04 +00:00
require("plugins.lspconfig") -- utilizes lsp
2023-12-12 12:16:58 +00:00
require("plugins.completions") -- adds completions
2024-02-19 19:26:04 +00:00
require("plugins.treesitter") -- better highlights