明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 710|回复: 0

A guide-line for Visual Studio

[复制链接]
发表于 2011-6-17 12:46 | 显示全部楼层 |阅读模式
作者:kean
原文地址:http://through-the-interface.typepad.com/through_the_interface/2011/06/a-guide-line-for-visual-studio.html

And yes, I do mean that literally. :-)
Since starting this blog, 5 years ago – and even more in the last 2 years, since starting to develop and edit our Plugins of the Month for Autodesk Labs – I’ve been checking every line of code I’ve written to make sure it doesn’t exceed 70 characters in length (the magic number for fitting my blog’s width). It’s become close to automatic – in the sense I rarely write lines that exceed this length and therefore need adjusting – but the process I use is still quite manual: I check the status bar in Visual Studio to get the column count of the cursor position.
Augusto Gonçalves, from our DevTech team in Brazil, pointed out a nifty technique to add a guide-line (hence the post’s title) to Visual Studio at a certain column width. Here’s the Registry information (which can be saved to a .reg and merged with your Registry) that will do this for Visual Studio 2008:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor]
"Guides"="RGB(128,0,0) 70"

Just changing the Registry information to 10.0 instead of 9.0 didn’t just make it work for Visual Studio 2010 on my system, despite information to the contrary on StackOverflow. But Daniel Du, from DevTech China, did point me to a handy Visual Studio extension (which comes in two parts and is described in this  blog post).
After installing the two extensi**, it was possible for me to add a guideline at a particular column width by placing the cursor at the desired width, right-clicking and selecting “Add guideline”:

Which leads to our guideline being displayed (with the selected colour):

Interestingly, looking at the Registry the extension is actually modifying the entry that didn’t seem to have an effect when entered via the .reg file, so I assume there’s an additional entry I was missing. But anyway – the end result is what’s important, and this will save me a lot of effort. And hopefully some of you, too. :-)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
"觉得好,就打赏"
还没有人打赏,支持一下

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-4 05:43 , Processed in 0.220061 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表