Skip to content

Commit 9933c4f

Browse files
committed
Move file type detection back to plugin script (issues #16 & #17)
Since I published the notes.vim plug-in I cannot remember ever getting a single complaint about the file type not loading, however since I introduced "ftdetect/notes.vim" I've gotten several complaints. I'm hoping this commit will resolve the issues some users have been experiencing. Still it's strange that I'm not experiencing the issue myself. Oh well.
1 parent 4be5e0b commit 9933c4f

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

autoload/xolox/notes.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: December 11, 2011
3+
" Last Change: December 14, 2011
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.16.15'
9+
let g:xolox#notes#version = '0.16.16'
1010
let s:scriptdir = expand('<sfile>:p:h')
1111

1212
function! xolox#notes#init() " {{{1

ftdetect/notes.vim

Lines changed: 0 additions & 19 deletions
This file was deleted.

plugin/notes.vim

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim plug-in
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: December 11, 2011
3+
" Last Change: December 13, 2011
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Support for automatic update using the GLVS plug-in.
@@ -45,6 +45,12 @@ augroup PluginNotes
4545
exe 'au BufWriteCmd' xolox#notes#autocmd_pattern(g:notes_directory, 1) 'call xolox#notes#save()'
4646
augroup END
4747

48+
augroup filetypedetect
49+
let s:template = 'au BufNewFile,BufRead %s if &bt == "" | setl ft=notes | end'
50+
execute printf(s:template, xolox#notes#autocmd_pattern(g:notes_directory, 1))
51+
execute printf(s:template, xolox#notes#autocmd_pattern(g:notes_shadowdir, 0))
52+
augroup END
53+
4854
" Make sure the plug-in is only loaded once.
4955
let g:loaded_notes = 1
5056

0 commit comments

Comments
 (0)