|
1 # EditorConfig Vim Plugin |
|
2 |
|
3 [](https://travis-ci.org/editorconfig/editorconfig-vim) |
|
4 |
|
5 This is an [EditorConfig][] plugin for Vim. This plugin could be found on both |
|
6 [GitHub][] and [Vim online][]. |
|
7 |
|
8 ## Installation |
|
9 |
|
10 If your Vim is not compiled with `+python` feature (You can verify if the |
|
11 `+python` feature is included by running `:ver`. Most Linux distributions and |
|
12 with the official Windows binary have the `+python` feature enabled), please |
|
13 first download the [EditorConfig core][] and follow the instructions in the |
|
14 README and INSTALL files to install it. This plugin would NOT work if neither |
|
15 `+python` nor EditorConfig core is available. |
|
16 |
|
17 To install this plugin, you can use either of the following ways: |
|
18 |
|
19 - Download the archive and extract it into your Vim runtime directory (`~/.vim` |
|
20 on UNIX/Linux and `$VIM_INSTALLATION_FOLDER\vimfiles` on windows). |
|
21 |
|
22 - Use [pathogen][] (the git repository of this plugin is |
|
23 https://github.com/editorconfig/editorconfig-vim.git) |
|
24 |
|
25 - Use [Vundle][] by adding to your `.vimrc` Vundle plugins section: |
|
26 |
|
27 Plugin 'editorconfig/editorconfig-vim' |
|
28 |
|
29 Then remember to call `:PluginInstall`. |
|
30 |
|
31 |
|
32 ## Supported properties |
|
33 |
|
34 The EditorConfig Vim plugin supports the following EditorConfig [properties][]: |
|
35 |
|
36 * `indent_style` |
|
37 * `indent_size` |
|
38 * `tab_width` |
|
39 * `end_of_line` |
|
40 * `charset` |
|
41 * `insert_final_newline` (Feature +fixendofline (available on Vim 7.4.785+) or [PreserveNoEOL][] is required for this property) |
|
42 * `trim_trailing_whitespace` |
|
43 * `max_line_length` |
|
44 * `root` (only used by EditorConfig core) |
|
45 |
|
46 ## Recommended Options |
|
47 |
|
48 All of the options which are supported are documented in [editorConfig.txt][] |
|
49 and can be viewed by executing the following: `:help editorconfig`. |
|
50 |
|
51 #### Excluded patterns. |
|
52 |
|
53 To ensure that this plugin works well with [Tim Pope's fugitive][], use the |
|
54 following patterns array: |
|
55 |
|
56 > let g:EditorConfig_exclude_patterns = ['fugitive://.\*'] |
|
57 |
|
58 If you wanted to avoid loading EditorConfig for any remote files over ssh: |
|
59 |
|
60 > let g:EditorConfig_exclude_patterns = ['scp://.\*'] |
|
61 |
|
62 Of course these two items could be combined into the following: |
|
63 |
|
64 > let g:EditorConfig_exclude_patterns = ['fugitive://.\*', 'scp://.\*'] |
|
65 |
|
66 #### Exec Path |
|
67 |
|
68 The file path to the EditorConfig core executable. You could set this value in |
|
69 your |vimrc| like this: |
|
70 |
|
71 > let g:EditorConfig_exec_path = 'Path to your EditorConfig Core executable' |
|
72 |
|
73 ## Bugs and Feature Requests |
|
74 |
|
75 Feel free to submit bugs, feature requests, and other issues to the |
|
76 [issue tracker][]. Be sure you have read the [contribution guideline][]! |
|
77 |
|
78 [EditorConfig core]: https://github.com/editorconfig/editorconfig-core |
|
79 [EditorConfig]: http://editorconfig.org |
|
80 [GitHub]: https://github.com/editorconfig/editorconfig-vim |
|
81 [PreserveNoEOL]: http://www.vim.org/scripts/script.php?script_id=4550 |
|
82 [Tim Pope's fugitive]: https://github.com/tpope/vim-fugitive |
|
83 [Vim online]: http://www.vim.org/scripts/script.php?script_id=3934 |
|
84 [Vundle]: https://github.com/gmarik/Vundle.vim |
|
85 [contribution guideline]: https://github.com/editorconfig/editorconfig/blob/master/CONTRIBUTING.md#submitting-an-issue |
|
86 [issue tracker]: https://github.com/editorconfig/editorconfig-vim/issues |
|
87 [pathogen]: https://github.com/tpope/vim-pathogen |
|
88 [properties]: http://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties |