However, it looks a bit too minimalist, especially with all these nice statusline management plugins around:
- airline: https://github.com/bling/vim-airline
- lightline: https://github.com/itchyny/lightline.vim
- powerline: https://github.com/Lokaltog/powerline
So, below is Vorax with airline:
It'a nice improvement, and the information from the status line is better highlighted. In addition, I configured the current Oracle connection to be also displayed in a Vorax buffer (sql or plsql), just to be sure we know where we're connected to, especially if the output window is not shown (it can be toggled, I'm sure you know this).
So, let's see how we can achieve this. I put the following in my .vimrc file:
" Let me choose the statusbar let g:vorax_output_force_overwrite_status_line = 0 function! VoraxOutputFlags() let funnel = ["", "VERTICAL", "PAGEZIP", "TABLEZIP"][vorax#output#GetFunnel()] let append = g:vorax_output_window_append ? "APPEND" : "" let sticky = g:vorax_output_window_sticky_cursor ? "STICKY" : "" let heading = g:vorax_output_full_heading ? "HEADING" : "" let top = g:vorax_output_cursor_on_top ? "TOP" : "" return join(filter([funnel, append, sticky, heading, top], 'v:val != ""'), ' ') endfunction function! VoraxAirPlugin(...) let session = '%{vorax#sqlplus#SessionOwner()}' let txn = '%{vorax#utils#IsOpenTxn() ? "!" . g:vorax_output_txn_marker : ""}' if vorax#utils#IsVoraxBuffer() let w:airline_section_b = get(w:, 'airline_section_b', g:airline_section_b) . session let w:airline_section_warning = get(w:, 'airline_section_warning', g:airline_section_warning) . txn endif if &ft == 'outputvorax' let lrows = '%{exists("g:vorax_limit_rows") ? " [LIMIT ROWS <=" . g:vorax_limit_rows . "] " : ""}' let w:airline_section_a = '%{vorax#utils#Throbber()}' let w:airline_section_b = airline#section#create_left([session]) let w:airline_section_c = 'Output window' let w:airline_section_x = '' let w:airline_section_y = g:airline_section_z let w:airline_section_z = airline#section#create(["%{VoraxOutputFlags()}"]) let w:airline_section_warning = get(w:, 'airline_section_warning', g:airline_section_warning) let w:airline_section_warning .= airline#section#create([lrows, txn]) elseif (&ft == 'connvorax') || (&ft == 'explorervorax') || (&ft == 'oradocvorax') let w:airline_section_a = '' let w:airline_section_b = '' let w:airline_section_c = (&ft == 'connvorax' ? 'Connection Profiles' : &ft == 'explorervorax' ? 'DB Explorer' : 'Oracle Documentation') let w:airline_section_x = '' let w:airline_section_y = '' let w:airline_section_z = '' endif endfunction call airline#add_statusline_func('VoraxAirPlugin') " Let the statusbar as it is for inactive windows let g:airline_inactive_collapse=0That's all! The next logical step would be to defeat my lazyness and submit a real Airline extension for Vorax. I'm going to add this to my procrastination list.
7 comments:
I am getting following syntax error from bash:
bash: /home/chris/.bashrc: line 53: syntax error near unexpected token `('
bash: /home/chris/.bashrc: line 53: ` let w:airline_section_z = airline#section#create(["%{VoraxOutputFlags()}"])'
In .bashrc?
yes,
bash 4.3.33
Wasn't it supposed that vim code to go in your .vimrc file (instead of .bashrc)? Am I miss something?
I missed that :)
thanks for your help
No problem! Have fun!
Hi Alexandru Tică
I just wanted to say Thank you Thank you Thank you, ....... for developing this awesome tool .
Post a Comment