Permalink
Browse files

Make code skeleton directory configurable

  • Loading branch information...
1 parent d8730f4 commit c102bcf6e5db50d9459adeed5830e28a219ad693 Richard Ramsden committed May 4, 2012
Showing with 12 additions and 3 deletions.
  1. +7 −0 doc/vimerl.txt
  2. +5 −3 plugin/erlang_skel.vim
View
@@ -198,6 +198,13 @@ values: dictionary): >
Note: the "year" key may be omitted, in that case the current year is used.
------------------------------------------------------------------------------
+ *'erlang_skel_dir'*
+
+This option allows you to define a custom directory to use for loading
+code skeletons. By default it will use the code skeletons included in
+vimerl under plugin/erlang_skels.
+
+------------------------------------------------------------------------------
*'erlang_keywordprg'*
This option defines the command used to show man pages with the |K| command
View
@@ -14,7 +14,9 @@ if !exists('g:erlang_skel_replace')
let g:erlang_skel_replace = 1
endif
-let s:skels_dir = expand('<sfile>:p:h') . '/erlang_skels'
+if !exists('g:erlang_skel_dir')
+ let g:erlang_skel_dir = expand('<sfile>:p:h') . '/erlang_skels'
+endif
function s:LoadSkeleton(skel_name)
if g:erlang_skel_replace
@@ -25,7 +27,7 @@ function s:LoadSkeleton(skel_name)
normal G
endif
if exists('g:erlang_skel_header')
- execute 'read' s:skels_dir . '/' . 'header'
+ execute 'read' g:erlang_skel_dir . '/' . 'header'
for [name, value] in items(g:erlang_skel_header)
call s:SubstituteField(name, value)
endfor
@@ -35,7 +37,7 @@ function s:LoadSkeleton(skel_name)
call append(line('$'), '')
normal G
endif
- execute 'read' s:skels_dir . '/' . a:skel_name
+ execute 'read' g:erlang_skel_dir . '/' . a:skel_name
call s:SubstituteField('modulename', expand('%:t:r'))
if g:erlang_skel_replace
normal gg

0 comments on commit c102bcf

Please sign in to comment.