Fork me on GitHub
#spacemacs
<
2021-10-29
>
jumar06:10:55

I often use SPC / instead of projectile-find-file because it's faster. How come that a fulltext search is faster than finding a file by a file name?

jumar07:10:40

Another question related to docs - I use Shift-K quite a bit to show docs (it's the same thing as , h h) But a while ago it started prompting me for a symbol every time - I just press Enter, but it's still annoying. Is there some kind of configuration setting I should tweak? Can I have a doc popup shown, perhaps on a keypress or automatically after some delay? (I'm using latest develop and cider if that matters but I had an older version for quite a long time and the behavior was the same)

alexdavis08:10:10

I believe projectile-find-file uses find and SPC / uses rg or ag which are both much faster. There’s some docs on how to use something other than find I think https://practical.li/spacemacs/before-you-start/recommended-command-line-tools.html#finding-files-faster

alexdavis08:10:16

Shift-K works without prompting for input for me on latest develop, so not sure about that sorry

practicalli-johnny09:10:03

@jumar I assume the help (S-K or , h h) requires a running REPL connection and at least one namespace being evaluated to load Clojure into Cider. I havent always found cider docs 100 reliable though.

practicalli-johnny09:10:56

I havent noticed any slowness using SPC p f . I wonder if it slows down on bigger projects or if projectile is using a wider scope than the current project. I use layouts to manage all my projects as well, not sure if that has any effect. If on a Linux system and have updatedb installed, then there is the command helm-locate (`SPC f l`) that will very quickly find a file across your filespace.

jumar12:10:32

Tried this SPC f L thing but it doesn't work on my macOS:

jumar12:10:34

Tried this SPC f L thing but it doesn't work on my macOS:

practicalli-johnny14:10:50

It seems the -b option is missing from the locate command in the FreeBSD OS that MacOSX is based on. I thought the OSX layer may have fixed this, but I didnt find anything in the https://develop.spacemacs.org/layers/+os/osx/README.html Might need to hack the spacemacs code to fix it.

practicalli-johnny14:10:03

A quick search of the OSX layer and it seems mdfind is used instead of locate

(defun osx/pre-init-helm ()
  ;; Use `mdfind' instead of `locate'.
  (when (spacemacs/system-is-mac)
    (spacemacs|use-package-add-hook helm
      :post-config
      ;; Disable fuzzy matchting to make mdfind work with helm-locate
      ;; 
      (setq helm-locate-fuzzy-match nil)
      (setq helm-locate-command "mdfind -name %s %s"))))
So if the osx layer is added to spacemacs, it may fix helm search (I dont have a mac so cant test I am afraid)

jumar15:10:49

Thanks I’ll give it a try on Monday

jumar12:10:26

Thank you both, super useful! I thought it might be the view itself that makes it slower as I'm typing in the string to narrow down the search for projectile. I have a somewhat larger project (monorepo) so there many files but nothing dramatic. I've just installed fd and I think it's faster. For docs - I have a running repl and after I do Shift-K, Enter it works but the midstep is annoying. The xtra window is a bit distracting too - does somebody have/use "(auto-)popup docs" ?

practicalli-johnny14:10:15

Using Emacs lsp-ui (with Clojure-lsp server) has a feature to pop-up docstrings either on mouse or cursor, with a pop-up delay too. https://emacs-lsp.github.io/lsp-ui/#lsp-ui-doc

practicalli-johnny14:10:27

If there are file patterns that you dont want to see when searching a project (but do want to commit into git), you can add them to a .projectile file in the root of the project https://docs.projectile.mx/projectile/projects.html#ignoring-files If the file patterns are not going to be committed, then add them to the .gitignore file in the root of the project and projectile should ignore them.