This is my personnal Emacs configuration.
Using Straight
to declare packages.
Install emacs:
brew install libtool cmake
brew tap d12frosted/emacs-plus
brew install emacs-plus --with-native-comp
./install.sh
# Put the following in your ~/.emacs:
# (load-file "$(pwd)/init.el")
Run
M-x nerd-icons-install-fonts
M-x treesit-auto-install-all
MacOS:
System Settings -> Keyboard shortcuts -> Input sources:
Disable all ^Space to fix ctrl-space
Aside from basic emacs keybindings here is a list of keybind defined in this config.
Keybinding | Description |
---|---|
C-f | select/mark current line |
C-d | duplicate current line |
C-q | kill buffer |
M-[UP-DOWN] | scroll buffer |
C-M-[arrow] | move the window to the left/right/up/down |
M-q-[arrow] | jump to window to the left/right/up/down |
Keybinding | Description |
---|---|
C-x C-f | helm-find-files : view and open files |
C-p | helm-buffer-list : select/create buffer |
M-f | helm-occur : search in current buffer |
M-R | helm-ag : select a directory and do a recursive ag search |
While in helm-find-files
(C-x C-f):
Keybinding | Description |
---|---|
M-R | start helm-ag in selected directory |
C-p | use find command in selected directory to search file |
While in helm-mode, use tab to quickly see the candidate in another buffer.
Keybinding | Description |
---|---|
C-c p f | list all the file in the project |
C-c p F | list all files from all opened project |
C-c p s s | runs helm-ag (recursive grep) at the root of the project |
C-c p a | switch between files with the same name but different extensions (for example .c/.h) |
C-c p r | runs query-replace on all files in the project |
C-c p i | regenerate project file cache (if many file path changed) |
Theses are standard projectile keybindings, see the complete list here
Keybinding | Description |
---|---|
C-j | add a new cursor to the next point that match the selected region. |
M-j | add a new cursor to the next point that match the selected symbol. |
For Iterm:
In Profiles
-> Advanced
-> Sementic History
:
Set to Run command
, with value: $PATH_TO/emacsclient -n \2 \1
On emacs version 28 and lower, apply helm patch for OSX:
cd ~/.emacs.d/straight/repos/helm
git apply ~/emacs-conf/helm.patch
To fix lldb bug on MacOS Sonoma
rm ~/.emacs.d/debug-adapters/codelldb/extension/lldb/bin/debugserver
emacs -Q -l ~/.emacs.d/straight/repos/straight.el/bootstrap.el
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(global-set-key (kbd "C-f") "\C-a\C-a\C-@\C-e")
(global-set-key (kbd "C-q") 'kill-this-buffer)
(when (string-equal system-type "darwin")
(setq mac-command-modifier 'meta
mac-option-modifier nil))
(use-package ...)
TODO:
-
try without fork on helm-ag: https://github.com/Azkae/emacs-helm-ag/compare/master...emacsorphanage:helm-ag:master they added finished status on modeline
-
try consult & https://github.com/mhayashi1120/Emacs-wgrep to replace helm & helm-ag? see embark: https://github.com/oantolin/embark
If you use the grepping commands from the Consult package, consult-grep, consult-git-grep or consult-ripgrep, then you should install the embark-consult package, which adds support for exporting a list of grep results to an honest grep-mode buffer, on which you can even use wgrep if you wish. ^ wgrep also works with helm