Skip to content

Instantly share code, notes, and snippets.

colo solarized
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" First, clear all autocommands, in case this file is sourced twice
autocmd!
" Pathogen, front and center
call pathogen#infect()
" Check for mac, which is unix + uname returns "Darwin"
let s:system = "unknown"
if has("unix")
let s:uname = system("uname")
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Git completion, from git/contrib/completion
source ~/.git-completion.bash
EDITOR="vim"
VISUAL="vim"
# vim for everything!
EDITOR="vim"
VISUAL="vim"
# Make vim use tabs, please.
alias vim="vim -p"
# Yup, definitely worked at Google.
alias blaze='bazel'
[Export(typeof(ITaggerProvider))]
[TagType(typeof(SquiggleTag))] // this will probably be "IErrorTag" in the next release
[ContentType("text")] // "text" is the base of basically all content types
internal sealed class ToDoTaggerProvider : ITaggerProvider
{
// Note: the "context" arg has been removed, but is still there in Beta 1
public ITagger<T> GetTagger<T>(ITextBuffer buffer, IEnvironment context) where T : ITag
{
return new ToDoTagger() as ITagger<T>;
}
internal sealed class ToDoTagger : ITagger<SquiggleTag>
{
// Our simple tagger can ignore this for now
public Event<SnapshotSpanChangedArgs> TagsChanged;
public IEnumerable<ITagSpan<SquiggleTag>> GetTags(NormalizedSnapshotSpanCollection spans)
{
foreach(SnapshotSpan span in spans)
{
string spanText = span.GetText();
[Export(typeof(ITaggerProvider))]
[TagType(typeof(SquiggleTag))] // this will probably be "IErrorTag" in the next release
[ContentType("text")] // "text" is the base of basically all content types
internal sealed class ToDoTaggerProvider : ITaggerProvider
{
// Note: the "context" arg has been removed, but is still there in Beta 1
public ITagger<T> GetTagger<T>(ITextBuffer buffer, IEnvironment context) where T : ITag
{
return new ToDoTagger() as ITagger<T>;
}
// starting with a SnapshotPoint, text line, or SnapshotSpan
SnapshotPoint point;
ITextSnapshotLine line = point.GetContainingLine();
SnapshotSpan extent = line.Extent;
SnapshotPoint start;
for (start = extent.Start; start < line.End && char.IsWhitespace(start.GetChar()); start++);
SnapshotSpan extentExcludingLeadingWhitespace = new SnapshotPoint(start, extent.End);
// Make the background goldenrod yellow :)
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
internal sealed class CreationListener : IWpfTextViewCreationListener
{
public void TextViewCreated(IWpfTextView textView, IEnvironment context)
{
textView.Background = Brushes.PaleGoldenrod;
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Utilities;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Outlining;
using System.Windows.Input;
using Microsoft.VisualStudio.Text;
namespace CollapseAllButThis
{
[Export(typeof(IKeyProcessorProvider))]