1
Fork 0

Almost rewrote my entire config

This commit is contained in:
Matei Adriel 2022-12-27 20:45:43 +01:00
commit c5b355601e
51 changed files with 973 additions and 870 deletions
dotfiles/neovim/lua/my/plugins

View file

@ -1,4 +1,19 @@
local M = {}
local env = require("my.helpers.env")
local telescope = {
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
dependencies = {
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
"nvim-telescope/telescope-file-browser.nvim",
"nvim-lua/plenary.nvim"
},
version = "0.1.x",
pin = true,
cond = env.vscode.not_active(),
}
local M = telescope
local function find_files_by_extension(extension)
return "find_files find_command=rg,--files,--glob=**/*." .. extension
@ -30,25 +45,31 @@ local function mkAction(action)
action = with_theme(action, defaultTheme)
end
return ":Telescope " .. action .. "<cr>"
return "<cmd>Telescope " .. action .. "<cr>"
end
local function setupKeybinds()
function telescope.init()
for _, mapping in pairs(keybinds) do
vim.keymap.set("n", mapping[1], mkAction(mapping[2]), { desc = mapping[3] })
end
end
function M.setup()
setupKeybinds()
function telescope.config()
local settings = {
defaults = { mappings = { i = { ["<C-h>"] = "which_key" } } },
pickers = { find_files = { hidden = true } },
extensions = { file_browser = { path = "%:p:h" } },
extensions = {
file_browser = { path = "%:p:h" },
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
},
},
}
require("telescope").setup(settings)
require("telescope").load_extension("fzf")
require("telescope").load_extension("file_browser")
end