Default Mappings Not Loading

44 views
Skip to first unread message

j0rd4n

unread,
Mar 24, 2011, 9:59:12 AM3/24/11
to vorax-discuss
Hello,

When using Vorax, the default custom mappings provided by vorax.vim
are not working. For instance, I want to use <Leader>ve. In my vimrc
file, I've configured the <Leader> to be ',' using the following:

let mapleader=','
let g:mapleader=','

This seems to work fine for some of the commands such as ",vc" to
connect. However, once I am typing an SQL statement, I cannot use
",ve". I have to type :VoraxExecBuffer.

Am I missing something? I'm on GVIM 7.2 for Windows.

talek

unread,
Mar 24, 2011, 10:20:50 AM3/24/11
to vorax-discuss
Hi,

Is the SQL statement you want to execute within an *.sql buffer? For
example, try:

:e test.sql

In the test.sql buffer type your SQL and execute it with the default
mapping. If this still doesn't work then take a look at the output of
the following vim command:

:map <buffer>

Does the :VoraxExec... command show up?

j0rd4n

unread,
Mar 28, 2011, 10:01:19 AM3/28/11
to vorax-discuss
Hey talek,

I tried working in a *.sql buffer with no luck. I'm also assuming
that once I start a connection, I'm automatically placed into a
scratch buffer. Is that correct or do I need to explicitly work in a
buffer I wrote saved with .sql extension?

When I dump my map for <buffer>, I do not see VoraxExec...

Cheers,
Jordan

talek

unread,
Mar 28, 2011, 10:19:06 AM3/28/11
to vorax-discuss
Hi,

Is the filetype plugin on? Place the following into your .vimrc,
restart your vim and see if it makes any diference:

filetype plugin on

j0rd4n

unread,
Mar 30, 2011, 8:12:38 AM3/30/11
to vorax-discuss
I didn't have this before. I added it but didn't notice any changes.
Anything else that might prevent this from loading?

Here is what my vimrc looks like:
--------------------------------------------------------------------------------------
set nocompatible
source $VIMRUNTIME/vimrc_example.vim

autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

filetype plugin on

colorscheme vylight

set hidden
set gfn=Courier_New:h14:cANSI
set lines=50
set columns=160
set nowrap
set number
set nobackup
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set ignorecase smartcase

let mapleader=','
let g:mapleader=','

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' .
arg3 . eq
endfunction
--------------------------------------------------------------------------------------

talek

unread,
Mar 31, 2011, 4:58:54 AM3/31/11
to vorax-discuss
I've just tried with a very basic ~/.vimrc file:

set nocompatible
filetype plugin on

and I didn't encounter any problems. I connected to a database and
then I inspected the buffer mappings within the VoraX scratch buffer
(:map <buffer>):

n \vg @:VoraxGotoDefinition<CR>
x \vdv @:VoraxDescribeVerboseVisual<CR>
n \vdv @:VoraxDescribeVerbose<CR>
x \vd @:VoraxDescribeVisual<CR>
n \vd @:VoraxDescribe<CR>
n \vb @:VoraxExecBuffer<CR>
x \vpo @:VoraxExplainOnlyVisualSQL<CR>
n \vpo @:VoraxExplainOnlyUnderCursor<CR>
x \vp @:VoraxExplainVisualSQL<CR>
n \vp @:VoraxExplainUnderCursor<CR>
x \v1 @:VoraxQueryVerticalLayoutVisual<CR>
n \v1 @:VoraxQueryVerticalLayout<CR>
x \ve @:VoraxExecVisualSQL<CR>
n \ve @:VoraxExecUnderCursor<CR>

So, before digging further I would suggest you to also try with this
basic .vimrc. In addition, please check if VoraX is correctly
installed. I expect to see something like:

under ~/.vim (unix) or $HOME/vimfiles (windows):

after
autoload
doc
ftpplugin
nerdtree_plugin
plugin
vorax

basically, just unzip vorax archive in your $HOME/vimfiles dir.

If VoraX seems to be correctly installed please try with a fresh vim
(without any other plugins installed except Vorax). Maybe one of your
current plugins conflicts with VoraX.

j0rd4n

unread,
Apr 7, 2011, 10:13:48 AM4/7/11
to vorax-discuss
Ah, it is fixed. Thank you so much for your help.

It turns out, I installed the plug-in wrong. I dumped it directly
into my $VIM/vim72 directory (Windows) instead of $VIM/vimfiles. Once
I re-installed vim72 and put vorax into the vimfiles directory, it
worked like a champ.

Thank you very much. Awesome plug-in!

Jordan

talek

unread,
Apr 7, 2011, 11:35:12 AM4/7/11
to vorax-discuss
Hi Jordan,

Great! Have fun! :)

--
talek
Reply all
Reply to author
Forward
0 new messages