I don't know the answers to those two. I'd just like to give a
suggestion (maybe you've tried it already in that case just ignore the
following).
Run strace on vim on another terminal and as soon as that problem
happens see what's up in that strace output. It might give a clue.
nazri.
You could also attach gdb to the vim process and check the backtrace.
--
Andreas.
Which version of Vim are you using? I recommend compiling
the latest version of Vim (Vim-7.2.121 as of today) to get all
latest bug fixes.
For example, following recent patch fixed a endless loop:
7.2.106 endless loop for "]s" in HTML when there are no misspellings
Now to answer your questions:
> 1. Is there a way to profile VIM so that I could find the culprit
> script or .vimrc line?
You can profile Vim itself with gprof or you can also profile vim
scripts with the profiler builtin feature in Vim (see :help profile).
If this feature is built in Vim command :version should output
+profile.
> 2. Does VIM support a way to display the action its currently doing or
> give some kind of feedback that its still alive when performing time
> consuming tasks?
:help 'verbose'
If it hangs, you can also attach with gdb and look at the stack:
$ gdb vim PID
(gdb) bt
where:
- vim is the full pathname of the Vim executable (compiled
with debug information and without optimization to get useful
output with gdb).
- PID is the process ID of the Vim process running (which hangs).
As someone mentioned, strace may also be useful.
-- Dominique
Doesn't work on my system for some reason. I get:
[yizaq@yizaq-lnx:Mon Feb 23:~]$ which vim
/usr/local/bin/vim
[yizaq@yizaq-lnx:Mon Feb 23:~]$ sudo gdb /usr/local/bin/vim 3693
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging
symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Attaching to program: /usr/local/bin/vim, process 3693
ptrace: Operation not permitted.
/users/yizaq/3693: No such file or directory.
I'll give the other options a try.
Thanks,
Yosi
Alas, this doesn't seem to give much info. I get:
[yizaq@yizaq-lnx:Mon Feb 23:~]$ ps -ef | grep yizaq | grep gvim
yizaq 3693 1 0 Jan06 ? 00:00:00 gvim -font Courier Bold 13 -d
[yizaq@yizaq-lnx:Mon Feb 23:~]$ sudo strace -p 3693
Process 3693 attached - interrupt to quit
ioctl(3, FIONREAD, [0]) = 0
poll(
Of course I tried to do a number of actions. Open buffers, alternate,
execute shell commands from within vim. The strace is silent.
Probably doing something wrong.
Thanks,
Yosi
This is a good counsel for any problem: if you aren't using the latest
version/patchlevel, try getting it (7.2.127 as of today), maybe your
problem was solved in the meantime. If your current version is only a
few patchlevels from the latest one, look at the bottom of
http://ftp.vim.org/pub/vim/patches/7.2/README to see if any of the
intervening patches looks promising. (That README file has a one-line
summary for every patch to the current version.)
>
> For example, following recent patch fixed a endless loop:
>
> 7.2.106 endless loop for "]s" in HTML when there are no misspellings
>
> Now to answer your questions:
>
>> 1. Is there a way to profile VIM so that I could find the culprit
>> script or .vimrc line?
>
> You can profile Vim itself with gprof or you can also profile vim
> scripts with the profiler builtin feature in Vim (see :help profile).
> If this feature is built in Vim command :version should output
> +profile.
[...]
If you have a version with -profile, install (or compile) a Huge version
of Vim -- according to ":help +feature-list", the profiling feature is
at the moment the only difference (all other things being equal) between
Big and Huge builds. (On Windows, Steve Hall's Vim distributions hosted
on the Cream project site include Big builds, so even on Windows, you'll
probably have to compile it yourself. See the Compiling HowTo pages for
Windows or Unix/Linux on my Vim site
http://users.skynet.be/antoine.mechelynck/vim/ for details.)
Best regards,
Tony.
--
Oregon, n.:
Eighty billion gallons of water with no place to go on Saturday
night.