Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim style folding for CSS/javascript in Visual Studio

Tags:

Is anyone aware of a way to have VIM style folding in Visual Studio? I use #region blocks in c# class files and they're great, but unfortunately there's no equivalent functionality for javascript and css. The site/app I'm currently working on has a rather lot of css selectors and javascript and navigating the monolithic files is becoming difficult.

One option that we've considered is breaking up the css and javascript into separate files similiar to jquery modules, but then that introduces performance problems in terms of increasing the overall number of http requests.

If anyone has any suggestions for managing the madness, I'd be greatly appreciative!

Update: Richard Kimber suggests using the bookmarking features of visual studio to make navigating by headings more manageable. This is a step in the right direction, but not as useful as code folding/blocking.

like image 490
Bayard Randel Avatar asked Mar 16 '09 23:03

Bayard Randel


1 Answers

I found a Microsoft extension that improved the JavaScript text editor for Visual Studio 2010.

http://visualstudiogallery.msdn.microsoft.com/en-us/872d27ee-38c7-4a97-98dc-0d8a431cc2ed

I have used it, and it gives all of the following for JavaScript files:

  • Brace Matching
  • Outlining / Code-folding
  • Current Word Highlighting
  • IntelliSense Doc-Comments Support
like image 102
Brian Grinstead Avatar answered Sep 30 '22 19:09

Brian Grinstead