Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion autoload/xolox/reload.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ endif
let &cpo = s:cpo_save
unlet s:cpo_save

if !exists('g:xolox#reload#short_names')
let g:xolox#reload#short_names = 0
endif

if !exists('s:reload_script_active')
function! xolox#reload#script(filename) " {{{1
let s:reload_script_active = 1
Expand All @@ -41,7 +45,11 @@ if !exists('s:reload_script_active')
let filename = s:unresolve_scriptname(a:filename)
for [callback, pattern] in s:scripttypes
if filename =~ pattern
let friendly_name = filename
if g:xolox#reload#short_names
let friendly_name = fnamemodify(filename, ':t')
else
let friendly_name = filename
endif
if pattern =~ 'ftplugin'
" Determine include guard for generic file type plug-ins.
let matches = matchlist(filename, pattern)
Expand Down
16 changes: 14 additions & 2 deletions doc/reload.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ problems you can add the following line to your |vimrc| script:
This disables automatic reloading which means you'll have to reload scripts
using the command discussed below.

-------------------------------------------------------------------------------
The *g:xolox#reload#short_names* option

reload.vim reports when it reloads a file. For long file paths, that report
may be wider than the screen and so trigger a |hit-enter| prompt. To avoid
that, add the following line to your |vimrc|:
>
let g:xolox#reload#short_names = 1
<
That will cause the report to include only the name of the file and not
its full path.

-------------------------------------------------------------------------------
The *:ReloadScript* command

Expand Down Expand Up @@ -121,7 +133,7 @@ complain that the command or function already exists:
:command MyCmd call MyFun()
:function MyFun()
:endfunction

" Good:
:command! MyCmd call MyFun()
:function! MyFun()
Expand All @@ -139,7 +151,7 @@ several times:
" Bad example: If the following line were re-evaluated, the message would
" appear multiple times the next time the automatic command fires:
:autocmd TabEnter * echomsg "Entered tab page"

" Good example: The following three lines can be reloaded without the
" message appearing multiple times:
:augroup MyPlugin
Expand Down