Skip to content

Commit 9e03b7c

Browse files
xerufglacambre
authored andcommitted
Improve wordings in README.md
1 parent 0515259 commit 9e03b7c

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ Turn your browser¹ into a Neovim client.
88

99
## How to use
1010

11-
Just click on any textarea and it will be immediately replaced by an instance of Firenvim. When you want to set the content of the now hidden textarea to the content of the Neovim instance, just `:w`. If you want to close the Firenvim overlay and return to the textarea run `:q`. If you selected an element where you expected the Firenvim frame to appear and it didn't, try pressing `<C-e>`.
11+
Just click on any textarea and it will be immediately replaced by an instance of Firenvim. To set the content of the now hidden textarea to the content of the Neovim instance, simply `:w`. If you want to close the Firenvim overlay and return to the textarea, use `:q`. If you selected an element where you expected the Firenvim frame to appear and it didn't, try pressing `<C-e>`.
1212

1313
## Installing
1414

1515
Before installing anything please read [SECURITY.md](SECURITY.md) and make sure you're okay with everything mentioned. In the event you think of a way to compromise Firenvim, please send me an email (you can find my address in my commits).
1616

1717
### Pre-built
1818

19-
1. Make sure you are using [Neovim][nvim] 0.4.0 or later. This plugin will not work with vanilla [VIM][vim] or [Vimr][vimr]. Also make sure that your browser hasn't been installed with Snap or Flatpak - these are sandboxed and won't work.
19+
1. Make sure you are using [Neovim][nvim] 0.4.0 or later. This plugin will not work with vanilla [VIM][vim] or [Vimr][vimr]. Also make sure that your browser hasn't been installed with Snap or Flatpak - these are sandboxed and thus won't work.
2020

2121
2. Check if the luabitop package is available by running `:lua bit.band(1,1)` in Neovim. If this throws an error, you will need to install it.
2222

23-
3. Install Firenvim as a VIM plugin as you would any other, then run the built in post-install hook script.
23+
3. Install Firenvim as a VIM plugin as you would any other, then run the built-in post-install script.
2424

2525
* [vim-plug](https://github.com/junegunn/vim-plug)
2626

@@ -51,20 +51,19 @@ Before installing anything please read [SECURITY.md](SECURITY.md) and make sure
5151
$ nvim --headless "+call firenvim#install(0) | q"
5252
```
5353
54-
4. Finally install Firenvim in your browser from [Mozilla's store](https://addons.mozilla.org/en-US/firefox/addon/firenvim/) or [Google's](https://chrome.google.com/webstore/detail/firenvim/egpjdkipkomnmjhjmdamaniclmdlobbo).
54+
4. Finally, install the Firenvim addon for your browser from [Mozilla's store](https://addons.mozilla.org/en-US/firefox/addon/firenvim/) or [Google's](https://chrome.google.com/webstore/detail/firenvim/egpjdkipkomnmjhjmdamaniclmdlobbo).
5555
5656
### From source
5757
5858
#### Requirements
5959
60-
Installing from source requires NodeJS, `npm`, and Neovim >= 0.4.
60+
Installing from source requires NodeJS, npm, and Neovim >= 0.4.
6161
6262
#### Cross-browser steps
6363
64-
First, install Firenvim like a regular vim plugin (either by changing your runtime path manually or by using your favourite plugin manager).
65-
66-
Then, run the following commands:
64+
First, install Firenvim like a regular vim plugin (either by changing your runtime path manually or by [using your favourite plugin manager](#pre-built)).
6765
66+
Then run the following commands:
6867
```sh
6968
git clone https://git.sr.ht/~glacambre/firenvim
7069
cd firenvim
@@ -77,7 +76,7 @@ These commands should create three directories: `target/chrome`, `target/firefox
7776

7877
#### Firefox-specific steps
7978

80-
Go to `about:addons`, click on the cog icon and select `install addon from file` (note: this might require setting `xpinstall.signatures.required` to false in `about:config`).
79+
Go to `about:addons`, click on the cog icon, select `install addon from file` and select the `target/firefox` directory (note: this might require setting `xpinstall.signatures.required` to false in `about:config`).
8180

8281
#### Google Chrome/Chromium-specific steps
8382

@@ -141,15 +140,15 @@ Similarly, you can detect when Firenvim disconnects from a Neovim instance with
141140

142141
### Using different settings depending on the page/element being edited
143142

144-
If you want to use different settings depending on the textarea you're currently editing, you can use autocommands to do that too. All buffers are named like this: `domainname_page_selector.txt` (see the [toFileName function](src/utils/utils.ts)). This means that you can for example set the file type to markdown for all GitHub buffers:
143+
If you want to use different settings depending on the textarea you're currently editing, you can use autocommands to do that too. All buffers are named like this: `domainname_page_selector.txt` (see the [toFileName function](src/utils/utils.ts)). For example, this will set file type to markdown for all GitHub buffers:
145144

146145
```vim
147146
au BufEnter github.com_*.txt set filetype=markdown
148147
```
149148

150149
### Understanding Firenvim's configuration object
151150

152-
You can configure the rest of Firenvim by creating a variable named `g:firenvim_config` in your init.vim. This variable is a dictionary containing the keys "globalSettings" and "localSettings". `g:firenvim_config["localSettings"]` is a dictionary, mapping Javascript patterns that match against the full URL to settings that are used for all URLs matched by that pattern. When multiple patterns match a same URL, the pattern with the highest "priority" value is used. Here is an example (the settings and their possible values will be explained in the next subsections):
151+
You can configure everything else about Firenvim by creating a dictionnary named `g:firenvim_config` in your init.vim and setting the keys "globalSettings" and "localSettings". In the dictionary `g:firenvim_config["localSettings"]` you can map Javascript patterns that match against the full URL to settings that are used for all URLs matched by that pattern. When multiple patterns match a URL, the pattern with the highest "priority" value is used. Here is an example (the settings and their possible values will be explained in the next subsections):
153152

154153
```vim
155154
let g:firenvim_config = {
@@ -212,11 +211,13 @@ You can chose to use an external command line (and thus save a line of space) by
212211
let fc['.*'] = { 'cmdline' : 'firenvim' }
213212
```
214213

214+
When you then enter command mode, the command will appear in a sort of "pop-up" instead of the bottom of the frame.
215+
215216
### Using a single neovim instance
216217

217218
Firenvim can be made to use a single neovim instance. To do so, set the `server` setting to `'persistent'`. Firenvim will automatically start an instance on Firefox's startup and then launch a new one every time the previous one is `:quit`'ed. In this mode, every new Firenvim window is actually a Neovim floating window. This means that having the cursor move to another window/opening new floating windows can be pretty confusing and should be avoided.
218219

219-
Note: this requires a Neovim compiled at commit a2efc9c or more recent.
220+
Note: this requires Neovim [commit a2efc9c](https://github.com/neovim/neovim/commit/a2efc9c) or later, which has no official release yet.
220221

221222
```vim
222223
let g:firenvim_config = {
@@ -269,14 +270,14 @@ Known Issues: some chat apps do not react to firenvim#press_keys (e.g. Slack).
269270

270271
### Automatically syncing changes to the page
271272

272-
Since Firenvim just uses the BufWrite event in order to detect when it needs to write neovim's buffers to the page, Firenvim can be made to automatically synchronize all changes like this:
273+
Since Firenvim simply uses the BufWrite event in order to detect when it needs to write neovim's buffers to the page, Firenvim can be made to automatically synchronize all changes like this:
273274

274275
```vim
275276
au TextChanged * ++nested write
276277
au TextChangedI * ++nested write
277278
```
278279

279-
Depending on how large the edited buffer is, this could be a little slow. A better approach would then be to delay writes, like this:
280+
Depending on how large the edited buffer is, this could be a little slow. This more sophisticated approach will throttle writes:
280281

281282
```vim
282283
let g:dont_write = v:false

0 commit comments

Comments
 (0)