These scripts are not necessarily supported by the NCL team, but we greatly appreciate and encourage these kind of contributions.
If you have an editor enhancement contribution for NCL, please let us know.
[an error occurred while processing this directive]
Example pages containing:
tidbits |
resources |
functions/procedures
These scripts are not necessarily supported by the NCL team, but we greatly appreciate and encourage these kind of contributions.
If you have an editor enhancement contribution for NCL, please let us know.
Functionality includes:
Issues that remain
Controlling your emacs window:
Add and modify the following to your .Xdefaults if desired:
Emacs.geometry: 80x38+250+10
Emacs*background: antique white
Emacs*foreground: black
Emacs.pane.menubar.background: peachpuff
Emacs.menu*.background: peachpuff
Emacs.cursorColor: red3
Emacs.font: 10x20
Emacs.pane.menubar.font: 10x20
Steps
(setq auto-mode-alist (cons '("\.ncl$" . ncl-mode) auto-mode-alist))
; this line associates ncl-mode with the lisp package that defines it.
(autoload 'ncl-mode "~murphys/bin/ncl.el")
; a hook is a list of functions that get executed under certain
; conditions.
(add-hook 'ncl-mode-hook
(lambda () ; lambda is an anonymous function. e.g. has no name.
;;setup display colors for font-lock
(set-face-foreground font-lock-comment-face "FireBrick")
(set-face-foreground font-lock-string-face "Salmon")
(set-face-foreground font-lock-keyword-face "Purple")
; select built-in functions
(set-face-foreground font-lock-function-name-face "Blue")
; gsn* functions
(set-face-foreground font-lock-variable-name-face "SteelBlue")
; shea_util and contributed functions
(set-face-foreground font-lock-reference-face "CadetBlue")
)
)
The following scripts enable NCL syntax highlighting in nedit versions 5.1.0 and higher. The scripts range from a minimalistic approach with few highlighting schemes and few colors, to a more thorough highlighting scheme with many colors. The scripts can be downloaded and, if desired, edited and tested. When ready you can import the file into nedit by typing, for example:
nedit -import ncl.edit
You will only have to import the file once. Go to "Preferences"
and click on "Save Defaults".
Steps
au BufRead,BufNewFile *.ncl set filetype=ncl
au! Syntax newlang source $VIM/ncl.vim
The following was donated by Prince K. Xavier [Laboratoire de Meteorologie Dynamique, France].
I experimented a bit with the VIM to include an auto-completion option for NCL commands. I think I have some good news for those who do not want to remember all the commands or consult the website often while writing a script! I find it particularly useful! Here is what you have to do.
(I took the commands from the ncl syntax file compiled by Arindam Chakraborty. I am not sure how complete this list is, but one can always add entries to this file.)
"Show autocomplete menus. set complete-=k complete+=k " Add dictionary search (as per dictionary option) set wildmode=list:full set wildmenu au BufRead,BufNewFile *.ncl set dictionary=~/.vim/dictionary/ncl.dic
Here is a screenshot of my editor that works great!
This script was contributed by TJ Olney of Western Washington University, for use with John E Davis's JED editor.
JED is a freely available text editor for Unix, VMS, MSDOS, OS/2, BeOS, QNX, and win9X/NT platforms. Although it is a powerful editor designed for use by programmers, its drop-down menu facility make it one of the friendliest text editors around. Hence it is ideal for composing simple email messages as well as editing complex programs in a variety of computer languages.JED makes extensive use of the S-Lang library, which endows it with a powerful S-Lang macro language. This and other features of the library are discussed on the features page.
To incorporate this syntax in your JED environment, add the lines from the ncl.sl to your "defaults.sl" or "jed.rc" (.jedrc) file. The instructions are also in the file.