nvim: add telescope plugin
This commit is contained in:
parent
47bc5bf1e1
commit
5d63069ce1
2 changed files with 29 additions and 37 deletions
|
@ -1,43 +1,29 @@
|
|||
local M = {}
|
||||
|
||||
-- telescope >>>
|
||||
M.telescope = function ()
|
||||
-- telescope action binds >>>
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opt = {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
}
|
||||
|
||||
map("n", "<leader>sf", "<cmd>lua require('telescope.builtin').find_files()<cr>", opt)
|
||||
map("n", "<leader>sg", "<cmd>lua require('telescope.builtin').live_grep()<cr>", opt)
|
||||
map("n", "<leader>sb", "<cmd>lua require('telescope.builtin').buffers()<cr>", opt)
|
||||
map("n", "<leader>ss", "<cmd>lua require('telescope.builtin').lsp_dynamic_workspace_symbols()<cr>", opt)
|
||||
-- <<<
|
||||
|
||||
-- telescope config >>>
|
||||
require('telescope').setup(
|
||||
)
|
||||
-- <<<
|
||||
end
|
||||
-- <<<
|
||||
|
||||
-- nvimtree >>>
|
||||
M.nvimtree = function ()
|
||||
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
|
||||
-- mappings
|
||||
local list = {
|
||||
{ key = {"<CR>", "<2-LeftMouse>", "zo", "l"}, cb = tree_cb("edit") },
|
||||
{ key = "J", cb = tree_cb("cd") },
|
||||
{ key = "K", cb = tree_cb("dir_up") },
|
||||
{ key = "vs", cb = tree_cb("vsplit") },
|
||||
{ key = "sp", cb = tree_cb("split") },
|
||||
{ key = "<C-t>", cb = tree_cb("tabnew") },
|
||||
{ key = "<", cb = tree_cb("prev_sibling") },
|
||||
{ key = ">", cb = tree_cb("next_sibling") },
|
||||
{ key = "<M-lt>", cb = tree_cb("first_sibling") },
|
||||
{ key = "<M->>", cb = tree_cb("last_sibling") },
|
||||
{ key = "P", cb = tree_cb("parent_node") },
|
||||
{ key = {"<BS>", "h", "zc"}, cb = tree_cb("close_node") },
|
||||
{ key = "<S-CR>", cb = tree_cb("close_node") },
|
||||
{ key = "<Tab>", cb = tree_cb("preview") },
|
||||
{ key = "I", cb = tree_cb("toggle_ignored") },
|
||||
{ key = "H", cb = tree_cb("toggle_dotfiles") },
|
||||
{ key = "R", cb = tree_cb("refresh") },
|
||||
{ key = "o", cb = tree_cb("create") },
|
||||
{ key = "d", cb = tree_cb("remove") },
|
||||
{ key = "r", cb = tree_cb("rename") },
|
||||
{ key = "<C-r>", cb = tree_cb("full_rename") },
|
||||
{ key = "x", cb = tree_cb("cut") },
|
||||
{ key = "c", cb = tree_cb("copy") },
|
||||
{ key = "p", cb = tree_cb("paste") },
|
||||
{ key = "y", cb = tree_cb("copy_name") },
|
||||
{ key = "Y", cb = tree_cb("copy_path") },
|
||||
{ key = "gy", cb = tree_cb("copy_absolute_path") },
|
||||
{ key = "g[", cb = tree_cb("prev_git_item") },
|
||||
{ key = "g]", cb = tree_cb("next_git_item") },
|
||||
{ key = "s", cb = tree_cb("system_open") },
|
||||
{ key = "q", cb = tree_cb("close") },
|
||||
{ key = "g?", cb = tree_cb("toggle_help") },
|
||||
}
|
||||
require'nvim-tree'.setup {
|
||||
hijack_cursor = true,
|
||||
}
|
||||
|
|
|
@ -138,7 +138,6 @@ return require('packer').startup({function()
|
|||
config = function()
|
||||
vim.g.ale_disable_lsp = 1
|
||||
end
|
||||
|
||||
}
|
||||
---- DAP (Debug Adapter Protocol)
|
||||
use { -- nvim-dap: DAP support
|
||||
|
@ -167,6 +166,13 @@ return require('packer').startup({function()
|
|||
}
|
||||
|
||||
---- Other IDE features
|
||||
use { -- telescope: fuzzy finder for finding fuzzy things
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = { {'nvim-lua/plenary.nvim'} },
|
||||
config = function()
|
||||
require('blake.other').telescope()
|
||||
end
|
||||
}
|
||||
use { -- git integration
|
||||
'lewis6991/gitsigns.nvim',
|
||||
requires = {
|
||||
|
|
Loading…
Add table
Reference in a new issue