fix(nvim): update file_browser command

This commit is contained in:
Oliver Davies 2022-01-14 23:47:04 +00:00
parent 6b8e3a8c59
commit 75c8e6e5b1
2 changed files with 9 additions and 6 deletions

View file

@ -46,16 +46,13 @@ local options = {
silent = true,
}
local mappings = R "opdavies.telescope.mappings"
-- Builtin
map("n", "<leader>fb", '<CMD>lua require("telescope.builtin").buffers()<CR>', options)
map("n", "<leader>fc", '<CMD>lua require("telescope.builtin").lsp_code_actions()<CR>', options)
map("n", "<leader>fd", '<CMD>lua require("telescope.builtin").lsp_workspace_diagnostics()<CR>', options)
map(
"n",
"<leader>fe",
'<CMD>lua require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }<CR>',
options
)
map("n", "<leader>fe", '<CMD>lua R "opdavies.telescope.mappings".file_browser()<cr>', options)
map("n", "<leader>fg", '<CMD>lua require("telescope.builtin").git_files{}<CR>', options)
map("n", "<leader>fh", '<CMD>lua require("telescope.builtin").help_tags()<CR>', options)
map("n", "<leader>fl", '<CMD>lua require("telescope.builtin").live_grep({ sorting_strategy="ascending" })<CR>', options)

View file

@ -27,6 +27,12 @@ function M.edit_neovim()
require("telescope.builtin").find_files(opts)
end
function M.file_browser()
local opts = { cwd = vim.fn.expand "%:p:h" }
require("telescope").extensions.file_browser.file_browser(opts)
end
function M.fd()
local opts = themes.get_ivy()