Skip to content

Commit 170d37b

Browse files
authored
Merge pull request #78 from gekkowrld/vi
Add vim syntax highlighting
2 parents 9c317d5 + db8033a commit 170d37b

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

extensions/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@
22

33
## [VSCODE](./vscode/)
44

5-
Nuru syntax highlighting on VSCode
5+
Nuru syntax highlighting on VSCode
6+
7+
## [VIM](./vim)
8+
9+
The file contained herein has a basic syntax highlight for vim.
10+
The file should be saved in `$HOME/.vim/syntax/nuru.vim`.
11+
You should add the following line to your `.vimrc` or the appropriate location:
12+
13+
```vim
14+
au BufRead,BufNewFile *.nr set filetype=nuru
15+
```
16+
17+
Only basic syntax highlighting is provided by the script.

extensions/vim/syntax/nuru.vim

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
" Sintaksia ya nuru kwenye programu ya "vim"
2+
" Lugha: Nuru
3+
4+
" Maneno tengwa
5+
syntax keyword nuruKeyword unda pakeji rudisha vunja endelea tupu
6+
syntax keyword nuruType fanya
7+
syntax keyword nuruBool kweli sikweli
8+
syntax keyword nuruConditional kama sivyo au
9+
syntax match nuruComparision /[!\|<>]/
10+
syntax keyword nuruLoop ktk while badili
11+
syntax keyword nuruLabel ikiwa kawaida
12+
13+
" Nambari
14+
syntax match nuruInt '[+-]\d\+' contained display
15+
syntax match nuruFloat '[+-]\d+\.\d*' contained display
16+
17+
" Viendeshaji
18+
syntax match nuruAssignment '='
19+
syntax match nuruLogicalOP /[\&!|]/
20+
21+
" Vitendakazi
22+
syntax keyword nuruFunction andika aina jaza fungua
23+
24+
" Tungo
25+
syntax region nuruString start=/"/ skip=/\\"/ end=/"/
26+
syntax region nuruString start=/'/ skip=/\\'/ end=/'/
27+
28+
" Maoni
29+
syntax match nuruComment "//.*"
30+
syntax region nuruComment start="/\*" end="\*/"
31+
32+
" Fafanua sintaksia
33+
let b:current_syntax = "nuru"
34+
35+
highlight def link nuruComment Comment
36+
highlight def link nuruBool Boolean
37+
highlight def link nuruFunction Function
38+
highlight def link nuruComparision Conditional
39+
highlight def link nuruConditional Conditional
40+
highlight def link nuruKeyword Keyword
41+
highlight def link nuruString String
42+
highlight def link nuruVariable Identifier
43+
highlight def link nuruLoop Repeat
44+
highlight def link nuruInt Number
45+
highlight def link nuruFloat Float
46+
highlight def link nuruAssignment Operator
47+
highlight def link nuruLogicalOP Operator
48+
highlight def link nuruAriOP Operator
49+
highlight def link nuruType Type
50+
highlight def link nuruLabel Label
51+

0 commit comments

Comments
 (0)