So for some reason some of my hooks for latex mode with auctex in emacs refuse to run but give no errors (at least none I can see in messages buffer). This is most of the stuff in my .emacs about latex (other than some keyword definitions, etc...). I'm running Emacs24.2 on Arch Linux with the latest version of auctex as well. Been wrestling with this for a while now and as far as I can remember this used to work just fine until today I noticed that flyspell and auto fill weren't being set automatically (has probably been happening for a while at this rate since I haven't use auctex in a while).
(add-to-list 'load-path "~/Dropbox/Emacs/")
(add-to-list 'load-path "~/Dropbox/Emacs/git/")
(add-to-list 'load-path "~/Dropbox/Emacs/magit/")
(add-to-list 'load-path "~/Dropbox/Emacs/GLSL/")
;; auto-complete
(require 'auto-complete)
(require 'auto-complete-config)
(require 'auto-complete-clang)
(ac-flyspell-workaround)
(add-to-list 'ac-modes 'LaTeX-mode)
(ac-config-default)
(setq ac-quick-help-delay 0)
(define-key ac-mode-map [(control tab)] 'auto-complete)
(setq-default ac-sources
'(ac-source-abbrev ac-source-dictionary
ac-source-words-in-same-mode-buffers))
(global-auto-complete-mode t)
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-symbols 'ac-source-variables)))
(defun add-sources-c-modes ()
(add-to-list 'ac-sources 'ac-source-semantic 'ac-source-clang))
(add-hook 'c-mode-hook 'add-sources-c-modes)
(add-hook 'c++-mode-hook 'add-sources-c-modes)
(define-key ac-completing-map "\C-n" 'ac-next)
(define-key ac-completing-map "\C-p" 'ac-previous)
;; DocView
(setq doc-view-continuous t)
(setq doc-view-resolution 300)
;; diff mode colors
(eval-after-load 'diff-mode
'(progn
(set-face-foreground 'diff-added "green")
(set-face-foreground 'diff-header "purple")
(set-face-foreground 'diff-removed "red")))
;; dired colors
(eval-after-load 'dired-mode
'(progn
(set-face-foreground 'dired-directory "cyan")
(set-face-foreground 'dired-flagged "red")
(set-face-foreground 'dired-header "purple")))
;; server mode
;; (server-start)
;; GLSL
(autoload 'glsl-mode "glsl-mode" nil t)
(add-to-list 'auto-mode-alist '("\.vert\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\.frag\'" . glsl-mode))
;; Git / SVN
(require 'git)
(require 'git-blame)
;; Emacs Code Browser / CEDET
;; (require 'cedet)
;; (require 'ecb)
;; (setq ecb-options-version "2.40")
;; Close scratch buffer on startup
(defun close-scratch-hook ()
(kill-buffer "scratch"))
(add-hook 'emacs-startup-hook 'close-scratch-hook)
;; LaTeX/Auctex settings
(require 'ac-math)
(defun ac-latex-mode-setup ()
(add-to-list 'ac-sources 'ac-source-math-unicode 'ac-source-math-latex
'ac-source-latex-commands))
(add-hook 'LaTeX-mode-hook 'latex-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)
(add-hook 'LaTeX-mode-hook 'ac-latex-mode-setup)
(add-hook 'LaTeX-mode-hook
(lambda ()
(set-face-foreground 'font-latex-sedate-face "cyan")))
(setq reftex-plug-into-AUCTeX t)
(setq font-latex-match-slide-title-keywords (quote (("frametitle" "{"))))
(setq font-latex-match-warning-keywords (quote ("hline" "pause" "and" "hfill")))
(setq font-latex-match-function-keywords
(quote
(("titlepage" "") ("maketitle" "") ("frame" "") ("tableofcontents" "")
("noindent" "") ("usetheme" "{") ("usecolortheme" "{") ("institute" "[{")
("includegraphics" "[{") ("title" "[{") ("href" "{{") ("url" "{") ("hypersetup" "{")
("useoutertheme" "{") ("useinnertheme" "{") ("setbeamercolor" "{{")
("setbeamertemplate" "{{") ("setdescription" "{") ("lstset" "{") ("lstinputlisting" "[{")
("textcolor" "{") ("verbatiminput" "{") ("graphicspath" "{")
("fancyhead" "[{") ("fancyfoot" "[{") ("fontsize" "{{") ("doublespacing" ""))))
;; Line numbers
(require 'linum)
(global-linum-mode t)
;; Disable line numbers in certain buffers
(defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode dired-mode)
"* List of modes disabled when global linum mode is on"
:type '(repeat (sexp :tag "Major mode"))
:tag " Major modes where linum is disabled: "
:group 'linum)
(defcustom linum-disable-starred-buffers 't
"* Disable buffers that have stars in them like Gnu Emacs"
:type 'boolean
:group 'linum)
(defun linum-on ()
"* When linum is running globally, disable line number in modes defined in `linum-disabled-modes-list'. Changed by linum-off. Also turns off numbering in starred modes like scratch"
(unless (or (minibufferp) (member major-mode linum-disabled-modes-list)
(and linum-disable-starred-buffers (string-match "*" (buffer-name))))
(linum-mode 1)))
;; Basic emacs settings
(setq initial-scratch-buffer nil)
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(setq-default truncate-lines t)
(setq backup-inhibited t)
(setq auto-save-default nil)
(setq compilation-scroll-output t)
(if (boundp 'scroll-bar-mode) (scroll-bar-mode -1))
(column-number-mode 1)
(setq-default fill-column 80)
(setq auto-fill-mode 1)
(if (boundp 'tool-bar-mode) (tool-bar-mode 0))
(set-face-attribute 'default nil :height 100)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(global-auto-revert-mode t)
(setq frame-title-format "%b")
;; cscope
(require 'xcscope)
(setq cscope-do-not-update-database t)
;; Enable these to speed up compiler output
;; (setq compilation-error-regexp-alist nil)
;; (setq compilation-error-regexp-alist-alist nil)
;; Indentation rules
(setq c-default-style "bsd" c-basic-offset 4)
(c-set-offset 'case-label '+)
(setq sgml-basic-offset 4)
(setq python-indent 4)
(setq indent-tabs-mode nil)
(setq tab-always-indent t)
(setq tab-width 4)
(setq tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52
56 60 64 68 72 76 80 84 88 92 96
100 104 108 112 116 120)))
;; highlight matching parentheses
(show-paren-mode 1)
(setq show-paren-delay 0)
;; highlight current line
(global-hl-line-mode 1)
(set-face-background 'hl-line "#300")
;; C-Sharp mode
;; (require 'cc-mode)
;; (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
;; (add-to-list 'auto-mode-alist '("\.cs$" . csharp-mode))
;; Change the color scheme
(require 'color-theme)
(color-theme-initialize)
(color-theme-midnight)
;; Make ENTER automatically indent in C derived buffers
(add-hook 'c-mode-common-hook
(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
;; Enable terminal colors
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; Hotkeys
(global-set-key [f9] 'compile)
;; Emacs IRC
(setq erc-auto-query 'buffer)
;; assembly mode
(add-hook 'asm-mode-hook
(lambda ()
(local-set-key (kbd "RET") 'newline)))
;; change default Browser
(setq browse-url-generic-program (executable-find "chromium")
browse-url-browser-function 'browse-url-generic)
;; multi-term
(require 'multi-term)
;; yasnippet work around
;; (add-hook 'change-major-mode-hook 'yas/exit-all-snippets)
;; develock
(require 'develock)
My guess is that you launch auto-complete-mode before you add LaTeX-mode to ac-modes.
To know what is happening for sure, we need to see the whole .emacs or a minimal example having the same problem.
By the way your ac-latex-mode-setup is doing nothing because when it is called it just defines a lambda (anonymous function) that will never be used. You need to change it to the following if you want your code to be executed:
(defun ac-latex-mode-setup () ; add ac-sources to default ac-sources
(setq ac-sources
(append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands)
ac-sources))
)
The progn you use is also doing nothing. progn allows you to chain multiple instructions and you only use one. You can progn for clarity as follows:
(eval-after-load 'LaTeX-mode
'(set-face-foreground 'font-latex-sedate-face "cyan"))
Stefan has a point with using package-install. This is the preferred way and it works amazingly well. And as a side note you should never use load. Always use require or eval-after-load.
AFAIK, there is no auctex.el. The file to load for AUCTeX in tex-site, IIRC. You may actually prefer to install AUCTeX via M-x package-install RET which will take care of that for you.
Related
I have this weird issue where whenever I type down :w or any other kind of command which can be used in vim's command mode (I am using evil-mode in emacs so that I can vim emulation) I always get this weird white cursor at the bottom of the minibuffer. Could you please tell me a way to get rid of this because it is really bugging me.
I thought that it may be useful if I included my init.el. If it is needed this is it:
(defun ali/initial-setup ()
"Basic Settings to make emacs usable"
(set-default-coding-systems 'utf-8)
(set-face-attribute 'default nil :font "Consolas" :height 120)
(setq scroll-margin 6)
(setq visible-bell 1)
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(setq inhibit-startup-message t)
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-follow-mouse 't)
(setq scroll-step 3)
(setq-default indent-tabs-mode nil)
"Setting up fringes and truncated lines"
(global-visual-line-mode t)
(setq truncate-lines t)
(add-to-list 'default-frame-alist '(internal-border-width . 1))
(setq-default left-fringe-width 6)
"Making the line numbers wider"
(add-hook 'display-line-numbers-mode-hook '(lambda() (setq display-line-numbers-width 3)))
"Getting rid of autosave files and other stuff"
(setq make-lockfiles nil
make-backup-files nil)
(auto-save-mode -1)
"Making splits always be vertical by default"
(setq split-height-threshold nil
split-width-threshold 0)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(setq-default c-basic-offset 4
c-default-style "linux"))
(defun ali/brackets()
"Automatically completing brackets and pairs"
(show-paren-mode 1)
(electric-pair-mode 1)
(setq electric-pair-pairs
'((?\" . ?\")
(?\{ . ?\}))))
;; Setting up packages
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(require 'package)
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
(defvar packages-we-need '(org modus-themes evil ido))
(dolist (package packages-we-need)
(unless (package-installed-p 'package)
(package-install 'package)))
(defun ali/ido()
"Setting up ido mode"
(require 'ido)
(setq ido-create-new-buffer 'always)
"Making ido-mode work in M-x"
(global-set-key
"\M-x"
(lambda ()
(interactive)
(call-interactively
(intern
(ido-completing-read
"M-x "
(all-completions "" obarray 'commandp))))))
(ido-everywhere t)
(ido-mode 1))
(require 'modus-themes)
(load-theme 'modus-vivendi t)
(defun ali/evil()
(require 'evil)
"Making cursor always be a box"
(setq evil-insert-state-cursor 'box)
(evil-make-overriding-map ali-keymap 'normal 'motion)
(evil-mode 1))
(let ((ali-keymap (make-sparse-keymap)))
(define-key ali-keymap (kbd "C-h") 'evil-window-left)
(define-key ali-keymap (kbd "C-j") 'evil-window-down)
(define-key ali-keymap (kbd "C-k") 'evil-window-up)
(define-key ali-keymap (kbd "C-l") 'evil-window-right)
(define-key ali-keymap (kbd "M-d") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "C-x d RET"))))
(define-key ali-keymap (kbd "C-p") 'ido-switch-buffer)
(define-key ali-keymap (kbd "C-f") 'ido-find-file)
(define-key ali-keymap (kbd "M-=") 'enlarge-window-horizontally)
(define-key ali-keymap (kbd "M--") 'shrink-window-horizontally)
(define-key ali-keymap (kbd "C-=") 'text-scale-increase)
(define-key ali-keymap (kbd "C--") 'text-scale-decrease)
(define-key ali-keymap (kbd "C-/") 'comment-line)
(define-key ali-keymap (kbd "C-S-i") 'display-line-numbers-mode)
(define-key ali-keymap (kbd "M-v") 'evil-window-vsplit)
(define-key ali-keymap (kbd "M-h") 'evil-window-split)
(define-key ali-keymap (kbd "C-S-h") 'help)
(define-key ali-keymap (kbd "C-d") 'kill-buffer)
(define-key ali-keymap (kbd "M-1") '(lambda() (interactive) (execute-kbd-macro (read-kbd-macro "M-x make-directory RET"))))
(defvar ali-keymap ali-keymap
"These are my keybindings"))
(define-minor-mode ali-keybindings-mode
nil
:global t
:lighter " keys"
:keymap ali-keymap)
(ali-keybindings-mode 1)
(ali/initial-setup)
(ali/evil)
(ali/brackets)
(ali/ido)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("27a1dd6378f3782a593cc83e108a35c2b93e5ecc3bd9057313e1d88462701fcd" "0feb7052df6cfc1733c1087d3876c26c66410e5f1337b039be44cb406b6187c6" "57e3f215bef8784157991c4957965aa31bac935aca011b29d7d8e113a652b693" "0f7fa4835d02a927d7d738a0d2d464c38be079913f9d4aba9c97f054e67b8db9" "ddff22007104a1317014e48ff3d4911a83771a4ccf57185ccebf7f91339dbfb8" default))
'(package-selected-packages '(geiser-stklos modus-themes evil)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
I solved removing where I wrote (setq-default left-fringe-width 6) and instead I added (add-to-list 'default-frame-alist '(left-fringe . 5))
I get the following error when I try to use jedi:complete-on-dot:
deferred error : (error "Keyword argument :triggered not one of (:requires :force-init)")
I will note that Jedi is not the only issue I'm having with emacs python modes today. isort stopped working (I fixed this). M-x python also stopped working; it simply offers auto-complete suggestions instead of launching a shell (cannot fix this).
Things were working just fine on Monday. Today, they are not working. St
To fix this, I tried updating all of my packages in MELPA, but the issue persists. I'm running emacs 24.5. This was suggested
I realized that, for whatever reason, emacs is pulling Python 2.7, but I actually use Python 3.5. OSX won't let me remove Python 2, because it's used by the OS. To fix py-isort, I just had to install isort via pip outside my virtualenv. I thought the same thing might work for jedi; I installed the following packages again (this time outside my virtualenv):
jedi
rope
epc
argparse
I also ran M-x jedi:install-server and M-x jedi:setup. Unfortunately, I still get the error.
One thought I had for fixing this error is to point emacs to python 3.5, but I can't figure out how to do this.
So, again, this issue may not be directly related to jedi, but hopefully someone will be familiar enough with the whole pipeline to help out.
Additional info
output from M-x pop-to-epc-buffer immediately after error:
56439
jedi:show-setup-info
;; Emacs Lisp version:
(:emacs-version "24.5.1" :jedi-version "0.2.7" :python-environment-version "0.0.2alpha0")
;; Python version:
((:version "2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]" :name "sys" :file nil)
(:version "0.9.0" :name "jedi" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/jedi/__init__.pyc")
(:version "0.0.5" :name "epc" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/epc/__init__.pyc")
(:version "0.0.3" :name "sexpdata" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/sexpdata.pyc"))
;; Command line:
(:virtualenv "/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv" :virtualenv-version "15.0.3\n")
;; Customization:
((jedi:complete-on-dot . t)
(jedi:doc-display-buffer . display-buffer)
(jedi:doc-hook view-mode)
(jedi:doc-mode . rst-mode)
(jedi:environment-root)
(jedi:environment-virtualenv)
(jedi:get-in-function-call-delay . 1000)
(jedi:get-in-function-call-timeout . 3000)
(jedi:goto-definition-config
(nil nil nil)
(t nil nil)
(nil definition nil)
(t definition nil)
(nil nil t)
(t nil t)
(nil definition t)
(t definition t))
(jedi:goto-definition-marker-ring-length . 16)
(jedi:imenu-create-index-function . jedi:create-nested-imenu-index)
(jedi:import-python-el-settings . t)
(jedi:install-imenu)
(jedi:install-python-jedi-dev-command "pip" "install" "--upgrade" "git+https://github.com/davidhalter/jedi.git#dev#egg=jedi")
(jedi:key-complete .
[C-tab])
(jedi:key-goto-definition .
[67108910])
(jedi:key-goto-definition-pop-marker .
[67108908])
(jedi:key-related-names . "r")
(jedi:key-show-doc . "d")
(jedi:server-args)
(jedi:server-command "/Users/alexhall/.emacs.d/.python-environments/default/bin/jediepcserver")
(jedi:setup-keys)
(jedi:tooltip-method pos-tip popup)
(jedi:use-shortcuts)
(python-environment-default-root-name . "default")
(python-environment-directory . "~/.emacs.d/.python-environments")
(python-environment-virtualenv "virtualenv" "--system-site-packages" "--quiet"))
My init.el
(only the subsection that I think is relevant)
;;Set up autocomplete
;;Autocomplete Config
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t)
;;Add autocomplete for coding
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(add-to-list 'load-path "~/emacsBackup/.emacs.d/auto-complete-1.3.1")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-dict")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-clang")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-anaconda")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-helm")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-html")
;;Python Mode
;;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(add-hook 'python-mode-hook 'my-python-mode-hook)
(defun my-python-mode-hook ()
(rainbow-mode 1)
(anaconda-mode 1)
)
(elpy-enable)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
(require 'py-isort)
(add-hook 'before-save-hook 'py-isort-before-save)
;;iPython Notebook
(autoload 'ein "ein")
(require 'python-django)
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
The entirety of my messy init.el file (for completeness)
;-------;
; REPO ;
;-------;
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;make sure the packages are installed; if not install them
(mapc
(lambda (package)
(or (package-installed-p package)
(package-install package)
)
)
'
; generated by C-h v package-activated-list
(ac-anaconda dash anaconda-mode f dash s s dash pythonic f dash s s dash auto-complete popup ac-clang yasnippet pos-tip auto-complete popup ac-helm popup auto-complete popup helm helm-core async popup async ac-html dash f dash s s auto-complete popup ample-theme ample-zen-theme anaconda-mode f dash s s dash pythonic f dash s s dash auctex auto-complete-clang auto-complete popup autopair better-defaults color-theme-sanityinc-tomorrow cuda-mode darkburn-theme ecb ein cl-generic request websocket elpy yasnippet pyvenv highlight-indentation find-file-in-project ivy company ergoemacs-mode undo-tree ergoemacs-status mode-icons powerline es-lib exec-path-from-shell find-file-in-project ivy flatland-black-theme flatland-theme flycheck seq let-alist pkg-info epl dash helm-descbinds helm helm-core async popup async highlight-indentation ivy jedi-direx direx jedi auto-complete popup jedi-core python-environment deferred epc ctable concurrent deferred json-rpc let-alist magit magit-popup dash async git-commit with-editor dash async dash with-editor dash async dash async magit-popup dash async markdown-mode+ markdown-mode markdown-mode matlab-mode mode-icons org php-mode pkg-info epl popup-complete popup pos-tip powerline pretty-lambdada py-autopep8 py-isort pydoc pydoc-info python-django python-environment deferred pythonic f dash s s dash pyvenv rainbow-mode request s scss-mode seq smex tidy undo-tree websocket with-editor dash async yasnippet zen-and-art-theme)
)
(defun set-exec-path-from-shell-PATH ()
"Sets the exec-path to the same value used by the user shell"
(let ((path-from-shell
(replace-regexp-in-string
"[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
;; call function now
(set-exec-path-from-shell-PATH)
;; Enable line numbers in all files.
(global-linum-mode 1)
;; Enable IDO Mode
;; Increases Interactivity and ease of use
;; e.g. Autocomplete
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
;; Hide splash screen & banner
(setq inhibit-startup-message t
inhibit-startup-echo-area-message t)
;; Enable auto-indenting
(define-key global-map (kbd "RET") 'newline-and-indent)
;; Add new lines if using C-n at the end of the buffer
(setq next-line-add-newlines t)
;; Use Zenburn Theme
;; Theme must be stored in "~/emacsBackup/.emacs.d/themes"
;; Theme available # wikemacs.org/wiki/Zenburn-theme
(add-to-list 'custom-theme-load-path "~/emacsBackup/.emacs.d/themes/")
(load-theme 'zenburn t)
;; Add Solarized Theme
(add-to-list 'custom-theme-load-path "~/emacsBackup/.emacs.d/themes/emacs-color-theme-solarized")
;; Start with subword mode on
;; easier navigation of camelCase
(load "subword.el")
(global-subword-mode 1)
;; Turn on Visible Mark
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(load "visible-mark.el")
;; Load extra help commands
(load "help-fns+.el")
;; Turn on Whitespace Mode
(require 'whitespace)
(setq whitespace-style '(face lines-tail))
(global-whitespace-mode t)
(setq whitespace-global-modes '(c-mode c++-mode cuda-mode web-mode python-mode php-mode))
;; Enable Smart Scan Mode
;; Quickly search for identifier at current point
(load "smartscan.el")
(smartscan-mode 1)
;;Store all backup files in C:/Temp
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(put 'set-goal-column 'disabled nil)
;;Swap Windows & Frames quickly
(setq windmove-wrap-around t)
(global-set-key (kbd "M-s M-f") 'windmove-up)
(global-set-key (kbd "M-s M-s") 'windmove-down)
(global-set-key (kbd "M-s M-r") 'windmove-left)
(global-set-key (kbd "M-s M-t") 'windmove-right)
(global-set-key (kbd "M-s M-c") 'other-frame)
(global-set-key (kbd "<Shift-up>") 'windmove-up)
(global-set-key (kbd "<Shift-down>") 'windmove-down)
(global-set-key (kbd "<Shift-left>") 'windmove-left)
(global-set-key (kbd "<Shift-right>") 'windmove-right)
;;Set up Web-Mode for syntax highlighting
(add-to-list 'load-path "~/emacsBackup/.emacs.d/syntax-modes/")
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[gj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.vtl\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode));; Set PHP-Mode for php files.
(add-to-list 'auto-mode-alist '("\\.cu$" . cuda-mode))
(add-to-list 'auto-mode-alist '("\\.upc$" . c++-mode))
(add-hook 'web-hook 'my-web-mode-hook)
(setq-default rainbow-mode 1)
(setq django-indent-width 4)
;;Display tabs as 4 spaces.
(setq-default tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
;;Next line moves to next ACTUAL line
;;ignores word wrap
(setq line-move-visual 'nil)
(define-key minibuffer-local-map "\M-s" nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-names-vector ["#3F3F3F" "#CC9393" "#7F9F7F" "#F0DFAF" "#8CD0D3" "#DC8CC3" "#93E0E3" "#DCDCCC"])
'(ansi-term-color-vector [unspecified "#393939" "#f2777a" "#99cc99" "#ffcc66" "#6699cc" "#cc99cc" "#6699cc" "#e8e6df"])
'(background-color "#002b36")
'(background-mode dark)
'(cursor-color "#839496")
'(custom-safe-themes (quote ("769bb56fb9fd7e73459dcdbbfbae1f13e734cdde3cf82f06a067439568cdaa95" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "4eaad15465961fd26ef9eef3bee2f630a71d8a4b5b0a588dc851135302f69b16" "2b5aa66b7d5be41b18cc67f3286ae664134b95ccc4a86c9339c886dfd736132d" "ed81411169b1b3e3d4cfc39b09d68ea13e0ff7708dc5b9d0bedb319e071968ad" "51bea7765ddaee2aac2983fac8099ec7d62dff47b708aa3595ad29899e9e9e44" "978ff9496928cc94639cb1084004bf64235c5c7fb0cfbcc38a3871eb95fa88f6" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "17034e7e911c6dced02ff9ed23bae2967b94f2585a7c942afbfae936b9e40a61" "9bac44c2b4dfbb723906b8c491ec06801feb57aa60448d047dbfdbd1a8650897" "e53cc4144192bb4e4ed10a3fa3e7442cae4c3d231df8822f6c02f1220a0d259a" default)))
'(fci-rule-color "#383838")
'(foreground-color "#839496")
'(vc-annotate-background "#2B2B2B")
'(vc-annotate-color-map (quote ((20 . "#BC8383") (40 . "#CC9393") (60 . "#DFAF8F") (80 . "#D0BF8F") (100 . "#E0CF9F") (120 . "#F0DFAF") (140 . "#5F7F5F") (160 . "#7F9F7F") (180 . "#8FB28F") (200 . "#9FC59F") (220 . "#AFD8AF") (240 . "#BFEBBF") (260 . "#93E0E3") (280 . "#6CA0A3") (300 . "#7CB8BB") (320 . "#8CD0D3") (340 . "#94BFF3") (360 . "#DC8CC3"))))
'(vc-annotate-very-old-color "#DC8CC3"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;;SET UP ORG MODE
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;;Define Default Workflow States
(setq org-todo-keywords
'((sequence "TODO" "NOW" "DONE")))
;; set key for agenda
(define-key global-map "\C-cl" 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(setq org-log-done t)
;;file to save todo items
(setq org-agenda-files (quote ("~/org/todo.org" "~/Documents/filmGrammar/todo.org")))
;;set priority range from A to C with default A
(setq org-highest-priority ?A)
(setq org-lowest-priority ?C)
(setq org-default-priority ?A)
;;set colours for priorities
(setq org-priority-faces '((?A . (:foreground "#F0DFAF" :weight bold))
(?B . (:foreground "LightSteelBlue"))
(?C . (:foreground "OliveDrab"))))
;;open agenda in current window
(setq org-agenda-window-setup (quote current-window))
;;capture todo items using C-c c t
(define-key global-map (kbd "C-c c") 'org-capture)
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "~/org/todo.org" "Tasks")
"* TODO [#B] %? :%^{Tags}:\n:Created: %U\n" ; template
:prepend t ; properties
:empty-lines 1 ; properties
:created t ; properties
)
("j" "Journal" entry (file+datetree "~/org/journal.org")
"* %?"
:empty-lines 1)
("n" "Note" entry (file+headline "~/org/notes.org" "Notes")
"* %?\nEntered on %U\n %i\n %a")
("f" "filmgrammar todo" entry (file+headline "~/Documents/filmGrammar/todo.org" "Tasks")
"* TODO [#B] %? :%^{Tags}:filmgrammar:ucb:research:code:work:\n:Created: %U\n" ; template
:prepend t ; properties
:empty-lines 1 ; properties
:created t ; properties
)
))
(add-hook 'org-mode-hook
(lambda ()
(org-indent-mode t))
t)
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-agenda-mode-hook
(lambda ()
(visual-line-mode -1)
(toggle-truncate-lines 1)))
;;Mac key rebinds
(setq mac-option-modifier 'control)
(setq mac-command-modifier 'meta)
(setq mac-control-modifier 'super)
;;Set up autocomplete
;;Autocomplete Config
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t)
;;Add autocomplete for coding
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(add-to-list 'load-path "~/emacsBackup/.emacs.d/auto-complete-1.3.1")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-dict")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-clang")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-anaconda")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-helm")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-html")
;;Python Mode
;;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(add-hook 'python-mode-hook 'my-python-mode-hook)
(defun my-python-mode-hook ()
(rainbow-mode 1)
(anaconda-mode 1)
)
(elpy-enable)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
(require 'py-isort)
(add-hook 'before-save-hook 'py-isort-before-save)
;;iPython Notebook
(autoload 'ein "ein")
(require 'python-django)
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(require 'cc-mode)
;; AucTeX
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(setq TeX-PDF-mode t)
;; Use Skim as viewer, enable source <-> PDF sync
;; make latexmk available via C-c C-c
;; Note: SyncTeX is setup via ~/emacsBackup/.latexmkrc (see below)
(add-hook 'LaTeX-mode-hook (lambda ()
(push
'("latexmk" "latexmk -pdf %s" TeX-run-TeX nil t
:help "Run latexmk on file")
TeX-command-list)))
(add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default "latexmk")))
;; use Skim as default pdf viewer
;; Skim's displayline is used for forward search (from .tex to .pdf)
;; option -b highlights the current line; option -g opens Skim in the background
(setq TeX-view-program-selection '((output-pdf "PDF Viewer")))
(setq TeX-view-program-list
'(("PDF Viewer" "/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b")))
;;Markdown Mode
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
;; display “lambda” as “λ”
(global-prettify-symbols-mode 1)
(electric-pair-mode +1)
(setq electric-pair-pairs '(
(?\" . ?\")
(?\{ . ?\})
) )
(add-hook
'web-mode-hook
'(lambda ()
(setq web-mode-enable-auto-pairing nil)
(setq-local
electric-pair-pairs
(append electric-pair-pairs '((?% . ?%))))))
;;tell tramp to use ssh
(setq tramp-default-method "ssh")
;;Activate up and down transposing
(defun move-line-up ()
(interactive)
(transpose-lines 1)
(forward-line -2))
(defun move-line-down ()
(interactive)
(forward-line 1)
(transpose-lines 1)
(forward-line -1)
)
(global-set-key (kbd "<M-down>") 'move-line-down)
(global-set-key (kbd "<M-up>") 'move-line-up)
;; Force frame to 80 column width
(defun set-window-width (n)
"Set the selected window's width."
(adjust-window-trailing-edge (selected-window) (- n (window-width)) t))
(defun set-80-columns ()
"Set the selected window to 80 columns."
(interactive)
(set-window-width 80))
(global-set-key "\C-x~" 'set-80-columns)
(setq debug-on-error t)
;; Adapted From Better Defaults.el
(unless (fboundp 'helm-mode)
(ido-mode t)
(setq ido-enable-flex-matching t))
(menu-bar-mode -1)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode -1))
(when (fboundp 'horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode -1))
(autoload 'zap-up-to-char "misc"
"Kill up to, but not including ARGth occurrence of CHAR." t)
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
(require 'saveplace)
(setq-default save-place t)
(global-set-key (kbd "M-/") 'hippie-expand)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "M-z") 'zap-up-to-char)
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
(show-paren-mode 1)
(setq x-select-enable-clipboard t
x-select-enable-primary t
save-interprogram-paste-before-kill t
apropos-do-all t
mouse-yank-at-point t
require-final-newline t
visible-bell nil
load-prefer-newer t
ediff-window-setup-function 'ediff-setup-windows-plain
save-place-file (concat user-emacs-directory "places")
backup-directory-alist `(("." . ,(concat user-emacs-directory
"backups"))))
;;; better-defaults.el ends here
It version missmatch between emacs jedi package and JEDI library.
For jedi-version "0.2.8" it require:
pip install jedi==0.17.2
I recently setup my dev environment on a new computer, and I'm having a very odd issue where pressing the up arrow sometimes moves my cursor up two spaces instead of one. I haven't been able to spot a pattern to when it happens, and it's really frustrating. Has anyone experienced anything similar? Here's my .emacs, in case it helps:
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(url-retrieve
"https://raw.github.com/dimitri/el-get/master/el-get-install.el"
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp))))
(delete-trailing-whitespace)
(add-to-list 'load-path "~/.emacs.d/vendor/")
(add-to-list 'load-path "~/.emacs.d/vendor/js2-mode")
(add-to-list 'load-path "~/.emacs.d/vendor/pig-mode")
(add-to-list 'load-path "~/.emacs.d/vendor/fill-column-indicator")
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.pig$" . pig-mode))
(require 'whitespace)
(require 'pig-mode)
(require 'fill-column-indicator)
`(require 'color-theme-zenburn)`
`(color-theme-zenburn)`
(setq scroll-step 1
scroll-conservatively 10000)
(setq column-number-mode t)
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
(el-get 'sync)
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(setq-default fill-column 80)
(add-hook 'after-change-major-mode-hook 'fci-mode)
;;Whitespace stuff
; make carriage returns blue and tabs green
(custom-set-faces
'(my-carriage-return-face ((((class color)) (:background "blue"))) t)
'(my-tab-face ((((class color)) (:background "green"))) t)
)
; add custom font locks to all buffers and all files
(add-hook
'font-lock-mode-hook
(function
(lambda ()
(setq
font-lock-keywords
(append
font-lock-keywords
'(
("\r" (0 'my-carriage-return-face t))
("\t" (0 'my-tab-face t))
))))))
; transform literal tabs into a right-pointing triangle
(setq
whitespace-display-mappings ;http://ergoemacs.org/emacs/whitespace-mode.html
'(
(tab-mark 9 [9654 9] [92 9])
;others substitutions...
))
Seems to be a known issue with fci-mode in combination with Emacs v24.3 (or with Emacs, depending on who you ask).
I'm having trouble getting Emacs to behave and set Python (or any environment) to 4-space tabs. Below is my .emacs file, and I've tried all the options under ;; --- Set python indent to 4 spaces ---, and none of them have worked. Is it possible there is some conflict or override happening with the indents?
Also, no matter how many times I set the tab-stop-list variables to be multiples of 4, they always end up as multiples of 8 when I use "Customize Emacs" from the menu and set the variables in the .emacs file.
I'm using GNU emacs for Mac OS X (http://emacsformacosx.com/).
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-names-vector ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"])
'(custom-enabled-themes (quote (deeper-blue)))
'(indent-tabs-mode nil)
'(inhibit-startup-screen t)
'(python-guess-indent nil)
'(python-honour-comment-indentation t)
'(python-use-skeletons t)
'(speedbar-indentation-width 2)
'(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "#181a26" :foreground "gray80" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "consolas"))))
'(bold ((t (:foreground "white" :weight bold))))
'(variable-pitch ((t (:family "Helvetica Neue")))))
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(let (el-get-master-branch)
(goto-char (point-max))
(eval-print-last-sexp))))
(el-get 'sync)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;; Yet another snippet extension for emacs -------------------------------------
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet")
(require 'yasnippet)
(yas-global-mode 1)
;; Develop and keep personal snippets under ~/emacs.d/mysnippets
(setq yas/root-directory "~/.emacs.d/mysnippets")
;; Load the snippets
(yas-load-directory yas/root-directory)
;; Auto headers for files ---------------------------------------------------
(add-to-list 'load-path "~/.emacs.d/plugins/")
(require 'header2)
(add-hook 'emacs-lisp-mode-hook 'auto-make-header)
;; Invoke Emacs Speaks Statistics (ESS) for R
(require 'ess-site)
; automatically get the correct mode
auto-mode-alist (append (list '("\\.c$" . c-mode)
'("\\.tex$" . latex-mode)
'("\\.S$" . S-mode)
'("\\.s$" . S-mode)
'("\\.R$" . R-mode)
'("\\.r$" . R-mode)
'("\\.html$" . html-mode)
'("\\.emacs" . emacs-lisp-mode)
)
auto-mode-alist)
;; --- Automatically close all parens and quotes ---
(add-to-list 'load-path "~/.emacs.d/plugins/autopair")
(require 'autopair)
(autopair-global-mode) ;; enable autopair in all buffers
; Match Triple-quoting in python
(add-hook 'python-mode-hook
#'(lambda ()
(setq autopair-handle-action-fns
(list #'autopair-default-handle-action
#'autopair-python-triple-quote-action))))
;; --- Add autopairing of $ in latex ---
(add-hook 'latex-mode-hook
#'(lambda ()
(push '(?$ . ?$)
(getf autopair-extra-pairs :string))))
; Show column numbers
(setq column-number-mode t)
; --- Set python indent to 4 spaces ---
;; Set indent size to 4
(setq standard-indent 4)
(setq default-tab-width 4)
;; (add-hook 'python-mode-hook '(lambda ()
;; (setq python-indent 4)))
;; (setq-default py-indent-offset 4)
;; (setq indent-tabs-mode t
;; tab-width 4
;; python-indent 4)
;; Python Hook
;; (add-hook 'python-mode-hook
;; (function (lambda ()
;; (setq indent-tabs-mode nil
;; tab-width 4))))
;; --- Remove all tabs, convert them to spaces ---
(setq indent-tabs-mode nil)
;; --- Auto complete latex ---
From C-h v default-tab-width RET
This variable is obsolete since 23.2;
use `tab-width' instead.
and for tab-width
Documentation:
*Distance between tab stops (for display of tab characters), in columns.
You can customize this variable.
When I insert
(custom-set-variables
'(tab-width 4))
into ~/.emacs and restart emacs, it is set to 4.
I've just upgraded my whole distro and I'm trying to setup my emacs with my previous settings and when using my 'magit' plugin and typing 'M-x magit-status' I get the following error:
Recursive `require' for feature `magit-simple-keys'
Here is my config (.emacs.d/init.el)
(require 'package)
(add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(setq required-packages
(list 'mwe-log-commands 'drag-stuff 'flymake-ruby 'flymake-haml 'regex-tool 'mic-paren 'highline 'android-mode 'css-mode 'csv-mode 'apache-mode 'crontab-mode 'emms 'switch-window 'multi-term 'undo-tree 'rvm 'auto-complete 'yasnippet-bundle 'ruby-electric 'rinari 'inf-ruby 'coffee-mode 'yaml-mode 'feature-mode 'scss-mode 'haml-mode 'magit-simple-keys))
(dolist (package required-packages)
(when (not (package-installed-p package))
(package-refresh-contents)
(package-install package)))
;; Setup external directory variable
(setq elisp-dir
(expand-file-name "elisp" user-emacs-directory))
(setq elisp-external-dir
(expand-file-name "external" elisp-dir))
;; Add external projects to load path
(add-to-list 'load-path elisp-external-dir)
(dolist (project (directory-files elisp-external-dir t "\\w+"))
(when (file-directory-p project)
(add-to-list 'load-path project)))
; Keybinding
(global-set-key [f1] 'twit)
(global-set-key [f2] 'gist-region-or-buffer)
(global-set-key [f3] 'switch-window)
(global-set-key [f4] 'magit-display-log)
(global-set-key [f5] 'magit-status)
(global-set-key [f6] 'multi-term)
(global-set-key [f7] 'split-window-vertically)
(global-set-key [f8] 'next-multiframe-window)
;; f9 is taken by git-status somewhere.
(global-set-key [f10] 'undo-tree-visualize)
(global-set-key [f12] 'switch-full-screen)
(global-set-key (kbd "C-x f") 'rinari-find-file-in-project)
(global-set-key (kbd "C-x g") 'rinari-rgrep)
(global-set-key (kbd "C-c I") 'irc)
;fullscreen mode
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
;; Allow using mouse thumb button to browse URLs
(global-set-key [mouse-10] 'browse-url-at-mouse)
; stop emacs from contaminating each directory with semantic.cache
(setq semanticdb-default-save-directory "/tmp")
; General settings
(setq-default tab-width 4)
(menu-bar-mode 1) ;; enable the menu bar
(tool-bar-mode -1) ; Disable tool-bar
(display-battery-mode)
(setq column-number-mode t)
(display-time)
(setq backup-inhibited t) ;; disable backup
;; Org-mode options
(add-hook 'org-mode-hook 'turn-on-visual-line-mode)
;; (add-hook 'org-mode-hook 'my-org-mode-autosave-settings)
;; (defun my-org-mode-autosave-settings ()
;; (set (make-local-variable 'auto-save-visited-file-name) t)
;; (setq auto-save-interval 20))
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(setq org-agenda-files '("~/Dropbox/org/"))
(setq org-directory "~/Dropbox/org")
(setq org-mobile-inbox-for-pull "~/Dropbox/org/inbox.org");; new notes will be stored here
(setq org-support-shift-select t)
(setq org-mobile-directory "~/Dropbox/MobileOrg") ;; Set to <your Dropbox root directory>/MobileOrg.
;; Set color
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
; Auto complete settings
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
; -------------------- Custom Settings --------------------
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(display-battery-mode t)
'(display-time-mode t)
'(ecb-options-version "2.32")
'(inhibit-startup-screen t)
'(org-agenda-files (quote ("~/Dropbox/org")) t)
'(rails-ws:default-server-type "mongrel")
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "smtp.googlemail.com")
'(smtpmail-smtp-service "smtp")
'(tool-bar-mode nil)
'(tooltip-mode nil))
; -------------------- File plugins --------------------
; Interactively Do Things
(ido-mode t)
; tramp - remote ssh editing
(require 'tramp)
(setq tramp-default-method "ssh")
; -------------------- Rails setting files --------------------
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
; -------------------- Rails minor plugin --------------------
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
;; https://github.com/remvee/emacs-rails
;; Currently this interfers with auto complete, using rinari instead
;; automatically adds end to blocks.
(require 'rails)
;; Rinari - Rails plugin
(add-to-list 'load-path "~/.emacs.d/rinari/")
(require 'rinari)
(add-hook 'ruby-mode-hook
(lambda ()
(defadvice ruby-mode-set-encoding
(around ruby-mode-set-encoding-disable activate) nil)))
; -------------------- Rails Views --------------------
; haml-sass
(require 'haml-mode nil 't)
(add-hook 'haml-mode-hook
'(lambda () (setq tab-width 2)))
(setq scss-compile-at-save nil)
; stylesheets
(autoload 'css-mode "css-mode")
(setq auto-mode-alist (cons '("\\.css\\'" . css-mode) auto-mode-alist))
; html2haml function to convert current buffer to haml
(defun haml-ify ()
"run html2haml on current buffer"
(interactive)
(setf filename buffer-file-name)
(setf newfilename (concat filename ".haml"))
(save-buffer)
(shell-command (concat
"html2haml " filename " > " newfilename))
(kill-buffer (current-buffer))
(delete-file filename)
(find-file newfilename))
;; -------------------- Rails Testing --------------------
;; Cucumber
(require 'feature-mode)
;; -------------------- Rails Tools --------------------
;; Check out abbrev-mode instead as it seems lighter.
(require 'snippet)
;; -------------------- Ruby plugins --------------------
(add-to-list 'auto-mode-alist '("Capfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
(add-to-list 'auto-mode-alist '("god" . ruby-mode))
(add-to-list 'auto-mode-alist '("Guardfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.html.erb\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.ejs\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.eco\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.hamlc\\'" . haml-mode))
;; Ruby-electric
(require 'ruby-electric)
(add-hook 'ruby-mode-hook 'ruby-electric-mode)
;; Issues under some compiles of emacs
;; (require 'ruby-electric)
;; (add-hook 'ruby-mode-hook
;; (lambda()
;; (add-hook 'local-write-file-hooks
;; '(lambda()
;; (save-excursion
;; (untabify (point-min) (point-max))
;; ;(delete-trailing-whitespace)
;; )))
;; (set (make-local-variable 'indent-tabs-mode) 'nil)
;; (set (make-local-variable 'tab-width) 2)
;; (imenu-add-to-menubar "IMENU")
;; (require 'ruby-electric)
;; (ruby-electric-mode t)))
;; Inferior Ruby Mode
(autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
(autoload 'inf-ruby-keys "inf-ruby" "" t)
(eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook 'inf-ruby-keys))
;; -------------------- SQL --------------------
(defun my-sql-interactive-mode-hook ()
(setq tab-width 8))
(add-hook 'sql-interactive-mode-hook 'my-sql-interactive-mode-hook)
(require 'sql)
(put 'upcase-region 'disabled nil)
;; -------------------- Autocomplete --------------------
;; Use with Rsense for Ruby autocomplete:
;; http://cx4a.org/software/rsense/
;; Follow instructions on: http://itstickers.blogspot.com/2010/11/all-about-emacs.html
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
;; Rsense
(setq rsense-home "/opt/rsense-0.3")
(add-to-list 'load-path (concat rsense-home "/etc"))
(require 'rsense)
;; Rsense + Autocomplete
(add-hook 'ruby-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-rsense-method)
(add-to-list 'ac-sources 'ac-source-rsense-constant)))
;; Complete by C-c .
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key (kbd "C-c .") 'rsense-complete)))
;; RVM in emacs
;; (require 'rvm)
;; (rvm-use-default) ;; use rvm’s default ruby for the current Emacs session
;; Switch windows easier when you have 3 or more.
(require 'switch-window)
;; gist
(require 'gist)
(setq gist-authentication-function 'gist-basic-authentication)
(setq the-secrets-file
(expand-file-name "secrets.el" user-emacs-directory))
(when (file-exists-p the-secrets-file)
(load the-secrets-file))
;; highline-mode
(require 'highline)
(defun highline-mode-on ()
(highline-mode 1))
;; Turn on local highlighting for Dired (C-x d)
(add-hook 'dired-after-readin-hook #'highline-mode-on)
;; Turn on local highlighting for list-buffers (C-x C-b)
(defadvice list-buffers (after highlight-line activate) (save-excursion (set-buffer "*Buffer List*") (highline-mode-on)))
;; mic-paren - advanced highlighting of matching parentheses
(paren-activate)
;; flyspell
(add-hook 'org-mode-hook
(lambda ()
(flyspell-mode)
(setq flyspell-issue-message-flag 'nil)))
(add-hook 'ruby-mode-hook
(lambda ()
(flyspell-prog-mode)
(setq flyspell-issue-message-flag 'nil)))
;; flymake haml
(add-hook 'haml-mode-hook 'flymake-haml-load)
;; undo
(add-hook 'ruby-mode-hook 'undo-tree-mode)
;; multi-term
;; (setq term-default-fg-color "#aaa")
;; Upgrade all packages
(defun package-update-all ()
"Update all packages"
(interactive)
(dolist (elt package-alist)
(let* ((name (car elt))
(file-name (symbol-name name))
(available-pkg (assq name package-archive-contents))
(available-version (and available-pkg
(package-desc-vers (cdr available-pkg))))
(current-version (package-desc-vers (cdr elt)))
)
(when (and available-version
(version-list-< current-version available-version))
(message "Updating to: %s - %s" file-name
(package-version-join available-version))
(package-install name)
(package-delete file-name (package-version-join current-version))))))
;; Music player
(add-to-list 'load-path "~/.emacs.d/elisp/external/bongo")
(setq bongo-global-lastfm-mode t)
(autoload 'bongo "bongo"
"Start Bongo by switching to a Bongo buffer." t)
;; Volume manager (Use 'v' in bongo music player)
(add-to-list 'load-path "~/.emacs.d/elisp/external/volume-el")
(autoload 'volume "volume"
"Tweak your sound card volume." t)
;; Twitter mode
(add-to-list 'load-path "~/.emacs.d/elisp/external/twitter-mode")
(require 'twittering-mode)
(setq twittering-icon-mode t)
(setq twittering-timer-interval 40)
(setq twittering-url-show-status nil)
(add-hook 'twittering-edit-mode-hook (lambda () (ispell-minor-mode) (flyspell-mode)))
(setq twittering-use-master-password t) ;; Don't prompt for authorisation.
;; drag-stuff
(require 'drag-stuff)
;; coffee-mode
(defun coffee-custom ()
"coffee-mode-hook"
(set (make-local-variable 'tab-width) 2))
;; (define-key coffee-mode-map [(meta r)] 'coffee-compile-buffer)
;; (define-key coffee-mode-map [(meta R)] 'coffee-compile-region)
(add-hook 'coffee-mode-hook
'(lambda() (coffee-custom)))
;; Don't ask to save abbrevs
(setq save-abbrevs 'silently)
;; log commands.
;; M-x mwe:open-command-log-buffer
(add-hook 'LaTeX-mode-hook (function mwe:log-keyboard-commands))
;; screensaver
(setq zone-when-idle t)
;; IRC reconnect
(eval-after-load 'rcirc
'(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick (rcirc-nick process))
channels query-buffers)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (eq process (rcirc-buffer-process))
(remove-hook 'change-major-mode-hook
'rcirc-change-major-mode-hook)
(if (rcirc-channel-p rcirc-target)
(setq channels (cons rcirc-target channels))
(setq query-buffers (cons buf query-buffers))))))
(delete-process process)
(rcirc-connect server port nick
rcirc-default-user-name
rcirc-default-full-name
channels))))
;; Video editor
;; (load "~/.emacs.d/elisp/external/gneve.el")
The problem was I only need to install 'magit not 'magit-simple-keys.
I am going to guess that you need to update one or other of magit and magit-simple-keys (and you might as well do both).
I can see that you are installing magit-simple-keys via package.el, but not magit itself, so you might want to source magit from there too in order to try to keep the versions synchronised.