Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze my computer after Live Grep with telescope in a project with assets folder #2489

Closed
jjairojr opened this issue May 2, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jjairojr
Copy link

jjairojr commented May 2, 2023

Description

I've a React project with assets folder, when i search for a Live Grep (fs) and i type like "a", sort a thousand files and the my computers freeze and i need to restart, i remove the assets folder just for test and now works fine, how can i ignore the assets folder in my searchs ?

Please help me

Thanks <3

telescope.lua file

-- import telescope plugin safely
local telescope_setup, telescope = pcall(require, "telescope")
if not telescope_setup then
	return
end

-- import telescope actions safely
local actions_setup, actions = pcall(require, "telescope.actions")
if not actions_setup then
	return
end

-- configure telescope
telescope.setup({

	-- configure custom mappings
	defaults = {
		file_ignore_patterns = {
			"node_modules",
			"%.svg",
			".png",
			".jpg",
			".jpeg",
			".mp4",
			".ico",
			".otf",
			".icns",
			".mp3",
			".gif",
			".wav",
			"assets/**",
			"assets/",
			"*/assets",
		},
		mappings = {
			i = {
				["<C-k>"] = actions.move_selection_previous, -- move to prev result
				["<C-j>"] = actions.move_selection_next, -- move to next result
				["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist
			},
		},
	},
})

telescope.load_extension("fzf")

Neovim version

NVIM v0.10.0-dev-219+g3287fc2ba
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

macOS Venture 13.0

Telescope version / branch / rev

new one

checkhealth telescope

telescope: health#telescope#check

- WARNING vim.health.report_start() is deprecated, use vim.health.start() instead. :help |deprecated|
  This feature will be removed in Nvim version 0.11

Checking for required plugins ~
- WARNING vim.health.report_ok() is deprecated, use vim.health.ok() instead. :help |deprecated|
  This feature will be removed in Nvim version 0.11
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.7.0

===== Installed extensions ===== ~

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Steps to reproduce

create a assets folder with a lot of imgs, svgs, pngs, mp3.

Expected behavior

dont freeze my computer

Actual behavior

dont search in this folders

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@jjairojr jjairojr added the bug Something isn't working label May 2, 2023
@jjairojr jjairojr changed the title telescope rg problem on assets folder Freeze my computer after Live Grep with telescope in a project with assets folder May 2, 2023
@jamestrew
Copy link
Contributor

I think this is a duplicate of this issue: #2482 (comment)
Try the vimgrep args in the comment linked and see if that helps. I've already created a PR #2488

@jjairojr
Copy link
Author

jjairojr commented May 3, 2023

I think this is a duplicate of this issue: #2482 (comment) Try the vimgrep args in the comment linked and see if that helps. I've already created a PR #2488

    defaults = {
        vimgrep_arguments = {
	    "rg",
	    "--color=never",
	    "--no-heading",
	    "--with-filename",
	    "--line-number",
	    "--column",
	    "--smart-case",
        }
    }
})

this works thnks bro!

@jamestrew
Copy link
Contributor

should be fixed on master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants