48 votes
Accepted

How to exclude files from Projectile?

Looking at projectile it seems to offer four customizations for ignoring files/directories globally. I am listing each of them below, with their documentation projectile-globally-ignored-files A ...
user avatar
  • 7,288
37 votes

How to clear cache of projectile file in spacemacs?

Type M-x projectile-invalidate-cache and you'll see the command with the bindings listed next to it. For me the bindings said M-m p I which was correct, and should be the default I suspect for holy ...
user avatar
30 votes

How to exclude files from Projectile?

Yes, in your .projectile file, on each line specify similar to: each line looks like: - /path/to/somefile Each line contains one file path. See the official documentation on ignoring files
user avatar
16 votes
Accepted

Mark and open multiple files with Helm and Projectile

Yes, use C-SPC to mark each file individually or mark all with M-a, then press RET to open all those files. I wrote a Helm guide here that covers Helm basics and most of default commands. Also check ...
user avatar
  • 6,672
13 votes
Accepted

How can the list of projects used by Projectile be manually updated?

You can add a single project to Projectile's runtime list of known projects (projectile-known-projects) using the command projectile-add-known-project, which interactively prompts you for the root ...
user avatar
  • 11.3k
11 votes
Accepted

Turn on projectile-mode only for files in actual projects

So, it's about the modeline. You can set projectile-mode-line to check if you are in a project root; if so, displays in the modeline, otherwise displays nothing: (setq projectile-mode-line '(:...
user avatar
  • 6,672
10 votes

Recursive grep in directory with helm and/or projectile?

You have two ways: Use helm-projectile-grep/ack/ag: You can search for everything starting from project root. Later if you want to save the search results, press F3 or press TAB to switch to action ...
user avatar
  • 6,672
9 votes
Accepted

A search interface for org mode files

Org itself provides a facility for filtering/searching information stored in .org files in various ways. It is called the "Agenda". The org-mode manual provides extensive information on how ...
user avatar
  • 14.2k
9 votes
Accepted

How to use .dir-locals.el with Projectile?

.dir-locals.el does not care about the meaning of the variables that it sets, nor does it assume their values are lists (they do not have to be.) So it does not perform any merge or other processing. ...
user avatar
9 votes
Accepted

Show counsel-ag results in separate buffer?

Try C-c C-o (ivy-occur) in the minibuffer.
user avatar
8 votes
Accepted

Projectile does not show all files in project

Once activated, projectile works out-of-the-box for git projects. To activate include (projectile-global-mode) in your Emacs configuration (or start projectile-mode) manually. Then projectile-find-...
user avatar
  • 206
8 votes
Accepted

How to detect if in a project, then configure another key binding for Projectile?

You can do it like this: (defun contextual-f9 () (if (projectile-project-p) ;; detect if current buffer is in a project (define-key evil-normal-state-map (kbd "<f9>") 'helm-projectile) ...
user avatar
  • 6,672
8 votes
Accepted

Automatically add project directory to flycheck clang/gcc include path

Use projectile-project-root to get the root path and add it to the list with a c++-mode-hook (defun setup-flycheck-clang-project-path () (let ((root (ignore-errors (projectile-project-root)))) (...
user avatar
8 votes
Accepted

Projectile indexes my home directory, how do I stop it from doing that?

Okay, this was dumb ... I had an empty Makefile sitting in my home directory. And because Projectile Project Root Files Top Down Recurring tells Projectile to recognize a Makefile as project root my ...
user avatar
8 votes
Accepted

helm-projectile with elscreen

Okay, let me share a bit of the process of arriving at the solution to Question #1 (which should also resolve #2). I'm going to assume you know Emacs key notation and at least a little about Elisp. ...
user avatar
  • 10k
8 votes

Open helm search result in a new window?

C-z will bring up a new buffer with actions available to helm, and I see the following: [f1] Open file [f2] Open file other window [f3] Save results in buffer [f4] Edit search results So you want C-...
user avatar
8 votes
Accepted

How to set Projectile project name as frame title

The following code works for me. (setq frame-title-format '("" "%b" (:eval (let ((project-name (projectile-project-name))) (unless (string= "-" project-name) ...
user avatar
  • 106
8 votes
Accepted

helm-projectile-ag use thing-at-point as input?

Found it. The setting is (setq helm-ag-insert-at-point 'symbol) Reference: https://github.com/syl20bnr/spacemacs/issues/1848#issuecomment-108973505
user avatar
  • 235
7 votes
Accepted

How do I bind keys in ido?

According to the source code, you need to modify keybindings via ido-setup-hook: ;; Customization ;; ------------- ;; ;; Customize the `ido' group to change the `ido' functionality. ;; ;; To modify ...
user avatar
  • 31.1k
7 votes
Accepted

Find in Project with Ack

ack-and-a-half is now abandonware. I don't think plain projectile-ack is still functional in current Projectile -- maybe you should try ag. If you really want ack, you could give helm-projectile-ack a ...
user avatar
  • 6,672
7 votes
Accepted

Have `projectile-find-file` fall back to `ido-find-file` outside of projects

Write your own command that checks: (defun maybe-projectile-find-file () (interactive) (call-interactively (if (projectile-project-p) #'projectile-find-file #'ido-find-file))) (...
user avatar
  • 6,434
7 votes

How to detect if in a project, then configure another key binding for Projectile?

Actually you can do it by using a wrapper of those two functions: (defun smart-for-files () "Call `helm-projectile' if `projectile-project-p', otherwise fallback to `helm-for-files'." (...
user avatar
  • 71
7 votes
Accepted

Projectile installed but "Autoloading failed to define function projectile-mode"

You got the error "Autoloading failed to define function" because multiple packages are apparently active in your load-path. Try M-x list-load-path-shadows to get a clue which packages are conflicting....
user avatar
  • 169
7 votes

How to exclude files from Projectile?

Another solution would be to use ag(the_silver_searcher) or rg (ripgrep) to generate project files. Here's how you can do it with rg: (setq projectile-enable-caching t) ;;; Default rg arguments ;; ...
user avatar
6 votes
Accepted

Projectile not showing all files under my Git project

The quick answer is to invalidate the projectile cache. When using projectile-find-file if you use C-u to send the universal argument before running the function, it will invalidate the cache before ...
user avatar
  • 3,984
6 votes
Accepted

Close other buffers with projectile

Save the below function to your emacs init and call it via M-x. By default this function will kill all buffers except the ones that belong to a projectile project or are special. The same function ...
user avatar
  • 24.3k
6 votes
Accepted

Run hook on new buffer

You can advise create-file-buffer, if you care only about file buffers. Likewise, you can advise rename-buffer. That's what uniquify does, for instance. Are you familiar with uniquify.el? Maybe it ...
user avatar
  • 69.6k
6 votes
Accepted

variable project root folder in .dir-locals.el

I found the solution with projectile. It has a function projectile-project-root which can be used to get the project path. I can noe use the following in .dir-locals.el and it will still work when I ...
user avatar
  • 785
6 votes
Accepted

Open file in a specific window

Allowing user to custom action is a great feature of helm, for example, to use ace-window to select a window for buffer to switch, all you need to do is implement it as an action: (defun helm-buffer-...
user avatar
  • 13.6k
6 votes
Accepted

Global Modes not consistent?

Your main question isn't really about global modes at all. global-linum-mode is (auto) loaded in Emacs by default, and so is available to all Emacs users at all times. projectile-global-mode is in a ...
user avatar
  • 43.5k

Only top scored, non community-wiki answers of a minimum length are eligible