mirror of
https://github.com/fred-drake/neovim.git
synced 2026-06-05 14:59:28 -05:00
FZF Files and Oldfiles now limits to CWD
This commit is contained in:
@@ -70,13 +70,12 @@
|
||||
{
|
||||
type = "button";
|
||||
val = " Find File ";
|
||||
on_press.__raw = "function() require('telescope.builtin').find_files() end";
|
||||
opts = {
|
||||
shortcut = "f";
|
||||
keymap = [
|
||||
"n"
|
||||
"f"
|
||||
"<cmd>lua require('telescope.builtin').find_files()<CR>"
|
||||
"<cmd>lua require('fzf-lua').files({ cwd = vim.loop.cwd() })<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
@@ -102,7 +101,7 @@
|
||||
keymap = [
|
||||
"n"
|
||||
"r"
|
||||
"<cmd>lua require('telescope.builtin').oldfiles()<CR>"
|
||||
"<cmd>lua require('fzf-lua').oldfiles({ cwd = vim.loop.cwd() })<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
@@ -128,7 +127,7 @@
|
||||
keymap = [
|
||||
"n"
|
||||
"g"
|
||||
"<cmd>lua require('telescope.builtin').live_grep()<CR>"
|
||||
"<cmd>lua require('fzf-lua').live_grep()<CR>"
|
||||
{
|
||||
noremap = true;
|
||||
silent = true;
|
||||
|
||||
+9
-17
@@ -5,51 +5,43 @@
|
||||
keymaps = {
|
||||
"<leader>/" = {
|
||||
action = "live_grep";
|
||||
options = {desc = "Live Grep";};
|
||||
options.desc = "Live Grep";
|
||||
};
|
||||
"<leader>," = {
|
||||
action = "buffers";
|
||||
options = {desc = "Switch Buffer";};
|
||||
options.desc = "Switch Buffer";
|
||||
settings = {
|
||||
sort_mru = true;
|
||||
sort_lastused = true;
|
||||
};
|
||||
};
|
||||
"<leader>ff" = {
|
||||
action = "files";
|
||||
options = {desc = "Find Files";};
|
||||
};
|
||||
"<leader>fr" = {
|
||||
action = "oldfiles";
|
||||
options = {desc = "Recent Files";};
|
||||
};
|
||||
"<leader>gc" = {
|
||||
action = "git_commits";
|
||||
options = {desc = "Git Commits";};
|
||||
options.desc = "Git Commits";
|
||||
};
|
||||
"<leader>gs" = {
|
||||
action = "git_status";
|
||||
options = {desc = "Git Status";};
|
||||
options.desc = "Git Status";
|
||||
};
|
||||
"<leader>s\"" = {
|
||||
action = "registers";
|
||||
options = {desc = "Registers";};
|
||||
options.desc = "Registers";
|
||||
};
|
||||
"<leader>sd" = {
|
||||
action = "diagnostics_document";
|
||||
options = {desc = "Document Diagnostics";};
|
||||
options.desc = "Document Diagnostics";
|
||||
};
|
||||
"<leader>sD" = {
|
||||
action = "diagnostics_workspace";
|
||||
options = {desc = "Workspace Diagnostics";};
|
||||
options.desc = "Workspace Diagnostics";
|
||||
};
|
||||
"<leader>sh" = {
|
||||
action = "help_tags";
|
||||
options = {desc = "Help Pages";};
|
||||
options.desc = "Help Pages";
|
||||
};
|
||||
"<leader>sk" = {
|
||||
action = "keymaps";
|
||||
options = {desc = "Key Maps";};
|
||||
options.desc = "Key Maps";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
+60
-45
@@ -4,6 +4,7 @@
|
||||
plugins.which-key = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# Settings groups
|
||||
spec = [
|
||||
{
|
||||
__unkeyed-1 = "<leader>g";
|
||||
@@ -64,19 +65,19 @@
|
||||
mode = "i";
|
||||
key = "jk";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = {desc = "Normal mode and clear highlight";};
|
||||
options.desc = "Normal mode and clear highlight";
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = "<ESC>";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = {desc = "Normal mode and clear highlight";};
|
||||
options.desc = "Normal mode and clear highlight";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<ESC>";
|
||||
action = "<CMD>noh<CR><ESC>";
|
||||
options = {desc = "Normal mode and clear highlight";};
|
||||
options.desc = "Normal mode and clear highlight";
|
||||
}
|
||||
|
||||
# Add undo breakpoints
|
||||
@@ -84,26 +85,40 @@
|
||||
mode = "i";
|
||||
key = ",";
|
||||
action = ",<C-g>u";
|
||||
options = {desc = "Undo breakpoint";};
|
||||
options.desc = "Undo breakpoint";
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = ".";
|
||||
action = ".<C-g>u";
|
||||
options = {desc = "Undo breakpoint";};
|
||||
options.desc = "Undo breakpoint";
|
||||
}
|
||||
{
|
||||
mode = "i";
|
||||
key = ";";
|
||||
action = ";<C-g>u";
|
||||
options = {desc = "Undo breakpoint";};
|
||||
options.desc = "Undo breakpoint";
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>e";
|
||||
action = "<CMD>Neotree toggle<CR>";
|
||||
options = {desc = "Toggle tree view";};
|
||||
options.desc = "Toggle tree view";
|
||||
}
|
||||
|
||||
# FZF-Lua custom commands -- I want to limit to current directory
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ff";
|
||||
action = "<CMD>lua require('fzf-lua').files({ cwd = vim.loop.cwd() })<CR>";
|
||||
options.desc = "Find Files";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fr";
|
||||
action = "<CMD>lua require('fzf-lua').oldfiles({ cwd = vim.loop.cwd() })<CR>";
|
||||
options.desc = "Recent Files";
|
||||
}
|
||||
|
||||
# Database
|
||||
@@ -111,7 +126,7 @@
|
||||
mode = "n";
|
||||
key = "<leader>Du";
|
||||
action = "<CMD>DBUI<CR>";
|
||||
options = {desc = "Show Database UI";};
|
||||
options.desc = "Show Database UI";
|
||||
}
|
||||
|
||||
# LSP Actions
|
||||
@@ -119,37 +134,37 @@
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action = "<CMD>FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = {desc = "Goto Definition";};
|
||||
options.desc = "Goto Definition";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action = "<CMD>FzfLua lsp_references jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = {desc = "References";};
|
||||
options.desc = "References";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action = "<CMD>FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = {desc = "Goto Implementation";};
|
||||
options.desc = "Goto Implementation";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gy";
|
||||
action = "<CMD>FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true<CR>";
|
||||
options = {desc = "Goto T[y]pe Definition";};
|
||||
options.desc = "Goto T[y]pe Definition";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cd";
|
||||
action = "<CMD>lua vim.diagnostic.open_float()<CR>";
|
||||
options = {desc = "Popup Diagnostics";};
|
||||
options.desc = "Popup Diagnostics";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cD";
|
||||
action = "<CMD>Trouble diagnostics toggle<CR>";
|
||||
options = {desc = "List All Diagnostics";};
|
||||
options.desc = "List All Diagnostics";
|
||||
}
|
||||
|
||||
# SOPS
|
||||
@@ -157,13 +172,13 @@
|
||||
mode = "n";
|
||||
key = "<leader>od";
|
||||
action = "<CMD>!sops -d -i %<CR><CR>";
|
||||
options = {desc = "Decrypt SOPS File";};
|
||||
options.desc = "Decrypt SOPS File";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>oe";
|
||||
action = "<CMD>!sops -e -i %<CR><CR>";
|
||||
options = {desc = "Encrypt SOPS File";};
|
||||
options.desc = "Encrypt SOPS File";
|
||||
}
|
||||
|
||||
# Git
|
||||
@@ -171,53 +186,53 @@
|
||||
mode = "n";
|
||||
key = "<leader>gg";
|
||||
action = "<CMD>LazyGit<CR>";
|
||||
options = {desc = "LazyGit";};
|
||||
options.desc = "LazyGit";
|
||||
}
|
||||
|
||||
# Windows
|
||||
{
|
||||
key = "<C-h>";
|
||||
action = "<CMD>wincmd h<CR>";
|
||||
options = {desc = "Navigate Window Left";};
|
||||
options.desc = "Navigate Window Left";
|
||||
}
|
||||
{
|
||||
key = "<C-j>";
|
||||
action = "<CMD>wincmd j<CR>";
|
||||
options = {desc = "Navigate Window Down";};
|
||||
options.desc = "Navigate Window Down";
|
||||
}
|
||||
{
|
||||
key = "<C-k>";
|
||||
action = "<CMD>wincmd k<CR>";
|
||||
options = {desc = "Navigate Window Up";};
|
||||
options.desc = "Navigate Window Up";
|
||||
}
|
||||
{
|
||||
key = "<C-l>";
|
||||
action = "<CMD>wincmd l<CR>";
|
||||
options = {desc = "Navigate Window Right";};
|
||||
options.desc = "Navigate Window Right";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>w";
|
||||
action = "<c-w>";
|
||||
options = {desc = "Windows";};
|
||||
options.desc = "Windows";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>-";
|
||||
action = "<C-W>s";
|
||||
options = {desc = "Split Window Below";};
|
||||
options.desc = "Split Window Below";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>|";
|
||||
action = "<C-W>v";
|
||||
options = {desc = "Split Window Right";};
|
||||
options.desc = "Split Window Right";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>wd";
|
||||
action = "<C-W>c";
|
||||
options = {desc = "Delete Window";};
|
||||
options.desc = "Delete Window";
|
||||
}
|
||||
|
||||
# Tabs
|
||||
@@ -225,43 +240,43 @@
|
||||
mode = "n";
|
||||
key = "<leader><tab>l";
|
||||
action = "<CMD>tablast<CR>";
|
||||
options = {desc = "Last Tab";};
|
||||
options.desc = "Last Tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>o";
|
||||
action = "<CMD>tabonly<CR>";
|
||||
options = {desc = "Close Other Tabs";};
|
||||
options.desc = "Close Other Tabs";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>f";
|
||||
action = "<CMD>tabfirst<CR>";
|
||||
options = {desc = "First Tab";};
|
||||
options.desc = "First Tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab><tab>";
|
||||
action = "<CMD>tabnew<CR>";
|
||||
options = {desc = "New Tab";};
|
||||
options.desc = "New Tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>]";
|
||||
action = "<CMD>tabnext<CR>";
|
||||
options = {desc = "Next Tab";};
|
||||
options.desc = "Next Tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>d";
|
||||
action = "<CMD>tabclose<CR>";
|
||||
options = {desc = "Close Tab";};
|
||||
options.desc = "Close Tab";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>[";
|
||||
action = "<CMD>tabprevious<CR>";
|
||||
options = {desc = "Previous Tab";};
|
||||
options.desc = "Previous Tab";
|
||||
}
|
||||
|
||||
# Buffer
|
||||
@@ -269,55 +284,55 @@
|
||||
mode = "n";
|
||||
key = "<S-h>";
|
||||
action = "<CMD>bprevious<CR>";
|
||||
options = {desc = "Previous Buffer";};
|
||||
options.desc = "Previous Buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<S-l>";
|
||||
action = "<CMD>bnext<CR>";
|
||||
options = {desc = "Next Buffer";};
|
||||
options.desc = "Next Buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bb";
|
||||
action = "<CMD>e #<CR>";
|
||||
options = {desc = "Switch To Other Buffer";};
|
||||
options.desc = "Switch To Other Buffer";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bd";
|
||||
action = "<CMD>bd<CR>";
|
||||
options = {desc = "Delete Buffer and Window";};
|
||||
options.desc = "Delete Buffer and Window";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bp";
|
||||
action = "<CMD>BufferLineTogglePin<CR>";
|
||||
options = {desc = "Toggle Pin";};
|
||||
options.desc = "Toggle Pin";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bP";
|
||||
action = "<CMD>BufferLineGroupClose ungrouped<CR>";
|
||||
options = {desc = "Delete Non-Pinned Buffers";};
|
||||
options.desc = "Delete Non-Pinned Buffers";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bo";
|
||||
action = "<CMD>BufferLineCloseOthers<CR>";
|
||||
options = {desc = "Delete Other Buffers";};
|
||||
options.desc = "Delete Other Buffers";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>br";
|
||||
action = "<CMD>BufferLineCloseRight<CR>";
|
||||
options = {desc = "Delete Buffers to the Right";};
|
||||
options.desc = "Delete Buffers to the Right";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>bl";
|
||||
action = "<CMD>BufferLineCloseLeft<CR>";
|
||||
options = {desc = "Delete Buffers to the Left";};
|
||||
options.desc = "Delete Buffers to the Left";
|
||||
}
|
||||
|
||||
# DAP Telescope Actions
|
||||
@@ -325,25 +340,25 @@
|
||||
mode = "n";
|
||||
key = "<leader>d/c";
|
||||
action = "<CMD>Telescope dap commands<CR>";
|
||||
options = {desc = "Search Commands";};
|
||||
options.desc = "Search Commands";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d/b";
|
||||
action = "<CMD>Telescope dap list_breakpoints<CR>";
|
||||
options = {desc = "Search Breakpoints";};
|
||||
options.desc = "Search Breakpoints";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d/v";
|
||||
action = "<CMD>Telescope dap variables<CR>";
|
||||
options = {desc = "Search Variables";};
|
||||
options.desc = "Search Variables";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>d/f";
|
||||
action = "<CMD>Telescope dap frames<CR>";
|
||||
options = {desc = "Search Frames";};
|
||||
options.desc = "Search Frames";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user