;;; Basic ruby setup
(require-package 'auto-complete)

(global-auto-complete-mode t)

(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)

(provide 'init-auto-complete)

;;; Basic ruby setup
(require-package 'auto-complete)

(global-auto-complete-mode t)

(define-key ac-mode-map (kbd "M-TAB") 'auto-complete)

(add-to-list 'ac-modes 'coffee-mode)
(add-to-list 'ac-modes 'enh-ruby-mode)

(provide 'init-auto-complete)

Add some more auto complete modes

Add some more auto complete modes


(require 'ruby-mode)

(add-to-list 'auto-mode-alist
             '("\\.\\(rb\\|ru\\|builder\\|rake\\|thor\\|gemspec\\)\\'" .
               ruby-mode))
(add-to-list 'auto-mode-alist
             '("\\(rake\\|thor\\|guard\\|gem\\|cap\\|vagrant\\)file\\'" .
               ruby-mode))

Add file association to ruby-mode

Add file association to ruby-mode


;; base16-zenburn-theme.el -- A base16 colorscheme

;;; Commentary:
;; Base16: (https://github.com/chriskempson/base16)

;;; Authors:
;; Scheme: elnawe
;; Template: Kaleb Elwert <belak@coded.io>

;;; Code:

(require 'base16-theme)

(defvar base16-zenburn-colors
  '(:base00 "#3f3f3f"
    :base01 "#404040"
    :base02 "#606060"
    :base03 "#4f4f4f"
    :base04 "#808080"
    :base05 "#dcdccc"
    :base06 "#c0c0c0"
    :base07 "#ffffff"
    :base08 "#dca3a3"
    :base09 "#dfaf8f"
    :base0A "#e0cf9f"
    :base0B "#5f7f5f"
    :base0C "#93e0e3"
    :base0D "#7cb8bb"
    :base0E "#dc8cc3"
    :base0F "#000000")
  "All colors for Base16 Zenburn are defined here.")

;; Define the theme
(deftheme base16-zenburn)

;; Add all the faces to the theme
(base16-theme-define 'base16-zenburn base16-zenburn-colors)

;; Mark the theme as provided
(provide-theme 'base16-zenburn)

(provide 'base16-zenburn-theme)

;;; base16-zenburn-theme.el ends here

Add base16-zenburn... this feels sacrilegious


(global-set-key (kbd "C-c l") 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(global-set-key (kbd "C-c c") 'org-capture)

Add Emacs config: configure global Org keys


;;; package --- Summary

;;; Commentary:

;;; Code:

(add-hook 'meson-mode-hook 'company-mode)(add-hook 'meson-mode-hook 'company-mode)

(provide 'language_meson)

;;; language_meson ends here

Use meson mode with company

Use meson mode with company


;;; skewer-proxy.el --- proxy a website so that it can be skewered

;; This is free and unencumbered software released into the public domain.

;;; Commentary:

;; Due to same origin policy, simply including the skewer JavaScript
;; in a page is not enough to skewer that website. The page must be
;; served by Emacs. To help accommodate this, Emacs can act as a
;; transparent proxy.

;; http://en.wikipedia.org/wiki/Same_origin_policy

;; Set `skewer-proxy-url' to the remote URL. Don't include the path,
;; so there's no trailing slash. Then enable the proxy with
;; `skewer-proxy-enable', which will overwrite the servlet currently
;; installed in `httpd/', probably the simple-httpd file server.
;; Finally, `skewer-proxy-disable' will restore the original `httpd/'
;; servlet.

;;; Code:

(require 'skewer-mode)

(defvar skewer-proxy-url "http://example.com"
  "Remote server for the silent proxy.")

(defvar skewer--orig-httpd/ (symbol-function 'httpd/)
  "Original definition of the servlet at httpd/.")

(defvar skewer--enabled nil
  "Current status of skewer-proxy.")

(defun skewer-proxy-servlet (proc p &rest args)
  (with-current-buffer (url-retrieve-synchronously (concat skewer-proxy-url p))
    (let* ((header-string (car (split-string (buffer-string) "\n\r?\n\r?")))
           (header (httpd-parse header-string)))
      (process-send-region proc (point-min) (point-max))
      (if (equal "close" (cadr (assoc "Connection" header)))
          (process-send-eof proc)))))

(defun skewer-proxy-enable ()
  "Enable the skewer proxy, overwriting the httpd/ servlet."
  (interactive)
  (unless skewer--enabled
    (setq skewer--enabled t)
    (setq skewer--orig-httpd/ (symbol-function 'httpd/))
    (fset 'httpd/ (symbol-function 'skewer-proxy-servlet))))

(defun skewer-proxy-disable ()
  "Disable the skewer proxy, restoring the original httpd/ function."
  (interactive)
  (fset 'httpd/ skewer--orig-httpd/)
  (setq skewer--enabled nil))

(provide 'skewer-proxy)

;;; skewer-proxy.el ends here

Implement a transparent proxy, to defeat same origin policy.


;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((clojure-mode
  (clojure-indent-style . :always-align)
  (indent-tabs-mode . nil)
  (fill-column . 80)))

Add some default project settings for Emacs users

This ensure that everyone is using the same indentation style
and no tabs.


;;;; company-mode

(require 'rtags)
(require 'company)

;; Turn on rtags completions
(setq rtags-completions-enabled t)

;; Turn on company mode everywhere
(global-company-mode)

;; Use ESC to escape company-complete (in addition to C-g)
(define-key company-active-map (kbd "<escape>") 'company-abort)

;; Key to force trigger company-complete
(define-key company-mode-map [(control .)] 'company-complete)

(provide 'init-company)

;;;; company-mode

(require 'rtags)
(require 'company)
(require 'diminish)

;; Turn on rtags completions
(setq rtags-completions-enabled t)

;; Turn on company mode everywhere
(global-company-mode)

;; Use ESC to escape company-complete (in addition to C-g)
(define-key company-active-map (kbd "<escape>") 'company-abort)

;; Key to force trigger company-complete
(define-key company-mode-map [(control .)] 'company-complete)

;; Clean up mode-line.
(eval-after-load "company"
  '(diminish 'company-mode "CA"))

(provide 'init-company)

Clean up line mode for company

Clean up line mode for company

'company' is a bit too long to my taste. Let's use 'CA' which is
not only shorter, not only respects Complete Any but is an anagram
of 'AC' used by the competition a.k.a auto-complete.


;; to install eply: pip install jedi flake8 autopep8 rope snakeviz
;; M-x package-refresh-contents
;; M-x package-install RET elpy RET

(setq user-mail-address "matthieu.garrigues@gmail.com")
(setq user-full-name "Matthieu Garrigues <matthieu.garrigues@gmail.com>")

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
(elpy-enable)

(setq inhibit-startup-message t)      ; don't show the GNU splash screen
(scroll-bar-mode -1)                 ; no scroll bar
(menu-bar-mode -1)                    ; no menu bar
(tool-bar-mode -1)                    ; no tool bar
(setq frame-title-format "%b")        ; titlebar shows buffer's name
(line-number-mode t)                  ; display line number in modeline
(column-number-mode t)                ; display column number in modeline
                                        ;(iswitchb-mode) ; switch sexy

;; SET cursor and mouse-pointer colours
(set-cursor-color "pink")
(set-mouse-color "goldenrod")

;; Set region background colour
(set-face-background 'region "blue")

;; Set emacs background colour
(set-background-color "black")
(set-foreground-color "#CCDDFF")
(set-border-color	"#FF0000")

;; Navigation
(global-set-key [M-left] 'windmove-left)                ; move to left windnow
(global-set-key [M-right] 'windmove-right)              ; move to right window
(global-set-key [M-up] 'windmove-up)                    ; move to upper window
(global-set-key [M-down] 'windmove-down)

(global-set-key [f7] 'compile)
(global-set-key [f8] 'recompile)

;; Backups
(setq
   backup-by-copying t      ; don't clobber symlinks
   backup-directory-alist
    '(("." . "~/.emacs_saves"))    ; don't litter my fs tree
   delete-old-versions t
   kept-new-versions 6
   kept-old-versions 2
   version-control t)       ; use versioned backups

Add python elpy only conf.

Add python elpy only conf.


;;; packages.el --- Conda Layer packages File for Spacemacs
;;
;; Author: James K. Glasbrenner <jglasbr2@gmu.edu>
;; URL: https://github.com/jkglasbrenner/dotfiles
;;
;; This file is not a part of GNU Emacs.
;;
;;; License: Unlicense

(setq conda-packages
  '(
    (conda :location elpa)
    ))

(defun conda/init-conda ()
  (use-package conda
    :defer t
    :init
    (progn
      (setq conda-anaconda-home (concat (getenv "HOME") "/.anaconda3/"))
      )
    :config
    (progn
      (conda-env-initialize-interactive-shells)
      (conda-env-initialize-eshell)
      (conda-env-autoactivate-mode t)
      )
    )
  )

Add custom layer for loading conda-mode

Add custom layer for loading conda-mode