I managed to insert a template to certain sripts with autocomplete.
Example:
(auto-insert-mode)
(setq auto-insert-query nil)
(setq auto-insert-alist
'(((ess-mode . "R script") nil
"# R script " \n
"# file: " (file-name-nondirectory buffer-file-name) "\n"
"# Description: " _ "\n\n")))
However, when creating a new file, the buffer-tab is now not selected as with "visit new file". Meaning, that the selected buffer remains selected. Can this behaviour be altered?
Admittedly, it is a minor problem, yet annyoing. Any help would be appreciated.