aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-26 23:57:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-26 23:57:42 +1200
commit1a59433fa33f737264af73a7323ce669fa14a21a (patch)
tree1a7234a87b724ca35708536e0e3bb25e16252c73
parentMerge branch 'release/v0.2.0' (diff)
parentBump VERSION (diff)
downloadvim-vimrc-reload-filetype-1a59433fa33f737264af73a7323ce669fa14a21a.tar.gz
vim-vimrc-reload-filetype-1a59433fa33f737264af73a7323ce669fa14a21a.zip
Merge branch 'release/v1.0.0'HEADv1.0.0master
* release/v1.0.0: Remove literal message documentation Adjust use of $MYVIMRC and expansion Move code out to autoload
-rw-r--r--README.md2
-rw-r--r--VERSION2
-rw-r--r--autoload/vimrc_reload_filetype.vim9
-rw-r--r--doc/vimrc_reload_filetype.txt2
-rw-r--r--plugin/vimrc_reload_filetype.vim15
5 files changed, 15 insertions, 15 deletions
diff --git a/README.md b/README.md
index aa46047..7a3230c 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ with a command to reload filetype detection and filetype plugin loading for the
current buffer, to correct the issue of `vimrc` `:set` commands clobbering
filetype-specific `:setlocal` options.
-It also echoes a nice "Reloaded vimrc" message so you know it's working.
+It also echoes a nice message so you know it's working.
License
-------
diff --git a/VERSION b/VERSION
index 0ea3a94..3eefcb9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.0
+1.0.0
diff --git a/autoload/vimrc_reload_filetype.vim b/autoload/vimrc_reload_filetype.vim
new file mode 100644
index 0000000..cc8df98
--- /dev/null
+++ b/autoload/vimrc_reload_filetype.vim
@@ -0,0 +1,9 @@
+" Wrapper function reloads .vimrc and filetypes
+function! vimrc_reload_filetype#Reload() abort
+ source $MYVIMRC
+ if exists('#filetypedetect#BufRead')
+ doautocmd filetypedetect BufRead
+ endif
+ redraw
+ echomsg 'Reloaded vimrc: '.fnamemodify($MYVIMRC, ':p:~')
+endfunction
diff --git a/doc/vimrc_reload_filetype.txt b/doc/vimrc_reload_filetype.txt
index eb9f446..65563b0 100644
--- a/doc/vimrc_reload_filetype.txt
+++ b/doc/vimrc_reload_filetype.txt
@@ -7,7 +7,7 @@ with a command to reload filetype detection and filetype plugin loading for
the current buffer, to correct the issue of |vimrc| |:set| commands clobbering
filetype-specific |:setlocal| options.
-It also echoes a nice "Reloaded vimrc" message so you know it's working.
+It also echoes a nice message so you know it's working.
REQUIREMENTS *vimrc_reload_filetype-requirements*
diff --git a/plugin/vimrc_reload_filetype.vim b/plugin/vimrc_reload_filetype.vim
index 34ff8d7..de23a8b 100644
--- a/plugin/vimrc_reload_filetype.vim
+++ b/plugin/vimrc_reload_filetype.vim
@@ -9,23 +9,14 @@
if exists('loaded_vimrc_reload_filetype') || &compatible
finish
endif
-if !has('autocmd') || !exists('##SourceCmd')
+if !exists('##SourceCmd')
finish
endif
let loaded_vimrc_reload_filetype = 1
-" Wrapper function reloads .vimrc and filetypes
-function! s:Reload() abort
- source <afile>
- if exists('#filetypedetect#BufRead')
- doautocmd filetypedetect BufRead
- endif
- redraw
- echomsg 'Reloaded vimrc: '.expand('<afile>')
-endfunction
-
" This SourceCmd intercepts :source for .vimrc
augroup vimrc_reload_filetype
autocmd!
- autocmd SourceCmd $MYVIMRC call s:Reload()
+ autocmd SourceCmd $MYVIMRC
+ \ call vimrc_reload_filetype#Reload()
augroup END