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

Re: gvim + gnome nautilus

Expand Messages
  • Gabriel B.
    ... I confess i didn t see what you where trying to make me see there... that was completely arcane to me. I haven t found the reason, but found the cause. for
    Message 1 of 4 , Sep 1, 2006
    • 0 Attachment
      On 8/30/06, A.J.Mechelynck <antoine.mechelynck@...> wrote:
      > Gabriel B. wrote:
      > > I've used gvim with gnome for some time.
      > >
      > > Now when i try to open a file with right click in the file nautilus'
      > > icon, open with gvim. I get:
      > >
      > > Erreur détectée en traitant BufReadCmd Auto commandes pour "file://*":
      > > error detected treating BufReadCmd Auto commandes for "file://*":
      > >
      > > is it something i messed up in vim or in nautilus?
      > >
      > > a grep for auto|file://|BufRead in my .vimrc show just that of interest:
      > > " Trim whitespace from python files
      > > autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
      > > autocmd BufRead,BufNewFile *.py syntax on
      > > autocmd BufRead,BufNewFile *.py set ai
      > >
      > >
      > >
      > > Thanks,
      > > Gabriel
      > >
      > >
      >
      > It may have been defined by another plugin such as netrw. Try
      >
      > :verbose au BufReadCmd
      >
      > For the file:// protocol I see:

      I confess i didn't see what you where trying to make me see there...
      that was completely arcane to me.

      I haven't found the reason, but found the cause. for some weird
      reason, when i 'ported' my .vimrc to windows, i ended up with those
      two lines. I probably had to use that because of mixed EOL i had in
      old files at work.
      set ff=dos
      set ffs=dos,unix

      removing the first line (or changing to unix) is the only thing that
      solved the problem.

      Anyway, i always tought that those options where just for the editing
      buffer. It seems that they messed up something else.
    • A.J.Mechelynck
      ... Well, when Vim starts up it normally runs, after your vimrc, a number of plugin scripts. Those that come with Vim are in $VIMRUNTIME/plugin; the plugin/
      Message 2 of 4 , Sep 2, 2006
      • 0 Attachment
        Gabriel B. wrote:
        > On 8/30/06, A.J.Mechelynck <antoine.mechelynck@...> wrote:
        >> Gabriel B. wrote:
        >> > I've used gvim with gnome for some time.
        >> >
        >> > Now when i try to open a file with right click in the file nautilus'
        >> > icon, open with gvim. I get:
        >> >
        >> > Erreur détectée en traitant BufReadCmd Auto commandes pour "file://*":
        >> > error detected treating BufReadCmd Auto commandes for "file://*":
        >> >
        >> > is it something i messed up in vim or in nautilus?
        >> >
        >> > a grep for auto|file://|BufRead in my .vimrc show just that of
        >> interest:
        >> > " Trim whitespace from python files
        >> > autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
        >> > autocmd BufRead,BufNewFile *.py syntax on
        >> > autocmd BufRead,BufNewFile *.py set ai
        >> >
        >> >
        >> >
        >> > Thanks,
        >> > Gabriel
        >> >
        >> >
        >>
        >> It may have been defined by another plugin such as netrw. Try
        >>
        >> :verbose au BufReadCmd
        >>
        >> For the file:// protocol I see:
        >
        > I confess i didn't see what you where trying to make me see there...
        > that was completely arcane to me.

        Well, when Vim starts up it normally runs, after your vimrc, a number of
        "plugin" scripts. Those that come with Vim are in $VIMRUNTIME/plugin;
        the plugin/ subdirectories of other directories mentioned in the
        'runtimepath' option, if they exist, can contain additional plugins
        written by the user himself, by his sysadmin, or downloaded from sources
        other than the Vim distribution.

        The command

        :verbose au BufReadCmd

        tells you which BufReadCmd autocommands have been installed in the
        present session of Vim, and, in Vim 7, by which script(s). In the
        default installation of Vim, there are BufReadCmd autocommands for
        file:// protocol URIs (since those were apparently what triggered the
        error you saw); they are set up by the netrw plugin. Why drag-and drop
        from Nautilus would drop a file:// URI and not a plain filename with
        path is a question to which I don't know the answer.

        >
        > I haven't found the reason, but found the cause. for some weird
        > reason, when i 'ported' my .vimrc to windows, i ended up with those
        > two lines. I probably had to use that because of mixed EOL i had in
        > old files at work.
        > set ff=dos
        > set ffs=dos,unix
        >
        > removing the first line (or changing to unix) is the only thing that
        > solved the problem.
        >
        > Anyway, i always tought that those options where just for the editing
        > buffer. It seems that they messed up something else.
        >
        >

        'ffs', i.e. 'fileformats', is a "global" option: it determines whether
        and how Vim will "guess" the 'fileformat' of a file being read.

        When opening a file for editing, 'ff', i.e., 'fileformat', is set
        buffer-locally according to 'fileformats', if the latter isn't empty.
        Whenever you use ":set fileformat=..." you modify both the local value
        for the current buffer and the global default (used e.g. for
        newly-created files). The ":set" commands has three variants (for
        options which have a local value, be it buffer-local or window-local):

        :setl[ocal] option=value " sets the local value only
        :setg[lobal] option=value " sets the global default only
        :se[t] option=value " sets both

        When used to interrogate the current value, ":set option?" and ":setl
        option?" return the local setting for the current window or buffer,
        ":setg option?" returns the global default.



        Best regards,
        Tony.
      Your message has been successfully submitted and would be delivered to recipients shortly.