Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can hide autogenerated files by TypeScript in NerdTree?

I want to hide the auto generated files (.js .js.map) by Typescript transpiler in NERDTree.

like image 995
Werner Echezuria Avatar asked Mar 27 '16 13:03

Werner Echezuria


3 Answers

Thanks to Hussein Nazzal, I've managed to solve it this way (because I'm using Angular2 there are a couple of steps to be aware):

  • Add an outDir property to tsconfig.json this way:

    {
      "compilerOptions": {
        "target": "es5",
        "module": "system",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false, 
        "outDir": "buildjs/"
      },
      "exclude": [
        "node_modules",
        "typings/main",
        "typings/main.d.ts"
      ]
    }
    
  • Then in .vimrc file add the following:

    let NERDTreeIgnore=['buildjs$']
    
  • Don't forget to modify index.html and add the following line near System.import('buildjs/main'),

    System.import('app/main')`
    
  • add to System.config

    map: {
      app: 'buildjs'
    }
    
like image 124
Werner Echezuria Avatar answered Nov 15 '22 07:11

Werner Echezuria


to hide files use the NERDTreeIgnore

let NERDTreeIgnore = ['\.js$' , '\.js.map$']

the following line should be used in your vimrcfile

like image 25
Hussein Nazzal Avatar answered Nov 15 '22 06:11

Hussein Nazzal


If you type I (uppercase i) in NERDTree you can toggle the visibility of hidden files.

To hide the files by default put this line in your vimrc:

let NERDTreeShowHidden=0
like image 32
Querenker Avatar answered Nov 15 '22 07:11

Querenker