diff --git a/nvim/lua/psoxizsh/plugins/config/fzf.lua b/nvim/lua/psoxizsh/plugins/config/fzf.lua deleted file mode 100644 index 55fc2be..0000000 --- a/nvim/lua/psoxizsh/plugins/config/fzf.lua +++ /dev/null @@ -1,35 +0,0 @@ -return function() - local fn, o, api = vim.fn, vim.o, vim.api - - if fn.executable('rg') == 1 then - -- Override the default grep implementation in vim - o.grepprg = 'rg --vimgrep --smart-case --follow' - - if fn.has('nvim-0.7') == 1 then - -- Only search file contents, not file name - -- We can use the stock :Files for that - local rg_func = function(opts) - return fn['fzf#vim#grep']( - "rg --column --line-number --no-heading --color=always --smart-case " .. fn.shellescape(opts.args), - true, - fn['fzf#vim#with_preview']({options = '--delimiter : --nth 4..'}), - opts.bang - ) - end - api.nvim_create_user_command('Rg', rg_func, { nargs = '*', bang = true }) - - -- If the user hasn't set a default FZF command, and has ripgrep installed, - -- use it over find, otherwise defer to the user's preferred command - if fn.empty(os.getenv('FZF_DEFAULT_COMMAND')) == 1 then - local files_func = function(opts) - return fn['fzf#vim#files']( - opts.args, - fn['fzf#vim#with_preview']({source = 'rg --files --hidden --glob "!**/.git/**" '}), - opts.bang - ) - end - api.nvim_create_user_command('Files', files_func, { nargs = '?', bang = true, complete = 'dir' }) - end - end - end -end diff --git a/nvim/lua/psoxizsh/plugins/config/pear-tree.lua b/nvim/lua/psoxizsh/plugins/config/pear-tree.lua index f7f3857..4500939 100644 --- a/nvim/lua/psoxizsh/plugins/config/pear-tree.lua +++ b/nvim/lua/psoxizsh/plugins/config/pear-tree.lua @@ -5,4 +5,5 @@ return function() g.pear_tree_smart_openers = 1 g.pear_tree_smart_closers = 1 g.pear_tree_smart_backspace = 1 + g.pear_tree_ft_disabled = { 'TelescopePrompt' } end diff --git a/nvim/lua/psoxizsh/plugins/config/telescope.lua b/nvim/lua/psoxizsh/plugins/config/telescope.lua new file mode 100644 index 0000000..f11d360 --- /dev/null +++ b/nvim/lua/psoxizsh/plugins/config/telescope.lua @@ -0,0 +1,11 @@ +return function() + local ts, util = require 'telescope', require 'psoxizsh.util' + + local defaults = {} + + ts.setup(util.mconfig('config.telescope', { defaults = defaults })) + + -- Requires telescope-fzf-native.nvim + -- Speeds up search times by 5-10x + ts.load_extension('fzf') +end diff --git a/nvim/lua/psoxizsh/plugins/plug.lua b/nvim/lua/psoxizsh/plugins/plug.lua index 34554c8..4e079b6 100644 --- a/nvim/lua/psoxizsh/plugins/plug.lua +++ b/nvim/lua/psoxizsh/plugins/plug.lua @@ -151,12 +151,13 @@ local plugins = { }, -- Fuzzy search helpers - { 'junegunn/fzf', - cmd = 'FZF', - fn = { 'fzf#run', 'fzf#wrap' } + { 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + requires = { 'nvim-lua/plenary.nvim', 'nvim-telescope/telescope-fzf-native.nvim' }, + config = require 'psoxizsh.plugins.config.telescope' }, - { 'junegunn/fzf.vim', - config = require 'psoxizsh.plugins.config.fzf' + { 'nvim-telescope/telescope-fzf-native.nvim', + run = 'make' }, { 'romainl/vim-cool' }, { 'adelarsq/vim-matchit' },