- C-g as many times as needed, to get out of a prompt
- How to open and save files using Emacs - remember that arrow keys and Page Up/Page Down work fine as well.
- C-c p a a to locate projects under the given directory
- C-c p c to start a compilation at the top of the current project
- C-c p f to find a file within the current project
- C-c p k to close all files in the current project
- C-c p p to visit a known project in Magit, which is a git status browser and git shell
- C-c p t to switch to a different open buffer within the project
- C-c p s r to search content within a project non-interactively
- C-c p s s to search content within a project interactively
- C-c p w p to copy the part of the file path relative to the project root
- C-c p w w to copy the file path of the current buffer
- C-c p ! to run a shell command at the top of the current project
- C-c V s to visit Magit Status Mode from any file within a git project
- C-c V a to open
git blameon the current file - use q to exit when done - C-c V b to visit Magit Branch mode and see a list of git branches to checkout
- C-c V f to take a git action on the current file with a menu
- C-c V l to visit Magit Log mode and see a list of git revisions made to the project, which can be opened
- C-c V v to take a git action on the current repo with a menu
- C-c p s s to search an entire project for a phrase as you type,
using
ripgrep- RET to visit a result, or
- C-c C-o to move the results into a separate buffer. r within that buffer will allow you to start making changes to any text in that buffer, and C-c C-c applies the changes.
- C-c p s r to search an entire project and put the results in a
buffer with links that can be visited
- g to refresh the buffer, which is useful for refactoring, if you've changed any files
- C-c p r to search and replace a phrase throughout an entire project, asking you what to do with each match
When you're visiting a source code file, you can use these commands to navigate to the definition of the function that the cursor is at.
- C-c . . to visit the definition
- C-c . , to return to the original point
- C-c . / to find references
- C-c p D to open the root of the project in Dired Mode, which looks
like
lsoutput but you can manipulate it - C-c p d to open a different project directory in Dired
- RET when in Dired, will visit the file at point
- r when in Dired, will allow you to make changes to the names of any
files
- C-c C-c applies the changes
- C-c ESC removes the changes and takes you back to Dired
- C when in Dired, will copy the file
- R when in Dired, will rename the file or move it to a different directory
The following shortcuts are added to ~/emacs-shared/bin which can be added to
your $PATH:
en: Open the provided file in the existing Emacs window, and return right awayet: Open the provided file in terminal Emacs, and wait until done editingew: Open the provided file in a new Emacs window, and wait until done editing