Refactor neovim config file structure
All plugins are now in their own files with their lazy specifications and configurations. Also moved lazy initialization to init.lua because it is very compact now
This commit is contained in:
parent
94244ca95c
commit
f44e0b3274
36 changed files with 554 additions and 584 deletions
|
@ -1,8 +1,22 @@
|
|||
return function()
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
-- Internal dependency for telescope
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
||||
telescope.setup({
|
||||
-- Use fzf for fuzzy finder
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
},
|
||||
|
||||
-- Replace vim built in select with telescope
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
|
||||
-- cd plugin for telescope
|
||||
"zane-/cder.nvim",
|
||||
},
|
||||
opts = {
|
||||
pickers = {
|
||||
find_files = { find_command = { "fd", "-Ht", "f" } },
|
||||
lsp_references = { show_line = false },
|
||||
|
@ -30,14 +44,20 @@ return function()
|
|||
dir_command = { "fd", "-Ht", "d", ".", os.getenv("HOME") },
|
||||
},
|
||||
},
|
||||
})
|
||||
},
|
||||
config = function(spec)
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
||||
telescope.load_extension("cder")
|
||||
telescope.setup(spec.opts)
|
||||
|
||||
-- Keybinds
|
||||
vim.keymap.set("n", "<C-s>", vim.cmd.Telescope)
|
||||
vim.keymap.set("n", "<C-f>", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-g>", builtin.live_grep)
|
||||
end
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
||||
telescope.load_extension("cder")
|
||||
|
||||
-- Keybinds
|
||||
vim.keymap.set("n", "<C-s>", vim.cmd.Telescope)
|
||||
vim.keymap.set("n", "<C-f>", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-g>", builtin.live_grep)
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue