modified structure
This commit is contained in:
30
lua/core/plugin_loader.lua
Normal file
30
lua/core/plugin_loader.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local config = require("config").plugins
|
||||
|
||||
-- Plugin loader
|
||||
|
||||
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",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Plugins
|
||||
|
||||
local plugins = {}
|
||||
|
||||
for name, info in pairs(config) do
|
||||
if info.enabled then
|
||||
local plugin = require("core.plugins." .. name)
|
||||
table.insert(plugins, plugin)
|
||||
end
|
||||
end
|
||||
|
||||
require("lazy").setup(plugins)
|
||||
15
lua/core/plugins/catppuccin.lua
Normal file
15
lua/core/plugins/catppuccin.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
|
||||
config = function()
|
||||
local catppuccin = require("catppuccin")
|
||||
|
||||
catppuccin.setup({
|
||||
flavour = "mocha",
|
||||
transparant_background = true,
|
||||
show_end_of_buffer = true
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme catppuccin")
|
||||
end
|
||||
}
|
||||
19
lua/core/plugins/lualine.lua
Normal file
19
lua/core/plugins/lualine.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
}
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = "catppuccin"
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
53
lua/core/plugins/nvim_tree.lua
Normal file
53
lua/core/plugins/nvim_tree.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
local config = require("config").plugins.nvim_tree
|
||||
local mappings = config.mappings
|
||||
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
}
|
||||
},
|
||||
|
||||
config = function()
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
local nvim_tree = require("nvim-tree")
|
||||
|
||||
nvim_tree.setup({
|
||||
view = {
|
||||
width = 30,
|
||||
side = "left"
|
||||
},
|
||||
|
||||
git = {
|
||||
enable = true
|
||||
},
|
||||
|
||||
renderer = {
|
||||
highlight_git = true
|
||||
},
|
||||
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {
|
||||
".git"
|
||||
}
|
||||
},
|
||||
|
||||
update_cwd = true,
|
||||
|
||||
update_focused_file = {
|
||||
enable = true
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", mappings.toggle_file_explorer, ":NvimTreeToggle<CR>", {
|
||||
desc = "Toggle file explorer",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
end
|
||||
}
|
||||
34
lua/core/plugins/nvim_treesitter.lua
Normal file
34
lua/core/plugins/nvim_treesitter.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local config = require("config").plugins.nvim_treesitter
|
||||
local options = config.options
|
||||
local mappings = config.mappings
|
||||
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
build = ":TSUpdate",
|
||||
|
||||
config = function()
|
||||
local nvim_treesitter_configs = require("nvim-treesitter.configs")
|
||||
|
||||
nvim_treesitter_configs.setup({
|
||||
ensure_installed = options.parsers,
|
||||
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = mappings.start_selection,
|
||||
node_incremental = mappings.increment_selection,
|
||||
node_decremental = mappings.decrement_selection
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
34
lua/core/plugins/telescope.lua
Normal file
34
lua/core/plugins/telescope.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local config = require("config").plugins.telescope
|
||||
local mappings = config.mappings
|
||||
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local telescope_builtin = require("telescope.builtin")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
prompt_prefix = "",
|
||||
sorting_strategy = "ascending"
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", mappings.open_file_finder, telescope_builtin.find_files, {
|
||||
desc = "Open file finder",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
|
||||
vim.keymap.set("n", mappings.open_text_finder, telescope_builtin.live_grep, {
|
||||
desc = "Open text finder",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
end
|
||||
}
|
||||
33
lua/core/vim.lua
Normal file
33
lua/core/vim.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
local config = require("config").vim
|
||||
|
||||
-- Options
|
||||
|
||||
local options = config.options
|
||||
|
||||
vim.opt.guicursor = ""
|
||||
|
||||
vim.opt.number = options.line_numbers.enabled
|
||||
vim.opt.relativenumber = options.line_numbers.relative
|
||||
|
||||
vim.opt.shiftwidth = options.tab_size
|
||||
|
||||
vim.g.mapleader = options.leader
|
||||
vim.g.maplocalleader = options.leader
|
||||
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Mappings
|
||||
|
||||
local mappings = config.mappings
|
||||
|
||||
vim.keymap.set("i", mappings.undo, "<C-o>:undo<CR>", {
|
||||
desc = "Undo last edit",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
|
||||
vim.keymap.set("i", mappings.redo, "<C-o>:redo<CR>", {
|
||||
desc = "Redo last edit",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
Reference in New Issue
Block a user