refactoring code
This commit is contained in:
parent
c043be9622
commit
e60a671ef6
@ -56,13 +56,16 @@
|
|||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
;; FullScreen
|
;; FullScreen
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
(load-file (concat user-emacs-directory "/modules/lib/myemacs.el"))
|
(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
|
(global-set-key (kbd "<f11>") 'myemacs/toggle-fullscreen) ; F11 FullScreen
|
||||||
|
|
||||||
;;----------------------------------------------------------------------------
|
;;----------------------------------------------------------------------------
|
||||||
;; clock
|
;; clock
|
||||||
;;----------------------------------------------------------------------------
|
;;----------------------------------------------------------------------------
|
||||||
|
|
||||||
(setq display-time-day-and-date t)
|
(setq display-time-day-and-date t)
|
||||||
(display-time)
|
(display-time)
|
||||||
|
|
||||||
|
@ -12,8 +12,49 @@ read the .el files"
|
|||||||
))
|
))
|
||||||
(mapc load-it (directory-files dir nil "\\.el$"))))
|
(mapc load-it (directory-files dir nil "\\.el$"))))
|
||||||
|
|
||||||
;; Load lib functions
|
;;------------------------------------------------------------------------------
|
||||||
(load-directory (concat user-emacs-directory "/modules/lib/"))
|
;; 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)))))
|
||||||
|
|
||||||
|
;; 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))))
|
||||||
|
;;------------------------------------------------------------------------------
|
||||||
|
|
||||||
;; 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.
|
;; 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.
|
||||||
(if (fboundp 'with-eval-after-load)
|
(if (fboundp 'with-eval-after-load)
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
;;; myemacs.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
|
||||||
;;; Commentary:
|
|
||||||
;;; myemacs reloj
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
;;----------------------------------------------------------------------------
|
|
||||||
;; Some cool functions
|
|
||||||
;;----------------------------------------------------------------------------
|
|
||||||
;; These functions are made by me (Quitter: @heckyel) or
|
|
||||||
;; heavily modified by me
|
|
||||||
|
|
||||||
;;----------------------------------------------------------------------------
|
|
||||||
;; Toggles 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)))
|
|
||||||
|
|
||||||
(provide 'myemacs)
|
|
||||||
|
|
||||||
;; Local Variables:
|
|
||||||
;; byte-compile-warnings: (not free-vars)
|
|
||||||
;; End:
|
|
||||||
;;; myemacs.el ends here
|
|
@ -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