Table of Contents
Inspired by the great Juan Pedro Fisanotti and his wonderful fisa-vim-config, I share my Emacs config. This is my personal Emacs configuration, built according to my personal preferences, without any justification to think it's the best possible emacs configuration. If you like it, great! :) It's mainly oriented to Python, PHP and Golang software development, but many of its features are useful for other languages and editing tasks.
This Emacs config have some useful modules:
- adoc-mode
- company
- emacs code browser (ecb)
- flycheck
- geben
- iedit
- js2-mode
- lsp-mode
- magit
- magit-gitflow
- markdown-mode
- markdown-toc
- neo-tree
- php-mode
- powerline
- projectile
- smarty-mode
- sqlformat
- yasnippet
- and much more...
- This config is tested in Emacs 25.2.2, but may also work in previous versions.
Your
~/.emacs.d
folder should be empty. If you have one, rename it or move to a different location (to keep a backup, just in case you want to go back). Also rename or move your~/.emacs
file (to keep a backup, just in case you want to go back).
$ cd ~
$ mv .emacs.d .emacs.d.bak
$ mv .emacs .emacs.bak
- Install the required dependencies:
$ sudo apt-get install emacs exuberant-ctags git ripgrep silversearcher-ag pylint pep8 php-pear python-pip virtualenv
$ sudo pear channel-update pear.php.net
$ sudo pear install PHP_CodeSniffer
$ pip install sqlparse
$ sudo snap install pyright --classic
$ go install golang.org/x/tools/gopls@latest # Make sure gopls is in your PATH
- Clone the repository:
$ git clone https://github.com/Abuelodelanada/pepe-emacs-config ~/.emacs.d
- Open emacs and it will continue the installation by itself installing packages from melpa and elpa. Wait for it to finish... and done! You now have your new shiny powerful emacs :)
Flycheck is activated and notifies in the powerline if there is a warning or an error
%
: go to match parenF7
: toggle ecb (emacs code browser)F8
: toggle neotreeF12
: toggle menu bar modeC-;
: activate iedit-dwimC-c C-k
: copy lineC-c C-w
: copy wordC-c C-z
: term stop subjobC-c TAB
: format sqlC-c c
: comment regionC-c down
: flycheck-next-errorC-c u
: uncomment regionC-c up
: flycheck-previous-errorC-d
: duplicate current lineC-l
: go to lineC-t
: create ctagsC-x g
: magit-statusC-x p
: run phpcbf --standard=PSR2 to the current bufferC-<prior>
: centaur-tabs-backwardC-<next>
: centaur-tabs-forward'sC-up
: beginning-of-bufferC-down
: end-of-bufferC-M-g
: lsp-goto-type-definition (Go to definition)C-M-p
: xref-go-back (Return from definition)S-M-down
: enlarge windowS-M-left
: enlarge window horizontallyS-M-right
: shrink window horizontallyS-M-up
: shrink windowS-down
: windmove downS-left
: windmove leftS-right
: windmove rightS-up
: windmove up