Created
March 8, 2014 12:57
-
-
Save piecyk/9430190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Turn off mouse interface early in startup to avoid momentary display | |
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) | |
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) | |
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) | |
;; No splash screen please ... jeez | |
(setq inhibit-startup-message t) | |
(mouse-wheel-mode t) | |
;; disable line wrap | |
(setq default-truncate-lines t) | |
;; make side by side buffers function the same as the main window | |
(setq truncate-partial-width-windows nil) | |
;; Add F12 to toggle line wrap | |
(global-set-key (kbd "<f12>") 'toggle-truncate-lines) | |
;; show keystrokes | |
(setq echo-keystrokes 0.02) | |
;; show matching parens | |
(show-paren-mode 1) | |
;; always show column numbers | |
(column-number-mode 1) | |
;; Narrow (C-x n n) | |
(put 'narrow-to-region 'disabled nil) | |
;; answer by y and n instead of yes and no | |
(defalias 'yes-or-no-p 'y-or-n-p) | |
;; configure cliboard | |
(setq x-select-enable-clipboard t | |
mouse-drag-copy-region t | |
yank-pop-change-selection t | |
kill-do-not-save-duplicates t) | |
;; utf-8 roxx | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(prefer-coding-system 'utf-8) | |
(ansi-color-for-comint-mode-on) | |
;; join line | |
(global-set-key (kbd "M-j") | |
(lambda () | |
(interactive) | |
(join-line -1))) | |
;;tabs | |
(setq-default indent-tabs-mode nil) | |
(setq tab-width 4) | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
;; basic initialization, (require) non-ELPA packages, etc. | |
(setq package-enable-at-startup nil) | |
(package-initialize) | |
;; (require) your ELPA packages, configure them as normal | |
;; second theme | |
(load-theme 'zenburn t) | |
;; search | |
(require 'ag) | |
(setq ag-highlight-search t) | |
(require 'grizzl) | |
(projectile-global-mode) | |
(setq projectile-enable-caching t) | |
(setq projectile-completion-system 'grizzl) | |
;; Press Command-p for fuzzy find in project | |
(global-set-key (kbd "s-p") 'projectile-find-file) | |
;; Press Command-b for fuzzy switch buffer | |
(global-set-key (kbd "s-b") 'projectile-switch-to-buffer) | |
;; Auto complete | |
(require 'auto-complete-config) | |
(ac-config-default) | |
(setq ac-ignore-case nil) | |
;;yas | |
(require 'yasnippet) | |
(yas/global-mode 1) | |
;;js2-mode | |
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
(smart-tabs-advice js2-indent-line js2-basic-offset) | |
(add-to-list 'load-path "~/.emacs.d/myPackage/tern/emacs/") | |
(autoload 'tern-mode "tern.el" nil t) | |
(add-hook 'js2-mode-hook (lambda () (tern-mode t))) | |
;;ido | |
(ido-mode 1) | |
;; Use ido everywhere | |
(require 'ido-ubiquitous) | |
(ido-ubiquitous-mode 1) | |
(setq ido-enable-flex-matching t | |
ido-everywhere t | |
ido-create-new-buffer 'always | |
ido-use-filename-at-point 'guess | |
ido-max-prospects 20 | |
ido-default-file-method 'selected-window | |
ido-default-buffer-method 'selected-window | |
ido-create-new-buffer 'always | |
ido-ubiquitous-enable-compatibility nil | |
ido-file-extensions-order '(".js" ".html" ".cfg")) | |
;; Fix ido-ubiquitous for newer packages | |
(defmacro ido-ubiquitous-use-new-completing-read (cmd package) | |
`(eval-after-load ,package | |
'(defadvice ,cmd (around ido-ubiquitous-new activate) | |
(let ((ido-ubiquitous-enable-compatibility nil)) | |
ad-do-it)))) | |
(ido-ubiquitous-use-new-completing-read webjump 'webjump) | |
(ido-ubiquitous-use-new-completing-read yas/expand 'yasnippet) | |
(ido-ubiquitous-use-new-completing-read yas/visit-snippet-file 'yasnippet) | |
;;backup | |
(setq make-backup-files nil) ; stop creating those backup~ files | |
(setq auto-save-default nil) ; stop creating those #autosave# files | |
;;(setq backup-directory-alist `(("." . "~/.emacs-saves"))) | |
;;(setq backup-by-copying t) | |
;;new terminals | |
(defun comint-delchar-or-eof-or-kill-buffer (arg) | |
(interactive "p") | |
(if (null (get-buffer-process (current-buffer))) | |
(kill-buffer) | |
(comint-delchar-or-maybe-eof arg))) | |
(add-hook 'shell-mode-hook | |
(lambda () | |
(define-key shell-mode-map | |
(kbd "C-d") 'comint-delchar-or-eof-or-kill-buffer))) | |
;; Auto refresh buffers | |
(global-auto-revert-mode 1) | |
;; Also auto refresh dired, but be quiet about it | |
(setq global-auto-revert-non-file-buffers t) | |
(setq auto-revert-verbose nil) | |
;; undo-tree everywhere | |
(global-undo-tree-mode) | |
;; Enable delete-selection-mode | |
(delete-selection-mode 1) | |
;;change magit diff colors | |
;;(eval-after-load 'magit | |
;; '(progn | |
;; (set-face-foreground 'magit-diff-add "green3") | |
;; (set-face-foreground 'magit-diff-del "red3") | |
;; (when (not window-system) | |
;; (set-face-background 'magit-item-highlight "black")))) | |
;;ifbuufer | |
(global-set-key (kbd "C-x C-b") 'ibuffer) | |
;; Ensure ibuffer opens with point at the current buffer's entry. | |
(defadvice ibuffer | |
(around ibuffer-point-to-most-recent) () | |
"Open ibuffer with cursor pointed to most recent buffer name." | |
(let ((recent-buffer-name (buffer-name))) | |
ad-do-it | |
(ibuffer-jump-to-buffer recent-buffer-name))) | |
(ad-activate 'ibuffer) | |
;;powerline | |
(require 'powerline) | |
(powerline-default-theme) | |
;;webjump | |
(eval-after-load 'webjump | |
'(progn | |
(setq webjump-sites | |
(append '(("efecte" . "http://localhost:8080/efecte/") | |
("stackoverflow" . | |
[simple-query | |
"www.stackoverflow.com" | |
"http://stackoverflow.com/search?q=" | |
""]) | |
("askubuntu" . | |
[simple-query | |
"www.askubuntu.com" | |
"http://askubuntu.com/search?q=" | |
""]) | |
("superuser" . | |
[simple-query | |
"www.superuser.com" | |
"http://superuser.com/search?q=" | |
""]) | |
("ClojureDocs" . | |
[simple-query | |
"clojuredocs.org" | |
"http://clojuredocs.org/search?q=" | |
""]) | |
("Clojars" . | |
[simple-query | |
"clojars.org" | |
"https://clojars.org/search?q=" | |
""])) | |
webjump-sample-sites)))) | |
(global-set-key (kbd "C-x g") 'webjump) | |
;;browser | |
(setq browse-url-browser-function 'browse-url-generic | |
browse-url-generic-program 'eww-browse-url) | |
(defun piecyk-browse-url-incognito () | |
"Call 'browse-url' displaying in a chrome incognito window." | |
(interactive) | |
(let ((browse-url-browser-function 'browse-url-generic) | |
(browse-url-generic-program "chromium") | |
(browse-url-generic-args '("--incognito"))) | |
(call-interactively 'browse-url))) | |
(defun piecyk-run-tests () | |
(interactive) | |
(shell-command "cd ~/efecte/SUMA-3280/webapps/equipment/efecte_refresh/ && grunt protractor:firefox")) | |
(global-set-key (kbd "C-c r") 'piecyk-run-tests) | |
(defun piecyk-remove-dos-eol () | |
"Do not show ^M in files containing mixed UNIX and DOS line endings." | |
(interactive) | |
(setq buffer-display-table (make-display-table)) | |
(aset buffer-display-table ?\^M [])) | |
;;(add-hook 'text-mode-hook 'flyspell-mode) | |
;;(add-hook 'prog-mode-hook 'flyspell-prog-mode) | |
;;(add-hook 'find-file-hooks 'turn-on-flyspell) | |
(require 'uniquify) | |
(setq | |
uniquify-buffer-name-style 'post-forward | |
uniquify-separator ":") | |
;; Enable transient mark mode | |
(transient-mark-mode 1) | |
;;;;org-mode configuration | |
;; Enable org-mode | |
(require 'org) | |
(define-key global-map "\C-cl" 'org-store-link) | |
(define-key global-map "\C-ca" 'org-agenda) | |
(setq org-log-done t) | |
(setq org-agenda-files (list "~/org/work.org" | |
"~/org/myOrg.org")) | |
(setq org-clock-persist 'history) | |
(org-clock-persistence-insinuate) | |
;;web mode | |
(require 'web-mode) | |
(add-to-list 'auto-mode-alist '("\\.hbs\\'" . web-mode)) | |
;; Locked mode | |
(global-set-key (kbd "C-c C-l") 'locked-buffer-mode) | |
(define-minor-mode locked-buffer-mode | |
"Make the current window always display this buffer." | |
nil " locked" nil | |
(set-window-dedicated-p (selected-window) locked-buffer-mode)) | |
;; helm | |
(require 'helm) | |
(require 'helm-swoop) | |
;; Change the keybinds to whatever you like :) | |
(global-set-key (kbd "M-i") 'helm-swoop) | |
(global-set-key (kbd "M-I") 'helm-swoop-back-to-last-point) | |
(global-set-key (kbd "C-c M-i") 'helm-multi-swoop) | |
(global-set-key (kbd "C-x M-i") 'helm-multi-swoop-all) | |
;; When doing isearch, hand the word over to helm-swoop | |
(define-key isearch-mode-map (kbd "M-i") 'helm-swoop-from-isearch) | |
;; From helm-swoop to helm-multi-swoop-all | |
(define-key helm-swoop-map (kbd "M-i") 'helm-multi-swoop-all-from-helm-swoop) | |
;; When doing evil-search, hand the word over to helm-swoop | |
;; (define-key evil-motion-state-map (kbd "M-i") 'helm-swoop-from-evil-search) | |
;; Save buffer when helm-multi-swoop-edit complete | |
(setq helm-multi-swoop-edit-save t) | |
;; If this value is t, split window inside the current window | |
(setq helm-swoop-split-with-multiple-windows nil) | |
;; Split direcion. 'split-window-vertically or 'split-window-horizontally | |
(setq helm-swoop-split-direction 'split-window-vertically) | |
;; If nil, you can slightly boost invoke speed in exchange for text color | |
(setq helm-swoop-speed-or-color nil) | |
;;helm for files | |
(require 'helm-files) | |
(setq helm-idle-delay 0.1) | |
(setq helm-input-idle-delay 0.1) | |
;;(define-key global-map [(alt t)] 'helm-for-files) | |
(global-set-key (kbd "C-c M-w") 'whitespace-mode) | |
(global-set-key (kbd "C-c M-d") 'delete-trailing-whitespace) | |
;; smartparens | |
(smartparens-global-mode 1) | |
;; | |
(require 'golden-ratio) | |
(golden-ratio-mode 1) | |
;;anzu | |
(global-anzu-mode +1) | |
;; node region | |
(global-set-key (kbd "C-c n") | |
(lambda () | |
(interactive) | |
(shell-command-on-region | |
(point-min) (point-max) "node" nil nil))) | |
;; TODO: | |
;;nav | |
;;(require 'nav) | |
;;(nav-disable-overeager-window-splitting) | |
;; Optional: set up a quick key to toggle nav | |
;;(global-set-key [f9] 'nav-toggle) | |
;;(setq gnus-select-method '(nnnil)) | |
;;(setq gnus-secondary-select-methods '((nntp "news.gwene.org"))) | |
;;resize | |
;;(require 'windresize) | |
;;(global-set-key [f2] 'windresize) | |
;;(require 'weechat) | |
;;(add-to-list 'load-path (expand-file-name "~/.emacs.d/myPackage/webkit")) | |
;;(require 'webkit) | |
;; M-x webkit-open-url | |
;;(require 'smex) ; Not needed if you use package.el | |
;;(smex-initialize) ; Can be omitted. This might cause a (minimal) delay | |
; when Smex is auto-initialized on its first run. | |
;;(global-set-key (kbd "M-x") 'smex) | |
;;(global-set-key (kbd "M-X") 'smex-major-mode-commands) | |
;; This is your old M-x. | |
;;(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment