📜 ⬆️ ⬇️

NERDTree: add / delete files / folders in the console vim

One foot on the dark side


Recently, I began to experience discomfort using vim on a new project. Frequent adding and deleting files / folders in a rapidly developing project has become a bit tiring. Therefore, being a man of a very weakly weak character, I decided that vim was not for me and began to “search” for happiness in the camp of the enemy ...


Dark side


Forgive me, emacs-community, but damn what kind of trained fingers you need to have to play emacs-chords without hesitation. Although this is not the main reason for my return to the camp of the conditionally "light" side of power, however, it turned out to be decisive ... From the words of my manipulator-employee, even an actively emacs-loving customer, being a very pragmatic person, complained to him that they vim did not get tired anymore. And there, on the little things, on the little things, my decision to return was accumulated

Return of the Jedi


Having broken the manual build of vim on my mac at lunchtime, I tried in every possible way to remember the configure options that compile vim with all the options I needed for my plugin (the + clientserver option needed for the ruby_debug plugin was the stumbling block)
Having remembered the magic set of options, I nevertheless collected vim by restoring my lunch balance of forces on my mac ... Although by that time I was in a firm decision to stay with vim forever, my problem with creating / deleting files / directories was not solved. I did it either using something like:! Mkdir or:! Touch - it was tiring.
Whether generally long how long, and came across directly github-ovsky nerdtree repository .
Immediately attracted the attention of the nerdtree_plugin / folder - there are two plug-ins that add additional menus in graphic mode, and specifically fs_menu.vim adds menu items with the addition / deletion of nodes cherished for me. Adds nodes directly to the NERDTreeAddNode function, and deletes the NERDTreeDeleteNode, respectively ...
Everything is just super, but I, by my conservatism, use exclusively console vim: (It turns out that this joy has bypassed me: (But no ...
')

May the force be with us


Having climbed a bit of plugin / NERD_tree.vim there, I somehow guessed that there is now a Public API in which there is an excellent NERDTreeAddKeyMap method. And what do you think? This method allows you to work wonders with the NERDTree panel. At the entrance, it takes a dictionary of the form:
{'key':'< >' ,
'quickhelpText': '< NERDTree>',
'callback': '< key>'}

Well, then I think even the most lazy padovan knows what to do ...

Source: https://habr.com/ru/post/82800/


All Articles