mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Update README.md
This commit is contained in:
20
README.md
20
README.md
@@ -110,7 +110,11 @@ See [Linguist::Generated#generated?](https://github.com/github/linguist/blob/mas
|
|||||||
|
|
||||||
## Overrides
|
## Overrides
|
||||||
|
|
||||||
Linguist supports custom overrides for language definitions and vendored paths. Add a `.gitattributes` file to your project using the keys `linguist-language` and `linguist-vendored` with the standard git-style path matchers for the files you want to override.
|
Linguist supports a number of different custom overrides strategies for language definitions and vendored paths.
|
||||||
|
|
||||||
|
### Using gitattributes
|
||||||
|
|
||||||
|
Add a `.gitattributes` file to your project using the keys `linguist-language` and `linguist-vendored` with the standard git-style path matchers for the files you want to override.
|
||||||
|
|
||||||
Please note that the overrides currently only affect the language statistics for a repository and not the syntax-highlighting of files.
|
Please note that the overrides currently only affect the language statistics for a repository and not the syntax-highlighting of files.
|
||||||
|
|
||||||
@@ -133,6 +137,20 @@ special-vendored-path/* linguist-vendored
|
|||||||
jquery.js linguist-vendored=false
|
jquery.js linguist-vendored=false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Using Emacs and Vim modelines
|
||||||
|
|
||||||
|
Alternatively, you can use Vim and Emacs style modelines to set the language for a single file. Modelines can be placed anywhere within a file and are respected when determining how to syntax-highlight a file on GitHub.com
|
||||||
|
|
||||||
|
```
|
||||||
|
Vim-style
|
||||||
|
vim: set filetype=prolog:
|
||||||
|
vim: set ft=cpp:
|
||||||
|
|
||||||
|
Emacs-style
|
||||||
|
-*- mode: php;-*-
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Github.com is usually running the latest version of the `github-linguist` gem that is released on [RubyGems.org](http://rubygems.org/gems/github-linguist).
|
Github.com is usually running the latest version of the `github-linguist` gem that is released on [RubyGems.org](http://rubygems.org/gems/github-linguist).
|
||||||
|
|||||||
Reference in New Issue
Block a user