refactoring and remove init-indent-guides
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
(menu-bar-mode 0)
|
||||
(setq make-backup-files nil) ; stop creating backup~ files
|
||||
(setq auto-save-default nil) ; stop creating #autosave# files
|
||||
(setq create-lockfiles nil) ; stop creating #create-lockfiles
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Editor configuration
|
||||
@@ -40,21 +41,26 @@
|
||||
;; Configure keys
|
||||
;;----------------------------------------------------------------------------
|
||||
(global-unset-key (kbd "C-z")) ; Stops C-z from minimizing window
|
||||
(global-set-key (kbd "M-<down>") (lambda () (interactive) (sanityinc/adjust-opacity nil -2))) ; M-down less visibility
|
||||
(global-set-key (kbd "M-<up>") (lambda () (interactive) (sanityinc/adjust-opacity nil 2))) ; M-up more visibility
|
||||
(global-set-key (kbd "M-0") (lambda () (interactive) (modify-frame-parameters nil '((alpha . 100))))) ; M-0 standard visibility
|
||||
(global-set-key (kbd "<f11>") 'myemacs/toggle-fullscreen) ; F11 FullScreen
|
||||
(global-set-key (kbd "s-C-+") 'sacha/increase-font-size) ; C-+ increase font size
|
||||
(global-set-key (kbd "s-C--") 'sacha/decrease-font-size) ; C-- decrease font size
|
||||
(global-set-key (kbd "<f12>") 'revert-buffer-no-confirm)
|
||||
(global-set-key (kbd "s-h") 'global-hl-line-mode) ; Highlight current line
|
||||
(global-set-key (kbd "M-c") nil) ; disable capitalize-word
|
||||
|
||||
;;---------------------------------------------------------------------------
|
||||
;; FullScreen
|
||||
;;---------------------------------------------------------------------------
|
||||
(defun myemacs/toggle-fullscreen ()
|
||||
"Return a message string if the current doc string is invalid."
|
||||
(interactive)
|
||||
(x-send-client-message nil 0 nil "_NET_WM_STATE" 32
|
||||
'(2 "_NET_WM_STATE_FULLSCREEN" 0)))
|
||||
(global-set-key (kbd "<f11>") 'myemacs/toggle-fullscreen) ; F11 FullScreen
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; clock
|
||||
;;----------------------------------------------------------------------------
|
||||
|
||||
(setq display-time-day-and-date t)
|
||||
(display-time)
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
;; This minor mode highlights indentation levels via font-lock
|
||||
(require-package 'highlight-indent-guides)
|
||||
|
||||
(setq highlight-indent-guides-method 'character)
|
||||
|
||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
|
||||
|
||||
(provide 'init-indent-guides)
|
||||
@@ -1,21 +1,47 @@
|
||||
;; Loads functions from libs
|
||||
(defun load-directory (dir)
|
||||
(let ((load-it (lambda (f)
|
||||
(load-file (concat (file-name-as-directory dir) f)))
|
||||
))
|
||||
(mapc load-it (directory-files dir nil "\\.el$"))))
|
||||
;;------------------------------------------------------------------------------
|
||||
;; Sachachua
|
||||
;;------------------------------------------------------------------------------
|
||||
;; Increase-decrease functions from Sacha Chua
|
||||
(defun sacha/increase-font-size ()
|
||||
(interactive)
|
||||
(set-face-attribute 'default
|
||||
nil
|
||||
:height
|
||||
(ceiling (* 1.10
|
||||
(face-attribute 'default :height)))))
|
||||
(defun sacha/decrease-font-size ()
|
||||
(interactive)
|
||||
(set-face-attribute 'default
|
||||
nil
|
||||
:height
|
||||
(floor (* 0.9
|
||||
(face-attribute 'default :height)))))
|
||||
|
||||
;; Load lib functions
|
||||
(load-directory (expand-file-name "~/.emacs.d/lisp/lib/" user-emacs-directory))
|
||||
;; Not original from Sacha.
|
||||
;; Taken from: http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/
|
||||
(defun sacha/smarter-move-beginning-of-line (arg)
|
||||
"Move point back to indentation of beginning of line.
|
||||
|
||||
;; This is borrowed from https://github.com/purcell/emacs.d/blob/master/lisp/init-utils.el by Steve Purcell but I have added some stuff.
|
||||
Move point to the first non-whitespace character on this line.
|
||||
If point is already there, move to the beginning of the line.
|
||||
Effectively toggle between the first non-whitespace character and
|
||||
the beginning of the line.
|
||||
|
||||
(if (fboundp 'with-eval-after-load)
|
||||
(defalias 'after-load 'with-eval-after-load)
|
||||
(defmacro after-load (feature &rest body)
|
||||
"After FEATURE is loaded, evaluate BODY."
|
||||
(declare (indent defun))
|
||||
'(eval-after-load ,feature
|
||||
'(progn ,@body))))
|
||||
If ARG is not nil or 1, move forward ARG - 1 lines first. If
|
||||
point reaches the beginning or end of the buffer, stop there."
|
||||
(interactive "^p")
|
||||
(setq arg (or arg 1))
|
||||
|
||||
;; Move lines first
|
||||
(when (/= arg 1)
|
||||
(let ((line-move-visual nil))
|
||||
(forward-line (1- arg))))
|
||||
|
||||
(let ((orig-point (point)))
|
||||
(back-to-indentation)
|
||||
(when (= orig-point (point))
|
||||
(move-beginning-of-line 1))))
|
||||
;;------------------------------------------------------------------------------
|
||||
|
||||
(provide 'init-utils)
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
;; Increase-decrease functions from Sacha Chua
|
||||
(defun sacha/increase-font-size ()
|
||||
(interactive)
|
||||
(set-face-attribute 'default
|
||||
nil
|
||||
:height
|
||||
(ceiling (* 1.10
|
||||
(face-attribute 'default :height)))))
|
||||
(defun sacha/decrease-font-size ()
|
||||
(interactive)
|
||||
(set-face-attribute 'default
|
||||
nil
|
||||
:height
|
||||
(floor (* 0.9
|
||||
(face-attribute 'default :height)))))
|
||||
|
||||
;; Not original from Sacha. Taken from: http://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/
|
||||
(defun sacha/smarter-move-beginning-of-line (arg)
|
||||
"Move point back to indentation of beginning of line.
|
||||
|
||||
Move point to the first non-whitespace character on this line.
|
||||
If point is already there, move to the beginning of the line.
|
||||
Effectively toggle between the first non-whitespace character and
|
||||
the beginning of the line.
|
||||
|
||||
If ARG is not nil or 1, move forward ARG - 1 lines first. If
|
||||
point reaches the beginning or end of the buffer, stop there."
|
||||
(interactive "^p")
|
||||
(setq arg (or arg 1))
|
||||
|
||||
;; Move lines first
|
||||
(when (/= arg 1)
|
||||
(let ((line-move-visual nil))
|
||||
(forward-line (1- arg))))
|
||||
|
||||
(let ((orig-point (point)))
|
||||
(back-to-indentation)
|
||||
(when (= orig-point (point))
|
||||
(move-beginning-of-line 1))))
|
||||
Reference in New Issue
Block a user