telescope, no more ctrl-p

This commit is contained in:
Anthony Cicchetti 2023-08-17 09:45:37 -04:00
parent 23ca3f754b
commit 883a1e2399
3 changed files with 68 additions and 31 deletions

View file

@ -16,6 +16,9 @@
onedark.enable = true;
};
plugins = {
fugitive = {
enable = true;
};
lsp = {
enable = true;
servers = {
@ -26,6 +29,33 @@
rust-analyzer.enable = true;
};
};
mini = {
enable = true;
ai.enable = true;
align.enable = true;
animate.enable = true;
comment.enable = true;
completion.enable = true;
indentscope.enable = true;
jump.enable = true;
jump2d = {
enable = true;
extraConfig = {
mappings.start_jumping = "<leader>a";
};
};
splitjoin.enable = true;
surround.enable = true;
};
project-nvim = {
enable = true;
};
telescope = {
enable = true;
extraLua = {
post = builtins.readFile ./neovim/telescope.lua;
};
};
treesitter = {
enable = true;
indent = true;
@ -34,46 +64,32 @@
enable = true;
};
};
mini = {
enable = true;
ai.enable = true;
align.enable = true;
animate.enable = true;
comment.enable = true;
jump.enable = true;
jump2d = {
enable = true;
extraConfig = {
mappings.start_jumping = "<leader>a";
};
};
surround.enable = true;
};
fugitive = {
enable = true;
};
undotree = {
enable = true;
};
which-key = {
enable = true;
};
project-nvim = {
enable = true;
groups = {
normal = {
"<leader>f" = "Telescope - Find";
"<leader>r" = "View registers";
"<leader>p" = "Telescope - LSP";
};
};
};
};
extraPlugins =
(
with pkgs.vimPlugins; [
vim-ReplaceWithRegister
ctrlp-vim
vim-dispatch-neovim
vim-bbye
editorconfig-nvim
leap-nvim
telescope-zf-native-nvim
vim-ReplaceWithRegister
vim-bbye
vim-dispatch-neovim
vim-expand-region
vim-signify
vim-terraform
leap-nvim
]
)
++ (with pkgs.vimExtraPlugins; [
@ -83,18 +99,23 @@
normal = {
"<leader>u" = {
action = "vim.cmd.UndotreeToggle";
desc = "Toggle undotree";
};
"<leader>h" = {
action = "function() vim.api.nvim_command('wincmd h') end";
desc = "Cursor - Window left";
};
"<leader>j" = {
action = "function() vim.api.nvim_command('wincmd j') end";
desc = "Cursor - Window down";
};
"<leader>k" = {
action = "function() vim.api.nvim_command('wincmd k') end";
desc = "Cursor - Window up";
};
"<leader>l" = {
action = "function() vim.api.nvim_command('wincmd l') end";
desc = "Cursor - Window right";
};
"<c-k>" = {
action = "'<c-u>'";
@ -104,6 +125,7 @@
};
"<leader>n" = {
action = "function() vim.api.nvim_command('nohl') end";
desc = "nohl";
};
};
visual = {

View file

@ -27,8 +27,3 @@ vim.o.wildmode = "list:longest,full"
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() vim.highlight.on_yank() end
})
-- Ctrlp
vim.g.ctrlp_map = "<leader>p"
vim.g.ctrlp_cmd = "CtrlPMixed"
vim.g.ctrlp_user_command = "rg --files %s"

View file

@ -0,0 +1,20 @@
require("telescope").load_extension("zf-native")
local builtin = require('telescope.builtin')
-- greps
vim.keymap.set("n", '<leader>ff', builtin.find_files, {desc = 'Find Files'})
vim.keymap.set("n", '<leader>fg', builtin.live_grep, {desc = 'Live Grep'})
vim.keymap.set("n", '<leader>fb', builtin.buffers, {desc = 'Buffers'})
-- register reading
vim.keymap.set("n", '<leader>r', builtin.registers, {desc = 'View registers'})
-- lsp stuff
vim.keymap.set('n', '<leader>pr', builtin.lsp_references, {desc = 'References'})
vim.keymap.set('n', '<leader>pi', builtin.lsp_implementations, {desc = 'Implementations'})
vim.keymap.set('n', '<leader>pd', builtin.lsp_definitions, {desc = 'Definitions'})
vim.keymap.set('n', '<leader>ps', builtin.lsp_document_symbols, {desc = 'Document Symbols'})
vim.keymap.set('n', '<leader>pws', builtin.lsp_workspace_symbols, {desc = 'Workspace Symbols'})
vim.keymap.set('n', '<leader>pwd', builtin.lsp_dynamic_workspace_symbols, {desc = 'Dynamic Workspace Symbols'})