Git configuration

We work with a git submodule: https://www.git-scm.com/book/en/v2/Git-Tools-Submodules.

If you develop on the submodule side, a git diff on the project root will only say that the submodule has local modifications (is dirty), but won’t tell you what changed. Set this setting:

git config --local diff.submodule log

Now a git diff will show the submodule’s log.

Note

That helps in Emacs’ Magit too.

Editors configurations

Here we share tips on our favorite(s) editors. Indeed, it must assist you in many areas: development in python and javascript (syntax highlighting, code checker, ...), development with AngularJS, documentation writing, json editing, project management, and why not as a test runner and a shell.

Emacs

Emacs’ package manager

Starting with version 24 Emacs has an official package manager: package.el (we already had el-get and it still works). But you won’t go far if you don’t activate the MELPA repository: see http://wikemacs.org/wiki/MELPA

Now to install a package:

Alt-x package-install RET the package RET

Note

The packages below are available either on MELPA or on the official package.el repository (GNU ELPA).

Not sure ? Use a starter kit

True enough, Emacs isn’t user friendly without some configarution. If you didn’t tweak it a lot yet, it’s a good idea to start with an excellent configuration out of the box. There are some options and our favorite is Prelude.

Vim emulation

You can get modal editing with the excellent evil-mode: http://wikemacs.org/index.php/Evil

LiveScript

Django mode

https://github.com/myfreeweb/django-mode

Gives a menu and some global functions to interact with Django.

Angular snippets and utilities:

Jade templates

JSON

  • Check the json integrity with flymake-json. You need:

    npm install -g jsonlint
    
  • json-mode: syntax highlighting and commands to reformat.

CSS

The CSS mode is recognized by default, but a few stuff more may be useful:

  • M-x rainbow-mode will colorize strings that represent colors, like “#cdfa07” or just “blue”.
  • M-x list-colors-display will show a big list of color choices with their notation in another buffer.

Shell interaction

See http://wikemacs.org/wiki/shell

Translating po files

See the [po-mode](https://raw.githubusercontent.com/andialbrecht/emacs-config/master/vendor/po-mode.el) and [its documentation](https://www.gnu.org/software/gettext/manual/html_node/Installation.html). When activated, press u to go to the next unread entry and type Enter to edit it.

See also

  • effectively open files and run commands on the project with projectile.
  • elscreen to have tabs.

More documentation

Shell

npm completion

Run:

.< (npm completion

on your current shell and put this command in your .bashrc.

If available on your system, the following does the same:

apt-get install npm-completion