diff --git a/MANIFEST.in b/MANIFEST.in index b8df330d..f1b4d444 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ recursive-include powerline *.json +recursive-include plugin *.vim exclude powerline/tests/*.xml diff --git a/examples/vim/__init__.py b/plugin/__init__.py similarity index 100% rename from examples/vim/__init__.py rename to plugin/__init__.py diff --git a/plugin/vim/__init__.py b/plugin/vim/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/plugin/vim/load_vim_plugin.py b/plugin/vim/load_vim_plugin.py new file mode 100644 index 00000000..f60c9c08 --- /dev/null +++ b/plugin/vim/load_vim_plugin.py @@ -0,0 +1,4 @@ +import os +import vim + +vim.command('source ' + os.path.join(os.path.abspath(os.path.dirname(__file__)), 'powerline.vim')) diff --git a/examples/vim/powerline.vim b/plugin/vim/powerline.vim similarity index 79% rename from examples/vim/powerline.vim rename to plugin/vim/powerline.vim index d1e341b7..87bd9965 100644 --- a/examples/vim/powerline.vim +++ b/plugin/vim/powerline.vim @@ -1,5 +1,9 @@ -" Powerline vim example -" Run with :source % +" Powerline vim plugin +" +" If Powerline is installed in a Python search path, load the plugin by +" adding the following line to your .vimrc: +" +" python import plugin.vim.load_vim_plugin python import sys, vim, os python sys.path.append(vim.eval('expand(":h:h:h")')) @@ -22,14 +26,14 @@ endfunction function! s:UpdateAllWindows() for w in range(1, winnr('$')) " getwinvar() returns empty string for undefined variables. - " Use has_key(getwinvar(w, ''), 'powerline') if you care about variable - " being really defined (currently with w:powerline=='' it will throw + " Use has_key(getwinvar(w, ''), 'powerline') if you care about variable + " being really defined (currently with w:powerline=='' it will throw " E706: variable type mismatch). if getwinvar(w, 'powerline') is# '' call setwinvar(w, 'powerline', {}) endif - call setwinvar(w, '&statusline', '%!Powerline('.w.')') + call setwinvar(w, '&statusline', '%!Powerline('. w .')') endfor endfunction @@ -38,4 +42,3 @@ augroup Powerline autocmd BufEnter,BufWinEnter,WinEnter * let w:current = 1 | call s:UpdateAllWindows() autocmd BufLeave,BufWinLeave,WinLeave * let w:current = 0 augroup END -" vim: ft=vim noet