refactoring and remove init-indent-guides
This commit is contained in:
parent
df9488c745
commit
d2aa408869
10
README.md
10
README.md
@ -5,6 +5,16 @@ Support C, C++, PHP, Python, ECMAScript, HTML, Sass, less, Markdown
|
||||
|
||||

|
||||
|
||||
### Installation
|
||||
|
||||
First step:
|
||||
|
||||
M-x package-refresh-contents [RET]
|
||||
|
||||
#### Main mirror
|
||||
|
||||
1. `git clone https://c.fridu.us/software/emacs-base.git ~/.emacs.d/`
|
||||
2. `emacs --batch --eval='(load-file "~/.emacs.d/init.el")'`
|
||||
|
||||
### Markdown Mode
|
||||
- Require installed markdown in distro GNU+Linux, example:
|
||||
|
19
custom.el
19
custom.el
@ -1,19 +0,0 @@
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(anzu-deactivate-region t)
|
||||
'(anzu-input-idle-delay 0.1)
|
||||
'(anzu-replace-threshold 1000)
|
||||
'(anzu-replace-to-string-separator " => ")
|
||||
'(anzu-search-threshold 1000)
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(rainbow-mode scss-mode sass-mode less-css-mode ac-php smarty-mode php-mode pkgbuild-mode markdown-mode flycheck highlight-indent-guides anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line nlinum sublime-themes))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
)
|
4
init.el
4
init.el
@ -78,7 +78,6 @@
|
||||
(require 'init-gui)
|
||||
(require 'init-editing-utils)
|
||||
(require 'init-modeline)
|
||||
(require 'init-indent-guides)
|
||||
;; Tools
|
||||
(require 'init-flycheck)
|
||||
;; Languages
|
||||
@ -90,7 +89,8 @@
|
||||
(require 'init-sass)
|
||||
(require 'init-scss)
|
||||
;; Plus
|
||||
(require 'init-rainbow))
|
||||
(require 'init-rainbow)
|
||||
)
|
||||
|
||||
;;; Custom variables
|
||||
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
||||
|
@ -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))))
|
Loading…
x
Reference in New Issue
Block a user