Comments (8)
@Hritik14 You should use |
when you are entering the command directly, and escape it like this \|
if you are using it in your config file(for example using as a custom binding), In addition to \|
you may also use <bar>
.
So either do :NERDTreeVCS | NERDTreeClose | NERDTreeFind
or use something like this map <C-f> :NERDTreeVCS \| NERDTreeClose \| NERDTreeFind<CR>
in your .vimrc/init.vim
to bind these commands to <C-f>
(or your preferred short cut)
from nerdtree.
This can be achieved by chaining these commands, Maybe it's not the prettiest approach, But it will do exactly what you want(If I'm not mistaken about your situation)
map <C-f> :NERDTreeVCS \| NERDTreeClose \| NERDTreeFind<CR>
Let me know if it didn't fix your problem, In that case, we can work on something else together.
from nerdtree.
This appears weird on my machine. :NERDTreeVCS \| NERDTreeClose \| NERDTreeFind<CR>
does not work but when commands separately, it works.
:NERDTreeVCS | NERDTreeClose | NERDTreeFind
from nerdtree.
@Hritik14 Have you found this answer to solve your problem? If that's the case I would appreciate it if you go ahead and close your issue.
from nerdtree.
@rzvxa thanks, this seems to work partially with two problems
- Cursor does not switch to NERDTree (https://asciinema.org/a/FHm3cAqoulmYVbZwenZJVAW7J)
- I cannot toggle nerdtree, need to use
q
to quit
I tried solving (1) by adding NERDTreeFocus
but to no avail. Although, the original command, when issued from vim without hotkey focuses NERDTree (https://asciinema.org/a/ueYAkoBDOiCioTPGTI9tmv2vU)
from nerdtree.
@rzvxa thanks, this seems to work partially with two problems
1. Cursor does not switch to NERDTree (https://asciinema.org/a/FHm3cAqoulmYVbZwenZJVAW7J) 2. I cannot toggle nerdtree, need to use `q` to quit
I tried solving (1) by adding
NERDTreeFocus
but to no avail. Although, the original command, when issued from vim without hotkey focuses NERDTree (https://asciinema.org/a/ueYAkoBDOiCioTPGTI9tmv2vU)
that's weird with my setup it works correctly(both get focus and toggle with NERDTreeToggle) would you kindly provide some minimal vim config to reproduce this? try to remove as many lines as possible in your vimrc / init.vim
What is your operating system and what version of Vim / Neovim do you use? Currently, I'm using Neovim as my daily driver so it may be a vim specific issue.
Anything that can help me with narrowing the problem and get it to be reproducible on my machine can help(I can test on both Linux and Windows but I don't have a Mac machine so I can't really help with Macvim)
from nerdtree.
@rzvxa (1)
is working now. I don't know what went wrong earlier. Thanks.
Although, cannot toggle with the same key mapping (ie <C-f>
above). I can use a different hotkey for that or q
. thanks
from nerdtree.
for toggling you can use this:
map <C-f> :if g:NERDTree.IsOpen() \| NERDTreeClose \| else \| NERDTreeVCS \| NERDTreeClose \| NERDTreeFind \| endif<cr>
or you can go the extra mile and do it the "right" way:
function! s:NERDTreeFindVCSToggle() abort
if g:NERDTree.IsOpen()
execute("NERDTreeClose")
else
execute("NERDTreeVCS | NERDTreeClose | NERDTreeFind")
endif
endfunction
command NERDTreeFindVCSToggle call s:NERDTreeFindVCSToggle()
map <C-f> :NERDTreeFindVCSToggle<cr>
from nerdtree.
Related Issues (20)
- Adding change logs for few last merged PRs and create tags for them HOT 10
- How to set the padding width between arrow and the icon HOT 4
- Issue #1368 remote authentication required…. HOT 2
- What's the remap api for nerdtree menu? HOT 2
- Change license to something more standard HOT 3
- Customize key to open quick help menu HOT 3
- Error when loading a vim session: BufLeave NERD_tree_* autocommand: Variable b:NERDTree does not exist HOT 3
- E1208: -complete used without allowing arguments HOT 2
- BUG: NERDTree Hijacked Movement Keys HOT 6
- Installing NERDTree with Vim 9 on Windows 10 HOT 4
- Error detected while processing WinEnter Autocommands for "*"..function <SNR>38_HandleOnlyWindow[13]..<SNR>38_CloseWindow: HOT 1
- Add user choice to follow symlinks or keep them HOT 4
- Installation??? HOT 4
- highlight the current filename in the tree window after following a tag HOT 1
- NERDTree.TreeNotOpen thrown when opening Neovim into NERDTree HOT 4
- Error detected while processing BufEnter Autocommands for "*" with the "Close the tab if NERDTree is the only window remaining in it." config HOT 9
- Error detected while processing function nerdtree#ui_glue#invokeKeyMap[1]..96[18]..95[3]..<SNR>185_openHSplit[1]..125[1]..141[3]..197[6]..198[17]..33: HOT 2
- provider: clipboard: missing required variable g:loaded_clipboard_provider HOT 1
- different files in different tabs with specific nerdtree HOT 1
- How to automatically close tab if nerdtree is the only window in the tab? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerdtree.