Is it possible to override an autoloaded plugin-function? I want to customize an airline-internal function just like this:

diff --git a/autoload/airline/extensions/default.vim b/autoload/airline/extensions/default.vim
index f9ca3d4..8ce3b00 100644
--- a/autoload/airline/extensions/default.vim
+++ b/autoload/airline/extensions/default.vim
@@ -92,7 +92,7 @@ function! airline#extensions#default#apply(builder, context)

   call a:builder.split(s:get_section(winnr, 'gutter', '', ''))

-  if airline#util#getwinvar(winnr, 'airline_render_right', 1)
+  if airline#util#getwinvar(winnr, 'airline_render_right', active)
     call s:build_sections(a:builder, a:context, s:layout[1])

Sure, I could fork the plugin and customize it, but is there also slim, vim-like solution I can simply apply to my vimrc?

  • 4
    airline maintainer here: Why? – Christian Brabandt Aug 17 '18 at 15:55
  • @ChristianBrabandt: This small change disables airline sections for inactive windows. It reduces the sections to simply the buffer name, which works great for me. – der_flo Aug 20 '18 at 17:50
  • I see. I think what might also work is :au WinLeave * :let w:airline_render_right=0 – Christian Brabandt Aug 23 '18 at 9:33
  • @ChristianBrabandt this works, awesome! I would leave the question open because this problem arises with quite many plugins I try to customize. – der_flo Aug 23 '18 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.