2019-07-21 00:37:46 +02:00
|
|
|
#+TITLE: .emacs.d
|
|
|
|
#+AUTHOR: Wojciech Kozlowski
|
|
|
|
#+EMAIL: wk@wojciechkozlowski.eu
|
|
|
|
|
|
|
|
* Emacs version
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
This configuration is maintained only for the Emacs master branch version. It
|
|
|
|
may work on some older version or you may have to remove the features that
|
|
|
|
rely on the newer Emacs versions. Currently, this configuration uses a few
|
2019-07-21 00:37:46 +02:00
|
|
|
features from Emacs 26 and 27.
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
To fully leverage the features used in this configuration, Emacs must be
|
|
|
|
compiled with the right options.
|
|
|
|
|
|
|
|
** Native JSON
|
|
|
|
|
|
|
|
This configuration uses ~lsp-mode~ for some programming languages which is
|
|
|
|
much faster if Emacs is compiled with native JSON support. Emacs will by
|
|
|
|
default compile with native JSON support if the ~jansson~ library is present
|
|
|
|
(including headers).
|
|
|
|
|
2019-08-07 12:33:22 +02:00
|
|
|
** Vterm
|
2019-08-07 12:10:46 +02:00
|
|
|
|
2019-08-07 12:33:22 +02:00
|
|
|
*** Dynamic modules
|
|
|
|
|
|
|
|
~vterm~ uses dynamic modules. In order to enable dynamic modules, Emacs must
|
|
|
|
be compiled with the ~--with-modules~ option (not enabled by default).
|
|
|
|
|
|
|
|
*** Pre-requisites
|
|
|
|
|
|
|
|
~vterm~ requires =cmake= and =libtool= to be installed.
|
|
|
|
|
|
|
|
*** Directory tracking
|
|
|
|
|
|
|
|
To enable directory tracking in vterm, put this in =.zshrc=
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
function chpwd() {
|
|
|
|
print -Pn "\e]51;$(pwd)\e\\";
|
|
|
|
}
|
|
|
|
#+END_SRC
|
2019-08-07 12:10:46 +02:00
|
|
|
|
2019-07-21 00:37:46 +02:00
|
|
|
* Installation
|
|
|
|
|
|
|
|
Clone this repository into your home directory:
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
2020-04-05 23:45:45 +02:00
|
|
|
$ git clone https://github.com/Wojtek242/.emacs.d ~/.config/emacs
|
2019-07-21 00:37:46 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
This configuration uses the [[https://github.com/adobe-fonts/source-code-pro][Source Code Pro]] font. If you do not have it
|
2019-07-21 00:37:46 +02:00
|
|
|
installed and it isn't available through your distribution you can install
|
|
|
|
the font by running
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
$ git clone https://github.com/adobe-fonts/source-code-pro.git --branch release ~/.local/source-code-pro
|
|
|
|
$ sudo cp ~/.local/source-code-pro/OTF/*.otf /usr/local/share/fonts
|
|
|
|
#+END_SRC
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
Once the initial setup completes, you also need to run the following in Emacs
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
M-x all-the-icons-install-fonts
|
|
|
|
#+END_SRC
|
|
|
|
|
2019-07-21 00:37:46 +02:00
|
|
|
* External Support for Programming Languages
|
|
|
|
|
|
|
|
This configuration relies uses ~lsp-mode~ for language-specific features.
|
|
|
|
However, in order to use the LSP features, you need to have the appropriate
|
|
|
|
language servers installed.
|
|
|
|
|
|
|
|
** C/C++
|
|
|
|
|
|
|
|
Install =ccls= from source
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
$ apt install clang libclang-dev
|
|
|
|
$ git clone --depth=1 --recursive https://github.com/MaskRay/ccls
|
|
|
|
$ cd ccls
|
|
|
|
$ cmake -H. -BRelease
|
|
|
|
$ cmake --build Release
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
Ensure =Release/ccls= is in your =$PATH=.
|
|
|
|
|
|
|
|
** Python
|
|
|
|
|
|
|
|
This configuration assumes =python3= and to use the auto-formatting features
|
|
|
|
you need to have =autopep8= installed.
|
|
|
|
|
|
|
|
Install the Python language server using =pip3=
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
$ pip3 install 'python-language-server[all]'
|
|
|
|
#+END_SRC
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
Note that when using Python virtual environments it is best to install the
|
|
|
|
language server in the environment itself.
|
|
|
|
|
2019-07-21 00:37:46 +02:00
|
|
|
** Rust
|
|
|
|
|
|
|
|
Install RLS using ~rustup~
|
|
|
|
|
|
|
|
#+BEGIN_SRC
|
|
|
|
$ rustup component add rls rust-analysis rust-src
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* Package Management
|
|
|
|
|
2019-08-07 12:10:46 +02:00
|
|
|
This =.emacs.d= uses its own small framework for package management located in
|
|
|
|
the [[emodule][emodule]] directory. Its operation is heavily inspired by [[http://spacemacs.org/][Spacemacs]], but is
|
|
|
|
much smaller with fewer features and thus simpler. For instructions, see its
|
|
|
|
own [[emodule/README.org][README file]].
|
2019-07-21 00:37:46 +02:00
|
|
|
|
|
|
|
* Theme
|
|
|
|
|
|
|
|
The theme in use started with the =underwater= theme and has been heavily
|
|
|
|
modified, with inspiration from the [[http://spacemacs.org/][Spacemacs]] theme, to add support for all
|
|
|
|
new faces introduced by the installed packages.
|
|
|
|
|
|
|
|
The theme files are located in the [[themes][themes]] directory.
|