Skip to content

Instantly share code, notes, and snippets.

@pheymann
Last active July 10, 2019 07:58
Show Gist options
  • Save pheymann/1f130704fcd00dec3544a5422635cbf2 to your computer and use it in GitHub Desktop.
Save pheymann/1f130704fcd00dec3544a5422635cbf2 to your computer and use it in GitHub Desktop.
emacs settings
(require 'package)
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(add-to-list 'package-archives '("marmalade" . "http://marmalade.ferrier.me.uk/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(use-package helm
:ensure t
:pin melpa-stable)
(use-package helm-projectile
:ensure t
:pin melpa-stable)
(use-package all-the-icons
:ensure t
:pin melpa-stable)
(use-package bash-completion
:ensure t
:pin melpa-stable)
(use-package key-cord
:ensure t
:pin melpa-stable)
(use-package magit
:ensure t
:pin melpa-stable)
(use-package monokai-theme
:ensure t
:pin melpa-stable)
(use-package multiple-cursors
:ensure t
:pin melpa-stable)
(use-package neotree
:ensure t
:pin melpa-stable)
(use-package projectile
:ensure t
:pin melpa-stable)
(use-package scala-mode
:ensure t
:pin melpa-stable)
(use-package recentf-ext
:ensure t
:pin melpa-stable)
(use-package org-bullets
: ensure t
:pin melpa-stable)
(electric-indent-mode 0)
(load-theme 'monokai t)
(setq-default indent-tabs-mode nil)
(setq js-indent-level 2)
(setq javascript-auto-indent-flag nil)
;; org mode
(setq org-src-fontify-natively t)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(tool-bar-mode 0)
(menu-bar-mode 0)
(toggle-frame-fullscreen)
(scroll-bar-mode 0)
(fset `yes-or-no-p `y-or-n-p)
(defun pbcopy ()
(interactive)
(call-process-region (point) (mark) "pbcopy")
(setq deactivate-mark t))
(defun pbpaste ()
(interactive)
(call-process-region (point) (if mark-active (mark) (point)) "pbpaste" t t))
(defun pbcut ()
(interactive)
(pbcopy)
(delete-region (region-beginning) (region-end)))
(global-set-key (kbd "C-c c") 'pbcopy)
(global-set-key (kbd "C-c v") 'pbpaste)
(global-set-key (kbd "C-c x") 'pbcut)
(global-set-key (kbd "M-/") 'ace-window)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-m") 'helm-M-x)
(global-set-key (kbd "C-c C-m") 'helm-M-x)
(global-set-key (kbd "C-x b") 'helm-mini)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "M->") 'next-buffer)
(global-set-key (kbd "M-<") 'previous-buffer)
(global-set-key (kbd "M-}") 'forward-paragraph)
(global-set-key (kbd "M-+") 'backward-paragraph)
(global-set-key (kbd "M-]") 'next-line)
(global-set-key (kbd "M-=") 'previous-line)
(global-set-key (kbd "M-{") 'backward-word)
(global-set-key (kbd "M-|") 'forward-word)
(global-set-key (kbd "M-[") 'backward-char)
(global-set-key (kbd "M-\\") 'forward-char)
(global-set-key (kbd "C-f") 'recenter-top-bottom)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
(neotree-toggle)
(global-linum-mode 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment