In this post I want however to talk a little bit about the new features this version brings in. The most important one, in my opinion, is the fuzzy search feature. The idea came from a practical need. I don't know about you but, personally, I have troubles remembering various package names, tables, views etc. You may say: okey, but you can use code completion, right? Yes, of course, but what if you don't know how the object name starts? For example, let's say I want to query the AWR snapshots. Frankly, I don't know exactly where these snapshots resides, but I (fuzzy) remember that it's something with "snapshot". So, I am in the middle of:
SELECT * FROM |<-- cursor here in insert mode
Now, I can invoke vorax fuzzy search. While in insert mode type <Leader> vl (vl stands for vorax locate). A prompt will be shown at the top and you can type there: snapshot. Pay attention that the list with the candidate items will start to be populated after you type at least three characters. You should see in the list the view you are looking for:
DBA_HIST_SNAPSHOT
. Oooh, yea I remember... that's it! Just select it, press ENTER and DBA_HIST_SNAPSHOT
will be inserted at the current cursor position. Nice!Another scenario when this feature may prove to be quite handy is when you have to change a system parameter. Suppose you want to increase the size of your flash recovery area. You are in the middle of:
ALTER SYSTEM SET |<-- cursor here in insert mode
Ookey, now what? I think the name of the parameter is something with
recovery
... Yeap, it's time for a fuzzy search. Invoke it and type: recovery
. Ups, a lot of items are there: views, synonyms, tables. You can narrow down and refine your search knowing that you're actually looking for a parameter. So, you further type ;:param
. Now your search pattern looks like: recovery;:param
. That's nice: I have now just the parameters which contain the word recovery
:- recovery_parallelism
- db_recovery_file_dest
- db_recovery_file_dest_size
Now, it's clear that we want
db_recovery_file_dest_size
.This feature depends on FuzzyFinder plugin so don't forget to install it if you want to have this new vorax feature. You can also customize the search-able database items by modifying the
search.sql
script located at: &rt/vorax/sql
.Another improvement is the possibility to invoke describe commands directly from the DbExplorer. It was proposed by Shaun and it makes a lot of sense.
VoraX 2.1 comes also with new syntax files for sql and plsql which means your oracle code will look much better. The sqlplus keywords like
ACCEPT, PROMPT
etc. are also highlighted in sql buffers.That's it for now! Enjoy!
2 comments:
Hi!
Great job and very nice plugin! I try to use the one, but get some problems:
1) in video tutorial it would be great to show pressed buttons in baloon tips. Now it looks like a shaman-style coding - i do not know, what i have to do to reproduce things from video tutorial.
2) How to enable VoraxMapping? By setting parameters
let mapleader=','
let g:mapleader=','
in .vimrc file only this mappings are enabled:
,vc ,vv and ,vo. The other ones just turn VIM into visual mode.
Please, give detailed explaination how to enable code comletion and how to enable ",ve" command.
Hi, and thanks for your comment.
1) yes, I had also received complains about the leak of the sound in that video. The purpose of it was to get people interested in and not to provide a video tutorial, which now, it doesn't sound like a bad idea at all. But, didn't the vorax documentation helped at all in finding out the available key mappings?
2) ,vc ,vv ,vo are global mappings and are available everywhere in vim. However, ,ve ,vd ,vdd etc are local mappings and applies just to sql, plsql buffers. Try to open an sql file and try there the describe table (,vd) for instance. It should work, otherwise it is a bug and you may report it on the vorax project site.
VoraX code completion also applies just to sql/plsql buffers. You may invoke it in the standard vim way CTRL+x CTRL+o or you may use the supertab plugin (the way I currently use) to get completion when TAB is pressed.
Post a Comment