Improve F.A.Q. Answers and Issue Templates (#1249)

* Update the issue templates, making them simpler to use.

* Update FAQ answers.

Closes #1246.
- Add an if statement to the autocommand to prevent its running in the
  Command Window.

Closes #1248.
- Add a new answer to show closing a tab when only NERDTree remains.

* Update the Bug issue template.

* Update version number in change log.
This commit is contained in:
Phil Runninger 2021-07-13 14:28:29 -04:00 committed by GitHub
parent 81f3eaba29
commit de0e2edeac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 49 deletions

View File

@ -5,41 +5,42 @@ labels: bug
--- ---
<!-- Attention! Please Read! <!-- Attention! Please Read!
Please fill out ALL the information below so that the issue can be fully Please fill out ALL the information below so that the issue can be fully understood. Omitting
understood. Omitting information will delay the resolution of your issue. It information will delay the resolution of your issue. It will be labeled "Needs More Info", and
will be labeled "Needs More Info", and may be closed until there is enough may be closed until there is enough information.
information.
Keep in mind that others may have the same question in the future. The better Keep in mind that others may have the same question in the future. The better your information,
your information, the more likely they'll be able to help themselves. --> the more likely they'll be able to help themselves.
-->
#### Self-Diagnosis #### Self-Diagnosis
<!-- Check the boxes after creating the issue, or use [x]. --> Before creating an issue, take some time to search these resources for an answer. It's possible that someone else has already seen and solved your issue.
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question. - [old NERDTree issues](https://github.com/preservim/nerdtree/issues?q=is%3Aissue)
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree` - NERDTree documentation - `:h NERDTree`
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki). - [NERDTree Wiki](https://github.com/preservim/nerdtree/wiki)
- [ ] I have searched the web for an answer to my question. - Other resources: <https://stackoverflow.com>, <https://vi.stackexchange.com>, etc.
#### Environment (for bug reports) #### Environment
- [ ] Operating System: - Operating System:
- [ ] Vim/Neovim version `:echo v:version`: - Vim/Neovim version `:version`:
- [ ] NERDTree version, found on 1st line in NERDTree quickhelp `?`: - NERDTree version, found on first line of quickhelp `?`:
- [ ] vimrc settings - Are you using any of these NERDTree-dependent plugins? <!-- Check the boxes after creating the issue. -->
- [ ] NERDTree variables - [ ] [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin)
```vim - [ ] [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons)
``` - [ ] [tiagofumo/vim-nerdtree-syntax-highlight](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight)
- Other NERDTree-dependent Plugins - [ ] [scrooloose/nerdtree-project-plugin](https://github.com/scrooloose/nerdtree-project-plugin)
- [ ] jistr/vim-nerdtree-tabs - [ ] [PhilRunninger/nerdtree-buffer-ops](https://github.com/PhilRunninger/nerdtree-buffer-ops)
- [ ] ryanoasis/vim-devicons - [ ] [PhilRunninger/nerdtree-visual-selection](https://github.com/PhilRunninger/nerdtree-visual-selection)
- [ ] tiagofumo/vim-nerdtree-syntax-highlight - [ ] [jistr/vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs)
- [ ] Xuyuanp/nerdtree-git-plugin - [ ] Others (specify):
- [ ] Others (specify): - Provide a minimal **.vimrc** file that will reproduce the issue.
- [ ] I've verified the issue occurs with only NERDTree installed. ```vim
```
#### Steps to Reproduce the Issue #### Steps to Reproduce the Issue
1. 1.
#### Current Result (Include screenshots where appropriate.) #### Current Behavior (Include screenshots where appropriate.)
#### Expected Result #### Expected Result

View File

@ -3,22 +3,11 @@ name: "General Question"
about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here." about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here."
labels: "general question" labels: "general question"
--- ---
<!-- Attention! Please Read! Before creating an issue, take some time to search these resources. It's possible that someone else has already asked your question and gotten an answer.
- [old NERDTree issues](https://github.com/preservim/nerdtree/issues?q=is%3Aissue)
Please fill out ALL the information below so that the issue can be fully - NERDTree documentation - `:h NERDTree`
understood. Omitting information will delay the resolution of your issue. It - [NERDTree Wiki](https://github.com/scrooloose/nerdtree/wiki)
will be labeled "Needs More Info", and may be closed until there is enough - Other resource: <https://stackoverflow.com>, <https://vi.stackexchange.com>, etc.
information.
Keep in mind that others may have the same question in the future. The better
your information, the more likely they'll be able to help themselves. -->
#### Self-Diagnosis
<!-- Check the boxes after creating the issue, or use [x]. -->
- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question.
- [ ] I have reviewed the NERDTree documentation. `:h NERDTree`
- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki).
- [ ] I have searched the web for an answer to my question.
#### State Your Question #### State Your Question

View File

@ -5,10 +5,11 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
--> -->
#### 6.10 #### 6.10
- **.10**: Improve F.A.Q. Answers and Issue Templates (PhilRunninger) [#1249](https://github.com/preservim/nerdtree/pull/1249)
- **.9**: `go` on a bookmark directory will NERDTreeFind it. (PhilRunninger) [#1236](https://github.com/preservim/nerdtree/pull/1236) - **.9**: `go` on a bookmark directory will NERDTreeFind it. (PhilRunninger) [#1236](https://github.com/preservim/nerdtree/pull/1236)
- **.8**: Put `Callback` function variables in local scope. (PhilRunninger) [#1230](https://github.com/preservim/nerdtree/pull/1230) - **.8**: Put `Callback` function variables in local scope. (PhilRunninger) [#1230](https://github.com/preservim/nerdtree/pull/1230)
- **.7**: Fix mouse-clicking a file to open it. (PhilRunninger) [#1225](https://github.com/preservim/nerdtree/pull/1225) - **.7**: Fix mouse-clicking a file to open it. (PhilRunninger) [#1225](https://github.com/preservim/nerdtree/pull/1225)
- **.6**: Restore the default behavior of the <CR> key. (PhilRunninger) [#1221](https://github.com/preservim/nerdtree/pull/1221) - **.6**: Restore the default behavior of the `<CR>` key. (PhilRunninger) [#1221](https://github.com/preservim/nerdtree/pull/1221)
- **.5**: Fix `{'keepopen':0}` in NERDTreeCustomOpenArgs (PhilRunninger) [#1217](https://github.com/preservim/nerdtree/pull/1217) - **.5**: Fix `{'keepopen':0}` in NERDTreeCustomOpenArgs (PhilRunninger) [#1217](https://github.com/preservim/nerdtree/pull/1217)
- **.4**: Removed directory separator from sort key (Daniel E) [#1219](https://github.com/preservim/nerdtree/pull/1219) - **.4**: Removed directory separator from sort key (Daniel E) [#1219](https://github.com/preservim/nerdtree/pull/1219)
- **.3**: Add new FAQ and answer: How to prevent buffers replacing NERDTree. (PhilRunninger) [#1215](https://github.com/preservim/nerdtree/pull/1215) - **.3**: Add new FAQ and answer: How to prevent buffers replacing NERDTree. (PhilRunninger) [#1215](https://github.com/preservim/nerdtree/pull/1215)

View File

@ -148,12 +148,16 @@ autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in
\ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
``` ```
### How can I close Vim automatically when NERDTree is the last window? ### How can I close Vim or a tab automatically when NERDTree is the last window?
```vim ```vim
" Exit Vim if NERDTree is the only window left. " Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
\ quit | endif ```
---
```vim
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
``` ```
### How can I prevent other buffers replacing NERDTree in its window? ### How can I prevent other buffers replacing NERDTree in its window?
@ -168,7 +172,7 @@ autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_
```vim ```vim
" Open the existing NERDTree on each new tab. " Open the existing NERDTree on each new tab.
autocmd BufWinEnter * silent NERDTreeMirror autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
``` ```
or change your NERDTree-launching shortcut key like so: or change your NERDTree-launching shortcut key like so:
```vim ```vim