summaryrefslogtreecommitdiff
path: root/.config/nvim/after/ftdetect/aerc.vim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/after/ftdetect/aerc.vim')
-rw-r--r--.config/nvim/after/ftdetect/aerc.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/nvim/after/ftdetect/aerc.vim b/.config/nvim/after/ftdetect/aerc.vim
new file mode 100644
index 0000000..cdd4812
--- /dev/null
+++ b/.config/nvim/after/ftdetect/aerc.vim
@@ -0,0 +1,18 @@
+let s:cfg = getenv('XDG_CONFIG_HOME')
+if s:cfg == v:null
+ let s:cfg = '~/.config/aerc/'
+else
+ let s:cfg .= '/aerc/'
+endif
+
+let s:ipaths
+ \ = s:cfg . '*.conf,'
+ \ . s:cfg . 'stylesets/*,'
+ \ . '/usr/share/aerc/*.conf,'
+ \ . '/usr/share/aerc/stylesets/*'
+let s:gpaths
+ \ = s:cfg . 'templates/*,'
+ \ . '/usr/share/aerc/templates/*'
+
+execute 'autocmd BufRead,BufNewFile ' . s:ipaths . ' setfiletype ini'
+execute 'autocmd BufRead,BufNewFile ' . s:gpaths . ' setfiletype gotmpl'