Get emacs to automatically active a virtualenv for a directory & below
create a .dir-locals.el file: ensure that env var WORKON_HOME is set, either in shell or earlier in emacs config as below:
create a .dir-locals.el file: ensure that env var WORKON_HOME is set, either in shell or earlier in emacs config as below:
How to fix it To paraphrase: set package-check-signature to nil, e.g. M-: (setq package-check-signature nil) RET download the package gnu-elpa-keyring-update and run the function with the same name, e.g. M-x package-install RET gnu-elpa-keyring-update RET. Restart emacs
add to ~/.emacs (add-hook ‘yaml-mode-hook (lambda () (highlight-indentation-mode) ))
A small skeleton you can put into your python emacs editing session: ;; insert python skeleton with auto-insert (eval-after-load ‘autoinsert ‘(define-auto-insert ‘(“\\.\\py\\'” . “python skeleton”) ‘(“” “#!/usr/bin/env python” \n “# ” (file-name-nondirectory (buffer-file-name)) \n \n “def main():” \n “pass” \n \n “if __name__ == ‘__main__’:” \n “main()” \n \n)))
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 …
Continue reading ‘Build emacs 25 rpm for redhat / centos 7’ »
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”)
;; This maps the M1 key (global-set-key [XF86Tools] ‘smex)