Re: search/paste question

2007-06-05 Thread Tim Chase
I see you can /text to search, and do * to find the next occurrence of the word under the cursor, but how do you paste text that you've just yank'd, into the search line after you press / without using the mouse? You can use control+R followed by / to insert the text of the last search.

Re: ex editor

2007-06-05 Thread Tim Chase
I would dearly like to be able to replace ex by a more comfortable older version eg not wiping image of recent changes on screen on exit. I'm not 100% sure how to do this one. This is likely a terminal thing. Perhaps you can monkey with the settings as described in

Re: ex editor

2007-06-05 Thread Tim Chase
Can you please expand on what :open does and what it's useful for? :help :open tells me nothing at all :-( Open-mode is a quasi-Ex and quasi-Vi mode, or could also be described as Vi mode on a glass/printing TTY. It doesn't redraw the screen. I found it useful when I had to use a printer

Re: ex editor

2007-06-05 Thread Tim Chase
Is :help undo where we can get information on Vim7's undo? I remember reading about how it was all awesome and stuff, but I haven't gotten a chance to actually try to use it yet. It's all contained in :help undo.txt The powerful additions to Vim7 are found at :help

Open all folds in the current fold?

2007-06-04 Thread Tim Chase
I'm trying to find/create a command that acts somewhat like zO/zR for within an existing fold. If I use zR, it opens all the folds in the whole document. If I use zO, it opens all the folds under the cursor. The behavior I'm looking for is that if I'm within an existing fold, it recursively

Re: Edit output of external command

2007-06-04 Thread Tim Chase
Is there a better (faster?) way to edit the output of an external prog in a new tab or window, than to filter the new buffer through it? :tabnew|%!svn diff Faster? Not so much. Better? for certain definitions of Better :) :tabnew | 0r! svn diff It doesn't involve funneling

Re: Open all folds in the current fold?

2007-06-04 Thread Tim Chase
I'm trying to find/create a command that acts somewhat like zO/zR for within an existing fold. The behavior I'm looking for is that if I'm within an existing fold, it recursively opens all the folds within the current fold: Try zczO Works like a charm. Andy's solution worked as well,

Re: OT: Vi in a browser...

2007-06-01 Thread Tim Chase
Speaking of which, is there any quicker way to visually select the entire file, analogous to ^A in other systems? I have to essentially do 1GVGctl-del to stick everything into the scratchpad/clipboard/whatever to dump it back into the item from whence it originally came, and that's

Re: gvim 7 highlight search string

2007-06-01 Thread Tim Chase
In the old gvim, doing a search (/something) highlights all something in red. In gvim 7, it doesn't highlight all occurrences. Is there a way to turn this back on? It sounds like in the process, a vimrc (system-wide?) was changed. You don't mention your distro/OS, so it's hard to help there.

Re: collapsing single lines of html tag attributes via plugin??

2007-06-01 Thread Tim Chase
Been a long long time vi user but bizarrely never made the jump to vim until quite recently. Welcome! I'm editing a lot of complex html/cake-php thtml templates at the moment and despite useful color highlighting I'm finding it quite difficult to see the wood for the trees due to the

Re: good keys for mappings

2007-05-31 Thread Tim Chase
Any suggestions on keys/key combos that are good candidates for custom mappings etc? [snip] I think Bram mentioned he's found prefixing with _ works well.. I believe that the backslash (\) is the only stand-alone lower-ASCII character available for mappings, and thus is the default

Re: Retaining undo levels

2007-05-31 Thread Tim Chase
Is there a way to retain the undo levels, even when the buffer is not loaded in any windows/tabs? Right now, whenever I open another file in a window, the previous file loses it's undo levels, even though it is still inside the buffer list. Just to make sure I understand, you're talking about

OT: Vi in a browser...

2007-05-30 Thread Tim Chase
Just stumbled across this link: http://gpl.internetconnection.net/vi/ for a basic implementation of Vi, authored in JavaScript. Sick, sick, sick. So just in case you're on a foreign computer that doesn't have vi/vim installed, and you need a fix, you can get it via the web. :) -tim

Re: local diffs?

2007-05-29 Thread Tim Chase
I'm looking for a quick and easy way to compare two pieces of code inside a single file. I find it to be quite a common use case to compare two functions or code block to see if they are similar enough to be refactored out to a single function. I've done this occasionally, and use the following

Re: Why bottom-posting is prefered on Vim Mainling List?

2007-05-29 Thread Tim Chase
It seems that top-posters and bottom-posters belongs to different party and no one can convice another. Follow to difficult conversation the makes questions the reading before answers the reading. Responding with the answers interlinearly makes the conversation easier to follow for people who

Re: Replacing newline/carriage returns in a file with spaces

2007-05-28 Thread Tim Chase
/+,/ENDTEXT/-j to every line after STARTTEXT through every line before ENDTEXT. If the text to join is embedded in your HTML/JS files, this might help isolate the contents so you're only joining germane lines. -tim On 5/26/07, Tim Chase [EMAIL PROTECTED] wrote: I have been trying to figure out

Re: Using syntax declarations as range?

2007-05-25 Thread Tim Chase
I'd like to use a defined syntax group as a range; eg. {cComment}s/me/you/g to substitute every me by you in C-comments. I found SrchRplcHiGrp (http://www.vim.org/scripts/script.php?script_id=848) but that does only search/replace ... Doesn't this plugin answer your need stated

Re: undo replace in multiple files

2007-05-23 Thread Tim Chase
echo first file first.txt echo second file second.txt gvim first.txt second.txt Suppose in first.txt I edit `first` to become `1st` using Vim editing commands: cw1stEscape Now I perform a search-and-replace to change `second` to `2nd`: :argdo

Re: A performance question

2007-05-22 Thread Tim Chase
That brings me to my question. I have noticed that when editing large files (millions of lines), deleting a large number of lines (say, hundreds of thousands to millions) takes an unbelieveably long time in VIM--at least on my systems. The issue of editing large files comes up occasionally. A

Re: A performance question

2007-05-22 Thread Tim Chase
Do you have syntax highlighting enabled? That can really slow vim down. Well, I don't mean to. :set says this: It can be toggled via :syntax on and :syntax off To see what flavor of syntax highlighting you currently have, you can query the 'syntax' setting:

Re: Really stupid question...

2007-05-22 Thread Tim Chase
I am trying to write a simple function, which searches through the whole buffer to fund a certain pattern and stops searching when found the first match. I also want the function to return a matched/not matched return code and given the caller the line/column of the match if found.

Re: undo replace in multiple files

2007-05-21 Thread Tim Chase
Let's say I do multi-file replace like 'argdo %s/foo/bar/g', and I 'autowrite' and 'nohidden' options are set. So the argdo will replace and write files, because of 'autowrite' is on. My question is, is there any trick to do 'undo' after that that would undo all changed files in this situation ?

Re: How to get value of ~ (last used replace-to string) in script

2007-05-20 Thread Tim Chase
In a script, how do I get the value of ~ -- the last used replace-to string, as used in s//~/ ? While I've wondered this in the past, and don't have an answer at the moment, I found a small bug in the help text (or in the :help command) while hunting. In Vim7, if I type :help ~ and

Re: Disabling Alt+keys (menu keys) in Windows gVim

2007-05-18 Thread Tim Chase
Is there a way I can rebind alt+something keys for Windows gVim. Normally alt+b is for opening the buffers menu, alt + w is for opening the windows menu, etc. Is the only solution rebuilding Vim without those shortcuts, or is there a easier/quicker way to do it? Well, if you don't use the

Re: regex help

2007-05-16 Thread Tim Chase
I'm trying to work out if it's possible to refer to 'the previous line' in a regex. e.g. if the first 8 characters of a line are blank, ^\s{8} replace them with the 8 characters at the start of the previous line. Ideally it would handle a line a time, thus multiple blank line starts

Re: regex help

2007-05-16 Thread Tim Chase
:g/^\s\{8}/-s/^\(.\{8}\).*\n\zs\s\{8}/\1 I don't understand that regex completely - but it deletes lines of data :-) Looks like it globably matches the 'blank start' lines, then searches in that for the pattern - thus deleting the third line... That's really odd...the \zs *should* be forcing

Re: FC6 gvim version 7.0.235 question

2007-05-11 Thread Tim Chase
I am running gvim version 7.0.235 on FC6. I have a slight problem where everytime I open a gvim session, the gvim window is placed behind all of my terminals. Would anyone have an idea why this is happening and how I may correct it? While I don't know enough about your setup to give

Re: replace number with zero-packed number

2007-05-09 Thread Tim Chase
I've never used \=, but I see it only works at the beginning of the substitute string and makes the entire replacement an expression. Is there a way to put it in the middle. For example, I was thinking if the CSV file had other numbers, and only one field should be 0 padded, ex: Blah,

Re: is there a list-administrator ?

2007-05-09 Thread Tim Chase
I'm not a list-admin, but did you try sending a message to [EMAIL PROTECTED] From the account with which you subscribed? (just to make sure) It should be the same one with which you posted to the list, as the list shouldn't let you post if you're not subscribed. -tim

Re: Define regexp

2007-05-08 Thread Tim Chase
Is it possible to define a regular expression so that it remembered (.vimrc?) and i can just refer to the name of the regexp rather than type the whole thing, eg. something like: define myregexp = '^ *[1-9][0-9]\{3}-[A-Z0-9\-]*\. *$' and then in command line i just do:

Re: Define regexp

2007-05-08 Thread Tim Chase
let @x = '^ \+[1-9][0-9]\{3}-[-A-Z0-9]*. \+$' You don't even need to load it explicitly in the vimrc, registers are remembered by the viminfo (see :help viminfo). ...as long as your copy of vim is 1) compiled with +viminfo 2) set to use viminfo (non-empty 'viminfo') and 3) the 'viminfo' set

Re: Visual block mode insert/append (was Favorite little-known feature)

2007-05-06 Thread Tim Chase
Selecting a block (Ctrl-V), then pressing I (shift-i) and entering text which then gets inserted into all rows of the block at the same column. I've tried to that some time ago, because i though that should work the way you described it. But it didn't and still doesn't work on my vim,

Re: search pattern on sed or grep

2007-05-04 Thread Tim Chase
I'm very sorry to bother the list with this problem but I've been searching in the web the couples hours to find an answer and still haven't find any. It's a common sed problem and in the FAQ http://sed.sourceforge.net/sed1line.txt (scan for the emulates grep bit) Fortunately, the vim

Re: search pattern on sed or grep

2007-05-04 Thread Tim Chase
grep 'rs10946498' chr6.txt | grep -v 'rs10946498.*rs10946498' out.txt Sed might allow it in one pass with something like sed -e '/rs10946398/!d' -e '/rs10946398.*rs10946398/d' chr6.txt out.txt Still try to migrate from Windows to linux, but hopefully will done it someday! Since

Re: Favorite little-known feature

2007-05-04 Thread Tim Chase
What is your favorite little-known Vim feature? One person's little-known feature is another person's life-blood. :) There are dark corners and abuses of Ex commands that I exercise on a regular basis without thinking--when I mention them in an answer on the list, I occasionally get a wow, I

Re: moving virual rectange about in virtualedit mode

2007-05-01 Thread Tim Chase
Well, could one not do something like the following? :vnoremap down downodowno No, I did not mean move the corners of the selection. I meants move the contents. I meant erase the contents at the old place and put the contents at the new place. Imagine moving text frames in the

Re: moving virual rectange about in virtualedit mode

2007-04-30 Thread Tim Chase
I 'set ve=all' and selected a rectangle with Ctrl-V. How can I move this rectangle up/down left/right with arrows ? I assume you're asking how you can move the other sides of a visual block. When you're using visual block you usually have control of only one corner (southwest for me most of

Re: [converted]?

2007-04-30 Thread Tim Chase
There's one file (.htm) that I edit, and every time I write it to-disk, it'll say [converted], much the way you'd see on reading a file the status message that lists any non-native format or other quirks of the file, eg, [unix], [noeol], etc. (At least that's what I recall; the file's at home

Re: ...curiosity

2007-04-29 Thread Tim Chase
I am curious whether this kind of meta-regexp is possible with vim: I want to match a certain kind of pattern and want to do something with it. The kind of pattern does not describe a group of chars but their relation to each other. Example: I want to search for a number

Re: ...curiosity

2007-04-29 Thread Tim Chase
Five identical characters would be: /\[a-z,A-Z]\{4}/ I believe... This would be any 4 characters in your set [a-z,A-Z] (including the comma), it would match any of the following: A,b, ,A,Z Numbers would be: /\d\d\{2}\d/ This also would match things like 1221

Re: [HELP]how to delete all comment line in one command line(C/C++)?

2007-04-27 Thread Tim Chase
How to delete all comment line in one command line(C/C++)? Before: // /*comment1*/ // int Fun() { int a = 5; // number 1; int b = 10;// number 2; return a+b;// number 1 + number 2; } After: int Fun() { int a = 5; int b = 10; return a+b;

meta-Vim-ML question about duplicte posts

2007-04-27 Thread Tim Chase
On some of the other mailing lists to which I subscribe, I have the ability to set an option that sniffs the headers and doesn't send a duplicte copy to me if I'm already in the TO:/CC: headers. Most of these use the majordomo software, IIUC. Is there a way to do the same thing with the Vim

Re: button t useless?

2007-04-26 Thread Tim Chase
When the cursor is in the middle of a word you wish to delete diw has a distinct advantage over bdw But what is it? I think it's the mental model. diw is two mental steps: {action}{object} where {action} is delete and {object} is iw even though that {object} is two characters. bdw,

Re: change background for range of lines

2007-04-25 Thread Tim Chase
Is is possible to change background for range of lines without suppressing the other syntax highlighting in the range ? (I tried something simpler and less useful - match by range of lines (:match Search /\%123l\_.*\%999l/ which suppresses highlighting in the region) but even this did not

Re: Mapping to c-q and c-s doesn't work

2007-04-25 Thread Tim Chase
I'm running vim in a console using gnome-terminal. I put these mappings in my .vimrc file: map c-q :mksession! ~/.vim/.session cr map c-s :source ~/.vim/.session cr Pressing those buttons (CTRL+Q or CTRL+S) doesn't work. When I map as below instead: map F9 :mksession! ~/.vim/.session

Re: :global + fo[ld] (Vim 7.0 on WinXP)

2007-04-25 Thread Tim Chase
I expected :g/^\d/fold to create a fold of all lines matching ^\d, but nothing happens, except that the search string is higlighted. My 'foldmethod' is 'manual'. What am I missing? :fold expects a |range|. You don't supply one. What the above does is put the cursor on every line starting

Re: adding buffer using find awk and stderr

2007-04-24 Thread Tim Chase
find . -name pom.xml | awk '{print bad $1 /dev/stderr}' | vi - then issuing ls to no avail iff I issue find . -name pom.xml | awk '{print bad $1 /dev/stderr}' 2 session ; vi -S session [cut] I think I'm missing a point somewhere, can you think of anyway to skip the intermediary session

Re: problem with repeat and point (.)

2007-04-23 Thread Tim Chase
The following is the result of doing i1.1CRESC. 1.1 1¬1 that is inserting 1.1 and a newline, and then repeating. For some strange reason the . isn't repeated as it should be. I'm running the text version of vim in a gnome terminal on fedora core 6 using utf-8. I don't get the behavior you

Re: blank line at end of file

2007-04-23 Thread Tim Chase
I use vim7 on Win32 and every time I save a file, vim adds a new blank (CR+LF) line at the end of the file although it is not visible when in vim. Is there an option to disable this behaviour? yes, there is a way to break expectations :) The problem is that if you don't have a terminal newline

Re: Changing directory on start-up

2007-04-23 Thread Tim Chase
cd's to the directory that contains the file I'm editing. Does anyone know what's causing that or how I can turn if off? In more detail, what happens is this. I type something like: vi /some/other/dir/filename at the command line, and then when I'm in gvim, if I type: :pwd I get:

Re: turning arbitrary word change into substitution

2007-04-22 Thread Tim Chase
Is it possible to do the following, or maybe some plugin already exist. If not, how would I script it. Let's say I have some long identifier EXPECTED_GCONFIG scattered around the file. I put cursor after _ and change it to EXPECTED_CONTENTS somehow, maybe char-by-char, not necessarily in one

Re: [OT] Toolbars in Windows

2007-04-22 Thread Tim Chase
I use both Linux and Windows machines at work with one keyboard, mouse and dual-monitor display. Windows is OK for some things, but using it extensively drives me batty. Especially when working with several programs running in various windows, KDE is much easier to use. As a means to

Re: Vim freezes system ?!

2007-04-22 Thread Tim Chase
I did th3 follwing: With a program, which generates random numbers in different formats, I created a file, which consists of _one_ line of 2097152 characters (0-9,A-F). To split the line into lines of 72 characters each, I started vim and let it read the file. I postioned the cursor

Re: current file name to apped to an ex command

2007-04-20 Thread Tim Chase
I would like to map F12 to execute the following code within the shell. This si what I have so far: map F12 :!cleartool co -c . filenameCR You might try nnoremap f12 :!cleartool co -c . %cr The percent is expanded to be the current file name. :help :_% has more details

Re: current file name to apped to an ex command (2)

2007-04-20 Thread Tim Chase
I have this in my _vimrc file: function! CHANGE_CURR_DIR() let _dir = expand(%:p:h) let _filename = expand(%)//I added this line exec cd . _dir unlet _dir endfunction autocmd BufEnter * call CHANGE_CURR_DIR() You may also want to investigate the

Re: vim doesn't sort numerical fields

2007-04-20 Thread Tim Chase
I wanted to sort the first field numerically of a text applying the functions of Dr. Chip but all I can achieve is the following: - 977 ./gnuwin/coreutils-5.3.0-dep 9784 ./RESKIT 98./gnuwin/coreutils-5.3.0-9/usr/share/locale/af 987 ./Unison/Orchestral

Re: Annoying insertion.

2007-04-17 Thread Tim Chase
Recently gvim has had the annoying habit of inserting messages in the text of the document being edited, such as :confirm wqa Sometimes they are longer. I don't see anything glaringly obvious in your supplied vimrc files that would trigger such behavior. However, there's a possiblity

Re: Annoying insertion.

2007-04-17 Thread Tim Chase
-does this happen in one particular type of file but not in others (such as in *.tex or *.xyz but not in others) Most of the files I edit are *.tex files so that is not much of a distinguishing mark. Ah well...perhaps a tex-filetype mapping? -does it only happen in one mode? (only in

Re: Annoying insertion.

2007-04-17 Thread Tim Chase
With that knowledge, I'd go spelunking in the $VIMRUNTIME/ folders for the tex-related plugins/syntax/filetype files to see if there are map commands that should be nnoremap commands. Or perhaps you have some of your own additions under $HOME/.vim/ that might be bunging matters. -tim And what

Re: Search for complex regex

2007-04-17 Thread Tim Chase
i have a html-file with footnotes converted to plain text and like to replace the footnotes in the text with the footnotetext many pages later, eg. the occurrence of [12] with the later definition (many pages later) like [12] bla bla bla. Does anybody has an idea, how to achieve this? Without

Re: Troubles configuring vim (multi-questions)

2007-04-16 Thread Tim Chase
Otherwise, do a '0' and ride the 'j' key a the way down a file. If the cursor doesn't budge, how would you be able to tell if it was a space or multiple spaces there, or a tab character? Well, if that information is truely useful and what you want to know, you can always :set

Re: Troubles configuring vim (multi-questions)

2007-04-16 Thread Tim Chase
Well, if that information is truely useful and what you want to know, you can always :set list Displays ^I just fine, but trashes actual indentation, at least for me (dunno if there's any magical 'vim' setting, like :set keepindent or something). Iow, I wanna be able to see

Re: Moving cursor on wrapped lines

2007-04-14 Thread Tim Chase
Is there any option in vim which reconfigures the behavior of up/down buttons so that they move cursor on wrapped virtual lines like on real lines? While I don't believe there's an option per-se, it's very easy to use :nnoremap up gk :nnoremap down gj :vnoremap up gk

Re: problem with shifting block

2007-04-13 Thread Tim Chase
i am using visual mode and shift to indent a block of code. the problem i am having is that once i do this, the visual mode is gone. So, i have to re-select everything and do it again. Is there a command to repeat the last shift ? or better yet, is there a better way to shift code right and

Re: problem with shifting block

2007-04-13 Thread Tim Chase
Swt. Lotta things I didn't know about, should come in handy, tnx! Especially the } thing. Man, can't tell you how many times I just eyeball code and do things like 10 whups, make that 15 bah, too many... 14 Ah, better. Glad it

Re: problem with shifting block

2007-04-13 Thread Tim Chase
Eg, when deleting whole blocks of the same repetitive code (eg, consolidating multiple tables into just one big-ass table, and just need to delete the end-table from table N, and the begin-table for table N+1), I'll visually select the text to be deleted, note the status line that says

Re: help - how do I turn off auto-indenting?

2007-04-13 Thread Tim Chase
For some reason autoindent go turned on again with Vim 7.0. In earlier versions, I disabled it via set textwidth=0 at the bottom of my .vimrc, however, now, somehow this setting is being overwritten somewhere, and textwidth is being set to something else (i.e 78 last I checked). Well,

Re: Basic question, CTRL+Wh on Gvim, Win XP

2007-04-12 Thread Tim Chase
One other candidate might be the underscore, though it's a shifted key which makes it a little more difficult, it is usually in a pretty predictable place (unlike the backslash/pipe key which I find all over the keyboard depending on whose machine I'm using...makes typing DOS file-paths a pain).

Re: Setting font in console vim

2007-04-12 Thread Tim Chase
I can set the font in gvim using: Set guifont= But how do I do the same with console vim? It relies on the font your console uses. Thus, if you're using a xterm/rxvt/konsole/whatver, you can set your display font for the terminal application and vim uses it. If you're an an SSH session

Re: [Help]How can I add some char before a block?

2007-04-12 Thread Tim Chase
How can I add some char before a block? Just like C++ comment. Use V to select the block you want, then type :s/^/\/\// You can make this a little easier/shorter to type by using :s!^!// The alternative delimiters (you can use a variety of characters, though I tend to choose !, @,

Re: Silly Question

2007-04-11 Thread Tim Chase
Vowels are a problem. Unless you have an escape in your name, a, i and o are boring letters. I know someone named Veerle and her name is actually quite destructive, overwriting an entire line with l. What's the most interesting name anyone can find, and also the most damaging? I think my friend

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Re: gvim invalid expression error

2007-04-11 Thread Tim Chase
Scanning tags. E15: Invalid expression: substitute(v:fname,'s$','','g')substitute(v:fname,'s$','','g') i get this error only in gvim. vim7 and vim6.3 work fine. I suspect your gvimrc loads something that causes the problem. It seems odd that the problem would only occur in gvim, but not be

Sorry for duplicates (mailserver problems. Was: Re: gvim invalid expression error)

2007-04-11 Thread Tim Chase
Sorry for the duplicate emails...my mailserver was giving me fits telling me that it hadn't sent, yet was apparently not so truthful. -tim

Re: what is the language for vim development

2007-04-11 Thread Tim Chase
i would like to do some contribution in vim development, i have used vim more than one year in programming and text edit, but when i want to start to code for vim, i even do not know what language is used for vim development, could you give me some information and steps how to do? Vim is

Re: use variable in substitute

2007-04-10 Thread Tim Chase
Can I use variable in pattern of substitute() in script? let row = getline(j) 'trallala' let rownext = getline(j+1) 'bimbam' let row = substitute(row, ^\\\(.*\\\)$, \\1 rownext, g) 'trallala bimbam' yes is the short answer, though you have to 1) concat it (if there's something to which it

Re: Basic question, CTRL+Wh on Gvim, Win XP

2007-04-10 Thread Tim Chase
In general, the safest keys to use for the {lhs} (left-hand side) of mappings are the F keys. Almost everything else already has a function in Vim. Among Worth knowing. Thanks. What about when using a leader such as , or / ? The comma does a reverse-search of the last thing you searched for

Re: How to recognize a single line via regexs

2007-04-10 Thread Tim Chase
how can I identify a single line no longer than e.g. 60 characters preceded and followed by a blank line via regexs. This way I want to identify section headings. What I did was mark every blank line with %s/^$// and than chomp the CR %s/\n//g and if the text between the 's isn't longer than 60

Re: how to delete all occur of a character

2007-04-09 Thread Tim Chase
i have a file ( actually a group of them ) and i need to delete the quotation marks in each file, i am sure that vim has a tool for this. For a single file, you want to use :%s///g For multiple files, you might want: :set hidden :argdo %s///g (review your changes)

Re: delete buffer questions

2007-04-09 Thread Tim Chase
When I delete rows using dd the deleted text is put in the default buffer, using dd again will put it in 1 and so on. But if I use another kind of deletion like dw, I couldnt fetch it from the buffers 1-9, only from the first unnamed buffer. For future reference, these are registers rather

Re: how to set font italic

2007-04-07 Thread Tim Chase
i want to set some words in the text file in italic format, but not the whole file, i use gvim and when i set font from the edit menu, and choose italic, it will set all words in that file to be italic, but that is not what i want, how to use command to implement? and i think there is also

Re: Vim freezes system ?!

2007-04-06 Thread Tim Chase
I did th3 follwing: With a program, which generates random numbers in different formats, I created a file, which consists of _one_ line of 2097152 characters (0-9,A-F). To split the line into lines of 72 characters each, I started vim and let it read the file. I postioned the cursor at position

Re: Vim freezes system ?!

2007-04-06 Thread Tim Chase
The problem I have with my kind of splitting a line is not that it does not work -- it is the deadly side effect it caused. My opinion is, that it should not be possible to kill a system (...too big words, I know, but...) by simply submitting a sub-optimal command to a text editor. As you

Re: How to open a BIG file quickly?

2007-04-05 Thread Tim Chase
Just out of curiosity, why are you trying to edit a 1 GB file with any text editor? I'm assuming that these files are flat file databases. I need to do that quite often. They are usually log files from a long running program in debug mode. I find that pre-processing with grep/sed/awk

Re: my map only works sometimes

2007-04-04 Thread Tim Chase
:map ,bb cCRCRESCkpIspanESCA/spanESCkJJ Any thoughts on why this only works sometimes? I can't isolate what conditions bring it about. What are the results when it doesn't work? It looks like you're actually rejoining the lines, so it's odd to add the CRs just to remove them. Other items

Re: splitting buffer content to several files

2007-04-04 Thread Tim Chase
I have a buffer consisting of many create view ... ... go blocks. How can I write these blocks somehow efficient to different files? This presumes a little stability in your source (that there's consistent spacing/indenting, that case is consistent, that the view-name immediatedly follows

Re: fold acting strangely

2007-04-04 Thread Tim Chase
I'm experiencing a problem when folding visual blocks - if I have a section folded directly above another section that I want to fold, they end up merging once I fold the second section, sometimes they even add unfolded text to the fold - am I doing something wrong? It sounds like your folds

Re: Need advice on pattern matching using match()

2007-04-04 Thread Tim Chase
if match(getline(1,20),^ \{0,1}\(=\{2,6}\)[^=]\+\1 *$) = 0 The pattern used in the match() call is the same as in the syntax highlighting script. My guess is that it's something like an escaping problem. You're using double-quotes which are a little more finicky about

Re: quick query about moving a selection

2007-04-03 Thread Tim Chase
i know with i can move a selection to the right by one indent, how can i move a selection just one space ? Well, if you want to move by one indent, you can :set sw=1 ts=1 et which will then make and indent by one space (not one tab) or, you can :set sw=1 ts=1 noet and

Re: Vim memory leak

2007-04-03 Thread Tim Chase
:sp on a new buffer causes a raise of 4-8K. :q on a split causes a raise of 4-8K. Switching to/from gvim causes a small increase, typically 4-8K for a few switches. Searching (with *) for a word in a .c file (with syntax highlighting) causes it to increase. If you hold down * then you

Re: Help on search and replace

2007-03-29 Thread Tim Chase
I have used vim for a while, and though no expert I am fairly comfortable with the common commands. Recently I ran into a situation where I just couldn't find a way to do a search and replace. I was hoping some of you experts could help me out. Starting text: nameTable[pattern with

Re: a simple mapping

2007-03-27 Thread Tim Chase
Reading over my original question, I realize that it was awfully obtuse and confusing. The 'nohlsearch' line is the one that is already in my .vimrc and works. I yanked/put it to the next line down to use it as a template, modifing it to: map F3 :set nobackup return that's the one that

Re: Deleting some lines from a log file

2007-03-27 Thread Tim Chase
Can you tell me how I have to do to delete those lines beginning by numbers or MPRINT from my file ? Though I'm not sure I followed your examples, if this is all you want, the following should do what your above-summary describes: :g/^\(\d\|MPRINT\)/d That breaks down as :g/.../ on

Re: Search Replace in VIM Script

2007-03-27 Thread Tim Chase
I have a vim script which I want to use to search replace a part out of a given line. The fields in the line are based on field length and the field I want to change starts at position 33 and ends after 4 charachter. A regex search is not appropriet, as the string I am looking for may

Re: two questions , map and scroll

2007-03-27 Thread Tim Chase
first, is there a way i can scroll text under the cursor ( so that the cursor stays on the same place in the terminal, but the text scrolls anyway ) i just think that would be really cool. If you want the cursor to stay in the middle of the screen, you can set your 'scrolloff' setting to some

Re: SR with dynamic range

2007-03-26 Thread Tim Chase
In VHDL I many times need to change the following code: component AAA port ( i1 : in std_ulogic; i2 : in std_ulogic; o1 : out std_ulogic; o2 : out std_ulogic); end component AAA; into: inst_AAA : AAA port map ( i1 = in , i1 = in , o1

  1   2   3   4   5   >