From ef4697a88b6ecad69096adf195b2827c91403b2e Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 7 Mar 2023 23:00:58 +0200 Subject: emacs: for functions add create-scratch-writter-buffer --- .emacs.d/init.el | 9 ++- emacs.org | 173 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 96 insertions(+), 86 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index bdc5b16..786b6db 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -532,7 +532,7 @@ you have the correctly set the OPENAI_API_KEY variable"
-

Starting point

+

Starting point

@@ -594,7 +594,7 @@ you have the correctly set the OPENAI_API_KEY variable" (interactive) (start-process-shell-command "setxkbmap" nil "setxkbmap gr")) - + (defun apollo/exwm-update-class () (exwm-workspace-rename-buffer exwm-class-name)) @@ -617,6 +617,11 @@ you have the correctly set the OPENAI_API_KEY variable" (start-process-shell-command "polybar" nil "polybar main"))) +(defun create-scratch-writter-buffer nil + "create a scratch buffer" + (interactive) + (switch-to-buffer (get-buffer-create "*scratch-writter*"))) + (global-set-key (kbd "") 'keyboard-escape-quit) (global-set-key (kbd "s-=") 'text-scale-increase) (global-set-key (kbd "s--") 'text-scale-decrease) diff --git a/emacs.org b/emacs.org index 6f2c693..7787360 100755 --- a/emacs.org +++ b/emacs.org @@ -610,106 +610,111 @@ Hook with ~dired-mode~ #+end_src ** Random functions #+begin_src emacs-lisp -(defun apollo/html-boostrap-boilerplate () - "Insert html boilerplate with boostrap link." - (interactive) - (insert -" - - - - - - My Title - - - - -
-

Starting point

-
- - -" )) - - -(defun apollo/center-buffer () - "Centers/Uncenters selected buffer" - (interactive) - (if visual-fill-column-center-text - (setq visual-fill-column-center-text nil) - (setq visual-fill-column-center-text t)) - (visual-fill-column-mode 1) - (message "General's task completed!")) - - -(defun apollo/rofi-switch-window () - "Navigate X11 buffers using rofi." - (interactive) - (start-process-shell-command - "rofi" nil "rofi -show window")) + (defun apollo/html-boostrap-boilerplate () + "Insert html boilerplate with boostrap link." + (interactive) + (insert + " + + + + + + My Title + + + + +
+

Starting point

+
+ + + " )) + + + (defun apollo/center-buffer () + "Centers/Uncenters selected buffer" + (interactive) + (if visual-fill-column-center-text + (setq visual-fill-column-center-text nil) + (setq visual-fill-column-center-text t)) + (visual-fill-column-mode 1) + (message "General's task completed!")) -(defun apollo/run-in-background (command) - "Run COMMAND in the background." - (let ((command-parts (split-string command "[ ]+"))) - (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) -(defun rofi () - "Run Rofi." - (interactive) - (apollo/run-in-background "rofi -show drun")) + (defun apollo/rofi-switch-window () + "Navigate X11 buffers using rofi." + (interactive) + (start-process-shell-command + "rofi" nil "rofi -show window")) -(defun apollo/volume-increase () - "Increase Volume." - (interactive) - (start-process-shell-command - "amixer" nil "amixer sset Master 5%+")) + (defun apollo/run-in-background (command) + "Run COMMAND in the background." + (let ((command-parts (split-string command "[ ]+"))) + (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) -(defun apollo/volume-decrease () - "Decrease Volume." - (interactive) - (start-process-shell-command - "amixer" nil "amixer sset Master 5%-")) + (defun rofi () + "Run Rofi." + (interactive) + (apollo/run-in-background "rofi -show drun")) -(defun apollo/restore-wallpaper () - "Set NAME as wallpaper." - (interactive) - (start-process-shell-command - "feh" nil "feh --bg-scale ~/dotfiles/wallpaper.png")) + (defun apollo/volume-increase () + "Increase Volume." + (interactive) + (start-process-shell-command + "amixer" nil "amixer sset Master 5%+")) -(defun apollo/emacs-keys () - "Swap caps with ctrl." + (defun apollo/volume-decrease () + "Decrease Volume." (interactive) (start-process-shell-command - "setxkbmap" nil "setxkbmap us -option ctrl:swapcaps")) + "amixer" nil "amixer sset Master 5%-")) -(defun apollo/greek-keyboard () - "Swap caps with ctrl." + (defun apollo/restore-wallpaper () + "Set NAME as wallpaper." (interactive) (start-process-shell-command - "setxkbmap" nil "setxkbmap gr")) + "feh" nil "feh --bg-scale ~/dotfiles/wallpaper.png")) + + (defun apollo/emacs-keys () + "Swap caps with ctrl." + (interactive) + (start-process-shell-command + "setxkbmap" nil "setxkbmap us -option ctrl:swapcaps")) + + (defun apollo/greek-keyboard () + "Swap caps with ctrl." + (interactive) + (start-process-shell-command + "setxkbmap" nil "setxkbmap gr")) -(defun apollo/exwm-update-class () - (exwm-workspace-rename-buffer exwm-class-name)) + (defun apollo/exwm-update-class () + (exwm-workspace-rename-buffer exwm-class-name)) -(defun eshell-new() - "Open a new instance of eshell." - (interactive) - (eshell 'N)) + (defun eshell-new() + "Open a new instance of eshell." + (interactive) + (eshell 'N)) -(defun make-mini-geiser () - (interactive) - (split-window-below 60) - (geiser nil)) + (defun make-mini-geiser () + (interactive) + (split-window-below 60) + (geiser nil)) -(defun start-polybar () - "Check which system is running, start polybar accordingly." - (interactive) - (if (string= (system-name) "fsociety") + (defun start-polybar () + "Check which system is running, start polybar accordingly." + (interactive) + (if (string= (system-name) "fsociety") + (start-process-shell-command + "polybar" nil "polybar main & polybar second") (start-process-shell-command - "polybar" nil "polybar main & polybar second") - (start-process-shell-command - "polybar" nil "polybar main"))) + "polybar" nil "polybar main"))) + + (defun create-scratch-writter-buffer nil + "create a scratch buffer" + (interactive) + (switch-to-buffer (get-buffer-create "*scratch-writter*"))) #+end_src ** Key-bindings #+begin_src emacs-lisp -- cgit v1.2.3