|
|
|
@ -179,29 +179,27 @@ Happy hacking!
|
|
|
|
|
[vimtex](https://github.com/lervag/vimtex) can be configured to use nvr to
|
|
|
|
|
jump to a certain file and line: [read](https://github.com/lervag/vimtex/blob/80b96c13fe9edc5261e9be104fe15cf3bdc3173d/doc/vimtex.txt#L1702-L1708).
|
|
|
|
|
|
|
|
|
|
- **Use nvr as temporary editor.**
|
|
|
|
|
- **Use nvr as git editor.**
|
|
|
|
|
|
|
|
|
|
Imagine Neovim is set as your default editor: `VISUAL=nvim`.
|
|
|
|
|
Imagine Neovim is set as your default editor via `$VISUAL` or `$EDITOR`.
|
|
|
|
|
|
|
|
|
|
Now run `git commit`. In a regular shell, a new nvim process starts. That's
|
|
|
|
|
exactly what you want.
|
|
|
|
|
|
|
|
|
|
But in a terminal buffer (`:terminal`), a new nvim process starts as well. Now
|
|
|
|
|
you have one nvim nested within another. You don't want that. Put this in your
|
|
|
|
|
vimrc:
|
|
|
|
|
Running `git commit` in a regular shell starts a nvim process. But in a
|
|
|
|
|
terminal buffer (`:terminal`), a new nvim process starts as well. Now you
|
|
|
|
|
have one nvim nested within another.
|
|
|
|
|
|
|
|
|
|
If you do not want this, put this in your vimrc:
|
|
|
|
|
|
|
|
|
|
```vim
|
|
|
|
|
if has('nvim')
|
|
|
|
|
let $VISUAL = 'nvr -cc split --remote-wait'
|
|
|
|
|
let $GIT_EDITOR = 'nvr -cc split --remote-wait'
|
|
|
|
|
endif
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
That way, you get a new window for entering the commit message instead of a
|
|
|
|
|
nested nvim process.
|
|
|
|
|
nested nvim process. But git still waits for nvr to finish, so make sure to
|
|
|
|
|
delete the buffer after entering and saving the commit message: `:w | bd`.
|
|
|
|
|
|
|
|
|
|
Alternatively, you can make git always using nvr. In a regular shell, nvr
|
|
|
|
|
will create a new nvim process. In a terminal buffer, nvr will open a new
|
|
|
|
|
buffer (use `:w | bd` to commit).
|
|
|
|
|
To use nvr from a regular shell as well:
|
|
|
|
|
|
|
|
|
|
$ git config --global core.editor 'nvr --remote-wait-silent'
|
|
|
|
|
|
|
|
|
|