random tweaks

This commit is contained in:
Ivan Malison 2014-11-18 03:09:17 -08:00
parent d9155dc397
commit f0067856bf
2 changed files with 25 additions and 36 deletions

View File

@ -15,6 +15,7 @@
python-indent-electric-colon python-indent-electric-colon
sgml-slash sgml-slash
skeleton-pair-insert-maybe skeleton-pair-insert-maybe
tern-ac-dot-complete
universal-argument-minus universal-argument-minus
)) ))

24
init.el
View File

@ -42,9 +42,6 @@
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(defun ensure-packages-installed (packages) (defun ensure-packages-installed (packages)
"Assure every package is installed, ask for installation if its not.
Return a list of installed packages or nil for every package not installed."
;; fetch the list of packages available
(unless package-archive-contents (unless package-archive-contents
(package-refresh-contents)) (package-refresh-contents))
(mapcar (mapcar
@ -280,13 +277,10 @@ Return a list of installed packages or nil for every package not installed."
;; Python ;; Python
;; ============================================================================= ;; =============================================================================
(defvar use-python-tabs nil) (defvar use-python-tabs nil)
(defun python-tabs () (setq tab-width 4 (defun python-tabs ()
indent-tabs-mode t (setq tab-width 4 indent-tabs-mode t python-indent-offset 4))
python-indent-offset 4))
(defun add-virtual-envs-to-jedi-server () (defun add-virtual-envs-to-jedi-server ()
(let ((virtual-envs (get-virtual-envs))) (let ((virtual-envs (get-virtual-envs)))
@ -350,14 +344,8 @@ Return a list of installed packages or nil for every package not installed."
(progn (add-hook 'scala-mode-hook (progn (add-hook 'scala-mode-hook
(lambda () (lambda ()
(require 'whitespace) (require 'whitespace)
;; clean-up whitespace at save
(make-local-variable 'before-save-hook) (make-local-variable 'before-save-hook)
(add-hook 'before-save-hook 'whitespace-cleanup) (add-hook 'before-save-hook 'whitespace-cleanup)
;; turn on highlight. To configure what is highlighted, customize
;; the *whitespace-style* variable. A sane set of things to
;; highlight is: face, tabs, trailing
(whitespace-mode)))) (whitespace-mode))))
:config :config
(progn (progn
@ -540,7 +528,8 @@ buffer is not visiting a file."
(global-set-key (kbd "C-c C-s") 'sudo-edit) (global-set-key (kbd "C-c C-s") 'sudo-edit)
(global-set-key (kbd "C-c SPC") (lambda () (interactive) (global-set-key (kbd "C-c SPC") (lambda () (interactive)
(if current-prefix-arg (helm-global-mark-ring) (helm-mark-ring)))) (if current-prefix-arg (helm-global-mark-ring)
(helm-mark-ring))))
(global-set-key (kbd "C-c e") 'os-copy) (global-set-key (kbd "C-c e") 'os-copy)
(global-set-key (kbd "C-x C-b") 'buffer-menu) (global-set-key (kbd "C-x C-b") 'buffer-menu)
(global-set-key (kbd "C-x C-c") 'kill-emacs) (global-set-key (kbd "C-x C-c") 'kill-emacs)
@ -548,7 +537,6 @@ buffer is not visiting a file."
(global-set-key (kbd "C-x C-r") (lambda () (interactive) (revert-buffer t t))) (global-set-key (kbd "C-x C-r") (lambda () (interactive) (revert-buffer t t)))
(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1))) (global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1)))
(global-set-key (kbd "C-x w") 'whitespace-mode) (global-set-key (kbd "C-x w") 'whitespace-mode)
(global-set-key (kbd "M-Z") 'zap-to-char)
(global-set-key (kbd "M-g") 'goto-line) (global-set-key (kbd "M-g") 'goto-line)
(global-set-key (kbd "M-n") 'forward-paragraph) (global-set-key (kbd "M-n") 'forward-paragraph)
(global-set-key (kbd "M-p") 'backward-paragraph) (global-set-key (kbd "M-p") 'backward-paragraph)
@ -620,9 +608,9 @@ buffer is not visiting a file."
(defun set-my-font-for-frame (frame) (defun set-my-font-for-frame (frame)
(condition-case exp (condition-case exp
(set-default-font (random-choice fonts) nil t) (set-frame-font (random-choice fonts) nil t)
('error (package-refresh-contents) ('error (package-refresh-contents)
(set-default-font "monaco-10" nil t) nil))) (set-frame-font "monaco-11" nil t) nil)))
(defun remove-fringe-and-hl-line-mode (&rest stuff) (defun remove-fringe-and-hl-line-mode (&rest stuff)
(scroll-bar-mode -1) (scroll-bar-mode -1)