Loading ...
Sorry, an error occurred while loading the content.

trouble using python code with sql code

Expand Messages
  • A Loumiotis
    Hi, Omni sql completion does not seem to work with python filetypes. The example provided in section 4.6 of the helpfile ft_sql.txt works, ie omni sql
    Message 1 of 8 , Feb 17, 2014
    • 0 Attachment
      Hi,

      Omni sql completion does not seem to work with python filetypes. The
      example provided in section 4.6 of the helpfile ft_sql.txt works, ie
      omni sql completion works within a perl file. If I repeat this
      example editing a python file instead:

      :e test.py
      :set filetype=sql
      :set ft=python

      omni sql completion does not work within a python file. Is this a bug
      or am I doing something wrong?

      I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
      MS-Windows 32-bit GUI version with OLE support.

      Thanks,
      Antonis

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... Which patchlevel? As in the following (from my gvim): VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 16 2014 01:35:02) Included patches: 1-183 Compiled
      Message 2 of 8 , Feb 17, 2014
      • 0 Attachment
        On 17/02/14 12:45, A Loumiotis wrote:
        > Hi,
        >
        > Omni sql completion does not seem to work with python filetypes. The
        > example provided in section 4.6 of the helpfile ft_sql.txt works, ie
        > omni sql completion works within a perl file. If I repeat this
        > example editing a python file instead:
        >
        > :e test.py
        > :set filetype=sql
        > :set ft=python
        >
        > omni sql completion does not work within a python file. Is this a bug
        > or am I doing something wrong?
        >
        > I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
        > MS-Windows 32-bit GUI version with OLE support.
        >
        > Thanks,
        > Antonis
        >
        Which patchlevel? As in the following (from my gvim):

        VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 16 2014 01:35:02)
        Included patches: 1-183
        Compiled by antoine.mechelynck@...
        Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
        [...]

        If the "Included patches" line is missing in your :version, then it is
        7.4.0. In that case I'd recommend installing "Vim without Cream"
        http://sourceforge.net/projects/cream/files/Vim/ which is currently at
        7.4.179 (or to compile Vim 7.4.183 yourself).

        Also, which versions of $VIMRUNTIME/ftplugin/sql.vim and
        $VIMRUNTIME/ftplugin/python.vim ? I didn't check, but these versions, or
        at least a "Last change" datestamp, ought to be written somewhere near
        the top of the files.


        Best regards,
        Tony.
        --
        Not exactly as shown.

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • A Loumiotis
        On Mon, Feb 17, 2014 at 2:27 PM, Tony Mechelynck ... I updated Vim and installed Vim without cream as you suggested but it did not solve the problem. I use
        Message 3 of 8 , Feb 17, 2014
        • 0 Attachment
          On Mon, Feb 17, 2014 at 2:27 PM, Tony Mechelynck
          <antoine.mechelynck@...> wrote:
          > On 17/02/14 12:45, A Loumiotis wrote:
          >>
          >> Hi,
          >>
          >> Omni sql completion does not seem to work with python filetypes. The
          >> example provided in section 4.6 of the helpfile ft_sql.txt works, ie
          >> omni sql completion works within a perl file. If I repeat this
          >> example editing a python file instead:
          >>
          >> :e test.py
          >> :set filetype=sql
          >> :set ft=python
          >>
          >> omni sql completion does not work within a python file. Is this a bug
          >> or am I doing something wrong?
          >>
          >> I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
          >> MS-Windows 32-bit GUI version with OLE support.
          >>
          >> Thanks,
          >> Antonis
          >>
          > Which patchlevel? As in the following (from my gvim):
          >
          > VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 16 2014 01:35:02)
          > Included patches: 1-183
          > Compiled by antoine.mechelynck@...
          > Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
          > [...]
          >
          > If the "Included patches" line is missing in your :version, then it is
          > 7.4.0. In that case I'd recommend installing "Vim without Cream"
          > http://sourceforge.net/projects/cream/files/Vim/ which is currently at
          > 7.4.179 (or to compile Vim 7.4.183 yourself).
          >
          > Also, which versions of $VIMRUNTIME/ftplugin/sql.vim and
          > $VIMRUNTIME/ftplugin/python.vim ? I didn't check, but these versions, or at
          > least a "Last change" datestamp, ought to be written somewhere near the top
          > of the files.
          >
          >
          > Best regards,
          > Tony.
          > --
          > Not exactly as shown.
          >
          > --
          > --
          > You received this message from the "vim_use" maillist.
          > Do not top-post! Type your reply below the text you are replying to.
          > For more information, visit http://www.vim.org/maillist.php
          >
          > --- You received this message because you are subscribed to the Google
          > Groups "vim_use" group.
          > To unsubscribe from this group and stop receiving emails from it, send an
          > email to vim_use+unsubscribe@....
          > For more options, visit https://groups.google.com/groups/opt_out.

          I updated Vim and installed Vim without cream as you suggested but it
          did not solve the problem. I use version version 11.0 of
          $VIMRUNTIME/ftplugin/sql.vim with last change at 2013 May 13 and I use
          $VIMRUNTIME/ftplugin/sql.vim with last change stamp 2014 Feb 09.

          Any ideas?
          Antonis

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Tony Mechelynck
          ... Alas, not from me. Anyone else? Best regards, Tony. -- The urge to gamble is so universal and its practice so pleasurable that I assume it must be evil. --
          Message 4 of 8 , Feb 17, 2014
          • 0 Attachment
            On 17/02/14 14:01, A Loumiotis wrote:
            > On Mon, Feb 17, 2014 at 2:27 PM, Tony Mechelynck
            > <antoine.mechelynck@...> wrote:
            >> On 17/02/14 12:45, A Loumiotis wrote:
            >>>
            >>> Hi,
            >>>
            >>> Omni sql completion does not seem to work with python filetypes. The
            >>> example provided in section 4.6 of the helpfile ft_sql.txt works, ie
            >>> omni sql completion works within a perl file. If I repeat this
            >>> example editing a python file instead:
            >>>
            >>> :e test.py
            >>> :set filetype=sql
            >>> :set ft=python
            >>>
            >>> omni sql completion does not work within a python file. Is this a bug
            >>> or am I doing something wrong?
            >>>
            >>> I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
            >>> MS-Windows 32-bit GUI version with OLE support.
            >>>
            >>> Thanks,
            >>> Antonis
            >>>
            >> Which patchlevel? As in the following (from my gvim):
            >>
            >> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 16 2014 01:35:02)
            >> Included patches: 1-183
            >> Compiled by antoine.mechelynck@...
            >> Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
            >> [...]
            >>
            >> If the "Included patches" line is missing in your :version, then it is
            >> 7.4.0. In that case I'd recommend installing "Vim without Cream"
            >> http://sourceforge.net/projects/cream/files/Vim/ which is currently at
            >> 7.4.179 (or to compile Vim 7.4.183 yourself).
            >>
            >> Also, which versions of $VIMRUNTIME/ftplugin/sql.vim and
            >> $VIMRUNTIME/ftplugin/python.vim ? I didn't check, but these versions, or at
            >> least a "Last change" datestamp, ought to be written somewhere near the top
            >> of the files.
            >>
            >>
            >> Best regards,
            >> Tony.
            >> --
            >> Not exactly as shown.
            >>
            >> --
            >> --
            >> You received this message from the "vim_use" maillist.
            >> Do not top-post! Type your reply below the text you are replying to.
            >> For more information, visit http://www.vim.org/maillist.php
            >>
            >> --- You received this message because you are subscribed to the Google
            >> Groups "vim_use" group.
            >> To unsubscribe from this group and stop receiving emails from it, send an
            >> email to vim_use+unsubscribe@....
            >> For more options, visit https://groups.google.com/groups/opt_out.
            >
            > I updated Vim and installed Vim without cream as you suggested but it
            > did not solve the problem. I use version version 11.0 of
            > $VIMRUNTIME/ftplugin/sql.vim with last change at 2013 May 13 and I use
            > $VIMRUNTIME/ftplugin/sql.vim with last change stamp 2014 Feb 09.
            >
            > Any ideas?
            > Antonis
            >
            Alas, not from me. Anyone else?



            Best regards,
            Tony.
            --
            The urge to gamble is so universal and its practice so pleasurable
            that I assume it must be evil.
            -- Heywood Broun

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • A Loumiotis
            On Tue, Feb 18, 2014 at 6:38 AM, Tony Mechelynck ... I would also like to mention that I have faced another issue with python on Windows XP gvim. When I run
            Message 5 of 8 , Feb 18, 2014
            • 0 Attachment
              On Tue, Feb 18, 2014 at 6:38 AM, Tony Mechelynck
              <antoine.mechelynck@...> wrote:
              > On 17/02/14 14:01, A Loumiotis wrote:
              >>
              >> On Mon, Feb 17, 2014 at 2:27 PM, Tony Mechelynck
              >> <antoine.mechelynck@...> wrote:
              >>>
              >>> On 17/02/14 12:45, A Loumiotis wrote:
              >>>>
              >>>>
              >>>> Hi,
              >>>>
              >>>> Omni sql completion does not seem to work with python filetypes. The
              >>>> example provided in section 4.6 of the helpfile ft_sql.txt works, ie
              >>>> omni sql completion works within a perl file. If I repeat this
              >>>> example editing a python file instead:
              >>>>
              >>>> :e test.py
              >>>> :set filetype=sql
              >>>> :set ft=python
              >>>>
              >>>> omni sql completion does not work within a python file. Is this a bug
              >>>> or am I doing something wrong?
              >>>>
              >>>> I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
              >>>> MS-Windows 32-bit GUI version with OLE support.
              >>>>
              >>>> Thanks,
              >>>> Antonis
              >>>>
              >>> Which patchlevel? As in the following (from my gvim):
              >>>
              >>> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 16 2014 01:35:02)
              >>> Included patches: 1-183
              >>> Compiled by antoine.mechelynck@...
              >>> Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
              >>> [...]
              >>>
              >>> If the "Included patches" line is missing in your :version, then it is
              >>> 7.4.0. In that case I'd recommend installing "Vim without Cream"
              >>> http://sourceforge.net/projects/cream/files/Vim/ which is currently at
              >>> 7.4.179 (or to compile Vim 7.4.183 yourself).
              >>>
              >>> Also, which versions of $VIMRUNTIME/ftplugin/sql.vim and
              >>> $VIMRUNTIME/ftplugin/python.vim ? I didn't check, but these versions, or
              >>> at
              >>> least a "Last change" datestamp, ought to be written somewhere near the
              >>> top
              >>> of the files.
              >>>
              >>>
              >>> Best regards,
              >>> Tony.
              >>> --
              >>> Not exactly as shown.
              >>>
              >>> --
              >>> --
              >>> You received this message from the "vim_use" maillist.
              >>> Do not top-post! Type your reply below the text you are replying to.
              >>> For more information, visit http://www.vim.org/maillist.php
              >>>
              >>> --- You received this message because you are subscribed to the Google
              >>> Groups "vim_use" group.
              >>> To unsubscribe from this group and stop receiving emails from it, send an
              >>> email to vim_use+unsubscribe@....
              >>> For more options, visit https://groups.google.com/groups/opt_out.
              >>
              >>
              >> I updated Vim and installed Vim without cream as you suggested but it
              >> did not solve the problem. I use version version 11.0 of
              >> $VIMRUNTIME/ftplugin/sql.vim with last change at 2013 May 13 and I use
              >> $VIMRUNTIME/ftplugin/sql.vim with last change stamp 2014 Feb 09.
              >>
              >> Any ideas?
              >> Antonis
              >>
              > Alas, not from me. Anyone else?
              >
              >
              >
              > Best regards,
              > Tony.
              > --
              > The urge to gamble is so universal and its practice so pleasurable
              > that I assume it must be evil.
              > -- Heywood Broun
              >
              >
              > --
              > --
              > You received this message from the "vim_use" maillist.
              > Do not top-post! Type your reply below the text you are replying to.
              > For more information, visit http://www.vim.org/maillist.php
              >
              > --- You received this message because you are subscribed to the Google
              > Groups "vim_use" group.
              > To unsubscribe from this group and stop receiving emails from it, send an
              > email to vim_use+unsubscribe@....
              > For more options, visit https://groups.google.com/groups/opt_out.

              I would also like to mention that I have faced another issue with
              python on Windows XP gvim. When I run any :python command gvim
              crashes.
              I reported this in the vim dev google group a while ago:

              https://groups.google.com/forum/?hl=en#!searchin/vim_dev/python|sort:date/vim_dev/ASokGp_zCCc/HnOGHTfAZNwJ

              but since I do not know yet how to compile Vim myself or how to create
              a bug report I was not able to provide more useful information.
              Actually I have tried to create a bug report for gVim on Windows but I
              was not successful. I installed Visual C++ 2005 Express Edition and I
              reproduced the crash by following the instructions on section 3.2 of
              the helpfile debug.txt but no dialog appeared in Visual C++ that
              informed me about the unhandled exception. Perhaps I have not
              obtained the PDB file for my executable. But where do I find this
              file PDB file and how do I use it with Visual C++ when I reproduce the
              crash?

              I'm curious to know if these issues with python occur only in a
              Windows 32-bit platform or in other platforms also.

              Here is the version of gVim that I use:

              VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 13 2014 10:42:55)
              MS-Windows 32-bit GUI version with OLE support
              Included patches: 1-179
              Compiled by digitectNO@...
              Huge version with GUI. Features included (+) or not (-):
              +acl +ex_extra +multi_byte_ime/dyn +tag_old_static
              +arabic +extra_search +multi_lang -tag_any_white
              +autocmd +farsi -mzscheme -tcl
              +balloon_eval +file_in_path +netbeans_intg -tgetent
              +browse +find_in_path +ole -termresponse
              ++builtin_terms +float +path_extra +textobjects
              +byte_offset +folding +perl/dyn +title
              +cindent -footer +persistent_undo +toolbar
              +clientserver +gettext/dyn -postscript +user_commands
              +clipboard -hangul_input +printer +vertsplit
              +cmdline_compl +iconv/dyn +profile +virtualedit
              +cmdline_hist +insert_expand +python/dyn +visual
              +cmdline_info +jumplist +python3/dyn +visualextra
              +comments +keymap +quickfix +viminfo
              +conceal +langmap +reltime +vreplace
              +cryptv +libcall +rightleft +wildignore
              +cscope +linebreak +ruby/dyn +wildmenu
              +cursorbind +lispindent +scrollbind +windows
              +cursorshape +listcmds +signs +writebackup
              +dialog_con_gui +localmap +smartindent -xfontset
              +diff +lua/dyn -sniff -xim
              +digraphs +menu +startuptime -xterm_save
              -dnd +mksession +statusline -xpm_w32
              -ebcdic +modify_fname -sun_workshop
              +emacs_tags +mouse +syntax
              +eval +mouseshape +tag_binary
              system vimrc file: "$VIM\vimrc"
              user vimrc file: "$HOME\_vimrc"
              2nd user vimrc file: "$HOME\vimfiles\vimrc"
              3rd user vimrc file: "$VIM\_vimrc"
              user exrc file: "$HOME\_exrc"
              2nd user exrc file: "$VIM\_exrc"
              system gvimrc file: "$VIM\gvimrc"
              user gvimrc file: "$HOME\_gvimrc"
              2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
              3rd user gvimrc file: "$VIM\_gvimrc"
              system menu file: "$VIMRUNTIME\menu.vim"
              Compilation: i686-pc-mingw32-gcc -O3 -fomit-frame-pointer
              -freg-struct-return -fno-strength-reduce -DWIN32 -DHAVE_PATHDEF
              -DFEAT_HUGE -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DFEAT_PERL
              -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL="perl518.dll" -DFEAT_PYTHON
              -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3
              -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL="python33.dll" -DFEAT_RUBY
              -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL="msvcrt-ruby191.dll"
              -DDYNAMIC_RUBY_VER=191 -DFEAT_LUA -DDYNAMIC_LUA
              -DDYNAMIC_LUA_DLL="lua51.dll" -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV
              -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_CSCOPE
              -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_OLE
              -march=i386 -Iproto -I/cygdrive/c/strawberry/perl/lib/CORE
              -I/cygdrive/c/Ruby193/lib/ruby/1.9.1/i386-mingw32
              -I/cygdrive/c/Ruby193/include/ruby-1.9.1
              -I/cygdrive/c/Ruby193/include/ruby-1.9.1/i386-mingw32
              -I/cygdrive/c/PROGRA~2/Lua/5.1/include -s
              Linking: i686-pc-mingw32-gcc -s -o gvim.exe -luuid -lole32 -lwsock32
              -mwindows -lcomctl32 -lversion -loleaut32 -Wl,-Bstatic -lstdc++
              -Wl,-Bdynamic

              Best regards,
              Antonis

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • David Fishburn
              ... i R *@ :call sqlcomplete#Map( resetCache ) i L *@ :call
              Message 6 of 8 , Feb 18, 2014
              • 0 Attachment

                On Mon, Feb 17, 2014 at 6:45 AM, A Loumiotis <antonis.loumiotis@...> wrote:
                Hi,

                Omni sql completion does not seem to work with python filetypes.  The
                example provided in section 4.6 of the helpfile ft_sql.txt works, ie
                omni sql completion works within a perl file.  If I repeat this
                example editing a python file instead:

                :e test.py
                :set filetype=sql
                :set ft=python

                omni sql completion does not work within a python file.  Is this a bug
                or am I doing something wrong?

                I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
                MS-Windows 32-bit GUI version with OLE support.


                That is really interesting, I am seeing the same thing.

                :set ft=sql
                :set ft=perl
                :imap <buffer>


                i  <C-C>R      *@<C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>
                i  <C-C>L      *@<C-Y><C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                i  <C-C>l      *@<C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                i  <C-C>c      *@<C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>
                i  <C-C>v      *@<C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>
                i  <C-C>p      *@<C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>
                i  <C-C>t      *@<C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>
                i  <C-C>s      *@<C-\><C-O>:call sqlcomplete#Map("sqlStatement\\w*")<CR><C-X><C-O>
                i  <C-C>T      *@<C-\><C-O>:call sqlcomplete#Map("sqlType\\w*")<CR><C-X><C-O>
                i  <C-C>o      *@<C-\><C-O>:call sqlcomplete#Map("sqlOption\\w*")<CR><C-X><C-O>
                i  <C-C>f      *@<C-\><C-O>:call sqlcomplete#Map("sqlFunction\\w*")<CR><C-X><C-O>
                i  <C-C>k      *@<C-\><C-O>:call sqlcomplete#Map("sqlKeyword\\w*")<CR><C-X><C-O>
                i  <C-C>a      *@<C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>


                :e dave.py
                :set ft=sql

                :imap <buffer>

                This should have created all the above imaps, just as it did with Perl.

                I see why it didn't.
                At the top of ftplugin/sql.vim there is the "usual" code:

                if exists("b:did_ftplugin")
                  finish
                endif


                Python is defining b:did_ftplugin, so it is not sourcing this file.
                I guess Perl doesn't.

                I will update the ftplugin/sql.vim to perform a different test.

                In the meantime, you can do the following to work around the issue:

                :e dave.py
                :unlet b:did_ftplugin
                :set ft=sql
                :unlet b:did_ftplugin
                :set ft=python

                And completion will be enabled.

                HTH,
                David
                 

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
                 
                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • A Loumiotis
                ... Thanks David for your help. Your ftplugin has been very useful! I thought the issue was related to MS-Windows and perhaps it had to do something with the
                Message 7 of 8 , Feb 18, 2014
                • 0 Attachment
                  On Tue, Feb 18, 2014 at 7:10 PM, David Fishburn <dfishburn.vim@...> wrote:
                  >
                  > On Mon, Feb 17, 2014 at 6:45 AM, A Loumiotis <antonis.loumiotis@...>
                  > wrote:
                  >>
                  >> Hi,
                  >>
                  >> Omni sql completion does not seem to work with python filetypes. The
                  >> example provided in section 4.6 of the helpfile ft_sql.txt works, ie
                  >> omni sql completion works within a perl file. If I repeat this
                  >> example editing a python file instead:
                  >>
                  >> :e test.py
                  >> :set filetype=sql
                  >> :set ft=python
                  >>
                  >> omni sql completion does not work within a python file. Is this a bug
                  >> or am I doing something wrong?
                  >>
                  >> I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
                  >> MS-Windows 32-bit GUI version with OLE support.
                  >>
                  >>
                  > That is really interesting, I am seeing the same thing.
                  >
                  > :e dave.pl
                  > :set ft=sql
                  > :set ft=perl
                  > :imap <buffer>
                  >
                  >
                  > i <C-C>R *@<C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>
                  > i <C-C>L *@<C-Y><C-\><C-O>:call
                  > sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                  > i <C-C>l *@<C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                  > i <C-C>c *@<C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>
                  > i <C-C>v *@<C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>
                  > i <C-C>p *@<C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>
                  > i <C-C>t *@<C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>
                  > i <C-C>s *@<C-\><C-O>:call
                  > sqlcomplete#Map("sqlStatement\\w*")<CR><C-X><C-O>
                  > i <C-C>T *@<C-\><C-O>:call
                  > sqlcomplete#Map("sqlType\\w*")<CR><C-X><C-O>
                  > i <C-C>o *@<C-\><C-O>:call
                  > sqlcomplete#Map("sqlOption\\w*")<CR><C-X><C-O>
                  > i <C-C>f *@<C-\><C-O>:call
                  > sqlcomplete#Map("sqlFunction\\w*")<CR><C-X><C-O>
                  > i <C-C>k *@<C-\><C-O>:call
                  > sqlcomplete#Map("sqlKeyword\\w*")<CR><C-X><C-O>
                  > i <C-C>a *@<C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>
                  >
                  >
                  > :e dave.py
                  > :set ft=sql
                  >
                  > :imap <buffer>
                  >
                  > This should have created all the above imaps, just as it did with Perl.
                  >
                  > I see why it didn't.
                  > At the top of ftplugin/sql.vim there is the "usual" code:
                  >
                  > if exists("b:did_ftplugin")
                  > finish
                  > endif
                  >
                  >
                  > Python is defining b:did_ftplugin, so it is not sourcing this file.
                  > I guess Perl doesn't.
                  >
                  > I will update the ftplugin/sql.vim to perform a different test.
                  >
                  > In the meantime, you can do the following to work around the issue:
                  >
                  > :e dave.py
                  > :unlet b:did_ftplugin
                  > :set ft=sql
                  > :unlet b:did_ftplugin
                  > :set ft=python
                  >
                  > And completion will be enabled.
                  >
                  > HTH,
                  > David
                  >
                  >
                  > --
                  > --
                  > You received this message from the "vim_use" maillist.
                  > Do not top-post! Type your reply below the text you are replying to.
                  > For more information, visit http://www.vim.org/maillist.php
                  >
                  > ---
                  > You received this message because you are subscribed to the Google Groups
                  > "vim_use" group.
                  > To unsubscribe from this group and stop receiving emails from it, send an
                  > email to vim_use+unsubscribe@....
                  > For more options, visit https://groups.google.com/groups/opt_out.

                  Thanks David for your help. Your ftplugin has been very useful! I
                  thought the issue was related to MS-Windows and perhaps it had to do
                  something with the crash of Vim whenever I use the :python command
                  that I reported but it was not (could anyone with a Windows machine
                  confirm this crash please?). Your workaround works great!

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • A Loumiotis
                  On Wed, Feb 19, 2014 at 8:53 AM, A Loumiotis ... Regarding the Vim crash that I reported it seems that I found what caused it and how to fix it. I describe
                  Message 8 of 8 , Feb 20, 2014
                  • 0 Attachment
                    On Wed, Feb 19, 2014 at 8:53 AM, A Loumiotis
                    <antonis.loumiotis@...> wrote:
                    > On Tue, Feb 18, 2014 at 7:10 PM, David Fishburn <dfishburn.vim@...> wrote:
                    >>
                    >> On Mon, Feb 17, 2014 at 6:45 AM, A Loumiotis <antonis.loumiotis@...>
                    >> wrote:
                    >>>
                    >>> Hi,
                    >>>
                    >>> Omni sql completion does not seem to work with python filetypes. The
                    >>> example provided in section 4.6 of the helpfile ft_sql.txt works, ie
                    >>> omni sql completion works within a perl file. If I repeat this
                    >>> example editing a python file instead:
                    >>>
                    >>> :e test.py
                    >>> :set filetype=sql
                    >>> :set ft=python
                    >>>
                    >>> omni sql completion does not work within a python file. Is this a bug
                    >>> or am I doing something wrong?
                    >>>
                    >>> I use VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 10 2013 14:38:33)
                    >>> MS-Windows 32-bit GUI version with OLE support.
                    >>>
                    >>>
                    >> That is really interesting, I am seeing the same thing.
                    >>
                    >> :e dave.pl
                    >> :set ft=sql
                    >> :set ft=perl
                    >> :imap <buffer>
                    >>
                    >>
                    >> i <C-C>R *@<C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>
                    >> i <C-C>L *@<C-Y><C-\><C-O>:call
                    >> sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                    >> i <C-C>l *@<C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>
                    >> i <C-C>c *@<C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>
                    >> i <C-C>v *@<C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>
                    >> i <C-C>p *@<C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>
                    >> i <C-C>t *@<C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>
                    >> i <C-C>s *@<C-\><C-O>:call
                    >> sqlcomplete#Map("sqlStatement\\w*")<CR><C-X><C-O>
                    >> i <C-C>T *@<C-\><C-O>:call
                    >> sqlcomplete#Map("sqlType\\w*")<CR><C-X><C-O>
                    >> i <C-C>o *@<C-\><C-O>:call
                    >> sqlcomplete#Map("sqlOption\\w*")<CR><C-X><C-O>
                    >> i <C-C>f *@<C-\><C-O>:call
                    >> sqlcomplete#Map("sqlFunction\\w*")<CR><C-X><C-O>
                    >> i <C-C>k *@<C-\><C-O>:call
                    >> sqlcomplete#Map("sqlKeyword\\w*")<CR><C-X><C-O>
                    >> i <C-C>a *@<C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>
                    >>
                    >>
                    >> :e dave.py
                    >> :set ft=sql
                    >>
                    >> :imap <buffer>
                    >>
                    >> This should have created all the above imaps, just as it did with Perl.
                    >>
                    >> I see why it didn't.
                    >> At the top of ftplugin/sql.vim there is the "usual" code:
                    >>
                    >> if exists("b:did_ftplugin")
                    >> finish
                    >> endif
                    >>
                    >>
                    >> Python is defining b:did_ftplugin, so it is not sourcing this file.
                    >> I guess Perl doesn't.
                    >>
                    >> I will update the ftplugin/sql.vim to perform a different test.
                    >>
                    >> In the meantime, you can do the following to work around the issue:
                    >>
                    >> :e dave.py
                    >> :unlet b:did_ftplugin
                    >> :set ft=sql
                    >> :unlet b:did_ftplugin
                    >> :set ft=python
                    >>
                    >> And completion will be enabled.
                    >>
                    >> HTH,
                    >> David
                    >>
                    >>
                    >> --
                    >> --
                    >> You received this message from the "vim_use" maillist.
                    >> Do not top-post! Type your reply below the text you are replying to.
                    >> For more information, visit http://www.vim.org/maillist.php
                    >>
                    >> ---
                    >> You received this message because you are subscribed to the Google Groups
                    >> "vim_use" group.
                    >> To unsubscribe from this group and stop receiving emails from it, send an
                    >> email to vim_use+unsubscribe@....
                    >> For more options, visit https://groups.google.com/groups/opt_out.
                    >
                    > Thanks David for your help. Your ftplugin has been very useful! I
                    > thought the issue was related to MS-Windows and perhaps it had to do
                    > something with the crash of Vim whenever I use the :python command
                    > that I reported but it was not (could anyone with a Windows machine
                    > confirm this crash please?). Your workaround works great!

                    Regarding the Vim crash that I reported it seems that I found what
                    caused it and how to fix it. I describe this and another problem that
                    I face now in the following post in the vim_dev group:
                    https://groups.google.com/forum/?hl=en#!topic/vim_dev/ynYRvTmgKS8

                    Best,
                    Antonis

                    --
                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  Your message has been successfully submitted and would be delivered to recipients shortly.