Vim Screencast Teaser

Aaron just posted a kick ass teaser about using vim. I want the whole series on dvd now.

Toggle Between Tabs & Spaces With Ease

Ever get yelled at for using tabs instead of spaces or spaces instead of tabs?  Here’s your cure it toggles the text editor settings in visual studio for you.

Public Sub ToggleTabsAndSpaces()
 Dim keys As String() = { _
  "Basic", _
  "C/C++", _
  "CSharp", _
  "CSS", _
  "HTML", _
  "PL/SQL", _
  "PlainText", _
  "T-SQL", _
  "XML"}

 Dim turnTabsOn As Boolean = True
 Dim msg = "Truning Tabs On"

 If DTE.Properties("TextEditor", keys(0)) _
   .Item("InsertTabs").Value = True Then
   turnTabsOn = False
   msg = "Turning Tabs Off"
 End If

 IdeHelper.StatusBar(msg)
 IdeHelper.Output(msg)

 With DTE.Properties("TextEditor", "AllLanguages")
   .Item("TabSize").Value = 2
   .Item("InsertTabs").Value = 2
 End With

 For Each key As String In keys
   DTE.Properties("TextEditor", key) _
   .Item("InsertTabs").Value = turnTabsOn
 Next
End Sub

I mapped mine to Ctrl+Shift+=

If you need to find out what the names of the different editors are you can look them up in the registry.

x64
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\AutomationProperties\TextEditor
x32
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\AutomationProperties\TextEditor
[tag]vs2k8, tip[/tag]

Creating Patches for Subversion from Git

What a dreadful way to spend the last hour I wish it upon no one else. I recently started using Git and git-svn to track some of my projects and I almost completely abandoned it because creating an svn friendly patch that something like TortoiseMerge could apply is impossible. Then I found the git-svn-utils project. It doesn’t look like its active but it does have a script git-svn-diff which is exactly what I was looking for. Unfortunately the script was not handling new files the way subversion, or maybe TortoiseMerge wanted. So I made some pretty bad hacks and came up with this version. It will create a full patch file that can be applied with TSVN.

I am interested to know if I am the only one out there that had this problem or if there is a better solution. Please let me know as I am a total git newb.

Download git-svn-diff

[tag]git, svn[/tag]