Re: wish: collaboration of N vim instances editing same file
On Fri, Apr 20, 2007 at 03:55:33PM EDT, Andrew Maykov wrote: On 4/20/07, cga2000 [EMAIL PROTECTED] wrote: collaboration of N vim instances editing same file [there was some text] See the screen(1) man page and search for multi. Are you (Is he) talking about several users concurrently modifying the same file(s) .. possibly from different geographic locations? I can't think of any valid reason why one lonely user - me for instance - would want to fire up several instances of vim to edit the same file. It can be. For example, in LNX user can edit file in text console, then switch to X11 and then start editor again to edit the same file, forgetting that other instance of VIM already launched. I in this case just do killall vim(or killall -9 vim, depending on mood). Yeah .. I know .. the recipe for a happy life is good health and a bad memory .. I have neither .. so accounting for folks who happen to be forgetful sounds a bit far-fetched to me .. :-) And should vim take into account the foibles of different categories of users in the first place? Thanks, cga
How can I get rid of this popup?
I recently installed vim 7.x and I'm very impressed with all the new features, especially the new tab stuff .. On the other hand, I'm sorry to say that there is _ONE_ feature that's literally driving me _NUTS_. If I hit the CTRL-P combo by accident .. p is very close to [ .. and I use CTRL-[ a lot .. well, some popup menu materializes out of the blue .. presenting me with a list of completion choices .. Thanks, but I am not senile or otherwise mentally challenged .. I know what I want to type .. and most of the time vim does not .. and since I can type reasonably well .. I do _NOT_ need this completion feature. Is there any way I can turn of this completion popup .. ? Since unwanted popups is one of the absolute evils of the web .. I'm unsure why this should have become a default feature of the current version vim and I sincerely hope it will cease to be the default with the next release. Maybe this might make some sense for GUI users .. but could it be left our of the terminal version? Thanks, cga
Re: wish: collaboration of N vim instances editing same file
On Thu, Apr 19, 2007 at 03:09:38PM EDT, Gary Johnson wrote: On 2007-04-11, Yakov Lerner [EMAIL PROTECTED] wrote: Hello Bram, Is it possible to add this item to the vim voting list ?: collaboration of N vim instances editing same file -- Ability of N instances of vim to absorb, merge and show changes to the same file made by other running vim instances [ either by reading other vim's swapfiles, or somehow else ] ? Can this be added to SOC ? If you want this collaboration to occur in real time, then I would recommend that you use a screen session in multi-user mode. This solution already exists; it works with applications other than vim; it avoids complicating the vim code. See the screen(1) man page and search for multi. Are you (Is he) talking about several users concurrently modifying the same file(s) .. possibly from different geographic locations? I can't think of any valid reason why one lonely user - me for instance - would want to fire up several instances of vim to edit the same file. Or could he be talking about some non-interactive mode .. with possibly scripts updating a common file? Sorry I hooked up to this particular message .. I no longer have the OP's initial message. Thanks, cga
Re: wish: collaboration of N vim instances editing same file
On Thu, Apr 19, 2007 at 03:09:38PM EDT, Gary Johnson wrote: On 2007-04-11, Yakov Lerner [EMAIL PROTECTED] wrote: Hello Bram, Is it possible to add this item to the vim voting list ?: collaboration of N vim instances editing same file -- Ability of N instances of vim to absorb, merge and show changes to the same file made by other running vim instances [ either by reading other vim's swapfiles, or somehow else ] ? Can this be added to SOC ? If you want this collaboration to occur in real time, then I would recommend that you use a screen session in multi-user mode. This solution already exists; it works with applications other than vim; it avoids complicating the vim code. See the screen(1) man page and search for multi. Are you (Is he) talking about several users concurrently modifying the same file(s) .. possibly from different geographic locations? I can't think of any valid reason why one lonely user - me for instance - would want to fire up several instances of vim to edit the same file. Or could he be talking about some non-interactive mode .. with possibly scripts updating a common file? Sorry I hooked up to this particular message .. I no longer have the OP's initial message. Thanks, cga
Re: VIM Delete All Except
On Thu, Apr 05, 2007 at 10:10:03AM EDT, jas01 wrote: I have a huge file where I need to delete all lines except for a few I need. I'm trying to do this in a single command. I know that: :v/Text/d will delete all lines except for ones containing 'Text.' I have no idea how to put multiple strings so the command deletes everything except for 'Text' and 'Text2' and 'Text3'. Please help! Maybe you're using the wrong tool to begin with? If the file is really huge, you may find adopting a different strategy is preferable. If you're on linux or similar you might use a command-line tool such as: $ grep Text[1-3] huge_file a_few_lines What this does is that it finds all the lines that contain at least one occurrence of Text1, Text2, or Text3 in ./huge_file and copies them to ./a_few.lines. Thanks, cga
Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator
On Tue, Apr 03, 2007 at 02:00:59PM EDT, Thomas wrote: Hi, This is something that I found annoying quite a time now and I'm pretty sure there is a simple solution for this problem. Paragraphs are defined as: A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the 'paragraphs' option. I often end up with seemingly blank lines that contain whitespace characters. Is there a way to make vim handle these lines as paragraph boundaries too as ip does? One could remap the {} keys but AFAIK these maps would be ignored by norm! and noremap commands. Does somebody know a way to do this? I understand this could also be considered a finesse/feature, but I personally would like to have to choice to treat lines containing only whitespace characters as empty lines. Maybe I misunderstand the problem but can't you change those lines with just blanks to empty lines? If it's just spaces we're talking about .. not tabs or other unprintables .. maybe something such as: :%s/^ *$//g .. would do it. And map it to something convenient if you use it on a regular basis. Or do you need to hold on to those spaces for any reason? Thanks, cga
Re: Customizing vim: How to change the char before commands
On Wed, Mar 21, 2007 at 06:04:46PM EST, A.J.Mechelynck wrote: Tim Chase wrote: [...] Just my $0.02 adjusted for inflation, minus taxes, social security, and medicare. -tim LOL. Must be at least $20 after adjustment, no? Isn't the other way 'round..? With 0.02 cents left for the list after adjustment? Thanks, cga
Re: Customizing vim: How to change the char before commands
On Wed, Mar 21, 2007 at 07:16:58PM EST, A.J.Mechelynck wrote: cga2000 wrote: On Wed, Mar 21, 2007 at 06:04:46PM EST, A.J.Mechelynck wrote: Tim Chase wrote: [...] Just my $0.02 adjusted for inflation, minus taxes, social security, and medicare. -tim LOL. Must be at least $20 after adjustment, no? Isn't the other way 'round..? With 0.02 cents left for the list after adjustment? Thanks, cga Depends how much you reckon for inflation, and on which basis: two of George Washington's cents, plus inflation, would make a goodly sum nowadays, don't you think? Yes, but as you no doubt realize, there is such a big difference in terms of lifestyles between his time and ours that it's practically impossible to make such comparisons just using the value of money as your reference. In a sense it's as bit as if for some reason you decided to move to, say Guatemala .. where you would need to have access to quite a sizeable income to keep up with the lifestyle of the average middle-class Bruxellois .. but on the other hand you would live reasonably well on a handful of euros a day if you went native. Just my two .. no that's enough .. I won't say it. :-) Thanks, cga
Re: Consistently exit message display with 'q'?
On Mon, Mar 19, 2007 at 11:50:12PM EST, A.J.Mechelynck wrote: [..] more shows the colors with no problem. In general, I use: - less - when there is a long listing which I want to be able to scroll back and forth, or to search with a / command - not when there are interspersed ANSI-like escape sequences as in ls --color. [OT] You could try less -R. Works for me, although a quick look at the man page suggests this might not work under all circumstances: .. tries to keep track .. In any case I have aliased b as in browse to less -R -M and never had a problem. Thanks, cga
Re: command to indent file
On Sat, Mar 10, 2007 at 01:43:50AM EST, Michael Wookey wrote: In the path I often used command to indent my php file or C# file: gg ... G mean go to the top of file and indent code until the end of file. But Unfortunately I forgot. Could anyone tell me what I forgot? :help = For example: gg=G Worked faultlessly on my 1000-lines docbook/xml cheat sheet. Made my day. Thanks, cga
Re: pulling text to the right?
On Mon, Feb 26, 2007 at 07:30:09PM EST, Lev Lvovsky wrote: I'm sure there's a fancy word for this, but is there any way to pull text to the right? suppose I have the following: COL1 INT, COL2 INT, COL3INT, I'd like to get COL3 aligned to COL1 and COL2, but to do that, I need to put the cursor behind COL3, hit space several times, and then align INT with the other INTs. Can I put my cursor to the right of COL3, and pull it over to INT on the right? I have this mapping in my ~/.vimrc that lets me enter spaces while remaining in normal mode: :nmap space i esc So in the above example I would enter: G /* move cursor to last line - COL3 ..*/ 3spacebar /* move COL3 three columns to the right */ e /* move the cursor to the '3' of COL3*/ l /* move the cursor to the space after COL3 */ 3x /* delete three spaces to the right of COL3 */ Sounds like a lot of work but all it really adds up to is seven easy keystrokes and the hands remain positioned on the home row. Compare with, for instance: down-arrowdown-arrowdown-arrow i spacespacespace escape right-arrowright-arrowright-arrowright-arrow deletedeletedelete .. fifteen keystrokes (and several moves to difficult-to reach keys) It's obviously not what you were looking for .. but once you get used to cursor movement commands that go beyond h,j,k,l (or worse .. arrow keys) it can be done quickly effortlessly. I admit that fluency does require a few months of practice so it's really for you to decide whether it's worth the trouble. Thanks, cga
Re: How do I make the current working directory follow the active document in Gvim?
On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote: [..] - To change (once) to the dir of the current file :cd %:p:h Nice. But I'm not going to remember it until I understand it. I scoured the :help files but couldn't find and explanation of the syntax. :p is short for :print and :h is help. So there's two things I don't know: 1. The symbolic (?) language you are using - the same that's used when scripting vim, I would imagine. 2. How to use vim's help efficiently :-) Thanks, cga
edit-compile-edit cycle in vim
I'm currently giving docbook a go and was wondering whether there might be a plugin in vim70 that might help make the experience a little less painful or more productive. I found one called dbhelper at vim.org and was wondering if anyone is using it.. Is it still maintained .. mature .. etc. ?? It also appears to cover the docbook/sgml/openjade toolchain rather than XSL/XML, which is what I am using and doesn't seem to have been enhanced recently. Or is there something more current and more adapted to my needs that I failed to locate -- entering the XML keyword on the script search screen at vim.org gives me an error message can't connect to local MySQL server throught socket '/tmp/mysql.sock'. Thanks, cga
Docbook edit-compile-edit cycle in vim
Too quick posting ... Sorry, cga
Re: How do I make the current working directory follow the active document in Gvim?
On Mon, Feb 26, 2007 at 12:24:33PM EST, Sibin P. Thomas wrote: -Original Message- From: cga2000 [mailto:[EMAIL PROTECTED] Sent: Monday, February 26, 2007 10:28 PM To: vim@vim.org Subject: Re: How do I make the current working directory follow the active document in Gvim? On Sun, Feb 25, 2007 at 07:57:39PM EST, A.J.Mechelynck wrote: [..] - To change (once) to the dir of the current file :cd %:p:h Nice. But I'm not going to remember it until I understand it. I scoured the :help files but couldn't find and explanation of the syntax. :p is short for :print and :h is help. So there's two things I don't know: 1. The symbolic (?) language you are using - the same that's used when scripting vim, I would imagine. 2. How to use vim's help efficiently :-) Thanks, Cga 2. How to use vim's help efficiently -- try :help topic. If that doesn't give you what you want try - :helpgrep topic (followed by :cwin if needed). Try :helpgrep %:p:h you will find the meaning of %:p:h Interesting approach.. .. a bit like doing a google search on the vim helpfiles in a sense. All it brings up in my case is references to the what's new with vim 6.x as compared with vim 5.x but with difficult cases, this should give me enough pointers to search the manuals. Thanks, cga
Re: How do I make the current working directory follow the active document in Gvim?
On Mon, Feb 26, 2007 at 12:32:19PM EST, Tim Chase wrote: - To change (once) to the dir of the current file :cd %:p:h [..] If you're impatient, full details can be found at :help filename-modifiers 2. How to use vim's help efficiently There are several attacks one can use to get Vim's help to spit out helpful stuff. In this case, I found it by typing :help :p and then hitting control+D instead of enter which causes Vim to show auto-completion for what you've typed so far. This brought back 6 columns of 11 rows each of possibilities, Yes, I did that :-) but most of them were clearly not what I was looking for (there was something after the :p). The one that looked most promising was ::p which, though somewhat strange-looking, turned out to be what I wanted. Missed it .. and if I had seen it .. I probabably would have looked it up just out of curiosity. :-) Another attack might be to use :helpgrep :p :copen .. and to think that I have this on my own little personal cheat sheet and never really used it up to now. The nice thing is that you can then use / to skim the output. Sometimes the difficulty is not so much learning the rich vim feature-set but integrating it to your day-to-day habits. Thank you so much for the reminder .. I feel guilty now so that should help me do some :helpgrepping regularly from now on. This opens a quickfix window (:help quickfix-window) of all the hits in the help where :p appears in the help. While I get just shy of 400 hits back, there are some obviously good leads and some obviously bogus leads among the chaff. One of the nice things is that you can use regexps in your search, so you can change it to :helpgrep :p\ .. even cooler than my uneducated method. to winnow that list down to 47 according to the help I have here. A number of the top hits come back in cmdline.txt, all fairly clustered together, so any of them would be a good starting candidate. Just navigate to a prospective candidate and hit enter to jump to that piece of the helpfile. These two methods are my usual attack into finding something in the vim-help. If these don't get you to where you want to go, it's often a matter of finding the right search keyword/pattern. added to my cheat sheet .. which I try to write more as a task-oriented document than a mere collection of commands. I find the exercise useful since as, I believe, A. Einstein once remarked .. if you can't explain it .. you don't fully understand it .. or something to that effect. I've been stumped by this before (just this month) and the mailing list is quite friendly about answering questions as well as guiding you in with keywords. In my case it was finding what turned out to be :help i_CTRL-G_u and Yakov was able to dig it up in the help using the phrase break undo which I hadn't come up with. So dig a bit with the above tools, and if you hit a wall, drop a line on the list with what you want and what you've tried, and I'm sure you'll get all sorts of good answers back. I often think that the intrinsic quality of vim@vim.org adds considerable value to an already great piece of software. What I particularly like about it is that you can come up with a naive or even dumb question and within the hour, somebody will come up with the answer to the question you should have asked. I am subscribed to about 25 mailing lists at this point and the only one that comes close is the TeX/LaTeX list. Interestingly enough there is very little trolling on vim@vim.org .. as if the quality of the posts acted as a deterrent. Thanks cga
Re: How do I make the current working directory follow the active document in Gvim?
On Mon, Feb 26, 2007 at 08:47:00PM EST, A.J.Mechelynck wrote: cga2000 wrote: [...] I find the exercise useful since as, I believe, A. Einstein once remarked .. if you can't explain it .. you don't fully understand it .. or something to that effect. Some French author of the 17th century I think (Boileau?): Ce qui se conçoit bien s'énonce clairement Et les mots pour le dire arrivent aisément. (What one conceives well is expressed clearly And the words to describe it come to mind easily.) I don't 100% agree. Maybe because you leave out the context. This is indeed from Nicolas Boileau's l'Art Poétique .. a treatise on writing .. recommendations relative to style .. etc. As far as I can remember this was mainly in reaction to the appalling state of French official poetry of the time .. you know, all that artificial stuff with shepherds and shepherdesses .. Another one he wrote could probably be added to netiquette manuals without changing a comma: Avant donc que d'écrire, apprenez à penser. (Before writing, one must learn to think) .. (rough translation) But I think I know where you're coming from .. and it reminds me of another one of my favorites: For every problem there is one solution which is simple, neat, and wrong. H.L. Mencken. [...] I often think that the intrinsic quality of vim@vim.org adds considerable value to an already great piece of software. What I particularly like about it is that you can come up with a naive or even dumb question and within the hour, somebody will come up with the answer to the question you should have asked. Yes, I agree. Sometimes before your mailer comes around to polling the server again, three or four people will have answered with so many different -- and valid -- solutions to your problem. -- Pierre Larousse wrote: /A dictionary without examples is a skeleton./ I'll add: The best-coded program won't spread well if it hasn't got good documentation. (Let me rephrase this, since after all there exist some badly-coded and badly-documented programs which do spread well because huge marketing $$$ are spent on them. So let'say: ) Good documentation is a plus for any program; a well-coded and well-documented program will need hardly any marketing effort. The Vim code isn't bad, and it benefits from the Bazaar model, but the Vim documentation is _outstanding_. /Everything/ is in there. It's so complete that at times, it poses sort of a needle-and-haystack problem, I tend to consider that vim@vim.org is actually a priceless extension to the vim documentation system. but even that has been addressed with features like helptag completion, help hyperlinks, and the :helpgrep command. Then these mailing lists carry that a step further: if RTFM doesn't get you what you want, come here and you'll find real people who will show you where to look and what to do. I have had this feeling before that learning vim is a bit like mastering craft and consider myself a lucky apprentice. I am subscribed to about 25 mailing lists at this point and the only one that comes close is the TeX/LaTeX list. Interestingly enough there is very little trolling on vim@vim.org .. as if the quality of the posts acted as a deterrent. Thanks cga The patience and good humor of the old-timers here (first and foremost Bram) certainly acts by virtue of example. Another possibility (but I'm on less firmer ground there): maybe these lists are too confidential to attract a lot of trolls? And possibly a consensus that if anyone barges in with outrageous nonsense he will be met with complete silence. He will feel like the idiot that he is and go sell his wares elsewhere. Thanks, cga
Re: How do I make the current working directory follow the active document in Gvim?
On Mon, Feb 26, 2007 at 08:06:12PM EST, A.J.Mechelynck wrote: cga2000 wrote: [..] 2. How to use vim's help efficiently here are a few examples; some of them use a fictional subject: :help gives you very general help. Start scrolling and you will see a list of all known helpfiles, including those added locally (i.e. not distributed with Vim). :help subject gives you help about some subject, which can be (the list is not exhaustive): :help :subject an ex-command, for instance the following: :help :help help on getting help :help 'subject' an option :help subject() a function :help -subject a command-line option :help +subject a compile-time feature :help EventName an autocommand event :help abc a normal-mode command :help CTRL-B a control key in Normal mode :help i_abc :help i_CTRL-B the same in Insert mode :help v_abc :help v_CTRL-B the same in Visual mode :help c_abc :help c_CTRL-B the same in Command-line mode :help user-toc.txt table of contents of the User Manuel :help digraphs.txt the top of the helpfile digraph.txt similarly ofr any other helpfile :help patternTab get a helptag matching /pattern/ If 'wildmenu' is ON, the last one above will (if there are at least two matches) replace the bottom statusline by a menu. Navigate with Left Right, move up or down directory trees with Up Down, accept with Enter, abort with Esc -- see :help 'wildmenu' for details :help patternCtrl-D see all possible matches at once :helpgrep pattern search the whole text of all helpfiles for the given pattern. Results are built into a quickfix error file and can be viewed with :cn next match :cprev or :cN previous match :cfirst :clast first or last match :copen :cclose open/close the quickfix window This is beginning to make more sense. I need to xml-ize the above into a docbook table and add it to my little cheat sheet. Thanks for all the details. But, like a dictionary or an encyclopedia, the Vim help system also lends itself to reading by the Montecarlo method and to the dictionary game: - Montecarlo method: start anywhere and read what you find there. Read on. When bored, open another page at random. - the Dictionary Game: Start by the Montecarlo method. When you see a subject name (here anything in dark green) with which you are not familiar, look it up (here: double-click it or hit Ctrl-] on it). Repeat until bedtime. Or to paraphrase Marguerite Duras .. Des journées entière dans les livres. Thanks, cga
Re: vertically split the whole screen
On Mon, Feb 26, 2007 at 06:38:35PM EST, Kamaraju S Kusumanchi wrote: Let's say I open a vim session by vim -o2 file1 file2 now when inside file1, If I do :vs file3 I will get -- file1 | file3 -- file2 -- Instead I want to get -- file1 | --- file3 file2 | -- Is there any easy way? To switch from the first display to the second on the fly: CTRL-w L /* upper case 'L' !! */ Likewise you can use .. CTRL-w H /* ibid. */ CTRL-w J /* ...*/ CTRL-w K /* ...*/ .. to rearrange the respective locations of your windows following the usual lower case mnemonics (H=left, L=right, J=down, K=up) Now, combined with .. CTRL-W h,j,k,l .. to navigate your vim windows and a bit of practice to get the hang of it, you should be able to switch to just about any configuration that suits you at any given time without thinking. Thanks, cga
Re: How do I make the current working directory follow the active document in Gvim?
On Mon, Feb 26, 2007 at 11:39:08PM EST, A.J.Mechelynck wrote: cga2000 wrote: On Mon, Feb 26, 2007 at 08:47:00PM EST, A.J.Mechelynck wrote: [..] Avant donc que d'écrire, apprenez à penser. (Before writing, one must learn to think) .. (rough translation) Let's try to recapture the alexandrine rhythm: Before you start to write, teach yourselves to think. A marked improvement if I may say so. But I think I know where you're coming from .. and it reminds me of another one of my favorites: For every problem there is one solution which is simple, neat, and wrong. H.L. Mencken. I hark from Brussels, Belgium, if that's what you mean. I know where you're coming from has nothing much to do with geography these days. It's more like I hear you .. or I know what you're saying. It's just one of those expressions you keep hearing. I try to avoid them even in informal conversations but somehow it crept into my prose above. I have a feeling that when used in the first person by someone after voicing his opinion on some matter or other such as in, for instance, do you understand where I'm coming from? the said individual is trying to add more weight to that view of his by conveying that it evolved as a result of a lengthy and presumably painful learning experience. When used in the second person as I did above it probably adds a touch of empathy .. ie. not only do I rationally understand what you are saying but I am also aware of what led you to think thusly and feel pretty much the same myself about it. Thanks, cga
Re: hlsearch on dark back ground
On Wed, Feb 21, 2007 at 05:25:41PM EST, Kamaraju S Kusumanchi wrote: A.J.Mechelynck wrote: Most console terminals have only 8 background colours, 16 foreground colours. Some have 16 of both. Non-bright yellow (including every background yellow) is usually shown as brown. Whether you can or cannot change the terminal's colour palette is outside the realm of Vim. Best regards, Tony. How can I find out how many colors the konsole is using, how many colors the xterm is using? Any idea? I am using Debian Etch. $ strings $(which xterm) | grep ^color[0-9] Thanks, cga
Re: How to directly enter visual mode from insert mode ?
On Tue, Oct 03, 2006 at 12:05:30PM EDT, Ivan Vecerina wrote: This is a problem I am occasionally stumbling on: as I am done typing some new next in insert mode, I want to highlight and erase some text ahead of the insert point. Best case, I can type: ESClv But if I am at the end of the line, this won't work (the last character I inserted will be selected as well). It would be nice if there was a convenient way to go directly from insert mode to visual mode, while ensuring that the visual selection starts at the current insertion point. Is there an easy way to do so ? I do a Ctrl-O and then the lv commands .. May be convenient or er .. less so .. depending on where you want to start you visual highlighting. If you need to prefix three of four movement commands by a Ctrl-O to get there it may be worth your while to escape back to command mode. YMMV Thanks cga
Re: How to directly enter visual mode from insert mode ?
On Tue, Oct 03, 2006 at 05:55:31PM EDT, Dasn wrote: On Tue, Oct 03, 2006 at 06:05:30PM +0200, Ivan Vecerina wrote: This is a problem I am occasionally stumbling on: as I am done typing some new next in insert mode, I want to highlight and erase some text ahead of the insert point. Best case, I can type: ESClv I prefer using C-Ov or C-\C-Ov to switch to Visual mode temporarily Shoot .. this was hidden on the next page and I didn't see it until it was too late .. :-( :-( :-( Oh well .. should convince the OP that this is the way to go.. And then it may have the opposite effect... :-) Thanks cga
Re: vim backspace
On Mon, Oct 02, 2006 at 04:07:10PM EDT, Charles E Campbell Jr wrote: cga2000 wrote: I don't suppose there's any way I can save the current interactively- modified colorscheme to a file? Perhaps http://vim.sourceforge.net/scripts/script.php?script_id=1081 will be helpful for what you want to do. Interactively adjust the colorscheme using hicolors' colorscheme editor, then save it. I'll take a look. It may give me ideas on how to improve the methodology outlined in my previous message. Only problem I see is that I don't use a mouse. Thanks cga
Re: vim backspace
On Sat, Sep 30, 2006 at 03:25:08PM EDT, samitj wrote: [..] 2) I modified my .vimrc file with some color settings. However, now I just get a blank screen with my xterm color covering the whole screen - cant see any text. HOw do I fix this? I find that rather than making extensive changes to my .vimrc, a useful approach is experimenting in Command-line mode .. one color change at a time .. This lets you test your changes interactively before adding them to your .vimrc. Thanks cga
Re: first character cutted when v,j,x
On Sat, Sep 30, 2006 at 08:35:04PM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] What you highlighted includes the cursor Misuse of v was the issue and explains why Vim thus behaves. Since v is per character visual mode .. vjj does not make much sense in the first place .. using the wrong tool .. Either you do a Vjj .. or vj etc. (or vj$ not very logical but at least is consistent). Now that you have told me what to look for, I can see that cursor .. and everything falls into place. (move the cursor to the other end with o -- and with selection=inclusive -- to check it). The Unix default is to delete the whole Visual area, including the cursor character. This, IIUC, predates Vim. The Windows default is different: on Windows, in non-Vim programs, the bar cursor is between characters, not on a character, .. sounds fishy .. in a cell terminal how could a character be between characters.. except by being invisible? :-) and the highlighted area (when using shift-right or shift-down, i.e., forward motions) stops left of the cursor. The purpose of the confusing exclusive behaviour on Windows is to cater to the peculiar customs of Windows users. Notice that gvim has a block cursor in Visual mode when 'selection' is inclusive, and a thick bar cursor when it is exclusive. Note: to highlight and delete full lines, use linewise visual mode (with V not v). Linewise-visual always includes (and highlights) the cursor line. Which is what I did without understanding why .. just worked. Makes a lot of difference to know why, though .. Since this is general to all movement/selections it explains a number of other behaviors that have baffled me in the past. As always, thanks for your enlightening comments. cga
Re: vim backspace
On Sun, Oct 01, 2006 at 08:34:50AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] There are a number of colorschemes in $VIMRUNTIME/colors/ ; I'm adding my own rather simple one (attached) as an additional source of inspiration. To invoke a colorscheme, use the :colorscheme command with the script name (not including the .vim extension). After making changes to your current colorscheme, :syntax on will reapply it. This would reload the original colorscheme .. doing a reset defaults or rather original color scheme, if there is one .. so-to-speak .. right? I don't suppose there's any way I can save the current interactively- modified colorscheme to a file? What I mean is that .. I use a given colorscheme and make changes to it in a Vim session .. say, I want the cusor to be easier to see :-) .. or I don't like the reverse-vid effect that hilights searched/found items .. etc. So I play with all this stuff for 10 minutes until I like what I see. And when I'm done with my changes, I want to save them somewhere .. Now, I still need to copy the original colorscheme under a different name and edit it manually to implement my changes one at a time, am I correct? The way I do this is to split the screen .. so I have the colorscheme in one half and my sample practice file in the other .. So, I use the UP cursor key to retrieve my :hi commands .. gnu/screen to copy/paste them in the colorscheme in lieu or the original statements .. and save my changes to colorscheme_custom .. eg. Rather messy but safe .. As long as I can figure out which among the dozens of commands I issued were the final ones for a particular :hi feature, that is .. I wasn't too sure where I could look for this (keywords?) .. but I didn't find anything like this either in the tips/scripts or in the help files. Thanks cga
Re: first character cutted when v,j,x
On Sun, Oct 01, 2006 at 09:33:37AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [...] .. sounds fishy .. in a cell terminal how could a character be between characters.. except by being invisible? :-) [...] Windows, even more than modern Unixes (those with X11), is GUI-oriented. On Windows, IIUC, only old Dos hands like me, hackers, and Unix users ever use the Dos Box. Other people use WYSIWYG interfaces like Word, and their cursor is not a character, nor does it cover a character; it is a blinking bar between characters. Gvim imitates that quite well, except that the gvim cursor must always be thought of as being on a character, even in Insert mode when it displays as a thin vertical bar on the left edge of the character cell. Very interesting. Thanks cga
Re: vim backspace
On Sun, Oct 01, 2006 at 12:29:24PM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] I suppose it's explained under :help :highlight and below more than anywhere else (sections 12 and 13 of syntax.txt -- it's rather lengthy); but it's mainly something you have to learn by doing. I think I was unclear. What I'm doing is using an existing colorscheme as a template. I proceed to make some changes to it while editing some sample file .. Could be C code .. email .. python .. latex .. html whatever. This gives me instant feedback so I can see with my own eyes whether I have a pleasant and readable shade of grey .. pink .. blue .. etc. Heck .. I use a 256-color xterm and well I'm working on it but I haven't yet managed to memorize all of them .. color113 .. color178 .. I don't even know if they're reds.. greens .. or blues. I thought that doing it this way would make it a lot more easier than coding a colorscheme from scratch and hoping for the best. But then I went looking for a save current colorscheme feature and didn't find one. So I had to go through the hassle of figuring out what I did by retrieving the successive commands that I issued. Just another case of barking the wrong tree .. just editing the color scheme in one half of my display .. saving it and loading the modified version to check the results is just as quick and decidedly better than issuing :hi commands manually since it .. 1. saves a good deal of typing .. and .. 2. once you're satisfied with the result .. you're done. The last version of the colorscheme that you saved corresponds exactly to what you are looking at. Thanks for helping me figure out a more sensible methodology. cga
Re: first character cutted when v,j,x
On Sat, Sep 30, 2006 at 11:11:02AM EDT, Eddy Zhao wrote: Hello all, I find a behaviour difference between windows gvim linux gvim. For text like below line 1 line 2 line 3 Following the sequence below - move focus to first line first character - v - j - j - x On windows gvim, text remained is line 3 On linux gvim, text remained is ine 3 How to make linux gvim behave like windows vim (l not cutted)? Doesn't have to be gvim .. same behavior in plain console vim .. I have to do a Vjjx (instead of vjjx) so vim doesn't gobble up the l of line 3. Wonder why. Thanks cga
Re: first character cutted when v,j,x
On Sat, Sep 30, 2006 at 06:03:28PM EDT, Dasn wrote: [..] How to make linux gvim behave like windows vim (l not cutted)? Take a look at your 'selection', it should be 'exclusive' on your windows platform. For more info: :h :behave :h 'selection' Could you explain further? After reading the recommended help files I still don't see the logic of Vim deleting more characters than what I highlighted in the first place _and_ making this the default in *nix environments. What am I missing and what is the purpose of this confusing behavior? Thanks cga
Re: The Vim Outliner: \n does not work
On Sun, Aug 27, 2006 at 10:46:01PM EDT, Meino Christian Cramer wrote: [...] My question: When using the \x (x := [1-9at]) commands from above, they do simply nothing. I check with :map wheter there is anoter maplocalleader defined but it ios not. Furthermore, the commands are listed. When I first atttempted to use plugins that required typing leader+command such as the \x you mention above .. it did not work either. What I later found was that I had to type the \ and the following character(s) fairly rapidly. Otherwise the action would time out .. leaving me with just the character(s). But in your particular case this would amount to typing x, which in command mode would normally delete the character under the cursor. So, I'm not sure this will help. Thanks cga
Re: Paragraph formatting options
On Mon, Aug 28, 2006 at 10:15:00AM EDT, Mikolaj Machowski wrote: Dnia sobota, 19 sierpnia 2006 05:36, cga2000 napisa?: Is there any way I can tell Vim that when line 1 starts with a number followed by a dot '.' .. the following lines should be indented so that all the text is aligned. Not simple .. I guess .. since this could move into double digits (or more..) -- there could be more than nine numbered paragraphs and text should start in column 5 (or 6..). Vim7 option 'formatlistpat':: set formatlistpat=^\\s*\\(\\d\\+\\\|[A-Za-z]\\\|ps\\)[\\]:.)}]\\s\\+ will format digit and alpha/Alpha lists plus postscripts in mails. .. and I can't even test it since I'm still running Vim 6.4. :-( I'll add it to my .vimrc as a comment so I don't lose it .. and keep you posted after I upgrade. Thanks cga
Re: Paragraph formatting options
On Sat, Aug 26, 2006 at 05:09:35AM EDT, Gary Johnson wrote: On 2006-08-24, cga2000 [EMAIL PROTECTED] wrote: On Sat, Aug 19, 2006 at 01:45:32AM EDT, Gary Johnson wrote: On 2006-08-19, cga2000 [EMAIL PROTECTED] wrote: [..] Each Windows machine, on the other hand, is its own little universe: every application you want to use has to be installed on it and every customization has to be applied to each machine individually. I can't believe anyone actually thinks the system administration cost of Windows is less than that of Unix, if you include the cost of users doing their own administration. (Grumble grumble.) Of course, nobody *really* thinks that .. it's all about the guys on the top floor no longer feeling nervous about lowly system administrators doing things that they do not understand. Next thing you would be the one running the company .. :-) Is there any way I could map a simple toggle to (de)activate fo+=a (auto-format) .. so I can get rid of it quickly when it starts causing problems .. such as editing mail headers in mutt .. eg. ?? Try this: map silent F1 :if match(fo, 'a') != -1 bar set fo+=a bar else bar set fo-=a bar endifCR should be: .. if match() == -1 .. Is there a way I can list current keyboard mappings? Thanks cga
Re: Paragraph formatting options
On Sun, Aug 27, 2006 at 02:37:54PM EDT, Gary Johnson wrote: On 2006-08-27, cga2000 [EMAIL PROTECTED] wrote: [..] Is there a way I can list current keyboard mappings? You can get a list of user-defined mappings by executing :map and a list of the default bindings here: :help index See also: :help map-listing :help map-which-keys :help 40.1 This is cool..! Thanks cga
Re: Paragraph formatting options
On Sat, Aug 19, 2006 at 01:45:32AM EDT, Gary Johnson wrote: On 2006-08-19, cga2000 [EMAIL PROTECTED] wrote: [..] I'm three hours behind/ahead of you (EST) .. so it's bedtime for me .. It's getting late here, too, but I just got a new Windows PC and two new flat-panel monitors that I share between the Windows PC and my Linux PC, so I'm trying to get everything configured the way I want. So .. how did it go..? By the way, I was pretty sick with the flu (!) when I last posted and I really could have sworn (same as with Tony M.) that I had replied to this message. Main thing that I have to figure out is a simple way to get back to column 1 when starting a new list item. When I am done entering item #1, I need to type 2. in columns 1 and 2 and if I just hit enter to start a new line, Vim jumps to column 4. So I escape back to command mode .. Vim moves the cursor to column 1 .. I hit i .. Just hit Ctrl-D after the enter that finishes the item. Actually, you can hit Ctrl-D any time while you're typing the next numbered line. That will move the line one shift-width to the left, just as '' does in normal mode. Perfect .. Also, I created a ten-item list and the text in item #10 and items #1 to #9 is not aligned. So I select the column that has the space that separated 1. .. 2. .. from the text Ctrl-V .. yank it .. and hit p causing Vim to indent the text in items 1-9 by an additional column. Need to check the help files .. see if there's a better way. I usually usually use Ctrl-V to select the first column of text, then type 'I' and a space and Esc. Your method is slightly better, as long as you're not using tabs and a deeply-indented list. Well .. I have installed a plugin that causes Tab to do completion in insert mode (instead of entering a tab ..) .. so I have to do a Ctrl-V Tab .. so I don't use tabs very often these days. I probably need to get rid of the plugin but for the life of me, I can't rememeber what it's called. :-) Lastly.. I need to check what happens with fo+=a .. see if this plays well with automatic formatting of paragraphs. Hopefully Vim will reflow text without losing track of the list indent. It seems to work well most of the time, but there are a few cases where it doesn't, notably when a sentence ends in a number, such as a year or a model number, and that number wraps to the start of the next line. Then vim insists on indenting the line following that number as though the number was a list item. Like this, assuming a narrow 'textwidth': Columbus sailed the ocean blue in 1492. Then some more text just to fill in the line. gotcha .. Consequently, I never include 'n' and 'aw' in 'fo' at the same time. Is there any way I could map a simple toggle to (de)activate fo+=a (auto-format) .. so I can get rid of it quickly when it starts causing problems .. such as editing mail headers in mutt .. eg. ?? Thanks again. cga
Re: Paragraph formatting options
On Thu, Aug 24, 2006 at 10:40:40PM EDT, A.J.Mechelynck wrote: cga2000 wrote: On Sat, Aug 19, 2006 at 01:32:33AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] This is weird .. I'm sure I replied to this and yet there's no trace of my reply anywhere. I'll probably use the dot '.' .. hope it doesn't clash with anything.. Or maybe there's a :digraph that would look good and yet not cause trouble in email, printouts, .. eg. [..] Thank you for your suggestions. If you're using Latin1 or UTF-8, you may try: - Currency sign (decimal 164, ?, ^KCu) - Middle dot (decimal 183, ·, ^K.M) I did both: :set com+=fb:Cu :set com+=fb:.M .. entered via a Ctrl-V Ctrl-K followed by the digraph .. and they do don't use Ctrl-V before the Ctrl-K. Just Ctrl-K followed by the digraph. In each case you should see one character (a hollow bullet with outgrowing teeth on the four diagonals, or a dot at mid-height) appear as soon as you type the second character of the digraph. But if 'encoding' is neither Latin1 nor UTF-8 these characters may or may not exist. OK. I had tested both data entry syntaxes -- just Ctrl-K or Ctrl-V followed by Ctrl-K. I did that with the middle dot and I was getting an invalid character error message .. But then I was unsure how you were supposed to enter the character and figured that the problem was that I needed to enter a Ctrl-V before the Ctrl-K .. when in fact what probably happened was that I was doing something wrong .. inverting the digraph's two characters, maybe .. who knows. With your explanations above, I gave it another shot and this time everything works as advertised. My only problem now is that both looks very nice indeed and I'm not sure which one I am going to use. Also, first thing I did was a :set encoding=latin1 not seem to be recognized. When I reach the specified textwidth the text entered wraps to column 1. .. I also tried with asterisk '*' and the result is different and rather unexpected: When I reached the end of the first line, Vim automatically inserts an asterisk and a space in columns 1-2 before carrying over the word I started on the previous line. The strange thing about this is looks like Vim is treating ' *' in columns 1-2 as the middle part of a 3-part comment of this kind: /* * * * */ according to was already set in 'comments' and in particular s1:/*,mb:*,ex:*/ that if I do a: :set com=fb:* .. instead of :set com+=fb:* this problem goes away (line 2 wraps to column 3 as expected). Without the + you set the option from scratch; with it you add to what was already set. See :help 'comments'. Yes, that's what I meant. When I use '=' instead of '+= everything else in com is wiped out .. so that's why I started suspecting that something else in my default com settings was causing this. I'll see tomorrow if I can figure it out. BTW .. I had such a mess in set com? at one point that I tried a: set com-=garbage .. Vim didn't complain .. but didn't do anything either .. Guess I'll have to play with this a little more to figure it out .. and read the :h comments help file as directed. Thank you very much .. nifty little tricks like this always make my day..!! cga
Re: Paragraph formatting options
On Fri, Aug 25, 2006 at 07:02:15AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] OK. I had tested both data entry syntaxes -- just Ctrl-K or Ctrl-V followed by Ctrl-K. I did that with the middle dot and I was getting an invalid character error message .. But then I was unsure how you were supposed to enter the character and figured that the problem was that I needed to enter a Ctrl-V before the Ctrl-K .. when in fact what probably happened was that I was doing something wrong .. inverting the digraph's two characters, maybe .. who knows. With your explanations above, I gave it another shot and this time everything works as advertised. My only problem now is that both looks very nice indeed and I'm not sure which one I am going to use. Which one you use will of course be your own choice; but if you are undecided, I recommend the currency sign, which is more visible in all fonts (including any fonts you may use in the future): in the Courier font I'm using in this mail client, the middle-dot is a single pixel, not very easy to notice. Or you may want to use a different style of bullets for nested lists (bulleted lists within bulleted lists). Also, first thing I did was a :set encoding=latin1 [...] If you had something else before (such as cp1252 or cp850), it may have helped. Well, that was obviously not relevant to my problem but it did surprise me that :set enc? yielded encoding=. So it's not set to anything by default. Presumably this means that it just picks up the current locale, right? And Vim's rationale here is to display nothing unless I modified the default. Thanks cga
Re: Paragraph formatting options
On Sat, Aug 19, 2006 at 01:32:33AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] This is weird .. I'm sure I replied to this and yet there's no trace of my reply anywhere. I'll probably use the dot '.' .. hope it doesn't clash with anything.. Or maybe there's a :digraph that would look good and yet not cause trouble in email, printouts, .. eg. [..] Thank you for your suggestions. If you're using Latin1 or UTF-8, you may try: - Currency sign (decimal 164, ?, ^KCu) - Middle dot (decimal 183, ·, ^K.M) I did both: :set com+=fb:Cu :set com+=fb:.M .. entered via a Ctrl-V Ctrl-K followed by the digraph .. and they do not seem to be recognized. When I reach the specified textwidth the text entered wraps to column 1. .. I also tried with asterisk '*' and the result is different and rather unexpected: When I reached the end of the first line, Vim automatically inserts an asterisk and a space in columns 1-2 before carrying over the word I started on the previous line. The strange thing about this is that if I do a: :set com=fb:* .. instead of :set com+=fb:* this problem goes away (line 2 wraps to column 3 as expected). Are there conflicting values in my default .. :set com? - or even a lowercase o, but in that case you should make sure that it isn't recognised as a bullet unless followed by a space or tab. Will keep this one in mind in case I can't get either or the above to work. I'm running Vim 6.4 .. in case it matters. Thanks cga
Re: Email Text Formatter Plugin
On Mon, Aug 21, 2006 at 10:08:50PM EDT, Pete Johns wrote: On Mon, 2006-08-21 at 20:54:21 -0500, Tom Purl sent: I'm looking for a simple function that will reformat a selected block of text for e-mail messages (80 columns long, preserving characters, etc). Vim Cream can do this very well, but the functionality doesn't easily translate to vanilla Vim from what I can see, and I prefer using Vim instead of Cream. Is there a function that allows me to do this for Vim? Have you tried 'gq'? This works perfectly for me with visual blocks. Someone on the list recently suggested I use gqip to reflow paragraphs and I was going to suggest that. Much to my delight, I later found that it also preserved the characters in e-mail messages, so I was going to recommend using that. I find it quicker than entering visual mode. This thread made me realize that I do not even understand how gqip works..? :h gq tells me that the general format is gq{motion} .. but what kind of motion is ip..? i should move the cursor up just one line but what about p..? Thanks cga
Re: Email Text Formatter Plugin
On Mon, Aug 21, 2006 at 11:55:54PM EDT, Pete Johns wrote: On Mon, 2006-08-21 at 23:47:56 -0400, cga2000 sent: Someone on the list recently suggested I use gqip to reflow paragraphs and I was going to suggest that. Much to my delight, I later found that it also preserved the characters in e-mail messages, so I was going to recommend using that. Indeed. This would work well for a given paragraph. :h gq tells me that the general format is gq{motion} .. but what kind of motion is ip..? i should move the cursor up just one line but what about p..? Close but no cigar. 'k' would move up a line. 'ip' is Inner Paragraph. See: :he ip :he object-motions will help you speed up your Vim usage. Best; --paj gotcha .. :-( and thanks much for your last tip.. or pointing me in the right direction I should say..! Thanks cga
Re: gvim fullscreen mode on Gnome ?
On Sat, Aug 19, 2006 at 01:01:37PM EDT, A.J.Mechelynck wrote: KLEIN Stéphane wrote: 2006/8/19, A.J.Mechelynck [EMAIL PROTECTED]: KLEIN Stéphane wrote: Hi, is there gvim full screen mode feature on GNU/Linux Gnome... ? I don't think there is a full-screen mode as such, but on any version of gvim you can do: I speak about fullscreen without window decorator... I don't think you can have a (non-minimized) gvim screen without a titlebar; but I don't know everything. If by any chance it is possible, it would, I suppose, be set by command-line options specific to the particular GUI you are using. Such options might be unmentioned in the Vim help, in which case you would have to dig into whatever documentation there is for your particular flavour of Gnome and/or GTK (either Gnome1 and GTK+1 or Gnome2 and GTK+2 IIUC). In WindowMaker you can remove stuff like the titlebar .. status bar .. scroll bar(s).. all that useful (?) stuff that bars you from optimal use of your display's real estate. I understand you can use wmaker as gnome's window manager. Thanks cga
Re: Paragraph formatting options
On Fri, Aug 18, 2006 at 02:12:19PM EDT, Alan G Isaac wrote: Try this: set fo+=w and then leave no white space after your outdented header. Then you can gwap to your hearts content. Not quite what you asked for ... I realize that this is not what you asked for either .. but what is this gwap (or :gwap ..) command? Seems it is not recognized by Vim 6.3. Another good reason to upgrade? Thanks cga
Re: Paragraph formatting options
On Fri, Aug 18, 2006 at 08:12:01PM EDT, Alan G Isaac wrote: On Fri, 18 Aug 2006, apparently wrote: but what is this gwap (or :gwap ..) command? Seems it is not recognized by Vim 6.3 :h gw guess what .. I was mistyping it .. .. something like gwa- I guess .. didn't realize it was gw+[motion] :-( Enjoy. Many thanks.. I certainly do..! I there a way I can enter effortlessly stuff like the following: 1. this is a numbered paragraph several lines long and I would like all lines aligned with the this which starts in column 4. I don't know if it's good typography but I use these numbered lists a lot and with the text aligned I think it looks better. .. and format it like this: 1. this is a numbered paragraph several lines long and I would like all lines aligned with the this which starts in column 4. I don't know if it's good typography but I use these numbered lists a lot and with the text aligned I think it looks better. .. or possibly make Vim indent this automatically when typing..? I mean that I usually have a textwidth of 72 and Vim automatically wraps to line 2 after I have written the all at the end of line 1 .. but obviously Vim has no reason to indent and therefore starts line 2 and the following lines in column 1. Is there any way I can tell Vim that when line 1 starts with a number followed by a dot '.' .. the following lines should be indented so that all the text is aligned. Not simple .. I guess .. since this could move into double digits (or more..) -- there could be more than nine numbered paragraphs and text should start in column 5 (or 6..). Or maybe somone has written a script that can convert a bunch of paragraphs into something like a numbered (or bulleted) list? Thanks cga
Re: Paragraph formatting options
On Sat, Aug 19, 2006 at 12:15:10AM EDT, Gary Johnson wrote: On 2006-08-18, cga2000 [EMAIL PROTECTED] wrote: [help creating numbered and bulleted lists in Vim] For numbered lists, set fo+=n For bulleted lists using '-', set com+=fb:- or '*', set com+=fb:* but those should already be part of the default 'comments' option unless you have changed it. (Odd that numbered lists and bulleted lists use different options.) See :help 'fo' :help 'com' I also have '2' as part of my 'formatoptions' string. I don't think it affects lists, but you might try it if those other settings don't work as you'd like them to. Looks very promising. I'm three hours behind/ahead of you (EST) .. so it's bedtime for me .. Main thing that I have to figure out is a simple way to get back to column 1 when starting a new list item. When I am done entering item #1, I need to type 2. in columns 1 and 2 and if I just hit enter to start a new line, Vim jumps to column 4. So I escape back to command mode .. Vim moves the cursor to column 1 .. I hit i .. Also, I created a ten-item list and the text in item #10 and items #1 to #9 is not aligned. So I select the column that has the space that separated 1. .. 2. .. from the text Ctrl-V .. yank it .. and hit p causing Vim to indent the text in items 1-9 by an additional column. Need to check the help files .. see if there's a better way. Lastly.. I need to check what happens with fo+=a .. see if this plays well with automatic formatting of paragraphs. Hopefully Vim will reflow text without losing track of the list indent. Thank you very much.. cga
Re: Paragraph formatting options
On Sat, Aug 19, 2006 at 12:22:56AM EDT, Gary Johnson wrote: On 2006-08-18, Gary Johnson [EMAIL PROTECTED] wrote: For bulleted lists using '-', set com+=fb:- or '*', set com+=fb:* but those should already be part of the default 'comments' option unless you have changed it. I just checked again. fb:- is there by default; I added fb:* in my .vimrc and ftplugin/mail.vim. I'll probably use the dot '.' .. hope it doesn't clash with anything.. Or maybe there's a :digraph that would look good and yet not cause trouble in email, printouts, .. eg. Thanks again, cga
Re: Color change of :set cul or ctrl-V
On Fri, Aug 11, 2006 at 10:42:31AM EDT, striker wrote: I am using colorscheme vo_dark. When I :set cul or use visual highlighting, the color for the highlight is light gray and makes the highlighted text very difficult to see. The first few lines are: let g:colors_name=VO Dark hi normal guifg=darkgreen guibg=black ctermfg=darkgreen ctermbg=black hi StatusLine guifg=darkgreen guibg=black ctermfg=darkgreen ctermbg=black hi StatusLineNC guifg=darkgreen guibg=black ctermfg=darkgreen ctermbg=black hi VertSplit guifg=darkgreen guibg=black ctermfg=darkgreen ctermbg=black hi OL1 guifg=darkgreenctermfg=darkgreen hi OL2 guifg=red ctermfg=red hi OL3 guifg=lightbluectermfg=lightblue hi OL4 guifg=violet ctermfg=magenta hi OL5 guifg=darkgreenctermfg=darkgreen hi OL6 guifg=red ctermfg=red hi OL7 guifg=lightbluectermfg=lightblue hi OL8 guifg=violet ctermfg=magenta hi OL9 guifg=darkgreenctermfg=darkgreen My question is this: What do I need to look for and change in order to implement a new color for the highlighting? Sorry I'm behind with my howmework .. What's cul..? Is it a new feature with Vim 7.0? Here, :help cul says E149: Sorry, no help for cul Thanks cga
Re: Color change of :set cul or ctrl-V
On Tue, Aug 15, 2006 at 08:49:51PM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] What's cul..? It's an option which is new in version 7. In version 7 Vim, :help cul, or, more properly, :help 'cul', shows the help for the 'cursorline' option. There is also a 'cursorcolumn' (aka 'cuc') option. These are boolean options; when on, the cursor line and/or the cursor column are highlighted with a different highlight group than the default Normal group, helping you to easily find your cursor if the blinking isn't enough for you. Thanks much for answering. Yet another reason why I should be upgrading. Thanks cga
Re: Show/Hide Split Windows
On Thu, Aug 10, 2006 at 02:42:57PM EDT, Rodolfo Borges wrote: On 8/10/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote: Type ctrl-w o to toggle between maximizing one window and restoring to all. By maximizing, I mean that the current window will take over the entire display, not leaving a lot of status bars around. Actually, Ctrl-w o will close all other windows. You can't get back to them using Ctrl-w o again Immediately went to check that. How stupid of me not to have tried it, I thought. Well unfortunately all I got was an error - Ye already have only one window. Question: Could this be scripted -- using the error code from the failed C-O attempt to restore the previous layout? 1. When in split mode: . Vim saves screen layout -- size, position, etc. . Vim hides all buffers save the current one . Vim maked the current buffer stretch to occupy entire window 2. When not in split mode: . Vim checks whether there's is a previous split mode . If so, Vim restores the previous layout . If not, displays error message Would be very cool, afaic ..save me having to look for and then memorize yet another mapping. :-) I use :unhide N but it's usually a pain restoring the layout via C-W + {H/J/K/L} and then having to resize the sub-windows. But then, I'm no unhide master. Thanks, cga.
Re: Show/Hide Split Windows
On Thu, Aug 10, 2006 at 03:28:22PM EDT, Charles E Campbell Jr wrote: cga2000 wrote: On Thu, Aug 10, 2006 at 02:42:57PM EDT, Rodolfo Borges wrote: On 8/10/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote: Type ctrl-w o to toggle between maximizing one window and restoring to all. By maximizing, I mean that the current window will take over the entire display, not leaving a lot of status bars around. Actually, Ctrl-w o will close all other windows. You can't get back to them using Ctrl-w o again Immediately went to check that. How stupid of me not to have tried it, I thought. Well unfortunately all I got was an error - Ye already have only one window. Please look at the rest of my email concerning the ZoomWin plugin. It what makes ctrl-w o do the trick mentioned above. And, of course, there's always my website (http://mysite.verizon.net/astronaut/vim) where I keep the latest versions (albeit perhaps still alpha/beta-ish) of my plugins. This is weird .. I got the message you are referring to after I posted mine .. although the one I was replying to was posted later to the list. Thanks much for taking the trouble to write this reminder. The plugin does exactly what I want. Thanks, cga
Re: fonts for gui menu (gtk)
On Sat, Aug 05, 2006 at 05:53:56AM EDT, Andrei A. Voropaev wrote: Hi! Can anyone explain me how the font for menu in GUI is selected? I have 3 computers with the same set of fonts and the same configuration for fonconfig, the same version of gvim (different GTK though) and on all 3 machines I get different menu font :) The worse is on the laptop. There the font is large and in Bold, so it takes quite a big portion of the fairly small screen :) Does this affect all gtk apps or just gvim? In my case all gtk apps -- such as gimp, mozilla, .. were using the same oversized and rather ugly font. If you problem is only with gvim you can probably ignore the following. I solved my global gtk font problems by editing the contents of: ~/.gtkrc ~/.gtkrc-2.0 ..yes, *both* of them *and* on the same system..!! Other options: . if you have the gnome desktop installed there is a nice interactive option that let's you change gtk menu/dialog fonts (sizes.. styles..) . if you don't have access to gnome you could try gtk-theme-switch or gtk-theme-switch2 that also let you change gtk fonts on the fly. If would be careful editing the .gtkrc files.. IIRC, there's a comment in the default files that says something like automatically gen'd.. don't edit.. so you probably want to save their current contents somewhere before doing anything. Thanks cga
Re: fonts for gui menu (gtk)
On Sat, Aug 05, 2006 at 12:11:04PM EDT, Andrei A. Voropaev wrote: On Sat, Aug 05, 2006 at 08:47:42AM -0400, cga2000 wrote: On Sat, Aug 05, 2006 at 05:53:56AM EDT, Andrei A. Voropaev wrote: Hi! Can anyone explain me how the font for menu in GUI is selected? I have 3 computers with the same set of fonts and the same configuration for fonconfig, the same version of gvim (different GTK though) and on all 3 machines I get different menu font :) The worse is on the laptop. There the font is large and in Bold, so it takes quite a big portion of the fairly small screen :) Does this affect all gtk apps or just gvim? Hm. Firefox is OK. xine has the same problem, but it is not compiled with GTK. Aha, gimp has exactly the same menu. So it is problem of GTK. This may be a gross misunderstanding on my part but this sounds like the version of FF you are running is fontconfig-aware while the other apps ain't. I sorted out my GUI font problems about eighteen months ago and my memories are getting a bit shaky now -- especially since I decided some 3-4 months ago to dump the GUI for good. In my case all gtk apps -- such as gimp, mozilla, .. were using the same oversized and rather ugly font. I solved my global gtk font problems by editing the contents of: ~/.gtkrc ~/.gtkrc-2.0 Hm. I didn't have neither of these files and didn't know how to create them. I found that the safest/quickest way is to: 1. Download and install gnome 2. Start a gnome session tweak your fonts 3. Optionally, remove gnome from your HD Yes, I'm still a little pissed about the whole thing. :-) Googling didn't provide any samples neither. So, I guess this is a top secret info :) This is precisely the problem I ran into. Fortunately I've found gtk-chtheme program and using it could set up better alternative. Thank you for the tip. Glad I could help. Thanks cga
Re: cterm256?
On Fri, Aug 04, 2006 at 09:12:46AM EDT, Mikolaj Machowski wrote: Hello, Since Konsole in KDE 3.5.4 supports 256 colors it could be nice if Vim could use them. Is any way to convince Vim to use guibg/guifg from syntax files in console? If I understand correctly one problem is to map the 256 available colors to the 64K or 16M colors available in the gui. So just changing the keywords in the color scheme is not enough. Thanks cga
Re: ESC key is too far away.
On Wed, Aug 02, 2006 at 07:09:24PM EDT, Brian Dorsey wrote: On 8/2/06, cga2000 [EMAIL PROTECTED] wrote: On Wed, Aug 02, 2006 at 05:20:05PM EDT, Brian Dorsey wrote: I think that's the one I downloaded once. Only problem I have with it is that when you only bring up Windows occasionally each time you boot you need to bring up the Cpanel keyboard popup, go to the new tab added by the add-on and then hit enter to activate it for the duration of your session. You wouldn't happen to know whether there is a way this can be automated so that the remapping is done transparently every time you start Windows, by any chance? I think this may be a different application. It is a stand-alone application which modifies the registry. The changes I've made on a couple of machines have survied reboots every time. Yeah, you're right. Right now I am in linux and it was not possible to boot into Windows so I didn't check. But I ran a locate against the windows filesystem and the add-on is actually called keyremap. It's part of a bunch of Windows Toys if that kinda rings a bell. It basically adds an extra tab to the standard keyboard popup and lets you do some keyboard remapping but unless I am unaware of some of its advanced functions the changes are lost every time you reboot. Thanks anyway.. I'll check whether there is a Win98 version of the app you are using. Thanks cga
Re: Visual select / paste behaviour
On Fri, Jul 28, 2006 at 09:48:21AM EDT, Jürgen Krämer wrote: [Resending this because I noticed that the original mail had been encoded with base64 by either my mail client or a server on the way to the mailing list.] Hi, Roel Vanhout wrote: Take the following example: file file_id=myidc:\test.txt/file When the cursor is on the 'm' of 'myid' and I press 'vw', a word is selected in visual mode. However, the at the end of 'myid' is also selected. How do I change the list of 'word separators'? to be exact 'w' in visual word does NOT select a word but it extends the current selection to the START of the next word (for a definition of word see :help word). So in your case 'viw' would be better. This starts visual mode and selects the Inner Word. This works on any letter of myid and does not select the following quote. cool. Thanks cga
Re: Other European languages on a US keyboard [OT]
On Tue, Jul 25, 2006 at 10:27:58AM EDT, Russell Bateman wrote: [more way off topic comments] [...] Phonemes are (very) roughly equivalent to syllables and exist at the oral or phonetic level. French has the peculiarity, more than most other Western languages in my observation, of its end of word phonemes being greatly ambiguous due to the erosion from Latin already mentioned. Hence, it's easier to find rhymes both rich and otherwise in French even across gender boundaries (whereas Italian and Spanish have kept the o/a alternance when French erodes both feminine am and masculine um to silent e). The resulting explosion in jeux de mots (puns), so looked down upon or at least smirked at in English, is inexplicably prized in French (where it is so much more common in the first place): Le _saint_ père, _sain_ de corps et d'esprit, _ceint_ de vertu, couvait le mal dans son _sein_. (The _holy_ father, while _healthy_ in body and spirit, and _girded_ with virtue, nourished evil in his _breast_. All these underlined words are pronounced identically. There's yet another word or two in French pronounced the same way, but it's been too many years and I can't seem to conjure them up at the moment. seing .. as in blanc-seing If Linguistics paid a decent wage, I probably wouldn't be writing C code for a living. Is this off-topic or what? Russ
Re: Other European languages on a US keyboard
On Tue, Jul 25, 2006 at 03:09:29AM EDT, A.J.Mechelynck wrote: [..] and it can change fonts on-the-fly (change the font from Courier to Lucida to whatever, only through Vim keyboard commands). I would never want do that.. but just out of curiosity.. why would that not be possible in an xterm? because console Vim has no control over the xterm's fonts. ok. a bit more flexible than toggling the xterm's font. It can do real boldface and italics, as well as straight or curly underlining. That would be for highlighting stuff, right? So the same functionality can be achieved with colors. And in a more pleasing manner IMHO.. the color schemes that I have seen that use italics have not convinced me. I do html a lot, and it helps me to see iitalics, bbold italics, ubold underlined italics,/u/b uunderlined italics,/u/iuunderlined/u text all displayed like they should. .. meaning you can toggle between the source version and the rendered version of the document in Vim? Of course colours can do it, but console vim has only 16 bg and 16 fg colours: the list is soon over. .. my mistake.. I never counted them and I thought that console Vim on a 256-color xterm was capable of displaying 256 colors simultaneoulsy. [..] Note: :setl fenc=latin9 follows by :setl fenc? returns iso-8859-15. This is normal, they are two names for the same thing. So this should help clarify the issue. For more details, see :help mbyte.txt http://vim.sourceforge.net/tips/tip.php?tip_id=246 section 37 (last) of the Vim FAQ http://vimdoc.sourceforge.net/htmldoc/vimfaq.html http://www.unicode.org/ http://www.cl.cam.ac.uk/~mgk25/unicode.html Thanks cga
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 03:36:54AM EDT, Matthew Winn wrote: On Sun, Jul 23, 2006 at 06:41:09PM -0400, cga2000 wrote: Avoid words such as coeur.. boeuf.. etc. Rather amazing that the French who are so picky about anything that concerns their language never came up with a codepage.. or whatever it's called that features this particular character. I think it dates from the days when typewriters were popular. The US dominance of the market for office equipment prompted many European languages to manage without combinations like oe, ae and ij where the characters can be approximated by typing separate letters. It's easier to change typing habits than to manufacture a new range of typewriters just to deal with one special letter. .. hmm.. as far as I know only France and Germany went to the trouble of designing their own typewriter keyboard layouts separate from the QWERTY model. I think Polish keyboards are derived from the German layout.. I would assume variations of the French layout are used in other French-speaking countries and some African countries.. As to other European countries - ie. the ones that speak neither French nor German - I believe that you are correct and that they use derivatives of the US keyboard. Therefore, since the French went so far as building keyboards that have the basic letters arranged differently (AZERTY instead of QWERTY) it would not have been such a major enhancement to provide an oe some place on that keyboard..? I have a feeling it is more a question of whoever designed the original French typewriter keyboard just did not think it worth bothering with such typographic niceties as providing an o dans l'e (or is it the other way round?) when the end result with fixed-width characters was going to be light-years removed from the refinements of traditional typesetting anyway.. But I would agree that the absence of the oe on French keyboards (typewriters and computers alike) probably accounts for the fact that you can't find it anywhere in the latin* charsets. Prior to computers many keyboards didn't even have separate keys for the digits 1 and 0, typists using the letters l and O instead. I was aware of the l/1 thing.. sometimes use it when I feel lazy. Thanks cga
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 10:50:33AM EDT, Gene Kwiecinski wrote: Rare enough .. but besides oeuf is also occurs in such very common words as voeu [wish] and coeur [heart] and it really bothers me when I see them incorrectly spelled in web pages for instance. I spot it and after that I tend to lose focus and not be able to take in what I'm reading for a short while. How're they misspelled? well .. can't give you a sample of the correct spelling - ie. the single oe character instead of the o .. a space and the e.. - since I am not running with an UTF8 locale.. and even that might not work if you are running latin1 for instance. so to get my meaning you need to go to www.wordreference.com .. enter egg in the Enter Word field and check the English to French radio button.. Enter .. and a few lines down you should see a bunch of oeuf correctly spelled .. bad egg - oeuf pourri, for example.. provided your browser is set up to display UTF8, naturally.. otherwise.. I'll have to put up a screenshot some place.. [...] In order to set up my foreign language keymap correctly I would really need tables of all the characters that occur in these languages, decide which ones are common enough to be worth adding to the keymap, and make sure I build a scheme that's coherent before I get my fingers to memorize it. I'll scour the Wiki's later today.. see if I can find anything useful. If you wouldn't mind, definitely keep me in the loop on this one, as I've got something of an interest. Not much joy where finding tables of all characters used in typesetting for different languages, I'm afraid. I did find this regarding keyboard layouts though: http://www-306.ibm.com/software/globalization/topics/keyboards/registry_index.jsp .. as usual I had a very simplified vision of the problem. Offhand, some contributions and questions: beta-looking SS (German) .. used to know this as an s-tset (phonetic rendering..) slashed 'l' (Polish) no knowledge of slavonic languages here.. sorry. looks like Poland has somewhat switched to a US-derived keyboard where computers are concerned. And Tony was right assuming that most central European countries - Czech.. Slovak.. Slovenian/Croatian.. Moldovan.. Hungarian.. even Rumanian have keyboards that are derived from the German layout. slashed 'o' (Scandinavian or thereabouts, not sure if Dutch or other) don't think Dutch has this. AElig/aelig/OElig/oelig (Latin, etc.) Danes Norwegians have a key for AElig right on the keyboard. ccedil/Ccedil (how done, ,C?) Some keyboards - French.. Italian.. Portuguese.. have a ccedil key ecedil(?) (also Polish, possibly other vowels, 'though don't recall offhand) Doesn't appear to be one on the Polish keyboard as pictured at the IBM site. Oh, someone on the list is native Polish, so might ask him. Was it Mikolaj? Dunno anyone Dutch who'd recall the slashed-'o'. Can't think a town in Holland that has this .. so I would assume it's not indigenous (?) How to enter Aring (eg, Aring;ngstrom)? oA?? Synonymous with aa (eg, Haas == Haring;s?) Oh, well... Yes, I could say I agree with that last remark.. Vast subject.. but quite fascinating.. :-) Real glad I started this thread.. Learned some useful stuff here.. Thanks cga
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 09:02:34AM EDT, Russell Bateman wrote: As you say, warning: off-topic post. Read at your own risk. .. don't see this as OT.. Being lazy I skipped the .. in Vim in the subject.. This discussion underlines all the more strongly why I don't attempt to produce final documents using vim: I sometimes use an actual word processor like Open Office Writer, but mostly I write in HTML and, of course, the best HTML editor on the planet is... Maybe I should dump LaTeX and use HTML.. I printed some of the TeX-gen'd stuff and it just looks too beautiful.. I end up with correspondence that looks more like pages torn out of an expensive book.. ...vim! agreed.. natch'.. Russ P.S. Yes, typing eacute; , oelig; and uuml; is painful, but I'm one of those perfectionists who would have used half-spacing back in the old days if I had been in need of such things. My father used a non-electric typewriter, but I was 19 before I moved to France from the US and needed what wasn't on the keyboard. After coming back at 25 (some 26+ years ago now), I never lost the need to communicate and product documents of with accents, digraphs, etc. yes.. have a feeling only the folks at the Académie Française and enlightened foreigners are really concerned about this these days.. I'm sure the French don't take notice or give a damn whether you write laetitia or lætitia.. Hope you get my accents.. cedillas.. and e dans l'a above.. in fact, I added the need to compose classical Greek texts while in France, but that's a whole other mess. [..] Thanks cga
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 08:37:47AM EDT, A.J.Mechelynck wrote: Warning: off-topic post. Read at your own risk. [..] Before computers, I used a French typewriter keyboard (AZERTY type). Nowadays I use a Belgian computer keyboard (also AZERTY but with special characters arranged differently). My father has an old typewriter he bought in Switzerland when he was a student, and it uses a QWERTZ layout. (Switzerland has four official languages, viz. German, French, Italian and Romanche; and I don't know how many different keyboards they use.) On a mechanical typewriter, it was possible to use half-spacing by holding the space bar down. So, if one wanted to produce the oe digraph on a French typewriter (not an electric one though), it was possible -- for a perfectionist. Let's say I wanted to type boeuf (= beef/ox): 1. press and hold spacebar. This advances the carriage by one half space 2. hit b. This prints b without moving the carriage. 3. release, press and hold spacebar. 4. hit o 5. release spacebar. The carriage is now over the right half of the o. 6. hit e u f in succession. .. makes my mouth water.. I should try Ebay .. see if I can find an affordable high-end typewriter that does such fancy stuff. The oe digraph is called o, e dans l'o and the ae digraph is called in French a, e dans l'a. The latter as in Serge Gainsbourg's song elaeudanla téitéia (which spells the name Laetitia). phew.. this one took me a couple of minutes to figure out.. !! French typewriters indeed seldom had the digits one and zero: small-ell and big-oh were used insted. But it even carried over to computers: Several decades ago (before the merger with Honeywell), the (French) Bull computer company used on its computers a charset where the same character could mean either zero or O-for-Oscar depending on context -- and another one, I think, could mean one or I-for-India. (Few computers had lowercase in those days.) This, of course, caused headaches without end when trying to convert those computers' magnetic tapes to IBM's BCD and EBCDIC standards or to (whose? PDP? CDC? other?) ASCII. Hehe.. maybe a bit of OT at one point in the designers' career wouldn't have hurt.. Sounds like the year 2000 business.. but worse.. What did they do? Hired a few thousand data entry folks to do the conversion.. Not sure regex's had been invented at the time. .. anyway .. as I always say we should all go back to writing in Latin Roman numerals.. I'm not sure non-English non-French non-German speaking countries all use a US-derived keyboard, even if we limit ourselves to those that use variants of the Latin alphabet. Typewriters, after all, date back to (I think) before World War I, a time when English was much less dominant internationally than it is now. At the courts of St-Petersburg and Potsdam, French was spoken; Germany and Austria together covered (or had recently covered) a territory that went from Alsace to Silesia and from Schleswig-Holstein to the plain of the Po. I suspect that most of Central Europe would have adopted a German-derived (or maybe French-derived) keyboard regardless of whether the majority language was Czech, Slovak, Italian, Hungarian, Croatian... quick googling for keyboard layout shows that you are correct. I don't trust Wiki's 100% but this page has some useful keyboard layouts: http://en.wikipedia.org/wiki/Keyboard_layout I agree that the lack of oe OE digraphs in the Latin charsets is probably due to their absence on French typewriter keyboards. (AE ae were kept because they are used in Danish.) There is more than a single-letter difference with English though: not only the layout is different but there are several accented letters. The French (and Belgian) .. somewhat to my surprise the Belgian keyboard uses the AZERTY layout while the Netherlands use QWERTY. But then this would make sense since as far as I recall Dutch/Flemish is pretty limited to the ASCII charset and that's obviously available on AZERTY keyboards. So they only needed to accomodate the French-speaking community. But doesn't Belgium also have a German-speaking community? Ah.. maybe it was just that most businesses were owned by French-speaking Belgians at the time the layout was adopted.. keyboards have a dead key for circumflex and trema/diaeresis/umlaut, but à ç é è ù and sometimes uppercase-C-cedilla each have their own glyphs. (In French, uppercase letters with the exception of C-cedilla and sometimes E-acute were usually left unaccented. I believe computers are slowly pushing back the trend.) Actually I found that there is such a thing as a US International Keyboard and maybe I could acquire one of those since it all the fancy characters that I would want.. Best regards, Tony. Thanks much for all this pre-computer days lore..! Doesn't hurt to know a little something about where we came from.. Thanks cga
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 12:05:02PM EDT, Charles E Campbell Jr wrote: cga2000 wrote: I sometimes need to write text in other languages such as French, Spanish and occasionally German or Italian. ..snip.. I would like to do this in Vim. Unfortunately I only have a US keyboard. Have you considered EasyAccents.vim? http://vim.sourceforge.net/scripts/script.php?script_id=451 That's exactly the sort of thing I initially had in mind but since I've already spent some time getting familiar with the standard (?) Vim solution (:set keymap=) and it's a breeze to customize I'll probably stick with that. What I like abut the :set keymap solution is that if you wait a fraction of a second between ' and e for instance Vim realizes that you want an apostrophe followed by an e.. not an e with acute accent and moves the cusor to the next position.. Another way to achieve this is to map two apostrophes to the (single) apostrophe in your keymap description.. so you type two ''s in quick succession when you want an apostrophe rather than an accented letter.. But I find the former method more natural. Thanks all the same. Appreciate your help. It doesn't use the spelling checker in vim 7.0, but it accepts a' a` a^ a: etc to generate accented characters. Easy to turn on and off, too: \eza toggles. For some bizarre reason .. something in my Vim setup .. I've never managed to get this '\' leader escape character to work. So for the vimspell plugin for instance I have to type the :* commands. Regards, Chip Campbell
Re: Other European languages on a US keyboard
On Mon, Jul 24, 2006 at 08:29:10PM EDT, A.J.Mechelynck wrote: cga2000 wrote: On Mon, Jul 24, 2006 at 05:59:42PM EDT, Christian Ebert wrote: * A.J.Mechelynck on Saturday, July 22, 2006 at 22:40:45 +0200: The French oe (o, e-dans-l'o) is not defined in the Latin1 encoding, neither in capitals (as for titles or if the word oeuf [egg] is the first of a sentence), nor in lowercase. You need UTF-8 for it, No. Just latin9 or ISO8859-15 (Look at the header of this mail). Mon coeur. This is on a Mac with a German keyboard, but using actually an American keyboard layout. I enter the oe with Alt-q (the Alt key on Mac keyboard corresponds to the Modifier key on other keyboards I believe). Could this be Mac-specific? I switched to encoding=latin9. When I do a Ctrl-K o e and a Ctrl-K O E this is what I get: ½ ¼ confirmed by the :dig command. I looked carefully at the output of :dig and I couldn't see our elusive e dans l'o either. So I switched to the French ISO-08859-15, then the US version of latin9.. still can't find that o dans l'e. Strange thing is that the font I use on terminals does have these two characters (upper/lower case E dans l'O..) in the exact same spot Vim displays the above fractions.. Try the following (in gvim): .. with all the goings-on in this thread I never had a chance to mention the fact that I do not use gvim. I try to do everything in a terminal (under gnu/screen) because text-mode apps were designed for the keyboard so they work a lot better than gui's for those of us who prefer not to use mice. :echo has(multi_byte) the answer should be 1. If it is zero, your version of gvim cannot handle UTF-8. Works fine if I switch my locale to UTF-8. Vim automatically figures what I want and :dig displays the o dans l'e (both the lower and upper case versions) among a gazillon other digraphs. Then I can use the ususal Ctrl-K oe .. save the file.. pass this on to LaTeX and provided I have the correct LaTeX statements to activate UTF-8 (that's what took forever to figure out the other day..) I get my coeurs, voeux and boeufs rendered correctly in xdvi/gv .. *and* the the ensuing printout looks great too. The problem with this is that I haven't found a comfortable way to run Vim in UTF-8 mode and the rest of my stuff in 8-bit mode. Over the week-end I found that I can run Vim in a separate unicode xterm but that's not what I want because I lose screen's copy/paste and more importantly it destroys my attempt at running a fully integrated desktop. Other problems that I have run into is that text files created when in UTF-8 mode are a mess when browsed in latin1/9 mode. I also have problems when I print unicode files.. I once created a nice table with those box-drawing characters that were available in UTF-8 mode and it was really nice on-screen.. but when I tried to print it, all I got was rows and columns of questiion marks. So I switched back to latin1 pending better internationalization support in some applications (slrn, ELinks.. mutt should workd but it's tricky) and maybe more importantly until I acquire a better understanding of running a unicode locale in X/linux and the implications thereof.. :if tenc== | let tenc = enc | endif | set enc=utf-8 :new then i (set Insert mode) and ^Vu0153 (where ^V is Ctrl-V, unless you use Ctrl-V to paste, in which case it is Ctrl-Q). If you see anything other than the oe digraph, then your 'guifont' is plain wrong. See http://vim.sourceforge.net/tips/tip.php?tip_id=632 about how to choose a better one. Well.. actually.. I ran some tests in latin-9 earlier.. trying to figure out this o dans l'e business.. that was on a linux console.. and that's where I realized that I was still running a unicode font.. both on the linux console and in 'X'.. :-) .. It seems I never switched back after my brief incursion into unicode territory.. and since I haven't had any problems displaying and printing text since I switched back.. I would say that the font is ok.. And that UTF-8 stuff is indeed backward-compatible? The font is called terminus and I like it a lot because it looks like a fixed-width version of MS's Verdana, which is my favorite screen font. see http://.geocities.com/cga/wee.png for an excellent screenshot. Thanks cga
Re: Other European languages on a US keyboard
On Sat, Jul 22, 2006 at 04:40:45PM EDT, A.J.Mechelynck wrote: cga2000 wrote: On Fri, Jul 21, 2006 at 03:19:25PM EDT, A.J.Mechelynck wrote: [...] Only minor glitch seems to be that text doesn't wrap when in INSERT (lang) mode.. haven't figured out why yet.. so I just escape out of insert mode and do a gqip once in a while. Could be unrelated though.. Check your options: for auto-insert of linebreaks :verbose set textmode? wrapmargin? :verbose set formatoptions? formatexpr? about display of long lines :verbose set wrap? linebreak? breakat? :verbose set textmode? wrapmargin? textmode wrapmargin=0 :verbose set formatoptions? formatexpr? formatoptions=tcql Last set from /usr/share/vim/vim63/ftplugin/mail.vim E518: Unknown option: formatexpr? :verbose set wrap? linebreak? breakat? wrap nolinebreak breakat= [EMAIL PROTECTED];:,./? Since this non-wrapping behavior only occurs after I issue the :setlocal keymap=accents command, I ran these commands both before and after but the output was strictly identical. As to to he E518: error message, I run Vim 6.3 - that's the version available on debian stable, so I assume that this option was implemented in later versions. But I am writing this message in Vim and I set the keymap to accents and right now everything is wrapping correctly. Don't know if this makes sense but I would appear that the problem only occurs when working on a .tex file? So maybe this is a bug/feature that's related to syntax checking or highlighting? I need to run another test and try to figure out what I was doing. Issue the same above commands while editing latex stuff and see if it makes a difference. I will update the thread if I find something interesting. Or, if none of the distributed keymaps is exactly what you want, you can write your own. It isn't hard. See :help :loadkeymap for the theory, and look at the contents of Bram's $VIMRUNTIME/keymap/accents.vim and my $VIMRUNTIME/keymap/esperanto_utf8.vim for a couple of simple examples. You might want to write something more extensive but this will show you how to do it. Already started on this: copied accents.vim to ~/.vim/keymap/ .. renamed it to foreign.vim and added the Spanish inverted question / exclamation marks - an for now I have mapped to !! and ??. Doesn't look like much is missing.. Maybe the French o+e .. but then my screen font doesn't have it either.. The French oe (o, e-dans-l'o) is not defined in the Latin1 encoding, neither in capitals (as for titles or if the word oeuf [egg] is the first of a sentence), nor in lowercase. You need UTF-8 for it, and for this relatively rare character you can still use Ctrl-K o e ; or else Rare enough .. but besides oeuf is also occurs in such very common words as voeu [wish] and coeur [heart] and it really bothers me when I see them incorrectly spelled in web pages for instance. I spot it and after that I tend to lose focus and not be able to take in what I'm reading for a short while. I'm pretty sure there is also a similar a+e / A+E in French as well, though I could not think of one common word that has this. I'm pretty sure that it's the correct spelling for names such as Aegisthe or Laetitia but I don't have any printed material where I could check that for sure. Only words I can think of right now are caecum and caetera (as in et caetera) but there's bound to be others. you can add the following to your vimrc (after setting 'encoding' to UTF-8): lmap OE Char-338 lmap oe Char-339 The problem with switching to UTF8 is that practically all the other applications that I use on a daily basis do not support it correctly - mutt, slrn, ELinks.. at least not the versions that I am running. I had a go at it a couple of months back but I ran into so many problems that I had to switch back to latin1. Naturally, I could try to run Vim in a UTF8-capable terminal like uxterm while staying with a latin1 locale - I understand that this might work - but now that I have gotten used to the convenience of running all these apps under gnu/screen under a single xterm I don't think I would want to fire up Vim in a separate xterm on a regular basis. Printing was another area where I ran into problems. So, due to my ignorance of such matters and lack of time I'll have to keep this on the back burner until either the apps are more mature and do unicode out-of-the-box.. or until I have the time to look into this and acquire a better understanding of the issues. I'm using language mappings here so they will be turned on and off together with the keymap. Come to think of it, French would appear to have the most annoying spelling system of the West European languages that I have some degree of familiarity with. Spanish, Italian, and German seem to use fewer non-ASCII characters. In order to set up my foreign language keymap correctly I would really need
Re: Other European languages on a US keyboard
On Fri, Jul 21, 2006 at 03:19:25PM EDT, A.J.Mechelynck wrote: cga2000 wrote: I sometimes need to write text in other languages such as French, Spanish and occasionally German or Italian. I would like to do this in Vim. Unfortunately I only have a US keyboard. [..] I. Since you've already used digraphs, and they're too cumbersome for you, you could try a keymap. There are some keymaps in $VIMRUNTIME/keymap which you can apply by just doing :setlocal keymap=keymapname (where keymapname is the filename without the encoding and .vim endings) or by using the Edit - Keymap menu. Then you can toggle between US-QWERTY mode and keymap mode by hitting Ctrl-^ in Insert mode, or by toggling 'iminsert' between zero and 1 in any mode. Basically, what a keymap does is establish a set of language-mappings, i.e., insert-mode mappings which can be turned on an off. Try the accents keymap, it might be just what you want. This works great..! I tried that on a short text in French and within a couple of minutes I was almost as comfortable as I am when typing in English. The accents are all perfectly intuitive - ` ' ^ etc. so I didn't even need to look at the keymap. Just need to be a little patient when entering an apostrophe. Only minor glitch seems to be that text doesn't wrap when in INSERT (lang) mode.. haven't figured out why yet.. so I just escape out of insert mode and do a gqip once in a while. Could be unrelated though.. Or, if none of the distributed keymaps is exactly what you want, you can write your own. It isn't hard. See :help :loadkeymap for the theory, and look at the contents of Bram's $VIMRUNTIME/keymap/accents.vim and my $VIMRUNTIME/keymap/esperanto_utf8.vim for a couple of simple examples. You might want to write something more extensive but this will show you how to do it. Doesn't look like much is missing.. Maybe the French o+e .. but then my screen font doesn't have it either.. If and when you write your own keymap, place it in the keymap/ subdirectory of a directory listed early in 'runtimepath' but not in $VIMRUNTIME/keymap itself because any upgrade can silently change anything there. II. What you are suggesting looks like setting 'spelllang' (with three ells) to whatever means French and then spellchecking your US-ASCII-only text. But beware: the Vim spellchecker (which I don't use because of my good innate spelling) might not be clever enough to mark words which have accented homographs, such as a (has) vs. à (at), de (of) vs. dé (thimble), du (of the) vs. dû (owed), cru (believed or raw) vs. crû (grown) etc.: so the cure might be worse than the ill, owing to the necessity of looking for unmarked spelling mistakes even after running the spell checker. I think you're right. Considering how effective the keymap solution is there's just no point. Anyway, I don't even have an active spellchecker at this point. aspell segfaults for some reason and I haven't had time to research that yet. Just need to figure out how I can get latex to handle these non-ASCII characters. They disappear from the .dvi file. In case I can't figure it out, there's probably a latex user list somewhere. Great Tip..! Thanks cga
Re: Other European languages on a US keyboard
On Fri, Jul 21, 2006 at 05:19:33PM EDT, Yakov Lerner wrote: On 7/21/06, cga2000 [EMAIL PROTECTED] wrote: [..] I think the easiest apporach is to craete mappings. You could use ctrl-(a-z), ctrl-shift(a-z), ctrl-alt-(a-z), then f1-f12 + ctrl/alt/del combinations. Thanks, but not for me.. I touch type and as a result Tony's solution is much preferable than key combos. Linux has a keyboard mode where ' is used to modify letters to create diactitics. This works for all X applications, not just vim. I have used the Compose key in the past - usually mapped to menu.. I think I remapped it to the Windows key on this laptop at one point but I wasn't aware of this X keyboard mode. Thanks cga
Re: Other European languages on a US keyboard
On Fri, Jul 21, 2006 at 02:50:46PM EDT, Gene Kwiecinski wrote: Unfortunately I am only able to type the US keyboard, so remapping the keyboard might be a better solution than entering digraphs in the long run but will not be painless.. And since I do not do this on a regular basis, I am unsure whether it's really worth going to all the trouble. Would it be impractical to map, eg, ^e to whatever the code is for 'ê', ie, use prefix notation of [^'`~,], etc., as a prefix for [aeioucnAEIOUCN] as needed? Wouldn't be *all* those combinations, but, eg, would only need ,C for Ccedil;, ~N for Ntilde; (and their lowercase counterparts, natch), but the rest would just be whatever accented chars you normally use, for grave, acute, circumflex, etc. Unless I'm mistaken you have actually reinvented the loadkeymap solution discussed by Tony..? Don't take me wrong.. I am *not* being ironical.. Quite the contrary. I'm not sure how a non-US keyboard does such things, so I can't suggest a more transparent way of doing it. One other possibility would be the way my phone does multiple chars per key, eg, you'd hit '1' to get the generic '.', then '*' would cycle through different punctuation, and so on, 'til it'd get back to '.' again. Maybe hitting alt-A would get you an 'a' and put you into a loop, then multiple hits of an F-key would cycle through the 3-4 other chars and then back. Any other key would escape the loop. Arrange them in the order you expect their occurrence, most commonly-used ones first. That, I had thought of but I discarded it as impractical. That's also the method that's commonly used to input languages that have too many characters to fit on a reasonably-sized keyboard.. Chinese, eg. Entering the accent, tilde, cedilla.. etc. followed by the letter is a lot more in keeping with the wiring of my cortex.. Eg, if you arrange them in the order acute/grave/circumflex/ring, simply hitting M-a would get you aacute;. Hit F2, and it gets you agrave;. Hit F2 again, circumflex. Again, ring. Again, acute. Lather, rinse, repeat. *Implementing* this would for now be beyond my ken, or my barbie, but I'm sure someone might have some ideas how to best do it. No? Thanks cga
Other European languages on a US keyboard
I sometimes need to write text in other languages such as French, Spanish and occasionally German or Italian. I would like to do this in Vim. Unfortunately I only have a US keyboard. Using Ctrl-K to enter the various digraphs becomes somewhat cumbersome for anything larger than a short paragraph. Unfortunately I am only able to type the US keyboard, so remapping the keyboard might be a better solution than entering digraphs in the long run but will not be painless.. And since I do not do this on a regular basis, I am unsure whether it's really worth going to all the trouble. I was thinking of writing the text without accents, tildes, cedillas, etc. using the letters on the US keyboard and then feeding the result to some advanced functionality of a spellchecker that would replace all the words that can only be spelled one way by their correctly spelled version - say French 'épeler (to spell) can only be spelled this way.. there is no 'epeler' or 'èpeler' or 'êpeler'. On the other hand, for those words where the accent differs depending on the semantics such as French 'a' vs. 'à', the script/plugin would leave them untouched and - ideally - highlight them, thus leaving me with only a handful of manual corrections. Is there anything in Vim that does something like this? Or is there any other 'smart' way to achieve something like the above? Thanks cga
Problem with leader (backslash)
I have the vimspell plugin installed and I am able to use the ':' commands but the \.. shorcuts are not working the way I expected: If I type \sA to start autospell mode for instance I get: . a beep for the backslash . a switch to insert mode for the s . an inserted capital A I checked via a: :let mapleader that the leader is set to the default backslash and I'm not sure where to look. Maybe I'll try remapping leader to something else .. see if it makes any difference? Thanks cga
Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)
On Wed, Jun 07, 2006 at 10:20:56AM EDT, William O'Higgins Witteman wrote: On Tue, Jun 06, 2006 at 09:51:48PM -0400, cga2000 wrote: I will assume that you, as a relatively new Debian user, are running stable (sarge). Yes. But the main reason is that I am a new Debian user on a laptop :-( I have taken the middle path with Debian, and use testing. This gives me newer software with security updates, without the rapid change and general wobbliness of unstable. I wanted vim 7.0 though, and I got it from unstable - it works fine, and I have been doing this for new software for 5 years without anything upsetting happening. Here's what I did to get vim 7.0: # vim /etc/apt/sources.list :%s/testing/unstable/g :wq # apt-get update # apt-get install vim-full # vim /etc/apt/sources.list :%s/unstable/testing/g :wq # apt-get update I don't mess with pinning or anything tricky - I just let some packages get a head start. Eventually they are included and upgraded in testing, and then my regular updates pick them up and move them forward. Something to note with this approach is that it will overwrite your vim 6.4 installation. That was the result I wanted, and so I am unconcerned - I know that I can simply do an apt-get remove vim-full;apt-get install vim-full with my usual setup (with testing as my version) and I'll be back at 6.4 in a trice, with all of my configs where I expect them. Now, to be clear, this doesn't work if you are tracking stable for getting vim 7.0 - it is a bit too far behind unstable. For a laptop (for my laptop, actually) I recommend running testing, because you can keep more up to date but you are not working your expensive machine too much with custom compiling or package churn. I understand your reticence about doing things you don't understand, and I am not trying to pressure you into upgrading your OS :-) I just want you (and others who may read the archives or lurk) to know how I overcame my conflict between a stable system and the latest and greatest vim. -- yours, William Thanks. Just for the record: I tried installing etch about three months ago but the installer was unable to detect my PC card. I fooled him by going back and forth in the menus, loading the relevant module manually and the first part of the installation completed successfully. But when I rebooted into the base system to complete the install - the second phase where you download whatever applications you plan to use - etch stubbornly refused to connect me. There was apparently a problem with DHCP - I was never able to obtain a lease. I spent about a month trying to get this to work and eventually abandoned the install. I just could not afford to spend more time with this. So I'll stick with stable for the foreseeable future.. maybe give it another shot some time later this year - see if the pcmcia-related problems have been fixed. Thanks, cga
Re: display tweaks - tilde lines, statusline..
On Mon, Jun 05, 2006 at 08:27:17AM EDT, James Vega wrote: On Mon, Jun 05, 2006 at 01:09:41AM -0400, cga2000 wrote: I think I should stick these doubtful customizations of mine in some separate file rather than modifying individual colorschemes. I've just tested: :set FoldColumn=2 :hi Foldcolumn ctermbg=black .. and it adds a 2-column margin to the left of my display and thought I could add these to my .vimrc but then this will be lost whenever I change colorscheme on the fly. As Tony mentioned, setting 'foldcolumn' can be done in your vimrc. The highlighting can also be done there by taking advantage of autocommands. :au ColorScheme * hi FoldColumn ctermbg=black This only works in vim7 though since that's when the ColorScheme event was introduced. It may also be better to set ctermbg=NONE in case you change which colorscheme you use in the future to one that does not have a black background. .. yet another thing I need to worry about.. not introducing doubtful customization that will break when I upgrade. Thanks cga
Re: :ha printouts - fontsize
On Mon, Jun 05, 2006 at 03:11:08AM EDT, A.J.Mechelynck wrote: cga2000 wrote: [..] Well, here I am a comparatively new user of SuSE Linux, and I found it remarkably easy to compile Vim 7 on it. If you decide you want to try your hand at it, I was contemplating switching to gentoo at some point in the future. My understanding is that it is a source-packaged distro .. should make it easier to deal with compile-time customization. I've used SuSE (briefly) in the past and found it rather confusing - at the time. Among other things I had problems with the doc. It looked very nice at first glance but reading it was rather painful. Seems that rather than writing doc from scratch in English some non-native speakers had translated it from the original German doc.. Not sure.. I also found the curses config tools difficult to figure out. But then I prefer to do most configuration tasks by editing config files (things like fonts.. colors.. etc. are the exception because it's a trial and error process and some form of instant feedback is invaluable..) subscribe to the vim-dev list and ask advice there, I'll answer if no one else jumps in before me. Also, some day I should write a HowTo page for Vim on Unix, similar to the one I already have for Vim on Windows, and post it on my Vim site http://users.skynet.be/antoine.mechelynck/vim/ That would be very useful. The Vim book doesn't say much about these aspects and learning by just reading the Vim help is not very efficient.. for one you run into so much good stuff that you get sidetracked and forget what you were initially looking for. :-) Thanks Tony, I really appreciate all your help.. cga
Re: display tweaks - tilde lines, statusline..
On Sun, Jun 04, 2006 at 02:47:48PM EDT, Yegappan Lakshmanan wrote: Hi, On 6/4/06, cga2000 [EMAIL PROTECTED] wrote: Is there any way the tilde lines that represent empty lines at the end of the buffer can be changed to something else or removed altogether? AFAIK, you cannot remove/hide the tilde lines. You can change the highlighting used for the tilde lines using the NonText highlight group. .. for some reason I find them annoying.. :-) .. tried setting NonText ctermfg=black ctermbg=black and they were still visible Is there any was the statusline can be displayed systematically? As far as I can tell it only materializes when I split the display. You can set the 'laststatus' option to 2 to always display the status line: set laststatus=2 great, thanks. I don't like stuff like that to change while I'm editing. Is there any way I can have the contents of a buffer displayed a couple of columns to the right of the (sub)window's border? I currently specify set foldcolumn= but that doesn't appeear to be what it was meant for so I was wondering whether there might be a better way. Is there any way I can have vim display the hex contents of a buffer? I currently do a ggVG :!od -t x1z -w32 followed by u to revert back to a regular view but maybe there is a more straightforward way to achieve the same result. You can use the xxd tool shipped with Vim to convert a file to hex format and back. definitely more straightforward if you take xxd's defaults. I'll switch to that. - Yegappan Thanks, cga
Re: :ha printouts - fontsize
On Sun, Jun 04, 2006 at 02:50:02PM EDT, Yegappan Lakshmanan wrote: Hi, On 6/4/06, cga2000 [EMAIL PROTECTED] wrote: I occasionally need a quick printout of what I am currently editing and use the :ha command. I was wondering whether there was any way I could switch to a different printer font or choose a smaller font size. Did you try changing the 'printfont' option? :help pfn-option :help pfn :help printfont don't know how I missed that.. I must have done an :h print + Ctrl-D at some point. thanks a bunch.. answers all my questions. Thanks, cga
Re: :ha printouts - fontsize
On Sun, Jun 04, 2006 at 02:57:56PM EDT, A.J.Mechelynck wrote: cga2000 wrote: I occasionally need a quick printout of what I am currently editing and use the :ha command. I was wondering whether there was any way I could switch to a different printer font or choose a smaller font size. I doubt this is relevant but just in case I'll mention that I use vim on an xterm and cups for print jobs. As to the printer it is an HP Laserjet with embedded postscript. Thanks, cga The Vim documentation's well-known needle-and-haystack problem again. very frustrating this particular time.. I only had to page up once from where I was (*printoptions*) to find it.. See :help 'printfont' :help pfn-option This last one does not work in my version of vim. :help pfn does.. You could have found the latter from the former, which you could have found by means of :help 'printTab using :set nocompatible wildmenu starting using wildmenu yesterday.. nicer than :h print+Ctrl-D need to get used to it. Also, I found a vim plugin that provides a printoptions menu - prtdialog.vim - so you only need to remember the command to start it but I don't know if it's my setup or what.. I can't get it to work. You're supposed to type Leaderpd to activate the menu but vim keeps telling me that modifiable is off each time I issue a \pd against anything like a vim help file.. a man page.. etc. Not very useful. HTH, Tony. Thanks. cga
Re: display tweaks - tilde lines, statusline..
On Sun, Jun 04, 2006 at 08:50:18PM EDT, A.J.Mechelynck wrote: cga2000 wrote: On Sun, Jun 04, 2006 at 03:11:10PM EDT, A.J.Mechelynck wrote: [...] Note that the same highlight group also governs the @ or @@@ for a partial line at the end of a window, and possibly other things too. I had thought of that while experimenting - although I have no idea what the @ and @@@ are .. or the partial lines. When using 'wrap', one file line can be wrapped onto several screen lines. When the last file line in a buffer window overflows below the bottom of the window, then one of two things can happen: - if 'display' includes lastline, the bottom three characters at lower right of the window are replaced by @@@, the rest of that file line is displayed, or as much of it as fits into the window. - Otherwise (the default) the last file line in the window is replaced by as many screen lines as necessary consisting of @ at left, the rest empty. Thanks. Great explanation. Is there any way I can query vim to find out what a group (?) like NonText actually covers? :help NonText Looks like setting it to invisible the way you recommend is fairly harmless. Hope it doesn't come back and bite me when I've forgotten all about it. I think I should stick these doubtful customizations of mine in some separate file rather than modifying individual colorschemes. I've just tested: :set FoldColumn=2 :hi Foldcolumn ctermbg=black .. and it adds a 2-column margin to the left of my display and thought I could add these to my .vimrc but then this will be lost whenever I change colorscheme on the fly. [...] awful thing about vim is that the more you learn the more you realize how complex it is and how much more there is to learn.. But thanks to all the help I am getting on this list I am now a bit more able to find my own answers. The help files are great but it's really a maze.. You could spend hours and hours just following these tags.. Sometimes it gets to the point where I can't remember what I was looking for in the first place. :-) Best regards, Tony. Thanks, cga
non-gui version - changing fonts on the fly
Just a confirmation: I am under the impression that with vim running in an xterm, you are limited to using whatever fonts have been defined as X resources and using a mouse Ctrl-left-click if you want to change to a different font on the fly. Naturally the font change would affect the entire display. Likewise, I have seen some rather elegant color schemes where some :hi groups are highlighted not only by using a different colour but also switching to italic - charon.vim, eg. Coding cterm=italic in the .vim file does not appear to cause a vim syntax error but after taking a quick look at the xterm doc it seems that using an italicized font as a highlighting enhancement - as least in my setup - is not possible when running vim in non-gui mode. Am I correct assuming the above or am I missing anything? Thanks, cga
Re: Tables.
On Sat, May 20, 2006 at 04:08:01PM EDT, Thomas Adam wrote: --- Hari Krishna Dara [EMAIL PROTECTED] wrote: It is a text browser like lynx, but does a better job of formatting tables and others. From my man page, the homepage should be: Of which I find 'Elinks' to do an even better job. As usual, YMMV. .. and has a more sensible name than 'links' - try googling on links.. I have switched from mozilla to Elinks and find it mature enough for just about anything. Only drawback - at least in the version I am running, is that it does not appear to support javascript. Thanks, cga
Re: Tables.
On Sat, May 20, 2006 at 12:09:20AM EDT, Hari Krishna Dara wrote: [..] If you have links installed, you can do this easily with the -dump option. Here is a quick idea: function! HtmlToTxt() write let filename = expand('%') pedit %.txt wincmd p setl bufhidden=delete exec 'silent! 1,$!links -dump '.filename setl nomodified wincmd p endfunc nnoremap silent F12 :call HtmlToTxt()CR E.g., if you have the following in a file: html table border=1 tr thNumber/ththDescription/th /tr tr td1/tdtdOne/td /tr tr td2/tdtdTwo/td /tr tr td3/tdtdThree/td /tr /table /html and press F12, you get the below in the preview window: +--+ | Number | Description | |+-| | 1 | One | |+-| | 2 | Two | |+-| | 3 | Three | +--+ To make your HTML table editing easier, you can have macros to insert new rows and columns. Thanks, Hari, This is very nice indeed. Took me about two minutes to set it up and run the test and would appear to meet my requirements: I can get the text-only rendering - without box characters - for a quick preview in vim via a simple keyboard action and I could likely set up some other macro/function that would launch Elinks or a graphical web browser for different levels of rendering of my documents. I need to dig into vim's function capabilities, see if I can have the preview window full screen-height - or use normal vertical split instead of the preview window - so I can have the html source and the basic text-mode rendering thereof side-by-side. The dilemma of course is choosing which markup language I should choose (html, groff, latex, ..). I'm sure I could start one of those never-ending threads if I asked something quite vague such as which markup language is the best choice for the documenting dilettante.. or something to that effect. :-) Personally the main issue I have with html is that I find its syntax rather illegible and quite difficult to type. But I'm sure there must be quite a collection of vim tools to help your enter all these tags rapidly. Thank you very much. cga -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Tables.
On Fri, May 19, 2006 at 11:35:09PM EDT, Gary Johnson wrote: On 2006-05-19, cga2000 [EMAIL PROTECTED] wrote: On Fri, May 19, 2006 at 08:22:40AM EDT, Benji Fisher wrote: On Thu, May 18, 2006 at 10:08:53PM -0400, cga2000 wrote: I was wondering if another approach such as using a markup language that supports tables might not be preferable in the long run. What I mean by this is that it might be a little more difficult to start off with but might provide more control and facilities and end up being a more portable solution. html would be an obvious candidate but I suppose that there are others in the linux world? Is there any way I can split the screen and have the source version of a document written in a markup language in one window and the compiled version in the other? With a simple command or key combo that I could issue in the source window that would cause a refresh of what is displayed in the other window..? Or is vim just not suited for this kind of approach? It depends on what you mean by split the screen. vim vertical split on an xterm. If the compiled version is plain text, sure. You could use an autocommand with the BufWritePost event that would run the compiler on your source file, switch vim windows, delete the existing contents, and :read in the compiler output file. Sounds pretty straight-forward. This will work with HTML and with man pages, with some limitations on fonts and styles. If you want one window that has vim running in the bottom half and an HTML browser running in another, yes.. pretty much what I had in mind.. another example: I'm writing a man page and I would like to work on the source in the left vim window and check the rendered man page in the right vim window: 1. I make changes to my man page save to disk 2. I switch to the other window and hit the refresh key 3. Now I can see the results of my changes 4. Back to 1. above etc.. In order to do this in vim you would probably need to be able to run a shell in a vim window - doesn't seem to be possible. You don't need a shell in a window, just do what I suggested above. Or use a refresh key instead of an autocommand, if you prefer. Yes, your description of the process is very clear. If I understand correctly I would just need to direct the output of the compile command to a temp file and cause vim to re-read it and display the updated version. There is a plugin that lets you read man pages within vim. You could probably use this directly or adapt it to your needs. I was just going to ask whether you could suggest something comparable that I could adapt.. :-) As it happens, the :Man plugin is one of my favorites. It doesn't have to be html, though. Some very basic markup language that provides headers, paragraphs, lists, and tables and that could be easily translated to html, pdf, postscript, and simple text would be well-adapted to my needs. No idea if linux has such a thing. Well, there is nroff. I have used it once in the past to write a test man page. Just taking a look at how things work. And I don't remember running into any problems. Man pages are actually written using nroff macros. At least one implementation of the man command uses the following to format the pages it finds: tbl -TX file name | neqn | nroff -man | col -x I don't remember a man page that has a table in it. I mean a table that actually visualizes the cells with box drawing characters. The tbl command is used to format tables and the neqn command is used to format equations. Nroff does some things really well and some things not so well. I think w3m does a better job of creating tables from HTML than tbl and nroff do from their source code. I use mostly elinks and it also does a very good job of rendering HTML tables. Then there's latex, which I know nothing about other than it is supposedly a very nice typesetting language for everything from short letters to long dissertations and books. A lot of people swear by it. Yes, I've used LyX in the past and it's rather nice. Don't know if latex is quite suitable for the small documentation tasks I have in mind but from what I have heard it's probably worth the effort. HTH, Gary Very much so. Thanks, cga
Re: Tables.
On Fri, May 19, 2006 at 08:22:40AM EDT, Benji Fisher wrote: On Thu, May 18, 2006 at 10:08:53PM -0400, cga2000 wrote: I was wondering if another approach such as using a markup language that supports tables might not be preferable in the long run. What I mean by this is that it might be a little more difficult to start off with but might provide more control and facilities and end up being a more portable solution. html would be an obvious candidate but I suppose that there are others in the linux world? Is there any way I can split the screen and have the source version of a document written in a markup language in one window and the compiled version in the other? With a simple command or key combo that I could issue in the source window that would cause a refresh of what is displayed in the other window..? Or is vim just not suited for this kind of approach? It depends on what you mean by split the screen. vim vertical split on an xterm. If you want one window that has vim running in the bottom half and an HTML browser running in another, yes.. pretty much what I had in mind.. another example: I'm writing a man page and I would like to work on the source in the left vim window and check the rendered man page in the right vim window: 1. I make changes to my man page save to disk 2. I switch to the other window and hit the refresh key 3. Now I can see the results of my changes 4. Back to 1. above etc.. In order to do this in vim you would probably need to be able to run a shell in a vim window - doesn't seem to be possible. you will have to look for some other program that can embed both. I use gnu/screen and the one feature that I miss is that it does not have vertical split. So I can't have my source and output side by side visualising in one window the outcome of my changes in the other. If you are content with [g]vim and a browser running in separate windows, it should not be hard (depending on your OS) to have vim save the current version and send the browser a command to re-load the file. It doesn't have to be html, though. Some very basic markup language that provides headers, paragraphs, lists, and tables and that could be easily translated to html, pdf, postscript, and simple text would be well-adapted to my needs. No idea if linux has such a thing. Thanks, cga
Re: Tables.
On Thu, May 18, 2006 at 01:55:03PM EDT, Hari Krishna Dara wrote: On Thu, 18 May 2006 at 8:23am, Benji Fisher wrote: On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 HTH --Benji Fisher Oops... I searched for scripts and didn't find anything dealing with this kind of tabs, so got curious and went ahead and wrote a small plugin for this. I hope there is more to be offered in this, than your VarTab() function, especially that there is a GUI tabstop setter, and it maps Tab to insert the right number of spaces. I am attaching the plugin, and hope to get some feedback. You need genutils.vim also, and read the plugin header. Thanks to all. This was just a general question.. something I planned to keep on the back burner for a while.. so I'm not sure when I will have the time to look into this further. Saving this thread for later reference. cga
Re: Tables.
On Wed, May 17, 2006 at 10:50:08PM EDT, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh Thanks much, saving this for later. cga
Re: Tables.
On Thu, May 18, 2006 at 02:36:05AM EDT, Stano Sitar wrote: cga2000 napsal(a): The functionalities I had in mind would probably do something like this: 1. Assist text entry by letting you define tab stops, 2. Let you select a column of text and justify it, 3. Provide some means of inserting vertical lines at each tab stop, 4. Assist in creating horizontal lines by adding the ad hoc character where a vertical and a horizontal line intersect, 5. Reformat the table frame when box drawing characters are not available (replacing line intersections by '+' for instance). Try program sc sc is an anicent spreadsheet calculator for console (text only, no mouse) It does everything you want, it is very small, it exists for number of platforms (for dos and Windows version look for gnuish collection) keybindings in sc are very vi-like You can make script that sends data from vim to sc, format data in sc and export them back to vim best regards Stanislav Definitely the better strategy. I'll keep this in mind for when I have more time to look into it. I downloaded it to take a look. Is there a some kind of user guide or other resource that might help getting started? I also found another text-mode spreadsheet called slsc. Would you know if either of these is still maintained and where I should go, should I need some form of assistance? Thanks, cga
Re: Tables.
On Thu, May 18, 2006 at 08:23:00AM EDT, Benji Fisher wrote: On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 Thanks. Will play with that too. I was wondering if another approach such as using a markup language that supports tables might not be preferable in the long run. What I mean by this is that it might be a little more difficult to start off with but might provide more control and facilities and end up being a more portable solution. html would be an obvious candidate but I suppose that there are others in the linux world? Is there any way I can split the screen and have the source version of a document written in a markup language in one window and the compiled version in the other? With a simple command or key combo that I could issue in the source window that would cause a refresh of what is displayed in the other window..? Or is vim just not suited for this kind of approach? Thanks, cga
Re: colorscheme conversion script?
On Mon, May 15, 2006 at 10:08:03PM EDT, Suresh Govindachar wrote: Are you thinking of Gautam's xterm16 http://www.vim.org/scripts/script.php?script_id=795 ? No, I actually use the all-blue incarnation of his xterm16 colorscheme myself.. I have read the doc a couple of times, and I'm pretty sure this was from somebody else. Since I spent some time getting his colorscheme to work - where console vim is concerned, it requires a 256-color xterm I think it would have struck me if they had been from the same author. But who knows.. I'll take another look just in case.. Gautam may know something about this since he seems to be our greatest expert in vim colorschemes. I'll update the thread if I find anything. Thanks, cga PS. I think it would be preferable to bottom-post.. I wasn't sure where to reply.. right after your reply as I did.. at the bottom as I normally do.. at the top - before your reply..? Whichever way, this results in something rather messy especially for those who have not followed the entire thread.. and it's probably also preferable to reply to the list instead of the original poster (and cc'ing the list).. but then who am I to argue.. It comes with lots of files: cpalette.pl tags xterm16.ct xterm16.schema xterm16.vim xterm16.txt Gautam, is your colorscheme useful for vim under cmd.exe and gvim in Windows also? Also, why do you include the tags file? --Suresh -Original Message- From: cga2000 [mailto:[EMAIL PROTECTED] Sent: Monday, May 15, 2006 6:31 PM To: vim@vim.org Subject: colorscheme conversion script? I'm pretty sure I saw a vim script that converts gui colorschemes to 256-color xterm versions but I can't seem to find it any more. Can anyone on the list confirm that I'm not making this up and possibly provide the name of this script? Thanks, cga
Re: Tables.
On Wed, May 17, 2006 at 05:13:46PM EDT, A.J.Mechelynck wrote: cga2000 wrote: Does vim provide any form of native support for drawing tables? I have tried a couple of plugins and they don't seem to play well with my setup, presumably because I have temporarily switched my locale back from UTF-8 to en_US (due to problems with other applications that do are not yet utf8-ready). When in UTF-8 I was able to manually draw nice-looking tables to dress up text that I had previously formatted in rows and columns by using digraphs (Ctrl+K hh/vv etc..) and though there were some issues with printing I was all-in-all quite happy. The functionalities I had in mind would probably do something like this: 1. Assist text entry by letting you define tab stops, Tabs stops in Vim are fixed-width; and it's usually a good idea to keep the hard tab width at 8, though it is possible to define soft tab stops (:h 'softtabstop') of a different width. ok. But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Both regular tabs and soft tabs would appear to be more useful for indentation than column formatting. 2. Let you select a column of text and justify it, 3. Provide some means of inserting vertical lines at each tab stop, I think that's possible using block visual mode, but I don't know the details. that's pretty much how I was doing it manually - with a ':s' command. 4. Assist in creating horizontal lines by adding the ad hoc character where a vertical and a horizontal line intersect, 5. Reformat the table frame when box drawing characters are not available (replacing line intersections by '+' for instance). But then again I have little experience with vim and there is probably a vim way of doing this that I have not even imagined. So I am open to better strategies. Thanks, cga See also :help :s :help line() :help column() :help sub-replace-special etc. Probably some of the building blocks of the tools I'm looking for. Best regards, Tony. Thanks, much appreciated, cga
colorscheme conversion script?
I'm pretty sure I saw a vim script that converts gui colorschemes to 256-color xterm versions but I can't seem to find it any more. Can anyone on the list confirm that I'm not making this up and possibly provide the name of this script? Thanks, cga
Re: Text wrapping / reflowing - two questions.
Thus spake Gary Johnson on Sun, Apr 30, 2006 at 11:18:00PM -0700 or thereabouts: [EMAIL PROTECTED] [2006-05-01 02:38]: On 2006-05-01, cga2000 [EMAIL PROTECTED] wrote: [...] Now, after doing the above a number of times I began to think there must be a better way to handle this type of situation: 1. When I end up with (4) above, is there a better strategy than using 'J' to join line #2 and line #3 .. something that would take me directly from (4) to (9) .. hit 'A' and since the cursor would now be to the left of col. 72, continue entering my text and benefit from the wrap feature automatically? Yep. See :help gq :help 25.1 You can easily reformat the paragraph the cursor is currently in by typing this in normal mode: gqip bingo..!! tried this very rapidly and works great - c. 2:45 AM, so I'll have to dig into this - and read the doc - tomorrow.. later today, I mean.. 2. More generally, is there a command - or sequence of commands - that would let me reformat a paragraph to take care of any line that goes beyond the limit set via the textwidth option? There are two approaches to this: manual and automatic. I mentioned the manual technique above. You can also add the 'a' and 'w' flags to 'formatoptions' and have vim automatically reflow your text as you type. set fo+=aw As nice as this sounds, it has its limitations and can sometimes be really infuriating. It works well enough that I have my mail.vim plugin enable it, but I also have a command to disable it when it gets in the way. HTH, You bet..! Thank you very much, cga
Re: Text wrapping / reflowing - two questions.
Thus spake Eric Arnold on Mon, May 01, 2006 at 12:19:41AM -0600 or thereabouts: [EMAIL PROTECTED] [2006-05-01 02:38]: Do you have these set? setlocal formatoptions+=bcroqan2t better without w setlocal linebreak Not that I know of. I tried: :set ?formatoptions :set ?formatoptions+ :setlocal ?formatoptions .. etc. and vim didn't seem to like it.. I then did a :set and formatoptions is apparently set to: formatoptions=tcql .. looks very different from what you have above? I'll look into it further later today since it's really getting late. btw, is there any way I can direct vim to write the output of a query such as ':set' or ':ve' directly to the buffer? That would come in handy when someone asks me for more info as to how my system is configured. Thanks, cga
Re: hiding lines
Thus spake Yakov Lerner on Mon, May 01, 2006 at 10:06:57PM +0300 or thereabouts: [EMAIL PROTECTED] [2006-05-01 17:25]: On 5/1/06, Bill Pursell [EMAIL PROTECTED] wrote: Is it possible to completely hide lines? Something stronger than merely folding. In particular, I'd like to be able to display the buffer with all lines containing assert hidden, or to hide lines between and including #ifdef/#endif pairs. Can that be done? Piping the buffer text into temp. buffer through some sort of grep -v. could you be a little more specific - or provide a short example.. been looking for something like this myself for some time.. thanks, cga
Destructive left shift of a block of text
I have saved the following in a file: I can't give you any Mac-specific advice, since I don't use them, but I can give you a general run-down. 1. You need to have the right locale settings. Your locale should be set to something similar to this: $ locale LANG=en_US.UTF-8 [...] The above was posted on the mutt mailing list and has ' ' in col. 1-2 and I would have liked to get rid of these two characters. What would be the best approach to have vim do this for me? I tried setting shiftwidth=2 followed by as visual select of the entire buffer + '' or '' but vim does not do anything. I suspect he is just being nice and refusing to shift the selected block to the left because columns 1-2 contain stuff that is not white space and therefore might be important.. :-) So, is there any command that tells vim to shift left no matter what.. or should I use some regexp-driven substitute command to replace all greater-than characters followed by a space in column one by // (void)? Any idea? Thanks, cga
Re: hiding lines
Thus spake Gary Johnson on Mon, May 01, 2006 at 02:52:21PM -0700 or thereabouts: [EMAIL PROTECTED] [2006-05-01 19:31]: On 2006-05-01, cga2000 [EMAIL PROTECTED] wrote: Thus spake Yakov Lerner on Mon, May 01, 2006 at 10:06:57PM +0300 or thereabouts: [EMAIL PROTECTED] [2006-05-01 17:25]: On 5/1/06, Bill Pursell [EMAIL PROTECTED] wrote: Is it possible to completely hide lines? Something stronger than merely folding. In particular, I'd like to be able to display the buffer with all lines containing assert hidden, or to hide lines between and including #ifdef/#endif pairs. Can that be done? Piping the buffer text into temp. buffer through some sort of grep -v. could you be a little more specific - or provide a short example.. been looking for something like this myself for some time.. I can't think of anything 'grep -v pattern' can do in this situation that 'v/patter/d' can't, so here's one way to do this: ggaYG :new ap :1d :v/assert/d HTH, Gary Thanks, Gary.. :v (and :g) made my day..! -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: Destructive left shift of a block of text
Thus spake Gerald Lai on Mon, May 01, 2006 at 04:43:55PM -0700 or thereabouts: [EMAIL PROTECTED] [2006-05-01 20:16]: [...] What would be the best approach to have vim do this for me? One way is to use the Visual Block. To invoke it, type Ctrl-v or Ctrl-q in Normal mode, when your cursor is on the first . Then move the cursor down to highlight what I call a visual strip. You can also type G to highlight a visual strip till the end line of the file. Then move the cursor to the right by one character. This will highlight a box of 's. Hit x to delete that block. You can also use visual strips for ex commands like :y and :d, and for normal commands like I, A or c. I like this too.. funny I did not figure it out myself :-/ The nice thing about it being that you don't have to think - means less overhead on my personal cpu.. Also you can use it just as easily to get rid of some trailing character(s) in col. 72 or whatever - such as a column of !'s or |'s.. if the original text was for some reason inside an 'ascii box' or such like.. [...] [snip] Yes, that's a good idea: :%s/^ // I was having trouble with this.. thought that I had to escape the '^' meta character for some reason.. and I got caught in a nasty tangle of /'s and \'s.. HTH :) Thanks much.. It's a bit embarrassing to come up with all these silly questions but sometimes you're just stuck and wish someone with experience could give you a hint.. so all the help I've been getting for free here lately is much appreciated. cga
Text wrapping / reflowing - two questions.
When writing email messages I use the following settings: :set wrap :set textwidth=72 Say, I do the following: 1. I enter insert mode 2. I start to type the following introductory text: I am writing this short email message to ask the friendly and highly competent folks at vim@vim.org for some help regarding the text wrapping feature of Vim... As I was writing an email message last night, I ran in to the following problem: 3. So I start typing: I am writing this short email message to ask the friendly folks at vim@vim.org for some help regarding the text wrapping feature 4. I realize at this point that I left out the highly competent bit so I escape back to normal mode and move the cursor back to the f of folks, hit 'i' to switch back to insert mode, type the missing text and obtain the following: I am writing this short email message to ask the friendly and highly competent folks at vim@vim.org for some help regarding the text wrapping feature 5. The first line was correctly re-wrapped to accommodate the additional text, with competent folks at moved to the second line but now the rest of my original entry has been moved to a third line (vim@vim.org for some help .. etc.) 6. At this point I escape back to normal mode and hit 'J' to join line 2-3 and obtain the following: I am writing this short email message to ask the friendly and highly competent folks at vim@vim.org for some help regarding the text wrapping feature 7. So I hit 'A' to append the rest of my text to line 2: I am writing this short email message to ask the friendly and highly competent folks at vim@vim.org for some help regarding the text wrapping feature of Vim... As I was writing an email message last night I ran into the following problem: 8. In other words and in case the last line above is either truncated or rewrapped on your mail reader.. once you have decided to join two lines into one long ( textwidth) line, vim quite logically lets you append as much text as you wish to that line. 9. So far the way I handle this is that after J-oining my two lines as described above, I move the cursor to the first space before col.72, hit 'i' and manually insert a carriage return to move the excess text to the following line: I am writing this short email message to ask the friendly and highly competent folks at vim@vim.org for some help regarding the text wrapping feature Now, after doing the above a number of times I began to think there must be a better way to handle this type of situation: 1. When I end up with (4) above, is there a better strategy than using 'J' to join line #2 and line #3 .. something that would take me directly from (4) to (9) .. hit 'A' and since the cursor would now be to the left of col. 72, continue entering my text and benefit from the wrap feature automatically? 2. More generally, is there a command - or sequence of commands - that would let me reformat a paragraph to take care of any line that goes beyond the limit set via the textwidth option? Thanks, cga
the dash and the '.' repeat command
Are there any peculiarities associated with the '-' dash character in vim? I was experimenting with the '.' repeat command and I typed the following: +++ !!! followed by an esc and a '.' .. vaguely hoping to obtain this: +++ !!! +++ !!! .. in order to eventually create a table of two columns and n rows with minimal effort/typing. Instead I got this: ++---+ !! ++---+ !!¬¬¬!! iow the spaces on the second line of what I originally entered are replaced by the 'NOT' character - not present on the US keyboard. also the last of my exclamation points appears to have been removed from what I originally typed and now four of them appear on the second of the two lines added by the '.' command naturally, I could use shift-V followed by a number of 'yp's to obtain what I am looking for but I was just curious where this NOT ('¬' - 0xac) character comes into the picture - and whether there is more to it than the above triviality. Thanks. cga
Folding comments
Is there any way I could use folding to do this: 1. Fold all lines in a file that contain only comments. 2. Optionally delete all the lines that have previously been folded. I have a feeling I am looking for something less sophisticated than the fold feature where I could remove all lines that contain a given pattern - say, # or /* in col. 1, from a buffer and I am not sure folding is the feature I should be looking at. An example of possible use: I would find this useful when trying to prune some configuration file that has some ten lines of comments for every entry so that I can have more or less the entire configuration file fit on one screen instead of fifteen or twenty. A more general definition of this need/problem might be to 'remove all lines that match a certain pattern from the buffer - and optionally from the file itself'. Thanks. cga