]> git.rmz.io Git - dotfiles.git/blobdiff - vim/indent/roslaunch.vim
vim: add syntax and indent files for ros
[dotfiles.git] / vim / indent / roslaunch.vim
diff --git a/vim/indent/roslaunch.vim b/vim/indent/roslaunch.vim
new file mode 100644 (file)
index 0000000..6a4393b
--- /dev/null
@@ -0,0 +1,31 @@
+
+" Use XML indentation rules
+
+if exists("b:did_indent")
+  finish
+endif
+
+" load the XML indent rules
+runtime! indent/xml.vim
+runtime! indent/yaml.vim
+
+" override the vim indent expression (we'll call it ourselves)
+setlocal indentexpr=GetRoslaunchIndent(v:lnum)
+
+" Only define the function once.
+if exists("*GetRoslaunchIndent")
+  finish
+endif
+
+" wiki-indent will return vim indent inside a <pre> block,
+" and return -1 if not inside a block to trigger auto-indent
+function GetRoslaunchIndent(lnum)
+  return -1
+  if searchpair('<rosparam>','','</rosparam>','bWnm') > 0
+    return GetYAMLIndent(lnum)
+  else
+    return -1
+  endif
+endfunc
+
+