feat: experimenting with custom Telescope commands
This commit is contained in:
parent
af6d7d8b4e
commit
04392ea377
|
@ -38,14 +38,16 @@ local options = {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Builtin
|
-- Builtin
|
||||||
map('n', '<leader>df', '<CMD>lua require("telescope.builtin").find_files{ cwd="~/dotfiles", hidden=true }<CR>', options)
|
|
||||||
map('n', '<leader>fb', '<CMD>lua require("telescope.builtin").buffers()<CR>', options)
|
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>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>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 require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }<CR>', options)
|
||||||
map('n', '<leader>ff', '<CMD>lua require("telescope.builtin").find_files{ hidden = true }<CR>', options)
|
|
||||||
map('n', '<leader>fg', '<CMD>lua require("telescope.builtin").git_files{}<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>fh', '<CMD>lua require("telescope.builtin").help_tags()<CR>', options)
|
||||||
map('n', '<leader>fl', '<CMD>lua require("telescope.builtin").live_grep()<CR>', options)
|
map('n', '<leader>fl', '<CMD>lua require("telescope.builtin").live_grep()<CR>', options)
|
||||||
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
||||||
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
map('n', '<leader>fr', '<CMD>lua require("telescope.builtin").registers()<CR>', options)
|
||||||
|
|
||||||
|
-- Custom
|
||||||
|
map("n", "<Leader>en", '<CMD>lua require("opdavies.telescope.mappings").edit_neovim()<Cr>', options)
|
||||||
|
map("n", "<Leader>ff", '<CMD>lua require("opdavies.telescope.mappings").fd()<Cr>', options)
|
||||||
|
|
32
nvim/.config/nvim/lua/opdavies/telescope/mappings.lua
Normal file
32
nvim/.config/nvim/lua/opdavies/telescope/mappings.lua
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.edit_neovim()
|
||||||
|
local opts = {
|
||||||
|
prompt_title = "~ dotfiles ~",
|
||||||
|
shorten_path = false,
|
||||||
|
cwd = "~/.config/nvim",
|
||||||
|
|
||||||
|
layout_strategy = "flex",
|
||||||
|
layout_config = {
|
||||||
|
width = 0.9,
|
||||||
|
height = 0.8,
|
||||||
|
|
||||||
|
horizontal = {
|
||||||
|
width = { padding = 0.15 },
|
||||||
|
},
|
||||||
|
vertical = {
|
||||||
|
preview_height = 0.75,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("telescope.builtin").find_files(opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.fd()
|
||||||
|
local themes = require "telescope.themes"
|
||||||
|
|
||||||
|
require("telescope.builtin").find_files(themes.get_ivy())
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
Loading…
Reference in a new issue