emacs-up
emacs-up copied to clipboard
My emacs configuration files
#+title: Emacs Up: My personal El-get based Emacs configuration #+author: Vedang Manerikar <vedang.manerikar at gmail> #+last_updated: <2023-05-28 Sun>
- This starter kit provides:
-
Working and well-tuned configurations for:
- Clojure Programming (CIDER + other minor modes)
- Emacs Lisp Programming (ElSpice + other minor modes)
- Note-taking and Task-tracking through Org Mode
- Email through Emacs (Notmuch + mbsync + msmtp)
-
Other minor but important additions:
- Avy Mode (Jumping and Navigation)
- Company Mode (Completion)
- Helm Mode (Navigation)
- Magit (Git Interface)
- Multiple Cursors (Editing)
- Paredit (Editing Lispy things)
- YASnippets (Templating and Boiler Plate)
- Correct path manipulation on OS X (System)
-
Better defaults than "pure" Emacs. And a number of other small but beautiful packages.
- Pre-requisites :PROPERTIES: :CREATED: [2023-05-28 Sun 20:09] :ID: 492CBC79-1DF1-46CC-A9F9-604C6AE8AD2E :END:
The following tools should be installed and available on the system:
- [[http://git-scm.com/][git]]
- [[http://mercurial.selenic.com/][mercurial]]
- [[https://subversion.apache.org/][subversion]]
- [[http://aspell.net/][aspell]]
- [[https://www.gnu.org/software/automake/][automake]]
- [[https://www.gnu.org/software/texinfo/][Texinfo]]
- [[https://github.com/koalaman/shellcheck][Shellcheck]]
Make sure that they are on $PATH.
-
On a Mac, these can all be installed through Homebrew as follows: #+begin_src sh brew install git mercurial aspell automake texinfo subversion shellcheck #+end_src
-
On Ubuntu, these can all be installed through Apt as follows: #+begin_src sh apt install git mercurial aspell automake texinfo subversion shellcheck #+end_src
The following tools are optional, but recommended / needed for particular modes to work correctly.
- [[https://notmuchmail.org/][notmuch]]: My preferred email client.
- [[https://github.com/prettier/prettier-emacs][prettier]]: Provides formatting of JS code on save.
- [[https://github.com/dandavison/delta][delta]]: Beautiful and fast diff tool.
- [[https://github.com/ajeetdsouza/zoxide][zoxide]]: A smarter cd command
- [[https://github.com/clj-kondo/clj-kondo][clj-kondo]]: A linter for Clojure code that sparks joy.
- [[https://github.com/greglook/cljstyle][cljstyle]]: A tool for formatting Clojure code.
- First-time installation instructions / Optional Pre-requisites :PROPERTIES: :CREATED: [2023-05-28 Sun 20:09] :ID: 8DEF2070-5BA5-475E-B9E6-3614FAD82EF3 :END:
** Org Mode: :PROPERTIES: :CREATED: [2023-05-28 Sun 20:09] :ID: D648AA0E-3881-4CCF-ADF2-4801E3153604 :END:
For org-mode to work, you'll have to set your ~org-directory~. To do this, add the line
#+begin_src emacs-lisp (setq org-directory "/path/to/org/directory") #+end_src
somewhere in your Emacs config. I recommend that you create the file ~~/.emacs.d/personal.el~ and add the code to that file.
For more information about the org config, take a look at [[https://github.com/vedang/org-mode-crate][vedang/org-mode-crate]]
** Clojure interactive development through Cider :PROPERTIES: :CREATED: [2023-05-28 Sun 20:09] :ID: F7F6DF37-6E6A-41E0-8395-17EF47C427E5 :END:
[[https://github.com/clojure-emacs/cider/][cider]] needs a one time setup of [[https://github.com/clojure-emacs/cider-nrepl/][cider-nrepl]], [[https://github.com/clojure-emacs/refactor-nrepl/][refactor-nrepl]] middleware in order to work properly. Please follow the installation instructions in the respective repos to install ~cider-nrepl~ and ~refactor-nrepl~.
- Installation Instructions :PROPERTIES: :CREATED: [2023-05-28 Sun 20:07] :ID: 0D1C3749-5575-4EE8-AD4A-CFE97AC2CE18 :END:
-
Clone the repository and move it to your ~.emacs.d~ folder #+begin_example $ cd /tmp/ $ git clone https://github.com/vedang/emacs-up.git $ mv emacs-up ~/.emacs.d #+end_example
-
Make sure you've followed the One-Time installation instructions before proceeding.
-
Start Emacs. Make yourself a cup of tea. The first boot will trigger a (one-time) download of all the packages that Emacs-Up needs. This can take a lot of time. Sometimes (rarely) Emacs will stop and throw an error. If this happens, try re-starting Emacs. If the error is still being thrown, file an issue with me. Don't forget to include the stacktrace. Don't worry, your perfect environment is being baked with love.
-
...
-
Profit!
- Post-Installation instructions :PROPERTIES: :CREATED: [2023-05-28 Sun 20:06] :ID: 517D43E3-6EBA-4519-B4BC-B9DD8EC5FC95 :END:
** All the Icons :PROPERTIES: :CREATED: [2023-05-28 Sun 20:06] :ID: 30980333-DBC9-4A30-B27D-F0A3E50A4B11 :END:
This configuration installs ~all-the-icons~ for pretty icons. All the Icons requires special fonts to be installed, which can be done with ~M-x all-the-icons-install-fonts~
- Upgrading to the latest version of ~emacs-up~ from an older version :PROPERTIES: :CREATED: [2023-05-28 Sun 20:06] :ID: F1F517A7-F86B-4914-A2C8-197F6CE3FA46 :END:
- Close running ~emacs~ session
- Fetch the latest changes from ~vedang/emacs-up~
- Start ~emacs~ and run the following code: #+begin_example M-x el-get-self-update M-x el-get-update-all #+end_example
- Restart ~emacs~
- Features currently in experimental mode :PROPERTIES: :CREATED: [2023-05-28 Sun 20:05] :ID: CACF57C6-61E1-479A-923D-C07907BA1EFC :END: ** Using Tree Sitter with emacs-up :PROPERTIES: :CREATED: [2023-05-28 Sun 20:06] :ID: 4963A703-468F-4BA9-B680-590BCFBD36C0 :END: ~emacs-up~ now uses the new ~tree-sitter~ support that Emacs 29+ brings for many programming modes (see list below). Getting this to work requires installing ~tree-sitter~ and the language grammars. I consider this as experimental at the moment, you can skip this setup if you do not care of any of these languages.
The pre-requisite for this to work is that you need to install ~tree-sitter~ on your system. You can do this as follows: #+begin_src sh git clone https://github.com/tree-sitter/tree-sitter cd tree-sitter/ make sudo make install #+end_src
Here is the list of languages that use ~tree-sitter~ in this config, along with where we clone the grammars from:
#+begin_src emacs-lisp '((bash "https://github.com/tree-sitter/tree-sitter-bash") (c "https://github.com/tree-sitter/tree-sitter-c") (cpp "https://github.com/tree-sitter/tree-sitter-cpp") (clojure "https://github.com/sogaiu/tree-sitter-clojure") (cmake "https://github.com/uyha/tree-sitter-cmake") (css "https://github.com/tree-sitter/tree-sitter-css") (elisp "https://github.com/Wilfred/tree-sitter-elisp") (html "https://github.com/tree-sitter/tree-sitter-html") (java "https://github.com/tree-sitter/tree-sitter-java") (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") (json "https://github.com/tree-sitter/tree-sitter-json") (make "https://github.com/alemuller/tree-sitter-make") (markdown "https://github.com/ikatyang/tree-sitter-markdown") (python "https://github.com/tree-sitter/tree-sitter-python") (rust "https://github.com/tree-sitter/tree-sitter-rust") (toml "https://github.com/tree-sitter/tree-sitter-toml") (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") (yaml "https://github.com/ikatyang/tree-sitter-yaml")) #+end_src
This list is maintained in the variable ~vedang/treesit-grammars~, in case you are interested in modifying it.
Make sure you are using Emacs 29+ with ~tree-sitter~ support enabled. You can check this with ~C-h v system-configuration-features~. The output should have ~TREE_SITTER~ in it.
~emacs-up~ will install ~tree-sitter~ grammars automatically. We use code inspired from the ~combobulate~ README to do this. Check ~vedang/install-treesit-grammars-and-modes~ if you are curious.