diff options
author | Thanos Apollo <[email protected]> | 2023-03-07 23:00:58 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-03-07 23:00:58 +0200 |
commit | ef4697a88b6ecad69096adf195b2827c91403b2e (patch) | |
tree | 462144f217efdc5e13db1a0472a8d063fdfed5be /emacs.org | |
parent | 98520dab30300c3f54c74bf34793eb1372932f93 (diff) |
emacs: for functions add create-scratch-writter-buffer
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 173 |
1 files changed, 89 insertions, 84 deletions
@@ -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 -"<!DOCTYPE html> -<html lang=\"en\"> - <head> - <meta charset=\"UTF-8\"> - <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> - <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"> - <title>My Title</title> - <link rel=\"stylesheet\" href=\"./style.css\"> - <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\"> - </head> - <body> - <main> - <h1>Starting point</h1> - </main> - <script src=\"index.js\"></script> - </body> -</html>" )) - - -(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 + "<!DOCTYPE html> + <html lang=\"en\"> + <head> + <meta charset=\"UTF-8\"> + <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> + <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"> + <title>My Title</title> + <link rel=\"stylesheet\" href=\"./style.css\"> + <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\"> + </head> + <body> + <main> + <h1>Starting point</h1> + </main> + <script src=\"index.js\"></script> + </body> + </html>" )) + + + (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 |