3c8abfb75136dcdf26d52060c10e2946974beff6
[nit.git] / misc / README.md
1 # gtksourceview (gedit and other GTK editors)
2 To install in your home, just link (or copy) the language definition file in ~/.local/share/gtksourceview-2.0/language-specs
3
4 # syntaxhighlighter
5
6 Nit brush for the Alex Gorbatchev's JS syntaxhighlighter.
7
8 To install the JS syntaxhighlighter, please refer to http://alexgorbatchev.com/SyntaxHighlighter/
9
10 Then can add the brush to your html page:
11
12         <script type="text/javascript" src="shBrushNit.js"></script>
13
14 # Vim
15
16 Vim is a powerful text editor and a favorite of the Nit team.
17 The `misc/vim` directory provides Vim support for Nit source files.
18
19 ### Install
20
21 The simpler way to install nit for vim is with [pathogen][1].
22
23     cd ~/.vim/bundle
24     ln -s /full/path/to/nit/misc/vim nit
25
26 Ensure that `~/.vimrc` contains
27
28     call pathogen#infect()
29     syntax on
30     filetype plugin indent on
31
32   [1]: https://github.com/tpope/vim-pathogen
33
34 ### Features
35
36  * Syntax highlighting
37  * Automatic indentation
38  * Syntax checker (require [Syntastic][2]).
39  * Autocomplete for whole projects using module importations
40
41   [2]: https://github.com/scrooloose/syntastic
42
43 ### Autocomplete
44
45 The Nit plugin offers better autocomplete by scanning all projects in the
46 current directory, and their dependencies.
47
48 Add the following code to `~/.vimrc`, then use `ctrl-n` to open the
49 autocomplete popup.
50
51 ~~~
52 " Compute Nit module dependencies for autocomplete on loading our first Nit module
53 autocmd Filetype nit call NitComplete()
54
55 " Map reloading Nit module dependencies to F2
56 map <F2> :call ForceNitComplete()<enter>
57 ~~~
58
59 The plugin is compatible with, and optimized for, [AutoComplPop][3].
60
61 Look at the functions defined in `misc/vim/plugin/nit.vim` for all possible
62 usages.
63
64   [3]: http://www.vim.org/scripts/script.php?script_id=1879