Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 14 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,43 +167,37 @@ vim.keymap.set("n", "<leader>hm", function() header.add_license_header("mit") en

## Supported Languages

### Simple Languages
### Standard Languages

Headers are inserted at the beginning of the file (or after existing headers).
For most languages, headers are inserted at the top of the file (or after existing headers/comments if detected):

- C / C++
- Java
- JavaScript
- TypeScript
- JavaScript / TypeScript
- C#
- Go
- Rust
- Swift
- Kotlin
- Scala
- Go
- Rust
- Groovy
- Dart
- Lua
- Ruby
- Perl
- Haskell
- Groovy
- CoffeeScript
- R

---

### Context-Aware Languages

Headers are intelligently placed according to language-specific rules.

#### Bash / Shell (`sh`, `bash`, `zsh`)
### Bash / Shell (`sh`, `bash`, `zsh`)

Headers are inserted after the shebang:
Headers are inserted after the shebang if present:

```bash
#!/bin/bash
# Copyright (c) 2026 Your Name
# License information

echo "Hello, World!"
```
Expand All @@ -212,57 +206,44 @@ If no shebang exists, the header is placed at the top of the file.

---

#### Python (`py`)
### Python

Headers are inserted after the shebang and encoding declaration:
Headers are inserted after shebang and encoding declarations:

```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2026 Your Name
# License information

import os
```

Both encoding declaration styles are supported:

```python
# coding: utf-8
```

```python
# -*- coding: utf-8 -*-
```

---

#### PHP (`php`)
### PHP

Headers are inserted inside the PHP opening tag:

```php
<?php
/*
* Copyright (c) 2026 Your Name
* License information
*/

echo "Hello, World!";
echo "Hello";
```

If no PHP opening tag exists, insertion will fail to avoid generating invalid PHP files.
If no opening tag exists, the header is placed at the top of the file.

---

#### HTML (`html`)
### HTML

Uses HTML comment syntax:

```html
<!--
Copyright (c) 2026 Your Name
License information
-->

<!DOCTYPE html>
Expand Down
38 changes: 0 additions & 38 deletions lua/header/filetypes.lua

This file was deleted.

Loading