This is for the console only (no graphical xwindows) version. Installs into /opt/emacs253 so can run side-by-side with system emacs. # Download emacs tarball & untar ./configure –prefix=/opt/emacs253 –with-gif=no –with-tiff=no –with-x-toolkit=no \ –with-xpm=no –with-jpeg=no –with-png=no # install any dependencies & build make make DESTDIR=/tmp/emacs install # Install fpm (gem install fpm) to build package fpm …
Contains various helper functions including crux-duplicate-and-comment-current-line-or-region for when you want to rework a line of code but keep the original. I’ve added these shortcuts: ;; crux (global-set-key (kbd “C-c I”) #’crux-find-user-init-file) (global-set-key (kbd “C-c r”) #’crux-rename-file-and-buffer) (global-set-key (kbd “C-c d”) #’crux-duplicate-current-line-or-region) (global-set-key (kbd “C-c M-d”) #’crux-duplicate-and-comment-current-line-or-region) (global-set-key (kbd “C-c n”) #’crux-cleanup-buffer-or-region)
yafolding I like to bind double-Y to show/hide a fold with chord-mode: (key-chord-define-global “YY” ‘yafolding-toggle-element)
Put this in ~/.emacs ;; mouse activate window – eg for neotree (setq focus-follows-mouse t) (setq mouse-autoselect-window t)
My new current favourite theme for emacs is spolsky. If you use elpy / highlight-indentation, you might want to define this too: (set-face-background ‘highlight-indentation-face “#1B2025”)
By default emacs uses ctrl-rightmouse for the context menu, if you prefer a more “standard” right click only put this in .emacs: (global-set-key [mouse-3] ‘mouse-popup-menubar-stuff)
Just install this from the emacs package manager, add (ido-yes-or-no-mode) to your .emacs and you will never again have to laboriously type “yes” in response to “are you sure?” type queries from emacs.
Put this in your .emacs to automatically make your scripts (bash, python, perl, ruby, etc) executable: (add-hook ‘after-save-hook ‘executable-make-buffer-file-executable-if-script-p)
Hopefully you are already using ido or something similar to enhance emacs tab completion. I only use ido-switch-buffer ((ido-mode ‘buffer) in .emacs) as I dislike ido-find-file. What I don’t like is accidentally typing \C-x\C-b for buffer-menu-other-window (or whatever it is) when I meant \C-x b. So I put this in .emacs: (global-set-key “\C-x\C-b” ‘ido-switch-buffer)
I used to have a very complex .emacs config for python development, then I discovered elpy. It bundles together various python lisp modules cohesively, supports virtual environments, loading “project” files (via elpy-find-file), refactoring, running tests and so on. I’m not even tempted to use PyCharm much any more.