35

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 list of files globally ignored by projectile. projectile-globally-ignored-directories A list of directories globally ignored by projectile. projectile-...


30

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 mode (spc p I for evil mode).


23

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


14

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 my helm-projectile. It has the multifile opening right at the beginning. Aside from the answer above, the question was updated with the question to open ...


11

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 '(:eval (if (projectile-project-p) (format " Projectile[%s]" (projectile-project-name)) "")))


9

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 menu and select the 3rd action. To navigate hgrep buffer: C-<down>: go to next match and open the match. C-<up>: go to previous match and open the ...


9

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 directory of a project. In order to add multiple projects at a time, you can use projectile-known-projects-file, which is read when projectile.el is first loaded. ...


8

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-file (default key binding is C-c p f) works just like find-file, but will act on all files in the subdirectories of the project's main directory (where the ....


8

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. TL;DR It's hard. :) Research First, let's think a bit. helm-projectile-find-file is definitely calling find-file or some similar function at some point. You ...


7

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 the keybindings, use the ido-setup-hook. For example: ;;(add-hook 'ido-setup-hook 'ido-my-keys) ;; ;;(defun ido-my-keys () ;; "Add my keybindings for ido." ;; ...


7

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 try.


7

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 to use it (check the link above or do C-h i m Org Mode RET from within Emacs and navigate to the "Agenda Views" chapter), so it does not make sense to repeat all of this ...


7

Write your own command that checks: (defun maybe-projectile-find-file () (interactive) (call-interactively (if (projectile-project-p) #'projectile-find-file #'ido-find-file))) (global-set-key (kbd "C-x C-f") 'maybe-projectile-find-file)


7

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) (define-key evil-normal-state-map (kbd "<f9>") 'helm-for-files))) (add-hook 'find-file-hook #'contextual-f9) (add-hook 'dired-mode-hook #'contextual-...


7

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)))) (when root (add-to-list (make-variable-buffer-local 'flycheck-clang-include-path) root))) (add-hook 'c++-mode-hook 'setup-flycheck-clang-...


7

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 ;; https://github.com/BurntSushi/ripgrep (when (executable-find "rg") (progn (defconst modi/rg-arguments `("--line-number" ...


7

.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. The only thing that's been taken into account is precedence which is described in the documentation you have linked to. The values are interpreted as-is, emacs ...


7

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-z f3 After this you can move around the results like a regular buffer, and if you have two windows up, hitting RET on a result entry will open the entry in the ...


6

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'." (interactive) (if (projectile-project-p) (helm-projectile) (helm-for-files))) then set the keybinding as you want: (define-key evil-normal-state-map (kbd "&...


6

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.


6

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 third-party package you've installed via the package manager, and therefore unavailable until your ELPA packages have been initialized. Regarding your second ...


6

I have no idea how to check which magit-xyz command is triggered when using b b in magit-status. Use b ? b in magit-status. This tells you it runs magit-checkout. And even if I knew: How would I transparently "overwrite" that command to first call its previous definition and then projectile-invalidate-cache? Use advice: (defun run-projectile-...


6

The following code works for me. (setq frame-title-format '("" "%b" (:eval (let ((project-name (projectile-project-name))) (unless (string= "-" project-name) (format " in [%s]" project-name))))))


5

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 searching it. To match your example; C-u M-x projectile-find-file There are a number of other functions in projectile that use the prefix argument, check for ...


5

You can define filter groups for known projects using something like this: ;; Define ibuffer filter groups for each known project (defun my/define-projectile-filter-groups () (when (boundp 'projectile-known-projects) (setq my/project-filter-groups (mapcar (lambda (it) (let ((name (file-name-nondirectory (directory-file-...


5

Project is meant in the Projectile sense of the word. Using Projectile, there is a way to switch to a buffer inside a specific project C-c p b May I suggest ibuffer-vc? A way to group your buffers by their parent vc root directory.


5

The bindings for projectile are stored in projectile-command-map, so we can use define-key to add more stuff: (define-key projectile-command-map (kbd "s p") #'projectile-pt). This adds s p to whatever projectile-keymap-prefix happens to be.


5

Assuming you have projectile-indexing-method set to 'alien' (the default except for Windows), if the VCS isn't recognized, projectile will call projectile-generic-command, which is "find . -type f -print0" by default. If you want to take a closer look, projectile-get-ext-command is the function that decides to what to call. I don't think there's any easy ...


5

According to the source, I would reckon ack-and-a-half-executable is nil. This would explain the output you get. Again from the source, it would appear that ack is not visible to Emacs. Note the TODO: ; TODO Determine how to fall back to using ack-grep if ack is not found. (defcustom ack-and-a-half-executable (executable-find "ack") "*The location of ...


5

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 will also kill special buffers (except *scratch* and *Messages*) if called with a prefix like C-u. (defun modi/kill-non-project-buffers (&optional kill-...


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