简体   繁体   中英

Vim style folding for CSS/javascript in Visual Studio

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 suggestsusing 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.

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

I know I'm not really helping with this one, but have you heard of ViEmu . It is a, lets say, vim emulation within VS. Although it does not support all of vim's features, it does bring a flavor of it to VS navigation. I haven't used it myself, but others talk pretty good of it, so you might want to give it a shot.

I am currently using JScript Editor Extensions as Brian Grinstead suggested. If it supports region folding, I haven't figured out how. It does support function folding in JavaScript.

There are also JSEnhancements and JSOutlining . Haven't tried either of those though.

This issue is a partial duplicate of this and this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM