summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfpi2022-02-20 18:21:26 +0100
committerfpi2022-03-17 14:39:52 +0100
commit74718e20301e78a5feffbef96e0e4337acc94c44 (patch)
tree3a0d7168f83fb34961e26dc2d878b6de63ec4469
parentRedtick make updated intervals work & change recipe (diff)
Add auto +x on scripts and move auto-insert
Diffstat (limited to '')
-rw-r--r--emacs-init.org17
1 files changed, 16 insertions, 1 deletions
diff --git a/emacs-init.org b/emacs-init.org
index 9fa2fb9..d388b47 100644
--- a/emacs-init.org
+++ b/emacs-init.org
@@ -47,7 +47,6 @@
- [[#ledger][Ledger]]
- [[#plotting-data][Plotting data]]
- [[#html-renderer][HTML renderer]]
- - [[#auto-insert][Auto-Insert]]
- [[#email][Email]]
- [[#footnote-mode][Footnote Mode]]
- [[#bbdb][BBDB]]
@@ -5828,6 +5827,22 @@ Saves to a temp file and puts the filename in the kill ring."
(nil "✓" "#cf6a4c"))))
:config (redtick-mode 1))
#+end_src
+*** Script creation
+Automatically make scripts executable upon save if first line is a shebang:
+#+begin_src emacs-lisp
+(add-hook 'after-save-hook
+ 'executable-make-buffer-file-executable-if-script-p)
+#+end_src
+
+The =Auto-Insert= package helps inserting header templates upon creating files.
+#+begin_src emacs-lisp
+(use-package autoinsert
+ :config
+ (define-auto-insert '("\\.sh\\'" . "Shell script skeleton")
+ '(""
+ "#!/usr/bin/env bash" \n \n))
+ (auto-insert-mode 1))
+#+end_src
* Language settings
End sentences with single spaces.
#+begin_src emacs-lisp