-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overview of projectile for working with files only from the current project, making it easier to open files and navigate buffers for a project. Using helm transient state to help tidy up buffers.
- Loading branch information
1 parent
5a98cbb
commit 3486561
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Projectile - project specific commands | ||
|
||
`SPC p` opens the projectile menu allowing you to run commands relative to the project of the active buffer. | ||
|
||
[![Spacemacs Projectile menu](/images/spacemacs-projectile-menu.png)](/images/spacemacs-projectile-menu.png) | ||
|
||
## What is a project | ||
|
||
A project can be one or more of the following things | ||
|
||
* Git - a directory with the `.git` directory | ||
* Language specific - e.g. a Clojure Leiningen project | ||
* Projectile - any directory with a `.projectile` file | ||
|
||
## Opening Files from the same project | ||
|
||
`SPC p f` is a quick way to open a file that you know the name of as it lists all the files in a project. This is a good approach if you know the name but not the directory path of the file. | ||
|
||
The list of files will narrow as you start typing a file name and you can use the `C-k` and `C-j` keybindings to move up and down the list respectively. | ||
|
||
[![Spacemacs Projectile File - new file](/images/spacemacs-projectile-file-new-file--light.png)](/images/spacemacs-projectile-file-new-file--light.png) | ||
|
||
|
||
## Switching between buffers | ||
|
||
`SPC p b` gives a helm popup list of currently open buffers for the current project. | ||
|
||
|
||
## Toggling between test and code files | ||
|
||
`SPC p a` toggles the buffer between the test and code files in your project. | ||
|
||
In Clojure this is based on the corresponding namespaces, so `SPC p a` would toggle between these two files. | ||
|
||
``` | ||
src/project-name/component/clojure-code.clj | ||
test/project-name/component/clojure-code.clj | ||
``` | ||
|
||
Keybindings / commands | ||
|
||
`projectile-toggle-between-implementation-and-test` | ||
|
||
|
||
Cider also has a command to do this: | ||
|
||
`cider-test-default-test-ns-fn` | ||
|
||
Allegedly, this command is not as effective as the projectile command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Tidying up buffers | ||
|
||
Sometimes you want to close several buffers and not just the current buffer with `SPC b d`. | ||
|
||
`SPC b b` displays a list of open buffers in a popup window. | ||
|
||
`M-SPC` opens the Helm transient menu on the buffer popup window, allowing you to navigate using `j` and `k` keys. | ||
|
||
`M-D` will prompt you to kill the buffer the cursor is currently on. | ||
|
||
`t` will mark the buffer the cursor is currently on. | ||
|
||
`T` will mark all buffers listed in the popup. | ||
|
||
`M-D` will prompt you in turn to delete all the marked buffers. | ||
|
||
|
||
## Actions | ||
|
||
There are a range of actions you can run from the Helm transient state or even when you just have the buffer list popup open. | ||
|
||
|
||
> #### TODO:: image of available actions |