Skip to content
Browse files

make default filetype configurable

The g:soywiki_filetype variable can now be used to configure the filetype.
Default remains "txt".
  • Loading branch information...
1 parent a1c59f4 commit 230f6637a411700f8878b327e2af9b8a7eba1418 @gfrey gfrey committed Jan 12, 2014
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/soywiki.vim
View
6 lib/soywiki.vim
@@ -22,6 +22,10 @@ let s:expand_command = 'soywiki-expand '
let s:ls_command = 'soywiki-ls-t '
let s:search_for_link = ""
+if !exists("g:soywiki_filetype")
+ let g:soywiki_filetype = 'txt'
+endif
+
func! s:trimString(string)
let string = substitute(a:string, '\s\+$', '', '')
return substitute(string, '^\s\+', '', '')
@@ -690,7 +694,7 @@ endfunc
func! s:prep_buffer()
if (s:is_wiki_page() && !exists("b:mappings_loaded"))
" let user decide on the textwidth
- set filetype=txt
+ let &filetype=g:soywiki_filetype
nnoremap <buffer> <cr> :call <SID>follow_link_under_cursor(0)<cr>
nnoremap <buffer> <c-l> :call <SID>follow_link_under_cursor(2)<cr>
nnoremap <buffer> <c-h> :call <SID>follow_link_under_cursor(1)<cr>

0 comments on commit 230f663

Please sign in to comment.
Something went wrong with that request. Please try again.