Skip to content

Commit

Permalink
make default filetype configurable
Browse files Browse the repository at this point in the history
The g:soywiki_filetype variable can now be used to configure the filetype.
Default remains "txt".
  • Loading branch information
gfrey committed Jan 12, 2014
1 parent a1c59f4 commit 230f663
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/soywiki.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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\+', '', '')
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 230f663

Please sign in to comment.