Replaced telescope with lua-fzf
This commit is contained in:
parent
e4604d3a08
commit
1bd3db5a20
97
lua/plugins/fzf-lua.lua
Normal file
97
lua/plugins/fzf-lua.lua
Normal file
@ -0,0 +1,97 @@
|
||||
return {
|
||||
'ibhagwan/fzf-lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('fzf-lua').setup({})
|
||||
end,
|
||||
cmd = 'FzfLua',
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require('fzf-lua').files()
|
||||
end,
|
||||
desc = 'Find files',
|
||||
},
|
||||
{
|
||||
'<leader>c',
|
||||
function()
|
||||
require('fzf-lua').commands()
|
||||
end,
|
||||
desc = 'Find commands',
|
||||
},
|
||||
{
|
||||
'<leader>g',
|
||||
function()
|
||||
require('fzf-lua').git_files()
|
||||
end,
|
||||
desc = 'Find git files',
|
||||
},
|
||||
{
|
||||
'<leader>o',
|
||||
function()
|
||||
require('fzf-lua').oldfiles()
|
||||
end,
|
||||
desc = 'Find old files',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require('fzf-lua').buffers()
|
||||
end,
|
||||
desc = 'Select buffer',
|
||||
},
|
||||
{
|
||||
'<leader>q',
|
||||
function()
|
||||
require('fzf-lua').quickfix()
|
||||
end,
|
||||
desc = 'Quickfix list',
|
||||
},
|
||||
{
|
||||
'<leader>l',
|
||||
function()
|
||||
require('fzf-lua').live_grep_native()
|
||||
end,
|
||||
desc = 'Search in project',
|
||||
},
|
||||
{
|
||||
'<leader>d',
|
||||
function()
|
||||
require('fzf-lua').grep_cword()
|
||||
end,
|
||||
mode = { 'n' },
|
||||
desc = 'Find word under cursor',
|
||||
},
|
||||
{
|
||||
'<leader>d',
|
||||
function()
|
||||
require('fzf-lua').grep_visual()
|
||||
end,
|
||||
mode = { 'x', 'v' },
|
||||
desc = 'Find word under cursor',
|
||||
},
|
||||
{
|
||||
'<leader>j',
|
||||
function()
|
||||
require('fzf-lua').jumps()
|
||||
end,
|
||||
desc = 'Open jumplist',
|
||||
},
|
||||
{
|
||||
'<c-f>',
|
||||
function()
|
||||
require('fzf-lua').grep_curbuf()
|
||||
end,
|
||||
desc = 'Find in buffer',
|
||||
},
|
||||
{
|
||||
'<C-x><C-f>',
|
||||
function()
|
||||
require('fzf-lua').complete_path()
|
||||
end,
|
||||
mode = { "n", "v", "i" },
|
||||
desc = 'Fuzzy complete path',
|
||||
},
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
local lspKeys = function(client, bufnr)
|
||||
local tele_builtins = require('telescope.builtin')
|
||||
-- local tele_builtins = require('telescope.builtin')
|
||||
local fzf = require('fzf-lua')
|
||||
local options = { noremap = true, silent = false, buffer = bufnr }
|
||||
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev,
|
||||
vim.tbl_extend('error', options, { desc = 'Diag prev' }))
|
||||
@ -7,7 +8,7 @@ local lspKeys = function(client, bufnr)
|
||||
vim.tbl_extend('error', options, { desc = 'Diag next' }))
|
||||
vim.keymap.set({ 'n', 'x' }, '<space>a', vim.lsp.buf.code_action,
|
||||
vim.tbl_extend('error', options, { desc = 'Code action' }))
|
||||
vim.keymap.set('n', '<space>d', tele_builtins.lsp_definitions,
|
||||
vim.keymap.set('n', '<space>d', function() fzf.lsp_definitions({ jump_to_single_result = true }) end,
|
||||
vim.tbl_extend('error', options, { desc = 'Definition' }))
|
||||
vim.keymap.set('n', '<space>e',
|
||||
vim.lsp.buf.declaration, vim.tbl_extend('error', options, { desc = 'Declaration' }))
|
||||
@ -19,21 +20,21 @@ local lspKeys = function(client, bufnr)
|
||||
vim.tbl_extend('error', options, { desc = 'Incoming calls' }))
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename,
|
||||
vim.tbl_extend('error', options, { desc = 'Rename' }))
|
||||
vim.keymap.set('n', '<C-t>', tele_builtins.lsp_dynamic_workspace_symbols,
|
||||
vim.keymap.set('n', '<C-t>', fzf.lsp_live_workspace_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition,
|
||||
vim.tbl_extend('error', options, { desc = 'Type definition' }))
|
||||
vim.keymap.set({ 'n', 'i', 'x' }, '<C-k>', vim.lsp.buf.signature_help,
|
||||
vim.tbl_extend('error', options, { desc = 'Signature help' }))
|
||||
vim.keymap.set('n', '<space>r', tele_builtins.lsp_references,
|
||||
vim.keymap.set('n', '<space>r', fzf.lsp_references,
|
||||
vim.tbl_extend('error', options, { desc = 'References' }))
|
||||
vim.keymap.set('n', '<A-m>', tele_builtins.lsp_document_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'References' }))
|
||||
vim.keymap.set('n', '<scapce>s', tele_builtins.lsp_dynamic_workspace_symbols,
|
||||
vim.keymap.set('n', '<A-m>', fzf.lsp_document_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Document symbols' }))
|
||||
vim.keymap.set('n', '<space>s', fzf.lsp_live_workspace_symbols,
|
||||
vim.tbl_extend('error', options, { desc = 'Workspace symbols' }))
|
||||
vim.keymap.set('n', '<space>v', vim.diagnostic.open_float,
|
||||
vim.tbl_extend('error', options, { desc = 'Diagnostics Float' }))
|
||||
vim.keymap.set('n', '<space>V', function() tele_builtins.diagnostics({ bufnr = 0 }) end,
|
||||
vim.keymap.set('n', '<space>V', fzf.diagnostics_document,
|
||||
vim.tbl_extend('error', options, { desc = 'Diagnostics' }))
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>',
|
||||
vim.tbl_extend('error', options, { desc = 'Switch Source/Header' }))
|
||||
|
@ -13,6 +13,7 @@ return {
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
},
|
||||
cmd = { 'Telescope' },
|
||||
enabled = false,
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
|
Loading…
x
Reference in New Issue
Block a user