summaryrefslogtreecommitdiff
path: root/emacs.org
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-03-07 23:00:58 +0200
committerThanos Apollo <[email protected]>2023-03-07 23:00:58 +0200
commitef4697a88b6ecad69096adf195b2827c91403b2e (patch)
tree462144f217efdc5e13db1a0472a8d063fdfed5be /emacs.org
parent98520dab30300c3f54c74bf34793eb1372932f93 (diff)
emacs: for functions add create-scratch-writter-buffer
Diffstat (limited to 'emacs.org')
-rwxr-xr-xemacs.org173
1 files changed, 89 insertions, 84 deletions
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
-"<!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