modified architecture
This commit is contained in:
15
lua/plugins/catppuccin.lua
Normal file
15
lua/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
|
||||
}
|
||||
17
lua/plugins/lualine.lua
Normal file
17
lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = "catppuccin"
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
13
lua/plugins/luasnip.lua
Normal file
13
lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets"
|
||||
},
|
||||
|
||||
config = function()
|
||||
local luasnip = require("luasnip.loaders.from_vscode")
|
||||
|
||||
luasnip.lazy_load()
|
||||
end
|
||||
}
|
||||
73
lua/plugins/nvim_cmp.lua
Normal file
73
lua/plugins/nvim_cmp.lua
Normal file
@@ -0,0 +1,73 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"onsails/lspkind.nvim"
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
}),
|
||||
|
||||
sources = cmp.config.sources(
|
||||
{
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" }
|
||||
},
|
||||
{
|
||||
{ name = "buffer" },
|
||||
{ name = "path" }
|
||||
}
|
||||
),
|
||||
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "..."
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources(
|
||||
{
|
||||
{ name = "path" }
|
||||
},
|
||||
{
|
||||
{ name = "cmdline" }
|
||||
}
|
||||
)
|
||||
})
|
||||
end
|
||||
}
|
||||
51
lua/plugins/nvim_tree.lua
Normal file
51
lua/plugins/nvim_tree.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
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/plugins/nvim_treesitter.lua
Normal file
34
lua/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/plugins/telescope.lua
Normal file
34
lua/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
|
||||
}
|
||||
Reference in New Issue
Block a user