Insert shebang line automatically.
- Clone this repository
#+BEGIN_SRC sh
git clone https://github.com/psachin/insert-shebang.git
#+END_SRC sh
#+BEGIN_SRC emacs-lisp
M-x package-install RET insert-shebang RET
#+END_SRC emacs-lisp
- Add directory containing
insert-shebang.el
file to
=load-path= in your =~/.emacs= file. For example:
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path "/path/to/insert-shebang/")
#+END_SRC emacs-lisp
- To load a package, add:
#+BEGIN_SRC emacs-lisp
(require 'insert-shebang)
#+END_SRC emacs-lisp
- To enable it globally, add:
#+BEGIN_SRC emacs-lisp
(add-hook 'find-file-hook 'insert-shebang)
#+END_SRC emacs-lisp
- Optionally, run
make
to byte-compile the file.
- Customize using:
#+BEGIN_SRC emacs-lisp
M-x customize-group RET insert-shebang RET
#+END_SRC emacs-lisp
Defines path to =env=. Default is =/usr/bin/env=.
Defines file types.
*insert-shebang* can be extended to insert header for C, C++ and
FORTRAN programs etc.
Set file types(using extensions) you want to ignore.
Files ignored during the prompt are stored with their full-path
in =~/.insert-shebang.log= file. Set to *nil* if you want to
disable this feature.
You can visit this log file using
#+BEGIN_SRC emacs-lisp
M-x insert-shebang-open-log-buffer
#+END_SRC emacs-lisp