Hi Carl,
There is an emacs lisp script that, among other things, indents NCL-scripts at,
http://www.ncl.ucar.edu/Applications/Files/ncl.el,
You can use it from vim by running emacs batch-mode as an external command. In my setup I run ':!indentfile %' where indentfile is,
$ cat ~/bin/indentfile
#!/bin/bash
emacs -batch $1 -l ~/bin/emacs-format-file -l ~/.emacs.d/ncl.el -f emacs-format-function-ncl
and
$cat ~/bin/emacs-format-file
(defun emacs-format-function-ncl ()
"Format the whole buffer."
(ncl-mode)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))
(save-buffer)
)
If anyone has a native vim solution I'd be interested as well...
/Martin
-- Martin Evaldsson, PhD SMHI / Swedish Meteorological and Hydrological Institute, SE-601 76 Norrköping, www.smhi.se E-post/E-mail: Martin.Evaldsson@smhi.se Besöksadress/Street address: Folkborgsvägen 1 Tel: +46-11-495 8068 Fax: +46-11-495 8001 > > Hi Daran, > > Thanks for your comments. Maybe you know more about vim syntax files > than I > do--this is the first time I've worked with one. Do you know how to get vim > to automatically indent within blocks (e.g., ifs, do loops, etc)? > > Right now, it automatically indents as in the previous line, and it does > some special indentation for lines extend by "\", but that's it. > > What I want: > if (x.eq.0) then > print(x) > end if > > What I have: > if (x.eq.0) then > print(x) > end if > > Thanks! > Carl _______________________________________________ ncl-talk mailing list List instructions, subscriber options, unsubscribe: http://mailman.ucar.edu/mailman/listinfo/ncl-talkReceived on Wed Aug 29 14:46:00 2012
This archive was generated by hypermail 2.1.8 : Mon Jan 14 2013 - 14:31:38 MST