iffy nim support

Sun, 24 May 2020 03:30:05 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 24 May 2020 03:30:05 -0500
changeset 870
b91d44fd967d
parent 869
9b6eec375e56
child 871
cea35eb3af74

iffy nim support

.ctags file | annotate | diff | comparison | revisions
.vim/plugin/tagbar-types.vim file | annotate | diff | comparison | revisions
--- a/.ctags
+++ b/.ctags
@@ -20,3 +20,16 @@
 --regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m,modules,modules (defmodule ...)/
 --regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p,protocols,protocols (defprotocol...)/
 --regex-Elixir=/^[ \t]*Record\.defrecord[ \t]+:([a-zA-Z0-9_]+)/\1/r,records,records (defrecord...)/
+
+--langdef=nim
+--langmap=nim:.nim
+--regex-nim=/(\S+)\*?\s*=\s*(ref\s+)?object/\1/c,class/
+--regex-nim=/(\w+)\*?\s*=\s*enum/\1/e,enum/
+--regex-nim=/(\S+)\*?\s*=\s*tuple/\1/t,tuple/
+--regex-nim=/(\w+)\*?\s*=\s*range/\1/r,subrange/
+--regex-nim=/(\w+)\*?\s*=\s*proc/\1/P,proctype/
+--regex-nim=/proc\s+(\w+)/\1/p,procedure/
+--regex-nim=/method\s+(\w+)/\1/m,method/
+--regex-nim=/proc\s+`([^`]+)`/\1/o,operator/
+--regex-nim=/template\s+(\w+)/\1/T,template/
+--regex-nim=/macro\s+(\w+)/\1/M,macro/
--- a/.vim/plugin/tagbar-types.vim
+++ b/.vim/plugin/tagbar-types.vim
@@ -64,3 +64,19 @@ let g:tagbar_type_go = {
 	\ 'ctagsbin'  : 'gotags',
 	\ 'ctagsargs' : '-sort -silent'
 \ }
+
+let g:tagbar_type_nim = {
+    \ 'ctagstype': 'nim',
+    \ 'kinds' : [
+        \'c:classes',
+        \'e:enums',
+        \'t:tuples',
+        \'r:subranges',
+        \'P:proctypes',
+        \'p:procedures',
+        \'m:methods',
+        \'o:operators',
+        \'T:templates',
+        \'M:macros'
+    \ ]
+\}

mercurial