Geek Noise
Rants, rambles, news and notes by Peter Provost
22

Updated PowerShell Syntax File for vim

Monday, 22 September 2008 05:50 by Peter Provost

Thanks to Heath Stewart for sending in some nice updates to the vim syntax file for PowerShell.

Changes in v2.7:

  1. Added begin, process, and end keywords for script blocks
  2. Make foreach and where highlight when used as foreach-object and where-object

The new version is up and available here: http://www.vim.org/scripts/script.php?script_id=1327

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (2) | Comment RSSRSS comment feed
08

Tabs in Vim - How did I miss this?

Thursday, 8 November 2007 02:34 by Peter Provost

Yesterday John Lam did a keynote for the P&P Summit where he talked about the DLR, Ruby, Dynamic Languages and all that goodness. John is a smart, fun, engaging speaker and it was a great talk.

At the end of it I found myself wanting to run up on stage with everyone else to ask my question. But I decided against it. Because my question was WAAAAY off topic.

"How did you get those Tabs in your GVim widow???"

I figured with a bit of Googling I could find the answer and I did. It turns out that since Vim 7.0, there have been tabs you just don't see them unless you ask for them.

Rather than rehash all the details, I'll just point you to this excellent article on linux.com by Joe 'Zonker' Brockmeier:

http://www.linux.com/articles/59533

Happy vimming! :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
31

PowerShell Syntax File for Vim

Monday, 31 July 2006 08:02 by Peter Provost

After finally getting my machine setup back in order after and during the Agile 2006 conference, I realized that I hadn't updated my Monad/MSH syntax file to support PowerShell (ps1).

The updates are done and I have uploaded the file to vim.org. FWIW, the changes are almost none... just a replace of "msh" with "ps1" and all is well. After I use it some more, I will update it as needed.

I will post some LUA-friendly installation instructions shortly, but for now you can use my old instructions (not-LUA friendly).

Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (1) | Comment RSSRSS comment feed
21

Updated VIM syntax file for MSH

Wednesday, 21 December 2005 02:46 by Peter Provost

I have revved the Monad/MSH syntax file for VIM to version 2.0. This version has lots of updates and comments provided by Jared Parsons.

If you are using the old one, you may want to take a look at this new one.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
12

Updated MSH Syntax Highlighting For VIM

Friday, 12 August 2005 03:06 by Peter Provost

 

After posting my VIM MSH syntax file on the internal Monad discussion list, I got a great reply from Tommy Williams who obviously knows more about how to tweak VIM than I do. Tommy showed me the right way to add a custom syntax file to your VIM setup without potentially screwing up your upgradability. He also added support for comments, which in itself is worth the update. Thanks Tommy!

Here is the new msh.vim file. If you followed my previous instructions, then begin by undoing all of it.  Then download this new msh.vim file and follow Tommy's instructions:

The best explanation I can find for it in the help files is with :help runtimepath. That shows you the directories and files.

In this case, there are two directories and three files involved:

$VIM\vimfiles\filetype.vim
$VIM\vimfiles\ftplugin\msh.vim
$VIM\vimfiles\syntax\msh.vim

Msh.vim is the file you supplied as monad.vim.

filetype.vim

For me, this is just a series of blocks of the form:

	augroup filetypedetect
	au BufNewFile,BufRead *.<extension>     setf <extension>
	augroup END
	

In the case of MSH:

	augroup filetypedetect
	au BufNewFile,BufRead, *.msh    setf msh
	augroup END
	

ftplugin\msh.vim

This is a file where I set things like indenting, textwidth, etc. for that filetype: things you can’t – or shouldn’t – do in a syntax file. So far it’s just a shell. I’ll tweak it to add more options later, but it should give you a feel for things:

	" Only do this when not done yet for this buffer
	if exists("b:did_ftplugin") | finish | endif
	" Don't load another plug-in for this buffer
	let b:did_ftplugin = 1
	setlocal tw=0
	"setlocal comments=#
	setlocal commentstring=#%s
	setlocal formatoptions=tcqro
	"setlocal iskeyword+=#
	" Change the browse dialog on Win32 to show mainly MSH-related files
	if has("gui_win32")
	let b:browsefilter = "MSH Files (*.msh)\t*.msh\n" .
	\ "All Files (*.*)\t*.*\n"
	endif
	"-------------------------------
	" Undo the stuff we changed.
	let b:undo_ftplugin = "setlocal tw< cms< fo<" .
	\ " | unlet! b:browsefilter"
	" vim: ts=4:tw=0
	

And, of course, the syntax\msh.vim file is the one you made.

Now playing: AC/DC - Rocker

UPDATE 2005-08-12: Posted it to the vim.org scripts section.
UPDATE 2005-08-13: I made a small change to the syntax file that fixed a problem with foreach and while. The current version is 1.2. I will also be re-posting it to the vim.org scripts board.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (1) | Comment RSSRSS comment feed
04

Vim Syntax File For Monad (MSH)

Thursday, 4 August 2005 17:33 by Peter Provost

As you probably know, I'm becoming a Microsoft Command Shell (aka Monad, aka MSH) junkie. I'm also a vim guy, and I was sorely missing syntax highlighting for my MSH files in my general purpose text editor.

So I wrote one. Here is it.. in all its glory. This is my first ever syntax file for Vim, so I'm sure it could be improved. Send me any improvements you make, and I'll update it.

To use this file, first save it to the same directory as your other syntax files (C:\Program Files\Vim\vim63\syntax on my system). Then edit your _vimrc file (in your profile directory) and add the following lines to the bottom:

au BufRead,BufNewFile *.msh set filetype=monad
au! Syntax monad source $VIMRUNTIME\syntax\monad.vim

The next time you open a .MSH file, you should see colors. Woo hoo! (I'm sure Hanselman has already done one for Notepad2, but I don't use that. )

UPDATE: Apparently the link was broken. I turned it into a ZIP and now it works.

UPDATE: This post is obsolete. Please see this post for an updated version and some better instructions.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed