Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve file type detection (respect 'g:notes_suffix', issue #16)
- Loading branch information
Showing
3 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,16 +1,19 @@ | |||
" Vim file type detection script | " Vim file type detection script | ||
" Author: Peter Odding <peter@peterodding.com> | " Author: Peter Odding <peter@peterodding.com> | ||
" Last Change: November 26, 2011 | " Last Change: December 11, 2011 | ||
" URL: http://peterodding.com/code/vim/notes | " URL: http://peterodding.com/code/vim/notes | ||
|
|
||
" Initialize the configuration defaults. | " Initialize the configuration defaults. | ||
call xolox#notes#init() | call xolox#notes#init() | ||
|
|
||
" Define the automatic commands used to recognize notes. | " Define the automatic commands used to recognize notes. | ||
for s:directory in [g:notes_directory, g:notes_shadowdir] |
|
||
execute 'autocmd BufNewFile,BufRead' | execute 'autocmd BufNewFile,BufRead' | ||
\ xolox#notes#autocmd_pattern(s:directory) | \ xolox#notes#autocmd_pattern(g:notes_directory, 1) | ||
\ 'if empty(&buftype) | setlocal filetype=notes | endif' | |||
|
|||
execute 'autocmd BufNewFile,BufRead' | |||
\ xolox#notes#autocmd_pattern(g:notes_shadowdir, 0) | |||
\ 'if empty(&buftype) | setlocal filetype=notes | endif' | \ 'if empty(&buftype) | setlocal filetype=notes | endif' | ||
endfor | |||
|
|
||
" vim: ts=2 sw=2 et | " vim: ts=2 sw=2 et |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters