source, runtime and all that
I'd like to before :sourc'ing a file to execute one of my scripts (always the same). I though the autocmd 'SourcePre' event will help nut I can't get it work the way I'd needed it: As a first test I did: :au SourcePre *.vim let g:sfile=afile then amatch (I know sfile will not work before it gets expanded too early) If I now do :source test.vim which contains just 'echo g:sfile' I get errors about invalid expression afile or amatch depending what I used for :au. The idea was to get the file name in g:sfile of the file which is about to be sourced so I can call my function (in that autocmd) to process the file before it's :sourced. How can this be done? I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? ---Zdenek Zdenek Sekera | [EMAIL PROTECTED] LHC Computing Grid Project | mobile: +41-76-487.4971 CERN - IT Division | tel:+41-22-767.1068
Re: source, runtime and all that
Try expanding it. au SourcePre *.vim echomsg afile= . expand(afile) au SourcePre *.vim let g:sfile = afile On 5/26/06, Zdenek Sekera [EMAIL PROTECTED] wrote: I'd like to before :sourc'ing a file to execute one of my scripts (always the same). I though the autocmd 'SourcePre' event will help nut I can't get it work the way I'd needed it: As a first test I did: :au SourcePre *.vim let g:sfile=afile then amatch (I know sfile will not work before it gets expanded too early) If I now do :source test.vim which contains just 'echo g:sfile' I get errors about invalid expression afile or amatch depending what I used for :au. The idea was to get the file name in g:sfile of the file which is about to be sourced so I can call my function (in that autocmd) to process the file before it's :sourced. How can this be done? I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? ---Zdenek Zdenek Sekera | [EMAIL PROTECTED] LHC Computing Grid Project | mobile: +41-76-487.4971 CERN - IT Division | tel:+41-22-767.1068
Re: source, runtime and all that
On 5/26/06, Eric Arnold [EMAIL PROTECTED] wrote: Try expanding it. au SourcePre *.vim echomsg afile= . expand(afile) au SourcePre *.vim let @a = afile au SourcePre *.vim let @a = expand(afile ) On 5/26/06, Zdenek Sekera [EMAIL PROTECTED] wrote: I'd like to before :sourc'ing a file to execute one of my scripts (always the same). I though the autocmd 'SourcePre' event will help nut I can't get it work the way I'd needed it: As a first test I did: :au SourcePre *.vim let g:sfile=afile then amatch (I know sfile will not work before it gets expanded too early) If I now do :source test.vim which contains just 'echo g:sfile' I get errors about invalid expression afile or amatch depending what I used for :au. The idea was to get the file name in g:sfile of the file which is about to be sourced so I can call my function (in that autocmd) to process the file before it's :sourced. How can this be done? I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? ---Zdenek Zdenek Sekera | [EMAIL PROTECTED] LHC Computing Grid Project | mobile: +41-76-487.4971 CERN - IT Division | tel:+41-22-767.1068
RE: source, runtime and all that
-Original Message- From: Eric Arnold [mailto:[EMAIL PROTECTED] Sent: 26 May 2006 16:07 To: Zdenek Sekera Cc: vim-dev@vim.org Subject: Re: source, runtime and all that On 5/26/06, Eric Arnold [EMAIL PROTECTED] wrote: Try expanding it. au SourcePre *.vim echomsg afile= . expand(afile) au SourcePre *.vim let @a = afile au SourcePre *.vim let @a = expand(afile ) That works nicely. Thanks! Any idea about that runtime problem? ---Zdenek On 5/26/06, Zdenek Sekera [EMAIL PROTECTED] wrote: I'd like to before :sourc'ing a file to execute one of my scripts (always the same). I though the autocmd 'SourcePre' event will help nut I can't get it work the way I'd needed it: As a first test I did: :au SourcePre *.vim let g:sfile=afile then amatch (I know sfile will not work before it gets expanded too early) If I now do :source test.vim which contains just 'echo g:sfile' I get errors about invalid expression afile or amatch depending what I used for :au. The idea was to get the file name in g:sfile of the file which is about to be sourced so I can call my function (in that autocmd) to process the file before it's :sourced. How can this be done? I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? ---Zdenek Zdenek Sekera | [EMAIL PROTECTED] LHC Computing Grid Project | mobile: +41-76-487.4971 CERN - IT Division | tel:+41-22-767.1068
Re: source, runtime and all that
Zdenek Sekera wrote: I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? I'd guess it was intentional. The help for :source explicitly mentions that using it triggers the SourcePre autocommand, and nowhere in the help for :runtime does it mention doing so. OTOH, perhaps its an oversight! Regards, Chip Campbell
Re: Using py commands to evaluate text for balloon commands for web lookups.
I got my balloon function to do WEB lookups of word under mouse, on wiki/google/dictionary via python. However for couple of issues I am stuck with (any help appreciated): 1. The gvim freezes (cursor stop blinking for 3 seconds) while python is doing web lookups. Can I run this lookup as a thread in background? 2. The python lookup throws errors messages when lookup receives bad html; which I could NOT catch with 'python/try' and in 'vim/try' blocks. It looks ugly on the message bar. 3. I want to clear the Balloon text on a lookup error, instead of displaying stale results. Can I clear reset the Balloon value before starting a lookup? Because the Balloon interface only uses the return value of my function. 4. Any function to pick phrase under mouse? thanks for the earlier help (I used eval to interface with python). Mohsin On 5/24/06, Ilya [EMAIL PROTECTED] wrote: Mohsin wrote: I am trying to use the ':py' interface to evaluate text under cursor and show the result in a balloon text. I got the python and vim code to work easily, however I have problem communicating between the two (py and vim): 1. How do I access vim variables in py commands (like text under cursor, all the 'let variables', 'set options')? [...] Maybe this thread could be helpful, they are talking about vim.eval() function and looks like it could be used to get variable values, even arrays. http://groups.yahoo.com/group/vimdev/message/41394
Re: source, runtime and all that
On 5/26/06, Zdenek Sekera [EMAIL PROTECTED] wrote: -Original Message- From: Charles E Campbell Jr [mailto:[EMAIL PROTECTED] Sent: 26 May 2006 16:19 To: Zdenek Sekera Cc: vim-dev@vim.org Subject: Re: source, runtime and all that Zdenek Sekera wrote: I also thought 'runtime' is somehow equivalent to :source, except it is smart enough to use 'runtimepath'. Using the same test above (':runtime test.vim') I found this does *not* fire up the autocmd while :source does. Is this intentional or can it be considered a bug? I'd guess it was intentional. The help for :source explicitly mentions that using it triggers the SourcePre autocommand, and nowhere in the help for :runtime does it mention doing so. OTOH, perhaps its an oversight! It really bothers me it doesn't. I've sent an email to Bram, let's wait from his vac return if he can make it work. ---Zdenek Meanwhile, I think it should be fairly simple to make your own version of runtime as a Vim script which looks through the runtime (and whatever) path using source when it finds a match.
Re: Perl Support in Debian
On 5/25/06, William O'Higgins Witteman [EMAIL PROTECTED] wrote: On Thu, May 25, 2006 at 03:13:45PM -0400, James Vega wrote: Aha! You have spotted the problem. I have both vim-perl and vim-python installed, and even though they have the same priority, the system is defaulting to vim.python. You can change that with update-alternatives --config, but then you'll run into a similar situation if you (or someone else on that machine) want to use Python to script Vim. :) So now the question is, is it possible to enable both Perl and Python at the same time? We have vim-full which has support for all the interpreters (minus MzScheme). This is one of the situations where binary distributions are lacking because there's a trade-off between trying to meet everyone's needs and having numerous different versions of the same program. Joy! vim-full is just the ticket. I can't think why it was not installed before. Binary distributions do have drawbacks, but generally, managing all of my programs with apt is far more effective then muddling with source when I don't have to. Thanks for the help. Gentoo does it quite well, and generally you don't have to modify things and is all managed. In spite of that I am, too, a Debian user for the same reason you stated ;-). -- Regards, EddyP = Imagination is more important than knowledge A.Einstein
Re: OT: test
On Fri, May 26, 2006 at 11:52:42AM +0200, Meino Christian Cramer wrote: Please ignore... If you're going to send test messages at least put in something amusing or interesting for people to read. Something like the following (a fortune that turned up a few days ago; anyone who's used Oracle -- or any other software -- will know the feeling): [Taken from Oracle's own JDBC FAQ. Really.] 8.1.7 (8i r2) Is DML Returning Supported ? Not in the current drivers. However, we do have plans to support it in post 8.1.7 drivers. 9.0.1 (9i) Is DML Returning Supported ? Not in the current drivers. However, we do have plans to support it in post 9.0.1 drivers. 9.2.0 (9i r2) Is DML Returning Supported ? Not in the current drivers. However, we do have plans to support it in post 9.2.0 drivers. 10.1.0 (10g r1) Is DML Returning Supported ? Not in the current drivers. However, we do have plans to support it in post 10.1.0 drivers. We really mean it this time. 10.2.0 (10g r2) Is DML Returning Supported ? YES! And it's about time. See the Developer's Guide for details. -- Matthew Winn ([EMAIL PROTECTED])
Remembering 'Fold State' across buffers
Hi all, The problem I'm having is I'll open all folds in a buffer, switch buffers, go back to the original and all folds are closed again. Is there a way to stop this? ie Vim remembers the 'fold state' of the buffer when I return to it? So if folds were open when I left they'll be open when I return? Conversely if they were closed when I left they'll be closed when I return? Vim 7 Ubuntu Dapper thanks, -- Mark
Re: spell checking with html doesn't work
Dnia piątek, 26 maja 2006 03:28, David Purton napisał: Any suggestions? It kind of looks like a bug, but maybe I'm missing something obvious. Maybe you have some custom highlighting definitions for HTML? Remove them and check once more. m.
Re: Jumping to Headline in h1Headline/h1
On Fri, May 26, 2006 at 07:42:11AM -0500, Tim Chase wrote: (c)h1Headline/h1 My cursor is denoted by (c). How can I most quickly jump to the start of the Headline word? Pressing w or e isn't any good, I still have to press at least three times. Not nice, almost as bad as cursor keys. Sounds like it's time to learn the f/F/t/T family of commands, if you don't know/use them already. I use them so regularly that it bugs me to use any other editor where I can't jump quickly to my desired position in a line (namely...pretty much every other editor that's not a modal/vi editor). You can pop to their description at :help f My advice is to read all of :help motion.txt and then you will be on your way to joining the ranks of vim experts. HTH --Benji Fisher
Re: Jumping to Headline in h1Headline/h1
:help motion.txt and then you will be on your way to joining the ranks of vim experts. Some of us are just rank ;) But yes, Vim's multitude of ways for jumping around a document quickly are one of the hallmarks of why folks who learn it well seldom leave for another editor. -tim
Re: Remembering 'Fold State' across buffers
Mark Woodward wrote: Hi all, The problem I'm having is I'll open all folds in a buffer, switch buffers, go back to the original and all folds are closed again. Is there a way to stop this? ie Vim remembers the 'fold state' of the buffer when I return to it? So if folds were open when I left they'll be open when I return? Conversely if they were closed when I left they'll be closed when I return? Vim 7 Ubuntu Dapper thanks, Well, it should be possible, but I don't know how. Recently I saw the following: Viewed one file with folds in gvim (FWIW, it was Vim 7.0.017, huge version with GTK2 GUI, running on SuSE Linux 9.3). Opened one fold. :q the file. Then came back to it. The one fold was still open. I source the vimrc_example.vim in my vimrc. (Do you?) Then if you do, maybe we have different settings or autocommands? (AFAIK, I have nothing folds-related in my vimrc, other than what might be set by the vimrc_example.vim) Best regards, Tony.
html syntax highlighting disable spell check?
Hi All: I apologize for breaking the thread. I just share dc's problem about syntax highlighting in html and build-in spellchecker: when I edit a html file spell checking doesn't work, but as soon as I do syntax off the spell check works again! Any idea how to remedy it? I compiled vim 7 from source but did not delete the vim 6 installation from my distro. Would that be problem? For some reason for C files and latex files syntax highlighting doesn't seems to bother spell check. Jiang
spell check for multiple languages?
Hi all: I love the new spell check features. I usually write in English, which is why I set my spellchecker to en-us. However I sometimes write in Chinese, which AFAIK has no vim spell checker. So every time I write something it will underline it. Of course I can manually write :set nospell to disable spellchecker every time I write in Chinese, but is there an more intelligent way by which vim somehow know part of the paragraph is written in Chinese and skip them? I recall spellchecker plugin I used before doesn't seem to be bothered by my writing some Chinese. Thanks a lot in advance. Jiang
Re: Remembering 'Fold State' across buffers
(I missed part of this thread, so sorry if this has already been mentioned). Have you checked for mode lines at the top or bottom of the files which set fold options? If there aren't any which might be confusing you, you could consider adding your own mode lines to have the folding appropriate for your different files. On 5/26/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: Mark Woodward wrote: Hi all, The problem I'm having is I'll open all folds in a buffer, switch buffers, go back to the original and all folds are closed again. Is there a way to stop this? ie Vim remembers the 'fold state' of the buffer when I return to it? So if folds were open when I left they'll be open when I return? Conversely if they were closed when I left they'll be closed when I return? Vim 7 Ubuntu Dapper thanks, Well, it should be possible, but I don't know how. Recently I saw the following: Viewed one file with folds in gvim (FWIW, it was Vim 7.0.017, huge version with GTK2 GUI, running on SuSE Linux 9.3). Opened one fold. :q the file. Then came back to it. The one fold was still open. I source the vimrc_example.vim in my vimrc. (Do you?) Then if you do, maybe we have different settings or autocommands? (AFAIK, I have nothing folds-related in my vimrc, other than what might be set by the vimrc_example.vim) Best regards, Tony.
Re: spell checking with html doesn't work
I'm getting the same behavior under the same conditions on both WinXP and Linux (Ubuntu 5.10), with standard installations of Vim 7 (i.e., without compile-time or command-line modifications, or modifications to .*vimrc's). I've delved a bit deeper (though unsystematically and unscientifically) and made the following observations: - Loose text (i.e. not contained within or modified by any tags) doesn't appear to be spellchecked. Granted, there ought not _be_ completely loose text in HTML, ought there not? ;) - Text both within a p/p _and_ modified by something like a b or an i or an em _is_ spellchecked. Unmodified text within a p isn't. Thus: pThis word is spelled incorectly/p = no marking. pemThis word is spelled incorectly/em/p = marked. pThis word is spelled incorectly, emand so is this onwe/em/p = 'incorectly' not marked, 'onwe' marked. - Unmodified text within div or span isn't spellchecked, inside of or outside of a p. Add, say, i or b or em, and it suddenly is (inside or outside of a paragraph.) - titles aren't spellchecked. - spellcheck isn't really a word. ;) I've probably offered nothing particularly useful or helpful, but at least I've had fun hearing myself type. :) Thanks. On 5/26/06, David Purton [EMAIL PROTECTED] wrote: On Fri, May 26, 2006 at 11:30:52AM +0200, Mikolaj Machowski wrote: Dnia piątek, 26 maja 2006 03:28, David Purton napisał: Any suggestions? It kind of looks like a bug, but maybe I'm missing something obvious. Maybe you have some custom highlighting definitions for HTML? Remove them and check once more. mmm, not as far as I know. how can I tell? Well it *is* related to syntax highlighting. If I turn syntax higlighting off, it works correctly. It is not just windows, I can reproduce the probem under linux as well. Using debian unstable I can do the following to reproduce the problem: $ gvim -u /etc/vim/vimrc -U /etc/vim/gvimrc# load debian defaults :set filetype=xhtml :set spell Enter the following: h1This word is spelt incorectly/h1 pThis word is spelt incorectly/p h1, p and incorectly should be marked as wrong in all places. Now turn syntax on :syntax on Only incorectly within the h1 tag is marked as wrong. The tag names are not marked as wrong (good), but incorectly in the p tag is missed (bad). cheers dc -- David Purton Haese Harris Publications Phone: +61 8 8355 9444Email: [EMAIL PROTECTED] Fax: +61 8 8355 9471Web: http://www.haeseandharris.com.au/
RE: Jumping to Headline in h1Headline/h1
Consider this: I'm editing the HTML: (c)h1Headline/h1 My cursor is denoted by (c). How can I most quickly jump to the start of the Headline word? Pressing w or e isn't any good, I still have to press at least three times. Not nice, almost as bad as cursor keys. Dunno how arbitrary your input is or is likely to be (eg, what about h1Fooey/h1 or p class='head1'Headline/p, etc., so can't be *that* specific. Rolling forward 4 chars: 4space 4l Skip to closing '' (and 'a'ppend instead of 'i'nsert): f Skip to fixed 'H' fH Skip to 3rd word: 3w etc. Lotta ways to do the same thing...
Re: html syntax highlighting disable spell check?
Jiang Qian wrote: Hi All: I apologize for breaking the thread. I just share dc's problem about syntax highlighting in html and build-in spellchecker: when I edit a html file spell checking doesn't work, but as soon as I do syntax off the spell check works again! Any idea how to remedy it? I compiled vim 7 from source but did not delete the vim 6 installation from my distro. Would that be problem? For some reason for C files and latex files syntax highlighting doesn't seems to bother spell check. Jiang I don't know if that is (or what is) the cause of the problem, but it _is_ possible to have several versions of Vim coexist peacefully on a single computer; see my tip http://vim.sourceforge.net/tips/tip.php?tip_id=848 for details. That tip tells how to have each executable use the runtime files from its own distribution. The user's homemade files (~/.vimrc, ~/.vim/*, $VIM/vimfiles/*, etc.) are common, but it is possible to write them in a compatible way by means of constructs such as feature compiled-in, visible in the :version listing if has(mzscheme) functioning option if exists(+spell) test for version if version = 700 test for version and patchlevel if (version 604) || ((version == 604) has(patch008)) etc. Best regards, Tony.
Can not run any command with ! in W2K
Hi, Need help, after so many time I still can't fix this. http://permalink.gmane.org/gmane.editors.vim/22144 The problem is that any ! command returns, for example !!dir returns (after a couple seconds): E485: Can't read file x.tmp If I do :!dir a console opens and says: C:\WINNT\system32\CMD.EXE /c dir shell returned -1 Hit any key to close this window... and gvim says Press ENTER or type command to continue, no dir data shows. Any other ! command, and the diff stuff, all complain about the temporary files. Also, I don't have the Edit with vim item in the context menus, an issue that might be related. I've already done lots of tests: 1- I have rights to write the temp directories, tested with a :w command and using different TEMP and TMP variables 2- Deleted all previous versions (63, 64) 3- Un-registered gvim and the visvim and gvimext dlls 4- Deleted all registry references to GUIDS that seemed vim related, like {0F0BFAE?-4C90-11D1-82D7-0004AC368519} 5- Installed vim70 6- Have in _gvimrc this, tested several variations with \ / set shell=C:/WINNT/system32/CMD.EXE 7- Changed all registry entries to D:\vim\vim70\[g]vim.exe 8- Tried almost all of http://www.vim.org/tips/tip.php?tip_id=416 The temporary directories are in F:\tmp and F:temp, vim in installed in D:\vim\vim70. No messy long paths with spaces. I'm aware that this is not a problem of vim but of my Windows 2000 Pro. Anyway I'm begging for help, a hint, a tip, whatever. I ran out of ideas. -- Juan
Re: spell check for multiple languages?
Jiang Qian wrote: Hi all: I love the new spell check features. I usually write in English, which is why I set my spellchecker to en-us. However I sometimes write in Chinese, which AFAIK has no vim spell checker. So every time I write something it will underline it. Of course I can manually write :set nospell to disable spellchecker every time I write in Chinese, but is there an more intelligent way by which vim somehow know part of the paragraph is written in Chinese and skip them? I recall spellchecker plugin I used before doesn't seem to be bothered by my writing some Chinese. Thanks a lot in advance. Jiang The 'spell' option is local-to-window. You can set it (for any file, but not just part of it) by means of a modeline (q.v.), for example HTMLHEAD !-- vim: set nospell :-- at the top of an HTML file, or -- Best regards, Jiang Qian - vim:nospell at the bottom of an email. As the latter example shows, there may be a problem if the filetype doesn't allow comments and you don't want the modeline to be seen. (In an email, you could create a custom header, but not all mail clients allow it.) The EncodingChanged event cannot be used IIUC, since it applies to the global 'encoding' option, not to the local 'fileencoding'. Anyway, UTF-8 can be used for both English and Chinese, so in this case I don't recommend using the charset as a criterion. If you have a file in _mixed_ language (part of the file in English and another part in Chinese), then I don't know if (or how) Vim can spell-check only the English paragraphs. It might be as simple as excluding anything in the Chinese part of the Unicode range from spell-checking altogether. Best regards, Tony.
Re: spell check for multiple languages?
Oops. I inadvertently added a real signature delimiter. I meant: Jiang Qian wrote: Hi all: I love the new spell check features. I usually write in English, which is why I set my spellchecker to en-us. However I sometimes write in Chinese, which AFAIK has no vim spell checker. So every time I write something it will underline it. Of course I can manually write :set nospell to disable spellchecker every time I write in Chinese, but is there an more intelligent way by which vim somehow know part of the paragraph is written in Chinese and skip them? I recall spellchecker plugin I used before doesn't seem to be bothered by my writing some Chinese. Thanks a lot in advance. Jiang The 'spell' option is local-to-window. You can set it (for any file, but not just part of it) by means of a modeline (q.v.), for example HTMLHEAD !-- vim: set nospell :-- at the top of an HTML file, or --space Best regards, Jiang Qian - vim:nospell (where space means a single space character) at the bottom of an email. As the latter example shows, there may be a problem if the filetype doesn't allow comments and you don't want the modeline to be seen. (In an email, you could create a custom header, but not all mail clients allow it.) The EncodingChanged event cannot be used IIUC, since it applies to the global 'encoding' option, not to the local 'fileencoding'. Anyway, UTF-8 can be used for both English and Chinese, so in this case I don't recommend using the charset as a criterion. If you have a file in _mixed_ language (part of the file in English and another part in Chinese), then I don't know if (or how) Vim can spell-check only the English paragraphs. It might be as simple as excluding anything in the Chinese part of the Unicode range from spell-checking altogether. Best regards, Tony.
RE: Working directory problems
Thanks! I'm working on a deadline today but will see if I can integrate this and make things work on Monday. Max -Original Message- From: Eric Arnold [mailto:[EMAIL PROTECTED] Sent: Friday, May 26, 2006 5:57 AM To: Max Dyckhoff Cc: vim@vim.org Subject: Re: Working directory problems Try something like this: set noshellslash let f = 'c:\topdir\main\source\ai\somefile' let f = expand(f) let f =fnamemodify( f, escape( ':p:s?c:\topdir\main\source\??', '\\' ) ) This will give you the relative path, providing that the path head remains consistent. This should strip off any pathnames it detects from path: function! GetPathRelative( f ) let f = expand( a:f ) let f =fnamemodify( f, ':p', ) let longest = '' for dir in split( path, ',' ) let dir = expand( dir ) if stridx( f, dir ) == 0 f != dir if strlen( dir ) strlen( longest ) let longest = dir endif endif endfor if longest != '' let f = strpart( f, strlen( longest ) ) let f = substitute( f, '^[/\\]*', '', '' ) endif return f endfunction let f = GetPathRelative( 'c:\topdir\main\source\ai\somefile') echomsg f let f = expand(%:p) echomsg f let f = GetPathRelative( f ) echomsg f On 5/25/06, Max Dyckhoff [EMAIL PROTECTED] wrote: I'm sorry, the script which I call basically just makes a system call: function! SDCheckout() let file = expand(%) if (confirm(Checkout from Source Depot?\n\n . file, Yes\nNo, 1) == 1) call system(sd edit . file . /dev/null) if v:shell_error == 0 set noreadonly edit! else if (confirm(An error occured!, Oh no!, 1) == 1) endif endif endif endfunction Sorry for the wrapping problems. I'm not entirely sure what you are suggesting doing with :h and :s??, but would I not suffer the problem of not knowing which subdirectory the file was in? Surely this isn't something that should need to be fixed, rather it should Just Work? Thanks! Max -Original Message- From: Eric Arnold [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 24, 2006 8:10 PM To: Max Dyckhoff Cc: vim@vim.org Subject: Re: Working directory problems I'm not sure how your bound function works. Have you tried using fnamemodify() to manipulate the filename? You can use the :h option to strip the path, and :s?? to substitute the relative path. On 5/24/06, Max Dyckhoff [EMAIL PROTECTED] wrote: Hi, I have some issues with the working directory in vim that I really cannot get to the bottom of. I have tried looking through the help, and I've searched the Interweb too, to no avail, so I thought I would turn to this trusty mailing list! I operate a single vim instance with multiple files open in multiple splits. The common working directory for my code files is c:\project\main\source\, and the majority of the files therein lie in ai\filename. Normally the vim split status line shows the file as being ai\filename, namely the relative path from the working directory of c:\project\main\source\. When I open a new file - which I invariably do using sf filename, as I have all the appropriate directories in my path - occasionally the statusline shows as the absolute path, namely c:\project\main\source\ai\filename. If I perform the command cd c:\project\main\source, then the status line fixes itself. It should be noted that the status line is only incorrect for the new file; existing files are still fine. Now I wouldn't normally be bothered by this, but I have a function in vim which I have bound to F6 that will check the current source file out of our source depot, and if the status line is showing the absolute path then it will fail, because the information about the source depot lies only within the c:\project\main directories. God, I hope that makes sense. It seems like such a trivial problem, but it really irks me, and I wonder if anyone could give me a hand! Cheers, Max -- Max Dyckhoff AI Engineer Bungie Studios
Re: Jumping to Headline in h1Headline/h1
On Fri, 26 May 2006, Tim Chase wrote: [snip] I've also had times where, while I regularly use the fH varient of matters to go forward to the first character in the tag, sometimes I get stung, as in [c] lilook here!/li (with the cursor on [c]). Using fl (eff ell) in attempt to jump to the ell in look, gets hung up on the ell in the li tag. It's simple to just use ; to jump again, but it's one of those minor annoyances. Other matters that can play into the picture include ugly/broken (non-HTML-entity-ized) tag-soup HTML with attributes such as: [c] img src='foo.php?operator='pipsqueek getting to the first p in pipsqueak isn't exactly a trivial task to automate. fw seems to get where we want for both the cases above. I like it for its no-thinking-cap-just-hit-it result. If the result isn't what we want, then keep repeating with ;w. Don't think ;) Then again, some might argue that Vim is about thinking before making a calculated move.. -- Gerald
Re: Jumping to Headline in h1Headline/h1
Then again, some might argue that Vim is about thinking before making a calculated move.. Vim...the chess of editors :) Vim is an artistic blend of the two. Basic stuff becomes second nature so that it just comes flying out of the fingers. The more complex stuff takes a moment of thought before the fingers perform the incantation. -tim
Re: Jumping to Headline in h1Headline/h1
Gerald Lai wrote: [...] Then again, some might argue that Vim is about thinking before making a calculated move.. -- Gerald IMHO, Vim is about both editing files any way you might think of (and possibly thinking before you do it), and having (or possibly letting you make) simple keystrokes (or simple keystroke sequences) for whatever it is that you do day-in day-out. Best regards, Tony.
Re: Vim in combination with OpenVMS
Jansen of Lorkeers, Richard wrote: I have a general question concerning installation of VIM on a OpenVMS systems. Who has experience with the installation of the software? Its been a long time since I've used VMS. So I have no recent experience in the installing vim under OpenVMS. Once in a galaxy far, far away, I did have something to do with modifying Vim's VMS port. (Time travel costs extra!) :) However, may I point out http://vim.sf.net/ click on Community click on Mailing Lists that there's a whole mailing list devoted to vim and openvms, which I've cutpasted: [EMAIL PROTECTED] Purpose This list is for discussing the development of Vim on OpenVMS. To Subscribe email [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] To Post email [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]; you must be subscribed to post! To Unsubscribe email [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Help email [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] to obtain information, or use the web interface at: http://www.polarhome.com/mailman/listinfo/vim-vms Comments: This is for questions about compiling and coding for Vim on OpenVMS. Non VMS related use questions should stick to vim@vim.org, above. Archive http://www.polarhome.com/pipermail/vim-vms/ So, may I suggest attempting to contact someone there. Regards, Chip Campbell
--remote-expr stdout?
Does anybody know how to get gvim to really print the expression result from --remote-expr to stdout, as it says in the docs. I always get an error popup with the results (although the expression wasn't a failure, the error popup just seems to be the default).
Re: --remote-expr stdout?
Eric Arnold wrote: Does anybody know how to get gvim to really print the expression result from --remote-expr to stdout, as it says in the docs. I always get an error popup with the results (although the expression wasn't a failure, the error popup just seems to be the default). Use vim (the console version) as the client instead of gvim. (On Unix you can use the same executable, but make sure to invoke it as vim, not as gvim.) It's not an error popup, it's just that until the GUI opens, the GUI version of Vim (i.e., gvim) uses popups to display what would otherwise go in the command line display area. Try invoking gvim with --version or --help and you'll get the corresponding output as a popup, instead of on stdout as in console vim. Best regards, Tony.
Re: Can not run any command with ! in W2K
On Fri, 26 May 2006, Juan Lanus wrote: [snip] The problem is that any ! command returns, for example !!dir returns (after a couple seconds): E485: Can't read file x.tmp If I do :!dir a console opens and says: C:\WINNT\system32\CMD.EXE /c dir shell returned -1 Hit any key to close this window... and gvim says Press ENTER or type command to continue, no dir data shows. Any other ! command, and the diff stuff, all complain about the temporary files. [snip] My first assessment would be to check if C:\WINNT\system32\CMD.EXE does exist. Does it? -- Gerald
Re: Can not run any command with ! in W2K
On 5/26/06, Gerald Lai [EMAIL PROTECTED] wrote: My first assessment would be to check if C:\WINNT\system32\CMD.EXE does exist. Does it? Yes it does. I'm not at that PC now, but I assume it's there because I can open DOS windows with the usual shortcut that points to %SystemRoot%\system32\cmd.exe Also, when I use the :! syntax a DOS window containing the error shows. -- Juan
Re: spell check for multiple languages?
If you have a file in _mixed_ language (part of the file in English and another part in Chinese), then I don't know if (or how) Vim can spell-check only the English paragraphs. It might be as simple as excluding anything in the Chinese part of the Unicode range from spell-checking altogether. This seems to have the best hope to work. How do I do this in vim? I can probably figure out what the unicode range(4E00-9FAF I believe) for Chinese, but how do I specify that they're excluded from spell-checking? Thanks a lot! Jiang
Re: Remembering 'Fold State' across buffers
On Fri, 26 May 2006 07:58:22 -0600 Eric Arnold [EMAIL PROTECTED] wrote: (I missed part of this thread, so sorry if this has already been mentioned). Have you checked for mode lines at the top or bottom of the files which set fold options? If there aren't any which might be confusing you, you could consider adding your own mode lines to have the folding appropriate for your different files. On 5/26/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: Mark Woodward wrote: Hi all, The problem I'm having is I'll open all folds in a buffer, switch buffers, go back to the original and all folds are closed again. Is there a way to stop this? ie Vim remembers the 'fold state' of the buffer when I return to it? So if folds were open when I left they'll be open when I return? Conversely if they were closed when I left they'll be closed when I return? Vim 7 Ubuntu Dapper thanks, Well, it should be possible, but I don't know how. Recently I saw the following: Viewed one file with folds in gvim (FWIW, it was Vim 7.0.017, huge version with GTK2 GUI, running on SuSE Linux 9.3). Opened one fold. :q the file. Then came back to it. The one fold was still open. I source the vimrc_example.vim in my vimrc. (Do you?) Then if you do, maybe we have different settings or autocommands? (AFAIK, I have nothing folds-related in my vimrc, other than what might be set by the vimrc_example.vim) Best regards, Tony. Thanks all, interestingly its not doing it this morning! It might have been a combination of factors causing this. I'll have to try and reproduce it. Tony- no, not sourcing vimrc_example.vim DrChip - I'll have to look into set hidden. Not sure how session would help though. This was happening during a session. ie I'd open a fold in a buffer of many folds, :bn to go to another buffer (single window, no tabs, no splits) do something, :bp to go back and the fold would be closed. Gerald - set foldlevelstart = -1 Eric- no modelines. thanks again, -- Mark
Re: Can not run any command with ! in W2K
On Fri, 26 May 2006, Juan Lanus wrote: On 5/26/06, Gerald Lai [EMAIL PROTECTED] wrote: My first assessment would be to check if C:\WINNT\system32\CMD.EXE does exist. Does it? Yes it does. I'm not at that PC now, but I assume it's there because I can open DOS windows with the usual shortcut that points to %SystemRoot%\system32\cmd.exe Also, when I use the :! syntax a DOS window containing the error shows. I should have noticed that in the first place :) Well, your problem is a real weird one. What happens when you start cmd.exe manually and do C:\WINNT\system32\CMD.EXE /c dir ? Also try to recall the recent activities you've done on your PC system, e.g., installing new software/hardware, windows update, the way you installed Vim, etc. and generally keep a lookout for weird behavior. Beyond this advice, there's not much a remote help can do unless you can pinpoint what's wrong, or at least provide more information. -- Gerald
RE: Can not run any command with ! in W2K
Juan Lanus wrote: ... when I use the :! syntax a DOS window containing the error shows. Issue the : !dir and in the resulting DOS window, issue the path command. The output will be what this _particular_ dos window has for the path environment variable. Then directly open a dos window in which the dir command works and issue the path command. Compare the two outputs. --Suresh
Re: how will a plugin know if Vim is currently starting?
You could check: if bufnr($) == 1 !bufloaded(1) this seems to be the case when it's first sourcing .vimrc, anyway. On 5/26/06, Hari Krishna Dara [EMAIL PROTECTED] wrote: One of my plugins was using the VimEnter autocommand to initialize some of the values. The autocommand is added while the plugin is sourced, and is removed when the autocommand is triggered. The problem with this approach is that if the script is manually sourced *after* the vim session is completely started, the autocommand will never fire. My question is, is there a way for the plugin to detect if Vim is currently in startup mode? I haven't found any v: variable to do this (like v:dying), any there is no built-in function either. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
***SPAM*** GVIM7.0 terminates when tries to delete the quickfix buffer.
OS: Windows2000 VIM version: GVIM 7.0 from www.vim.org I used ':vimgrep/pattern/j %' to search for a pattern in current buffer and listed the matches in the quickfix window. Then I double-clicked the left button of the mouse on the items in the quickfix window to jump to the corresponding locations. After several double-clicks, I tried to delete the quickfix buffer with ':bd', then a message box prompted which said memory 0x0121fc74 accessed by instruction 0x004920e5 can't be read. After I closed the message box, VIM terminated. That has happened many times but not always. And when I used ':cs find' the same thing happened. Have I done anything wrong? Or it's a problem of the OS or VIM? _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/