https://github.com/sbdchd/vim-shebang
:metal: A simple plugin to insert the correct shebang of the file.
https://github.com/sbdchd/vim-shebang
Last synced: 11 months ago
JSON representation
:metal: A simple plugin to insert the correct shebang of the file.
- Host: GitHub
- URL: https://github.com/sbdchd/vim-shebang
- Owner: sbdchd
- License: bsd-2-clause
- Created: 2016-01-14T02:22:29.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-22T14:20:31.000Z (over 8 years ago)
- Last Synced: 2025-01-02T02:29:15.772Z (about 1 year ago)
- Language: Vim script
- Homepage:
- Size: 7.81 KB
- Stars: 10
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-shebang [](https://travis-ci.org/sbdchd/vim-shebang) [](https://circleci.com/gh/sbdchd/vim-shebang) [](https://drone.io/github.com/sbdchd/vim-shebang/latest)
A simple plugin to insert the correct shebang of the file.
## Install
[vim-plug](https://github.com/junegunn/vim-plug)
```viml
Plug 'sbdchd/vim-shebang'
```
## Usage
Run the command `:ShebangInsert` or use an autocmd e.g., `au! BufNewFile * ShebangInsert`.
Normally, `:ShebangInsert` will not overwrite an existing shebang.
By calling the command with a bang, `:ShebangInsert!`, any existing shebang
will be overwritten.
Additionally, a shebang can be specified by passing a name/filetype to `:ShebangInsert`.
```viml
:ShebangInsert python
```
or
```viml
:ShebangInsert node
```
You can also directly pass your desired shebang to the function.
```viml
:ShebangInsert #!/bin/sh
```
## Config
To add/change/remove a shebang and filetype, simple create the dictionary `g:shebang#shebangs`
in your `.vimrc`.
```viml
let g:shebang#shebangs = {
\ 'python': '#!/bin/python',
\ 'sh': '',
\ 'newfiletype': '#!/bin/newshebang'
\ }
```
## Supported Filetypes
- Applescript
- Bash
- Erlang (Escript)
- Fish
- Lua
- Node
- Perl
- PHP
- Python
- Ruby
- Sh
- Zsh