muren.nvim icon indicating copy to clipboard operation
muren.nvim copied to clipboard

Freeze when I try to active some options

Open t1gu1 opened this issue 1 year ago • 6 comments

When I try to active dir ou files my terminal freeze. I have to close and reopen everything.

image

Other option seems toggle correctly.

Is there some prerequisite package to install in the OS to get it works?

t1gu1 avatar Aug 01 '23 04:08 t1gu1

It seems to happend only if I wrote a patterns or replacement before I toggle the dir or files option.

image

t1gu1 avatar Aug 01 '23 04:08 t1gu1

Oh, directly when I active dir option and I write something in the patterns, it freeze too.

t1gu1 avatar Aug 01 '23 04:08 t1gu1

I finally find why.

My project is too "big" and it search everywhere. I simply change the files argument to: src/**/* and it was ok.

Is there a way to exclude files? Like /ios/Pods/,/vendor/bundle/,.history,node_modules,dist,.git,build/

t1gu1 avatar Aug 01 '23 06:08 t1gu1

Hi @t1gu1, if you're doing recursive replacements in a directory it can be useful to disable preview while typing the replacements and setting the options since that will do the replacements for each keystroke.

AckslD avatar Aug 01 '23 12:08 AckslD

Regarding your question to exclude files, currently muren calls out to :vimgrep but maybe we can optionally instead call :grep which the user can configure to use rg or anything and custom configs to ignore eg .gitignore.

But the syntax for patterns for both the search-term and files would then potentially have to be different.

AckslD avatar Aug 01 '23 12:08 AckslD

Considering the .gitignore file would be a nice enhancement. I would'nt had any issues with that.



Some Ideas


Maybe it could be an idea to remove de default value of the files options.

  • When there is nothing, it will list all the files except the one in the .gitignore with that command git ls-files.
  • If the git ls-files list nothing, it will default to the */**

You can try it with a: vimgrep thingsToSearch `git ls-files` | cw


Maybe add a call to action to make the search? e.g. when you pass from insert mode to normal mode it call the search.

In the options, it could have a live preview option instead of a preview and the preview could be always on with the call action.

t1gu1 avatar Aug 02 '23 22:08 t1gu1