{"action":"opened","issue":{"url":"https://api.github.com/repos/vim-airline/vim-airline/issues/1107","repository_url":"https://api.github.com/repos/vim-airline/vim-airline","labels_url":"https://api.github.com/repos/vim-airline/vim-airline/issues/1107/labels{/name}","comments_url":"https://api.github.com/repos/vim-airline/vim-airline/issues/1107/comments","events_url":"https://api.github.com/repos/vim-airline/vim-airline/issues/1107/events","html_url":"https://github.com/vim-airline/vim-airline/issues/1107","id":143556183,"number":1107,"title":"Provide API to toggle a section","user":{"login":"blueyed","id":9766,"avatar_url":"https://avatars.githubusercontent.com/u/9766?v=3","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-25T18:05:20Z","updated_at":"2016-03-25T18:05:20Z","closed_at":null,"body":"I am using the following to toggle the display of the current tag:\r\n\r\n```vim\r\n\" Toggle display of current tag in airline.\r\nnnoremap <silent> g<f1> :call MyToggleDisplayCurrentTag()<cr>\r\nfun! MyToggleDisplayCurrentTag()\r\n  if g:airline_section_x =~ 'tagbar'\r\n    let g:airline_section_x = airline#section#create_right(['filetype'])\r\n  else\r\n    if !has_key(airline#parts#get('tagbar'), 'function')\r\n      call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')\r\n    endif\r\n    let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype'])\r\n  endif\r\n  AirlineRefresh\r\nendfun\r\n```\r\n\r\nIt would be nice if there would be a single function to do this."}}