Being the keyboard kind of guy that I am, I’ve totally gotten back into the Vim editor. I had used it years ago, and discovered it again recently when I was looking for a text editor for some Ruby code I was writing.
It’s one of those power tools that most people, myself included, really didn’t like very much the first time you use it. But then you achieve a certain level of proficiency and you can slice and dice any text you have to edit so quickly that you become very spoiled.
I also have switched to using a black background. I found a great dark color scheme for Vim called Moria, that I would highly recommend. It’s a very readable, easy on the eyes scheme, that just seems right to me. I’ve posted an image of my setup using the abbrev.rb file from Ruby 1.8.5.
If you like using keyboard shortcuts, you owe it to yourself to try the Vim text editor. It does take some time to get used to a modal editor, but if you are going to be editing lots of text, it’s time well spent.
I still really like the text editor built into Visual Studio and will continue to post any tips and keyboard shortcuts that I find useful there too.
I had previously blogged about finding some good tutorials on how to get started. I’ve been using the WinDBG debugger a little bit more lately and I’ve put together a “cheat sheet” that I use for the most common commands and I thought I would share them. Almost all of these commands are specific to the SOS extension to debug .NET code.
If you are a seasoned WinDBG user, you’ll know all of these command by heart, but if you are just getting started this might help. The first thing to do is run, don’t walk to setup your “Symbol Search Path” setting. Enter CTRL+S from inside WinDBG, mine looks like this:
You can find out more about it in this Microsoft support article.
The WinDBG command line has TAB completion, so when you type the first few characters of a command, hit TAB to cycle through the possible completions.
I have picked up the majority of these tips by reading some of the great blogs on MSDN. If you are interested in learning a lot more about WinDBG and how to debug some very difficult problems you need to subscribe to Tess’s blog right away!
If you know of any other tips or helpful WinDBG command, please post them in the comments and I’ll add them to the list.
|.loadby sos mscorwks
||Loads the correct version of the SOS(.NET) extension dll based on the version of mscorwks currently loaded
||View the currently loaded extensions
||Opens the help file for the specified command. For example: .hh ~
||Displays help for extensions, including for SOS a list of commands
||Displays help for the specified extension command. For example: !help clrstack
||Clears the sceen
||List all threads
||List managed threads
||Set current thread, where # is a thread number, for example: ~3 s
||Display the CLR stack
||Display the CLR stack with parameters
||Display the stack frame for the native thread
||Dump objects on the stack
||Dump managed object
||Display the contents of memory as DWORDS and ASCII chars
||Dumps the contents of the managed heap
||Display stat summary of managed heap
||Dumps the MethodTable of the specified address
|!dumpmt -md address
||Dumps the MethodTable of the specified address and displays a list of all the methods on the object
||Displays the EEClass for the specified address
||Display the details of the object at the specified address
||Runs !DumpStack on all threads
||Displays all System.RuntimeType object from the managed heap
||Displays thread time statistics
||Displays System Uptime, Process Uptime, Kernel Time and User Time
||Displays synchronization lock info
||Displays objects locked with thinlocks instead of syncblk’s
|!dumpheap -type System.String -stat
||Displays count and total size of the specified type (in this case System.String) on the heap
||Display virtual memory stats, load addresses and reserve/commit info
||Display just the summary virtual memory info
||Display garbage collector generation info
||Print exception details
||Display callstacks for all threads
||Display stats and contents of the finalizer queue
I was able to get Fedora Core 6 running very well on Microsoft’s Virtual PC 2007 with just two small tweeks. The main problem is the emulated S3 video card doesn’t support 24 bpp mode, whereas the actual hardware card does! I wish I could find the blog or newsgroup post that I found that originally pointed this out so I could give credit to whoever figured this out — thanks! If you know please contact me and I’ll update the blog post.
Here’s all that i had to do:
- Run the install in text mode. You do this by entering “linux text” without the quotes at the initial prompt.
- When Fedora boots:
- vi /etc/X11/xorg.conf
- In normal mode: type /DefaultDepth — which if you are not familiar with vi, just means search for the string “DefaultDepth”
- Change 24 to 16
- :wq to save and exit vi
- Enter “startx” without the quotes at the terminal to start X.
That’s all you should need to do!
I found a plugin for VIM that was designed just for Rails coding by Tim Pope. I thought the first line of the documentation was great
“TextMate may be the latest craze for developing Ruby on Rails applications,
but Vim is forever.”
- quick navigation commands from model to view and controller
- rake integration
- extends ‘gf’ command to understand Rails
- CTRL+X, CTRL+U autocompletion
- interface to the script commands
- convenient log file viewing