vim is a very powerful editor, and when used with NERDTree, you can easily open files, search for files, etc. However, files cannot be created or deleted, which is somewhat inconvenient.
vim has a simple command line function and can perform touch/rm operations.
Is there a way that when NERDTreeC
goes to a certain directory, the vim terminal can also automatically cd
to the directory, so that when using the vim command line to create and delete files, it will not Need to write a long path
Thank you everyone for your answers, it made me realize that I asked such a SB
question
-_-
= =
Sir, do you know that in command mode, add in front of! Can execute shell commands
For example:! mkdir www to create a new folder.
! rm to delete the file
Of course, if you use Windows, just pretend I didn’t say anything
vim is a very powerful editor. When used with NERDTree, you can easily open files, search for files, etc. However, files cannot be created or deleted, which is somewhat inconvenient.
1. Create a new file. Isn’t it equivalent to creating a new file by adding a file name suffix in vim and saving it? Or as someone above said:!touch, but this is a command to call the operating system. Linux has it, but I don’t know about windows. Deleting files is similar
vim has a simple command line function and can perform touch/rm operations.
Is there a way that when NERDTreeC goes to a certain directory, the vim terminal can also automatically cd to the directory, so that when using the vim command line to create and delete files, there is no need to write a long path
2. Does NerdTree have this function? See the help information given above
Give you a simple cheatsheet
https://gist.github.com/ldong/f05bbae89079f52cca0e
C-x, C-f
Incorrect, m reported an error
And the NERDTree created with the command is not updated in real time
https://github.com/tpope/vim-eunuch
Windows users can tell you that it can also be used in gvim! Add cmd command to operate the file, but the cmd window will pop up during the command execution...
By the way, after using commands to operate files, NERDTree cannot automatically refresh the directory...
Newcomers would like to add: NERDTree cannot automatically refresh the directory...you can use shift+R to refresh manually.
Also, just read the answer given on the 1st floor carefully. After the cursor points to the file, press m and four file operations will appear. At this time, you can create, delete, copy and other operations.