aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus E <heckyel@riseup.net>2023-05-13 00:49:58 -0400
committerJesus E <heckyel@riseup.net>2023-05-13 00:49:58 -0400
commitd2aa408869fe2d284ec276fff604d9ec8c4a3a38 (patch)
tree2de820d715d8e13e8652be1efb3e90dea6fa00e6
parentdf9488c7459effbbd35e08ae110aa44e624a64e1 (diff)
downloademacs-base-master.tar.lz
emacs-base-master.tar.xz
emacs-base-master.zip
refactoring and remove init-indent-guidesHEADmaster
-rw-r--r--README.md10
-rw-r--r--custom.el19
-rw-r--r--init.el4
-rw-r--r--lisp/init-gui.el14
-rw-r--r--lisp/init-indent-guides.el8
-rw-r--r--lisp/init-utils.el56
-rw-r--r--lisp/lib/sachachua.el39
7 files changed, 63 insertions, 87 deletions
diff --git a/README.md b/README.md
index e413181..1e1df53 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,16 @@ Support C, C++, PHP, Python, ECMAScript, HTML, Sass, less, Markdown
![emacs-base](https://img.fenixzone.net/i/zOJSwUE.png?raw=true "emacs-base")
+### 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:
diff --git a/custom.el b/custom.el
deleted file mode 100644
index 86a43d2..0000000
--- a/custom.el
+++ /dev/null
@@ -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.
- )
diff --git a/init.el b/init.el
index 23ac856..13c3b64 100644
--- a/init.el
+++ b/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))
diff --git a/lisp/init-gui.el b/lisp/init-gui.el
index 6bcdb8c..1d33698 100644
--- a/lisp/init-gui.el
+++ b/lisp/init-gui.el
@@ -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)
diff --git a/lisp/init-indent-guides.el b/lisp/init-indent-guides.el
deleted file mode 100644
index f2be7ce..0000000
--- a/lisp/init-indent-guides.el
+++ /dev/null
@@ -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)
diff --git a/lisp/init-utils.el b/lisp/init-utils.el
index 0490986..20e20a3 100644
--- a/lisp/init-utils.el
+++ b/lisp/init-utils.el
@@ -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)
diff --git a/lisp/lib/sachachua.el b/lisp/lib/sachachua.el
deleted file mode 100644
index c862223..0000000
--- a/lisp/lib/sachachua.el
+++ /dev/null
@@ -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))))