]> git.rmz.io Git - dotfiles.git/commitdiff
vim: some ros specific ft and settings
authorSamir Benmendil <samir.benmendil@gmail.com>
Thu, 4 Dec 2014 20:43:23 +0000 (20:43 +0000)
committerSamir Benmendil <samir.benmendil@gmail.com>
Thu, 4 Dec 2014 20:43:23 +0000 (20:43 +0000)
vim/filetype.vim
vim/ftplugin/roscpp.vim [new file with mode: 0644]
vim/ftplugin/roslaunch.vim
vim/ftplugin/rospackage.vim [new file with mode: 0644]
vim/indent/cpp.vim
vim/indent/roscpp.vim [new file with mode: 0644]
vim/indent/rospackage.vim [new file with mode: 0644]
vim/syntax/rospackage.vim [new file with mode: 0644]
vim/ultisnips/roscpp.snippets [new file with mode: 0644]
vim/ultisnips/rospackage.snippets [new file with mode: 0644]

index ade77b054499c02b9e42a69bb6a3598ecf5f062a..e62ec35ea746c4c739607fe2a3e8d5a475d82e6b 100644 (file)
@@ -5,3 +5,9 @@ augroup filetypedetect
     autocmd! BufNewFile,BufRead *.launch  setfiletype roslaunch
     autocmd! BufNewFile,BufRead PKGBUILD* setfiletype PKGBUILD
 augroup END
+
+augroup ft_ros
+    autocmd! BufNewFile,BufRead */ros/*.cpp setfiletype cpp.roscpp
+    autocmd! BufNewFile,BufRead */ros/*.h   setfiletype cpp.roscpp
+    autocmd! BufNewFile,BufRead package.xml setfiletype rospackage
+augroup END
diff --git a/vim/ftplugin/roscpp.vim b/vim/ftplugin/roscpp.vim
new file mode 100644 (file)
index 0000000..e69de29
index abba3feaef489a719d6fa16d268485340f9b96db..370119fda3ef71fcc95ef258208a61f0d6f9b9cc 100644 (file)
@@ -1,3 +1,5 @@
+runtime! ftplugin/xml.vim
+
 setlocal expandtab
 setlocal tabstop=2
 setlocal shiftwidth=2
diff --git a/vim/ftplugin/rospackage.vim b/vim/ftplugin/rospackage.vim
new file mode 100644 (file)
index 0000000..795c31d
--- /dev/null
@@ -0,0 +1,6 @@
+runtime! ftplugin/xml.vim
+
+setlocal expandtab
+setlocal tabstop=2
+setlocal shiftwidth=2
+setlocal softtabstop=2
index 5484695731fe034cc01ad4998819dac963d88d16..d764fa43b76b6a524db87d8ebc9ea12e69e83530 100644 (file)
@@ -55,14 +55,14 @@ function! GoogleCppIndent()
     return l:orig_indent
 endfunction
 
-setlocal shiftwidth=2
-setlocal tabstop=2
-setlocal softtabstop=2
+setlocal shiftwidth=4
+setlocal tabstop=4
+setlocal softtabstop=4
 setlocal expandtab
 setlocal textwidth=80
 
 setlocal cindent
-setlocal cinoptions=h1,l1,g1,t0,i4,+4,(0,w1,W4
+setlocal cinoptions=l1,g0,t0,i4,+4,(0,w1,W4
 
 setlocal indentexpr=GoogleCppIndent()
 
diff --git a/vim/indent/roscpp.vim b/vim/indent/roscpp.vim
new file mode 100644 (file)
index 0000000..5e33d4a
--- /dev/null
@@ -0,0 +1,3 @@
+setlocal shiftwidth=2
+setlocal tabstop=2
+setlocal softtabstop=2
diff --git a/vim/indent/rospackage.vim b/vim/indent/rospackage.vim
new file mode 100644 (file)
index 0000000..6b8bf1c
--- /dev/null
@@ -0,0 +1 @@
+runtime! indent/xml.vim
diff --git a/vim/syntax/rospackage.vim b/vim/syntax/rospackage.vim
new file mode 100644 (file)
index 0000000..17d65f9
--- /dev/null
@@ -0,0 +1,5 @@
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/xml.vim
diff --git a/vim/ultisnips/roscpp.snippets b/vim/ultisnips/roscpp.snippets
new file mode 100644 (file)
index 0000000..ea728f2
--- /dev/null
@@ -0,0 +1,3 @@
+priority -49
+extends cpp
+priority -48
diff --git a/vim/ultisnips/rospackage.snippets b/vim/ultisnips/rospackage.snippets
new file mode 100644 (file)
index 0000000..30a61e0
--- /dev/null
@@ -0,0 +1,23 @@
+snippet maintainer "maintainer" b
+<maintainer email="${1:samir.benmendil@gmail.com}">${2:Samir Benmendil}</maintainer>
+endsnippet
+
+snippet author "author me" b
+<author email="${1:samir.benmendil@gmail.com}">${2:Samir Benmendil}</author>
+endsnippet
+
+snippet bd "build_depend" b
+<build_depend>$0</build_depend>
+endsnippet
+
+snippet rd "run_depend" b
+<run_depend>$0</run_depend>
+endsnippet
+
+snippet td "test_depend" b
+<test_depend>$0</test_depend>
+endsnippet
+
+snippet btd "buildtool_depend" b
+<buildtool_depend>$0</buildtool_depend>
+endsnippet