Friday, March 26, 2010

Re: issues with codde completion

On Mar 22, 9:59 pm, Gary Johnson <garyj...@spocom.com> wrote:
> On 2010-03-21,Jagpreetwrote:
> > On Mar 19, 8:20 pm, Gary Johnson <garyj...@spocom.com> wrote:
> > > On 2010-03-19,Jagpreetwrote:
> > > > Hi Vimmers,
>
> > > > I'm using code_complete.vim plugin for code completion.
> > > > I have written my won snippets file but that's not getting executed
> > > > with the plugin command
>
> > > > exec "silent! runtime ".g:user_defined_snippets
>
> > > > I suspect this is the only problem, co'z the output of
> > > > command :scriptnames doesn't show the entry of my_snippets.vim
>
> > > > If I execute the command manually with :so <PATH>/my_snippets.vim then
> > > > my_snippets.vim gets displayed in the listing(:scriptnames), also my
> > > > snippets are working.
>
> > > > Is there anything wrong with the last line in the plugin
> > > > exec "silent! runtime ".g:user_defined_snippets
>
> > > > I have defined g:user_defined_snippets in my .vimrc file.
>
> > > It would help greatly to know what that definition is and where you
> > > actually put my_snippets.vim.
>
> > > My guess is that you've defined g:user_defined_snippets as
> > > "my_snippets.vim" but put it somewhere that is not in your
> > > 'runtimepath'. In other words, the <PATH> you referred to above is
> > > not one of the directories in the 'runtimepath' list. Consequently,
> > > the runtime command won't find it.
>
> > > See also
>
> > > :help :runtime
> > > :help 'runtimepath'
>
> > > HTH,
> > > Gary
>
> > Gary,
>
> > :echo $VIMRUNTIME is   " $HOME/VIM/vim/share/vim/vim72 "
> > This path is set in my .bashrc
> > I have compiled the source at some other server and copied the
> > complete directory structure at $HOME/VIM
>
> > now what path I defined at g:user_defined_snippets is $HOME/.vim/tools/
> > my_snippets.vim
>
> The reference manual entry for :runtime says that the command
> searches for files in the 'runtimepath'; it doesn't say that it
> accepts fully qualified path names and in my limited
> experimentation, it appears that it doesn't.  I think your
> g:user_defined_snippets setting would have to look like this.
>
>     let g:user_defined_snippets = "tools/my_snippets.vim"

No, I have given the absolute path for g:user_defined_snippets


>
> > also I tried using the command :help :runtime   but no help available
> > for me.
> > I guess this is because of the directories I copied from some other
> > servers.
>
> You should look into fixing that.  Not only are Vim's help files
> extremely useful, but this problem may be indicative of other
> problems in your setup that will cause you other difficulties.
>
> All the help files should be in $VIMRUNTIME/doc.

I know, as a workaround I set the VIMRUNTIME in .bashrc but, that's
the best possible shortcut I got.
I now realize the earlier issues when I was facing were because of
this problem only.
all the help files are indeed available at my $VIMRUNTIME/doc but I
can't access them from vim.
I just wanted to check for ttimeout but it says E149: Sorry, no help
for
even for help.txt also its the same.

>
> One reason you may not be able to see any help files is that you may
> be using the minimal vim installation that some Linux distributions
> provide by default.
>
I am using full version of Unix installation and this is what
the :version command output is

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 31 2009 15:21:16)
Compiled by jagpreet@server19
Normal version with X11-Motif GUI. Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset
+cindent +clientserver +clipboard +cmdline_compl
+cmdline_hist +cmdline_info +comments +cryptv -cscope +cursorshape
+dialog_con_gui +diff +digraphs -dnd -ebcdic -emacs_tags
+eval +ex_extra +extra_search -farsi +file_in_path +find_in_path
+float +folding -footer +fork() -gettext -hangul_input -iconv
+insert_expand +jumplist -keymap -langmap +libcall +linebreak
+lispindent +listcmds +localmap +menu +mksession +modify_fname
+mouse +mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm
-mouse_sysmouse +mouse_xterm -multi_byte +multi_lang
-mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript
+printer -profile -python +quickfix +reltime -rightleft
-ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white -tcl
+terminfo +termresponse +textobjects +title +toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset
+xim +xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/export/home/jagpreet/.tools//share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MOTIF -I/
usr/dt/include -g -O2 -I/usr/openwin/include
Linking: gcc -L/usr/dt/lib -R /usr/dt/lib -L/usr/openwin/lib -R/usr/
openwin/lib -o vim -lXmu -lXext -lXm -lXpm -lXt -lX11 -lSM
-lICE -lm -ltermlib -lnsl -lsocket -ldl


Just notice the fall-back for $VIM , this path doesn't exists at the
server where I copied the bin and share folders. If I don't set the
VIMRUNTIME variable at .bashrc then I get this error

Error detected while processing /itcdev10_1/jagpreet/.vimrc:
line 32:
E484: Can't open file /export/home/jagpreet/.tools//share/vim/syntax/
syntax.vim
and no syntax highlight works.


> > as a workaround I copied the my_snippets.vim at $HOME/.vim/plugin and
> > it works
>
> $HOME/.vim is in your 'runtimepath' and vim loads all the files in
> the plugin directories in 'runtimepath' at startup.
>
> > but I was keen to know the reasons why exec "silent! runtime
> > ".g:user_defined_snippets  is failing.
>
> As Ben suggested, get rid of the "silent!" in that command, at least
> until you find out what the problem is.  If you don't want to modify
> the plugin, just try that command from Vim's command line, without
> the "silent!", and see what the messages are.

I tried this command at command line but nothing happens, no changes
whatsoever.

>
> Regards,
> Gary

I understand the runtime path doesn't include the doc and may be some
other paths.
As a workaround I can add those paths as well in the VIMRUNTIME in
bashrc but don't want to go happy further with just workaround, it
might create some other problem tomorrow.

Is there a way I can avoid changing the VIMRUNTIME path in .bashrc and
doing something else.
I can't install vim at all the servers so I am left with the options
of coping bin/ and share/ only from the server where I installed it.

I don't know what should be the best possible solution for this case.

Regards,
Jagpreet

--
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

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: