summaryrefslogtreecommitdiffstats
path: root/ftplugin/vala.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-12-07 12:21:37 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2019-12-07 12:21:37 +0100
commit7a0f2d974f9ac5bc85607e8c769d3370dd18ac74 (patch)
tree5c2b955af8e0f2ed54442d9e938fad403148ffce /ftplugin/vala.vim
parent15aeea662e0b08088ac7b6e3ee661c834e69106a (diff)
downloadvim-polyglot-4.1.2.tar.gz
vim-polyglot-4.1.2.zip
Updatev4.1.2
Diffstat (limited to 'ftplugin/vala.vim')
-rw-r--r--ftplugin/vala.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/ftplugin/vala.vim b/ftplugin/vala.vim
new file mode 100644
index 00000000..e243d674
--- /dev/null
+++ b/ftplugin/vala.vim
@@ -0,0 +1,29 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
+
+" Insert a CCode attribute for the symbol below the cursor
+" https://wiki.gnome.org/Projects/Vala/LegacyBindings
+function! CCode() abort
+ normal yiwO[CCode (cname = "pa")]
+endfunction
+
+" Set Vala Coding Style
+" https://wiki.gnome.org/Projects/Vala/Hacking#Coding_Style
+function! ValaCodingStyle() abort
+ set ts=4 sts=4 sw=4 tw=0 wm=0
+endfunction
+
+command! -buffer -bar CCode call CCode()
+command! -buffer -bar ValaCodingStyle call ValaCodingStyle()
+
+if get(g:, 'vala_syntax_folding_enabled', 1)
+ setlocal foldmethod=syntax
+endif
+
+endif