Re: oddity with :noautocmd when editing a help file
Benji Fisher wrote: Bug or feature? While editing this e-mail, :set ft=log :set ft? syntax? filetype=log syntax=log :noa e! /tmp/mutt-localhost-19331-88 /tmp/mutt-localhost-19331-88 7L, 108C :set ft? syntax? filetype=log syntax=log as expected. While editing a help file, :set ft=log :set ft? syntax? filetype=log syntax=log :noa e! autocmd.txt autocmd.txt [readonly] 1260L, 52535C :set ft? syntax? filetype=help syntax=log How did 'filetype' get set to help? help files are handled a bit special. The filetype is automatically set to help when loading the file. 'syntax' stays at log, because setting 'syntax' is done with an autocommand and you disabled that. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: Terminal-based auto-paste.
On 7/7/06, Sean Reifschneider [EMAIL PROTECTED] wrote: What I'm really looking for is that when I paste using the mouse, that paste is set. How about this :map MiddleMouse :set pastecr*p:set nopastecr and similar thing for imap -- untested Yakov
Re: Terminal-based auto-paste.
On 7/7/06, Sean Reifschneider [EMAIL PROTECTED] wrote: On Fri, Jul 07, 2006 at 11:35:41AM +0300, Yakov Lerner wrote: On 7/7/06, Sean Reifschneider [EMAIL PROTECTED] wrote: What I'm really looking for is that when I paste using the mouse, that paste is set. How about this :map MiddleMouse :set pastecr*p:set nopastecr and similar thing for imap I believe that's what vim does when you do set mouse. I would like to be able to do that when I do not have set mouse, based on number of characters in the input buffer, or characters read in the last 100ms or something. OK, so here's what you do: :map MiddleMouse :set pastecr*p:set nopastecr and :inoremap C-oset pasteCrC-r*C-oset nopasteCr nikolai
Re: Terminal-based auto-paste.
On Sat, Jul 08, 2006 at 12:10:14AM +0200, Nikolai Weibull wrote: On 7/7/06, Sean Reifschneider [EMAIL PROTECTED] wrote: On Fri, Jul 07, 2006 at 06:47:55PM +0200, Nikolai Weibull wrote: OK, so here's what you do: :map MiddleMouse :set pastecr*p:set nopastecr and :inoremap C-oset pasteCrC-r*C-oset nopasteCr That doesn't seem to do the job. I'm not quite sure what you're trying to accomplish here, so I can't tell where it's going wrong. There should be a MiddleMouse in the second line as well, of course. Even with MiddleMouse in the second line, it's not doing anything that I can see. It probably needs set mouse= for it to do anything, and as I said originally, set mouse totally doesn't work. Anyway, how about set mouse=a ttymouse=xterm ? That certainly does something on my terminal. I can't get it to work correctly in insert mode for some reason, but I really don't care so I'm leaving it at this. Probably because for it to work in insert mode you would need to do set mouse=i. However, as I explained originally, set mouse totally changes the way paste works from other applications in an xterm, including, you know, not pasting the text I've selected but some other text that came from I know not where. So, my original suggestion stands: Make it so that when vim detects a bunch of data arriving quickly, it sets paste. Thanks, Sean -- A computer scientist is someone who, when told to Go to Hell, sees the go to, rather than the destination, as harmful. -- Dr. Roger M. Firestone Sean Reifschneider, Member of Technical Staff [EMAIL PROTECTED] tummy.com, ltd. - Linux Consulting since 1995: Ask me about High Availability
Re: Terminal-based auto-paste.
On 7/8/06, Sean Reifschneider [EMAIL PROTECTED] wrote: Probably because for it to work in insert mode you would need to do set mouse=i. set mouse=a is a superset of set mouse=i nikolai
BUG: indirect 'configure' invocation hides exit status
I found a really annoying problem trying to build VIM 7 on HP-UX. I have an automated script that builds VIM as part of a toolchain. It ran through, and to my surprise and annoyance, installed VIM in /usr/local instead of where I wanted it. Long story short, the script called 'configure', which failed because it isn't (for some reason I have not yet figured out) finding the ncurses I built (--with-tlib=ncurses). Now, 'root/configure' calls 'src/configure' which calls 'src/auto/configure'... but the exit status is not preserved AT EITHER STEP. As a result, my script thinks 'configure' succeeded and moves on to 'make', which RE-runs 'configure' with default parameters, succeeds, and ultimately allows the script to move on to 'make install'! THIS IS BAD! The indirect 'configure' scripts need to preserve the exit status. The fix, which is trivial, I leave as an exercise. Otherwise, having a VIM with working highlighting and WORKING KEYS on the almost-half-dozen platforms I work on is wonderful. :-) Even if I've only managed builds for four of them so far... -- Matthew Do not expose to extreme heat, cold, or open flame.
Re: virus-laden emails from someone on the Vim list
To make this a little more concrete, here's some data from the last few such emails that I've received. First, typical headers: From - Thu Jul 6 18:56:35 2006 X-Account-Key: account2 X-UIDL: 1152233907.18606.mta6-4 X-Mozilla-Status: 0001 X-Mozilla-Status2: 1000 Return-Path: [EMAIL PROTECTED] Delivered-To: george:[EMAIL PROTECTED] X-OB-Received: from unknown (192.168.9.207) by 192.168.8.190; 7 Jul 2006 00:58:27 - Received: from 30013-2004-0009.com (unknown [203.229.175.114]) by spf6-3.us4.outblaze.com (Postfix) with SMTP id 1D21C10DADB for [EMAIL PROTECTED]; Fri, 7 Jul 2006 00:58:22 + (GMT) Date: Fri, 07 Jul 2006 09:58:30 +0900 To: George [EMAIL PROTECTED] From: Agiorgio [EMAIL PROTECTED] Subject: Avis Message-ID: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: multipart/mixed; Next, the IP addresses and the purported senders: 221.163.190.71 - Tal [EMAIL PROTECTED] 203.229.175.114 - Agiorgio [EMAIL PROTECTED] 218.155.24.56 - Tal [EMAIL PROTECTED] 210.222.7.64 - Slouken [EMAIL PROTECTED] 211.192.1.102 - Eljay [EMAIL PROTECTED] 214.180.5.118 - Tal [EMAIL PROTECTED] The last IP address is in Estonia; the rest are in Korea. Can anyone take this further? -- /George V. Reilly [EMAIL PROTECTED] http://www.georgevreilly.com/blog George V. Reilly wrote: [CCing the Vim and Vim-Dev lists. Not that it did any good the last time I raised this subject.] It is NOT me, dammit! Someone on the Vim list is infected with a virus that trawls through his address book and forges the From address. I too get dozens of virus-laden emails every week that purport to be from various people on the Vim list. Bram, Henk, Arpaffdy, and my own name are some of the names that I see regularly. This has been going on for at least two years :-( This laptop has been running a fresh install of Ubuntu 6.06 for the last four weeks, so if you've seen any mails from me in that interval, it definitely wasn't me. And I run antivirus and antispyware software when I'm running Windows, and I keep the signatures up to date. Vimmers, for the love of God, download antivirus and antispyware software, and run a scan on your machines. Windows users, start here: http://www.microsoft.com/athome/security/default.mspx /George @ Rocteur CC wrote: I can't believe it, is this really you. I receive at least 5 spams a week from your email address. I can't believe it, is this a legitimate mail from you ? I'll be damned, the worlds biggest spammer is from the VIM list.. I didn't realize.. Virus, worms, spam, you name it, I get it from your address, I always thought it was a phony email address and now I see it is a real one.. Can you not do something about this ? Anyway, I have hundreds of spam mail from you and it was a shock to see one that was not spam.. Jerry On 06 Jul 2006, at 21:10, George Reilly wrote: [snip]
Making vimdiff work
Hello, I am trying to set up vimdiff, but E97 is thrown. gvim -d tutor.alter tutor.de Enter tutor.de [unix] 847L, 31889C tutor.alter [unix] 853L, 31953C E97: Cannot create diffs Test diff.exe inside of gvim: :!diff - opens shell with diff.exe Test of diff itself: C:\TEMP\vimtutor_neuneu\Endversiondiff tutor.alter tutor.de | more 2c2 =W i l l k o m m e n z u m V I M T u t o r-Version 1.5D = --- =W i l l k o m m e n z u m V I M T u t o r-Version 1.5.2D = 7c7 gestaltet, um genug Befehle vorzustellen, so dass Du die Fõhigkeit erlangst , --- gestaltet, um genug Befehle vorzustellen, dass Du die Fõhigkeit erlangst, So everything seems to be ok. What is missing? (gvim 6.2) Thank you Joachim ### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/
Re: set textwidth=80 and c mode
On Thu, 06 Jul 2006 10:45:54 -0400 Charles E Campbell Jr [EMAIL PROTECTED] wrote: Do you have something like filetype plugin indent on in your .vimrc? When I put set tw=80 into my .vim/ftplugin/c/c.vim file, and then edited something.c, the textwidth was then 80 instead of 0 as it normally is. My .vimrc is very simple: set autoindent set wildmenu set wcm=Tab - also I add $ cat .vim/ftplugin/c.vim set textwidth=30 and that's all You can try editing something.c yourself, and then trying :verbose set tw? to find out where it was set last. It tell that it set it last time in ~/.vim/ftplugin/c.vim but it doesn't work. It only works if I start vim like this: vim +'set formatoptions=vt' /tmp/1.c
Re: turning on vim spell in xml documents
Excuse my too brief question. Actually spell is turnned on for xml through my autocmd. Probelm is that spelling errors do not show up in tags and only in xml comments. I have to chenge filetype to (say) txt in order to see the typos. Any suggestions? On 06/07/06, Benji Fisher [EMAIL PROTECTED] wrote: On Thu, Jul 06, 2006 at 10:00:27AM +0200, Eric Smith wrote: How? If you want to set the 'spell' option, or make other customizations, when editing xml files, the recommended method is to create a personal ftplugin file for xml, usually $HOME/.vim/ftplugin/xml.vim (creating the directory if necessary) and add the line set spell to this file. I do not think the default ftplugin will fight over the 'spell' option, but it gets more complicated if you want to tweak options that are already set there. For more details, read :help filetype-plugin HTH --Benji Fisher -- Eric Smith
Changing spell check colors
Using spell check in a terminal window hightlights some words with a bright green background and white text. I find this hard to read (I'm using a dark background and I have set background=dark in my .vimrc). Is it possible to override the the spell check color scheme, and if so, can someone please point me in the direction of what I need to look at? Thanx! Chris -- Chris Sutcliffe http://ir0nh34d.blogspot.com http://emergedesktop.org
Re: Changing spell check colors
On 7/7/06, Chris Sutcliffe [EMAIL PROTECTED] wrote: Using spell check in a terminal window hightlights some words with a bright green background and white text. I find this hard to read (I'm using a dark background and I have set background=dark in my .vimrc). Is it possible to override the the spell check color scheme, and if so, can someone please point me in the direction of what I need to look at? You need to define following highlighting groups: SpellBad SpellCap SpellRare SpellLocal For example, in my setup SpellBad is defined as SpellBad xxx term=reverse ctermbg=1 gui=undercurl guisp=Red -- shows as gray on red background To learn how to write your own :highlight commands 1) :highlight - instructive, shows existing highlight groups :hi 2) :help :hi 3) To check how Spell-related groups are defined: :hi SpellBad :hi SpellCap :hi SpellRare :hi SpellLocal Yakov
Re: turning on vim spell in xml documents
On 7/7/06, Eric Smith [EMAIL PROTECTED] wrote: Excuse my too brief question. Actually spell is turnned on for xml through my autocmd. Probelm is that spelling errors do not show up in tags and only in xml comments. I have to chenge filetype to (say) txt in order to see the typos. If you open xml.vim file :e $VIMRUNTIME/syntax/xml.vim and search for Spell, you'll see that it contains several occurences of [EMAIL PROTECTED] According to :help spell-syntax, this is what makes xml syntax spellcheck only in specific syntax items, but not in others. I do not find any conditional in xml.vim that let you customize it. You can try several things: 1) copy $VIMRUNTIME/syntax/xml.vim into your ~/.vim/syntax and edit it, removing all @Spell things. This will make spellcheck check everywhere in xml syntax, according to ':help spell-syntax', 2) You can email maintainer of xml.vim asking him to add some conditional regarding @Spell. 3) You can define some mappings to switch filetype to txt/empty together with setting spell, and setting filetype again when setting nospell. It's all in your hands now! Yakov
Re: Making vimdiff work
[EMAIL PROTECTED] wrote: Test diff.exe inside of gvim: :!diff - opens shell with diff.exe What is your shell quoting character? (:help 'shq') For Windoze, generally it should be a double quote (). Regards, Chip Campbell
Help with a syntax region
syn match tclExternal \\(package\)\s\(forget\|ifneeded\|require\)\ I would like a region that looks at the word(s) coming after that match. package require Tk Tk in that would be the word to match (and color). :Robert
Large stynax files
This is a really quick question, in a hope to save myself some potentially wasted time. The tags file for the code base I am using contains approximately 150,000 tags. A very quick parse of the file turns up around 15,000 tags that I would like to colour nicely in syntax - basically /\s\+[dst]$. Now, before I go to the effort of creating a more complete list of desirable tags, and parsing the data to turn it into a nice syntax file (all somewhat painful given that I'm not on Linux, my favoured platform), does anyone have experience using that many keywords, and any comments on how slow it will make vim load up? Will it take ridiculous amounts of time, or just lots of time? Cheers! -- Max Dyckhoff AI Engineer Bungie Studios
Visual Highlight non-contiguous regions
Is there a way to visually highlight multiple non-adjacent lines at the same time? For example, highlight lines 1, 4, 7, but no other lines. Kevin
Re: Project and ftp
just one more quick thing, is there a way for the files listed in the project pane that are on ftp/etc to just list their name instead of ftp://[EMAIL PROTECTED]/somefolder/somefile to only list somefolder/somefile or just somefile Thanks in advance. On 7/6/06, Silent1 [EMAIL PROTECTED] wrote: ah okay, thanks again for your help. On 7/6/06, Tom Purl [EMAIL PROTECTED] wrote: I don't believe so. is it possible for the project plugin to create the files/dir recursively if i give the ftp info? I tried with \C but with no luck. Thanks On 7/6/06, Tom Purl [EMAIL PROTECTED] wrote: my_servers=/home/someguy/project_folder CD=. { ftp://servera.domain.com//home/someguy/file1.html ftp://servera.domain.com//home/someguy/file2.html ftp://serverb.domain.com//home/someotherguy/file3.html } Basically, you use the same syntax that you would use to open a file via FTP with the netrw plugin (:h netrw). Hope that helps! Tom Purl
Re: Visual Highlight non-contiguous regions
stri ker wrote: Is there a way to visually highlight multiple non-adjacent lines at the same time? For example, highlight lines 1, 4, 7, but no other lines. Do you want to use ctrl-v, v, or V? With those, the answer is: (drumroll, please) ... No. However, if you're talking about :set hls, then /\%1l\|\%4l\|\%7l will do the job. Regards, Chip Campbell
Re: set textwidth=80 and c mode
On Fri, Jul 07, 2006 at 12:50:17PM +0400, Paul Drynoff wrote: On Thu, 06 Jul 2006 10:45:54 -0400 Charles E Campbell Jr [EMAIL PROTECTED] wrote: Do you have something like filetype plugin indent on in your .vimrc? When I put set tw=80 into my .vim/ftplugin/c/c.vim file, and then edited something.c, the textwidth was then 80 instead of 0 as it normally is. My .vimrc is very simple: set autoindent set wildmenu set wcm=Tab - This is the problem. If you add the line filetype plugin on to your vimrc file, then vim should recognize any file ending in .c as a C file and apply the settings from ~/.vim/ftplugin/c/c.vim . HTH --Benji Fisher
WG: Launch a browser from url in text
Hi, is it possible to hide ex commands called via a mapping from appearing in the command line? TIA, Stefan -Ursprüngliche Nachricht- Von: Bittner, Stefan Gesendet: Freitag, 7. Juli 2006 20:56 An: 'Cesar Romani' Betreff: AW: Launch a browser from url in text Hi Cesar, I don't think there is a way to hide it. The \gu is a mapping to that :call Utl_goUrl('edit') and this can't be hidden as far as I know. Sometimes I think, it would be nicer to only have : commands - no \xx mapping at all. So the \gu would be replaced by, say, :Gu . (The latter exists, but not to open URL under cursor but takes an URL as argument.) I guess, that what you want is: to get the right hyperlink feeling, just follow the URL with no noise. Correct? Regards, Stefan -Ursprüngliche Nachricht- Von: Cesar Romani [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 6. Juli 2006 03:57 An: [EMAIL PROTECTED] Cc: Vim Betreff: R: Launch a browser from url in text -Messaggio originale- Da: Bittner, Stefan [mailto:[EMAIL PROTECTED] Inviato: lunedì 3 luglio 2006 19.19 A: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Oggetto: WG: Launch a browser from url in text Hi Cesar, if you consider to use the Utl-plugin mentioned by Tom below, please don't hesitate to contact me if you have any questions. I think Utl.vim can do what you need. With the mapping :nmap 2-LeftMouse Leadergu you can doubleclick an URL. It would also be possible to use URLs without embeddings, e.g. execute http://www.vim.org/scripts/script.php?script_id=293 instead of URL:http://www.vim.org/scripts/script.php?script_id=293 Regards, Stefan (Creator of utl.vim plugin) -Ursprüngliche Nachricht- Von: Tom Purl [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 2. Juli 2006 04:30 An: Cesar Romani Cc: Vim Betreff: Re: Launch a browser from url in text Check out the utl plugin: * http://www.vim.org/scripts/script.php?script_id=293 It may not be exactly what you want, but it's very close. HTH! Tom Purl On Sun, Jul 02, 2006 at 04:19:10AM +0200, Cesar Romani wrote: Is it possible to doubleclick a highlighted URL in a text and thus launch a browser, f.e. internet explorer or firefox? The command gf allows to open a file under a cursor. Isn't there anything similar for URLS? Many thanks in advance, Andalou I'm using utl.vim to open url under the cursor. When I press \gu under an url, it opens the url but it appears at the bottom: :call Utl_goUrl('edit') How can it be hidden? Many thanks in advance, Cesar - End forwarded message - --
Re: Out of sequence messages from python
On Thu, Jul 06, 2006 at 06:15:21PM +0100, J Alan Brogan wrote: Hi all, I have a problem when scripting vim with python which is not covered by the FAQ (http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl), and would be grateful for help (or perhaps a redirect to a list more directly connected to vim scripting ?) I am using vim 7.0, and python 2.4.2 I have vim (or gvim) running with a python script in the current buffer and try to parse it. When parse errors occur I would like to move to the line with the error, and then ask the user what to do about it (or maybe just explain what the error is if I ain't no clue what to do). So, bypassing a few key-redirects, and extra scripting what happens is essentially: [snip] ie: compile the contents of current buffer, if there is an error, find row/col, go to that row, then if the error is a missing colon, ask whether it should be added. It looks as though you have already put a lot of work into this approach, but have you considered using quickfix mode? :help quickfix [snip] I have also seen the same effect with output, for example normal('%dG0%dl' % (row,col)) # other stuff print hello world and normal('%dG0%dl' % (row,col)) # other stuff print sys.stderr, hello world it can be seen that the (error) message is printed first, and later the cursor moves. Any suggestions as to where I might be going wrong, and how I can get the instructions to appear back in the right order ? Ah, now this is an example I can handle. I think that the cursor is moving before the print command, but you do not see it until the screen is redrawn, which happens later. I tried :python EOF import vim def normal(command): vim.command('normal %s' % command) cw = vim.current.window print cw.cursor normal('1G01l') print cw.cursor EOF and I got (97,1) (1,1) Can you construct a similarly simple example with a more convincing problem? HTH --Benji Fisher
Re: WG: Launch a browser from url in text
Stefan Bittner wrote: is it possible to hide ex commands called via a mapping from appearing in the command line? See :help :map-silent Regards, Chip Campbell
Re: Changing spell check colors
Chris Sutcliffe wrote: Using spell check in a terminal window hightlights some words with a bright green background and white text. I find this hard to read (I'm using a dark background and I have set background=dark in my .vimrc). Is it possible to override the the spell check color scheme, and if so, can someone please point me in the direction of what I need to look at? If you use the following plugin: http://vim.sourceforge.net/scripts/script.php?script_id=1081 and then type :help hicolors you'll see each highlighting color name in its own colors. This list includes SpellBad SpellCap SpellLocal SpellRare If you then right click on any of the names, a colorscheme editor will pop up for that color. Edit it, save it, use it! Regards, Chip Campbell
latex-suite and Vim 7.0 on Mac OS X
I recently upgraded Vim from 6.4 to 7.0 (binaries from macvim.org) under Mac OS X(10.4.7) and have noticed that the latex-suite package is no longer working. I installed the suite package in my personal .vim directory (not a system install), and all other ftplugins seem to be working under 7.0 as they had under 6.4. The only one that seems broken is latex-suite. I'm able to reproduce this problem on a number of machines (desktops and powerbooks). Has anyone else noticed this, or can anyone suggest ways to try to debug what is going on? thanks, -- Serge Rey http://geography.sdsu.edu/People/Faculty/Rey.html
Re: Project and ftp
On Fri, Jul 07, 2006 at 02:35:25PM -0400, Silent1 wrote: just one more quick thing, is there a way for the files listed in the project pane that are on ftp/etc to just list their name instead of ftp://[EMAIL PROTECTED]/somefolder/somefile to only list somefolder/somefile or just somefile Not that I know of. I usually end up using the spacebar shortcut when my cursor is in the project pane to expand the width of that pane temporarily.