Skip to content

Commit 46a6847

Browse files
ujihisajbodah
authored andcommitted
Do not change &formatprg globally
Since `&formatprg` is "global or local to buffer", `:set` does not only change &formatprg of the current buffer, but also any other buffers. Prefer `:setlocal` instead. ``` :h formatprg *'formatprg'* *'fp'* 'formatprg' 'fp' string (default "") global or local to buffer |global-local| The name of an external program that will be used to format the lines selected with the |gq| operator. The program must take the input on stdin and produce the output on stdout. The Unix program "fmt" is such a program. If the 'formatexpr' option is not empty it will be used instead. Otherwise, if 'formatprg' option is an empty string, the internal format function will be used |C-indenting|. Environment variables are expanded |:set_env|. See |option-backslash| about including spaces and backslashes. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. ```
1 parent 2e3b3b2 commit 46a6847

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Run [./manual_install.sh](manual_install.sh) to copy the contents of each direct
5050
We've decided not to include `mix format` integration into `vim-elixir`. If you'd like to set it up yourself, you have the following options:
5151

5252
* For asynchronous execution of the formatter, have a look at [vim-mix-format](https://github.com/mhinz/vim-mix-format)
53-
* Add it as a `formatprg` (e.g. `set formatprg=mix\ format\ -`)
53+
* Add it as a `formatprg` (e.g. `setlocal formatprg=mix\ format\ -`)
5454

5555
## Development
5656

0 commit comments

Comments
 (0)