Emacs editing mode for Ncar Command Language(NCL).
What's is it?.
ncl-mode is a package for emacs which contains an emacs major mode for NCL and number of other utilities to help write NCL scripts easily.
- Syntax highlighting (including all function in the latest NCL release).
- Proper indentation.
- auto-complete and company-mode support for auto completion.
- inferior ncl mode for running NCL within the Emacs (for testing scripts while writing).
- Proper comment handling.
- Imenu support for code navigation with in the file.
- TAGS file support for code navigation across files (consistent with other Emacs modes).
- Snippets for each NCL function (more than 1300 snippets). You will never need to remember the arguments for any certain function.
- ctags support (ctags generation script included).
- ncl-doc minor mode for browsing/searching NCL documentation from NCAR website (my favorite).
- Menu support (for emacs beginners).
Emacs-24.1 or above.
MELPA (recommended way)
ncl-mode can be installed from MELPA. If you have already set melpa in your
sources. Just do
M-x package-install RET ncl-mode RET
If you use
el-get, then just do
M-x el-get-install ncl-mode
Download the package from the latest release from here
unzip/untar put some where in your path (optionally rename it to ncl-mode)
put the following your
(load "/path/to/downloaded/ncl-mode/ncl-mode.el") (load "/path/to/downloaded/ncl-mode/ncl-doc.el") (load "/path/to/downloaded/ncl-mode/inf-ncl.el")
Bug & Feature requests
Helps you read NCL documentation for NCAR website.
M-x ncl-doc-query-at-point ( C-c C-s )
This function does few things.
- It prompts for a string/keyword and collects a given string
- It tries to find a URL for the given string
- if it finds URL for the string call the browser to open that URL
- If no URL is found, then goes on to search for the given string.
- Displays all search matches in separate buffer category wise. In that buffer RET in any search match will call browser for take you to that page.
- If no matches found for a given string it leaves you there
M-x ncl-doc-query-open ( C-c C-o )
Use this function you lets you choose from the all keywords ncl-doc has in its database and takes you to documentation page of that keyword.
To get an idea what ncl-doc does: here I loaded the ncl-doc.el then called the function "ncl-doc-query-at-point" and given "add" string.
Which lets you run NCL within Emacs and interact NCL process from ncl-mode buffer. auto-complete support is also available for this mode.
One linper to generate ctags from NCL Source files (look into tools directory); uses USAGE:
if no arguments supplied it searches for ncl files in current directory including sub directories
M-x customize-group RET ncl-doc RET check out the following variables
- `ncl-doc-url-base' = defaults to "http://www.ncl.ucar.edu" you can change this to any folder if you have downloaded the documentation from the NCL website and want read offline.
(setq ncl-doc-url-base "file:///home/yagnesh/docs/ncl/")
Tip from NCL website FAQ:
Is there a way I can download the NCL website documentation so I can access it locally on my machine? TJ Onley pointed out this nice solution. For example, if you just want to download the files under http://www.ncl.ucar.edu/Document, use:
wget -r -l0 -p -np -nH -k http://www.ncl.ucar.edu/Document/ This will create a directory called "Document", and in that directory, you can open the "index.shtml" file with your web browser and have access to all the files locally.
See todo.org file.
NOTE: Please don't confuse this package with the old less featured another mode written by NCAR people.