feat: telescope file browser
This commit is contained in:
parent
577a19cf27
commit
1e499dccba
10 changed files with 169 additions and 72 deletions
dotfiles/neovim/lua/my/plugins
|
@ -1,20 +1,22 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
-- Other unconfigured plugins
|
||||
require('nvim-autopairs').setup()
|
||||
require("startup").setup({theme = "dashboard"})
|
||||
require('lualine').setup({theme = "github"})
|
||||
|
||||
-- Plugins with their own configs:
|
||||
require("my.plugins.cmp").setup()
|
||||
require("my.plugins.lspconfig").setup()
|
||||
require("my.plugins.null-ls").setup()
|
||||
-- require("my.plugins.fzf-lua").setup()
|
||||
require("my.plugins.telescope").setup()
|
||||
require("my.plugins.treesitter").setup()
|
||||
require("my.plugins.comment").setup()
|
||||
-- require("my.plugins.nerdtree").setup()
|
||||
require("my.plugins.nvim-tree").setup()
|
||||
require("my.plugins.vimtex").setup()
|
||||
|
||||
-- Other unconfigured plugins
|
||||
require('nvim-autopairs').setup()
|
||||
require("startup").setup({theme = "dashboard"})
|
||||
require('lualine').setup({theme = "github"})
|
||||
require("my.plugins.telescope").setup()
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
7
dotfiles/neovim/lua/my/plugins/null-ls.lua
Normal file
7
dotfiles/neovim/lua/my/plugins/null-ls.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
-- Setup goes here
|
||||
end
|
||||
|
||||
return M
|
|
@ -3,34 +3,59 @@ local mapSilent = require("my.keymaps").mapSilent
|
|||
local M = {}
|
||||
|
||||
local bindings = {
|
||||
-- Open files with control + P
|
||||
find_files = "<c-P>",
|
||||
builtin = {
|
||||
-- Open files with control + P
|
||||
find_files = "<c-P>",
|
||||
|
||||
-- Search through files with control + F
|
||||
live_grep = "<c-F>",
|
||||
-- Search through files with control + F
|
||||
live_grep = "<c-F>",
|
||||
|
||||
-- See diagnostics with space + d
|
||||
lsp_document_diagnostics = "<space>d",
|
||||
lsp_workspace_diagnostics = "<space>wd",
|
||||
-- See diagnostics with space + d
|
||||
lsp_document_diagnostics = "<space>d",
|
||||
lsp_workspace_diagnostics = "<space>wd",
|
||||
|
||||
-- Open a list with all the pickers
|
||||
builtin = "<space>t",
|
||||
-- Open a list with all the pickers
|
||||
builtin = "<space>t",
|
||||
|
||||
-- List function, var names etc
|
||||
treesitter = "<space>s",
|
||||
-- List function, var names etc
|
||||
treesitter = "<space>s",
|
||||
|
||||
-- Git stuff
|
||||
git_commits = "<space>gj",
|
||||
git_branches = "<space>gk"
|
||||
-- Git stuff
|
||||
git_commits = "<space>gj",
|
||||
git_branches = "<space>gk"
|
||||
},
|
||||
["extensions.file_browser.file_browser"] = "<space>p"
|
||||
}
|
||||
|
||||
function M.setup()
|
||||
for action, keybind in pairs(bindings) do
|
||||
-- Maps the keybind to the action
|
||||
mapSilent('n', keybind, "<cmd>lua require('telescope.builtin')." .. action .. "()<CR>")
|
||||
local function setupKeybinds(obj, path)
|
||||
if path == nil then path = "" end
|
||||
for name, keybinds in pairs(obj) do
|
||||
if (type(keybinds) == "table") then
|
||||
-- This means we found a table of keybinds, so we go deeper
|
||||
setupKeybinds(keybinds, path .. "." .. name)
|
||||
else
|
||||
-- Maps the keybind to the action
|
||||
mapSilent('n', keybinds, "<cmd>lua require('telescope" .. path .. "')." .. name .. "()<CR>")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require("telescope").setup {defaults = {mappings = {i = {["<C-h>"] = "which_key"}}}}
|
||||
function M.setup()
|
||||
setupKeybinds(bindings)
|
||||
|
||||
local settings = {
|
||||
defaults = {mappings = {i = {["<C-h>"] = "which_key"}}},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
mappings = {
|
||||
-- Comment so this does not get collapsed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require("telescope").setup(settings)
|
||||
require("telescope").load_extension "file_browser"
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue