GithubHelp home page GithubHelp logo

zheguzai / nerdtree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from preservim/nerdtree

0.0 1.0 0.0 1.49 MB

A tree explorer plugin for vim.

License: Do What The F*ck You Want To Public License

Vim Script 100.00%

nerdtree's Introduction

The NERDTree

Introduction

The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.

This plugin can also be extended with custom mappings using a special API. The details of this API and of other NERDTree features are described in the included documentation.

NERDTree Screenshot

Installation

git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree

Then reload Vim, run :helptags ~/.vim/bundle/nerdtree/doc/ or :Helptags, and check out :help NERDTree.txt.

apt-vim install -y https://github.com/scrooloose/nerdtree.git

F.A.Q.

Is there any support for git flags?

Yes, install nerdtree-git-plugin.


Can I have the nerdtree on every tab automatically?

Nope. If this is something you want then chances are you aren't using tabs and buffers as they were intended to be used. Read this http://stackoverflow.com/questions/102384/using-vims-tabs-like-buffers

If you are interested in this behaviour then consider vim-nerdtree-tabs


How can I open a NERDTree automatically when vim starts up?

Stick this in your vimrc: autocmd vimenter * NERDTree


How can I open a NERDTree automatically when vim starts up if no files were specified?

Stick this in your vimrc:

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

Note: Now start vim with plain vim, not vim .


How can I open NERDTree automatically when vim starts up on opening a directory?

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif

This window is tab-specific, meaning it's used by all windows in the tab. This trick also prevents NERDTree from hiding when first selecting a file.

Note: Executing vim ~/some-directory will open NERDTree and a new edit window. exe 'cd '.argv()[0] sets the pwd of the new edit window to ~/some-directory


How can I map a specific key or shortcut to open NERDTree?

Stick this in your vimrc to open NERDTree with Ctrl+n (you can set whatever key you want):

map <C-n> :NERDTreeToggle<CR>

How can I close vim if the only window left open is a NERDTree?

Stick this in your vimrc:

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

Can I have different highlighting for different file extensions?

See here: preservim#433 (comment)


How can I change default arrows?

Use these variables in your vimrc. Note that below are default arrow symbols

let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'

nerdtree's People

Contributors

scrooloose avatar philrunninger avatar lifecrisis avatar camthompson avatar cperl82 avatar xuyuanp avatar ggicci avatar skyblueee avatar pendulm avatar mnussbaum avatar vincenttsf avatar weynhamz avatar ku1ik avatar juanibiapina avatar pickrelated avatar wincent avatar actionshrimp avatar bubba-h57 avatar andrewradev avatar skylerlipthay avatar czak avatar andreykozlov1984 avatar stevedewald avatar jason0x43 avatar inecas avatar wgfm avatar twinside avatar trkoch avatar thenigan avatar terryding77 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.