gvim

gvim: Is there any way to get an array of strings?

I have in my .vimrc: let g:PROJECT1="/a/b/c" let g:PROJECT2="/d/e/f" I then do a bunch of operations on the above strings: let str=":!/usr/bin/ctags ".g:FLAGS_CPP." -f ".g:TAG_FILE." ".g:PROJECT1 exec(str) let str=":!/usr/bin/ctags ".g:FLAGS_CPP." -f ".g:TAG_FILE." ".g:PROJECT2 exec(str) I want to replace the above code with a for ...

What is the easiest/most elegant way to iterate over matches in a vim script/function?

Hello I am looking for an elegant solution to (within vim script) iterate over all matches of a regular expression in a buffer. That would be something like fu! DoSpecialThingsWithMatchedLines() for matched_line_no in (GetMatchedPositions("/foo\\>.*\\<bar")) let line = getline(matched_line_no) call DoItPlease(line) en...

Wrap long lines in Vim?

I've noticed that gq does not work when I paste in a long line. For example, with a textwidth=72 and formatoptions=tcroqbnl, gq refuses to wrap this (in insert mode, I pasted the entire label contents, and then exited insert mode with ESC): <label for="contact_reason_1">To get assistance with or to confirm a tire replace...

Vim: how to redefine tab as 4 spaces

Hi folks: My current setting assumes 8 spaces; how could i redefine it? Thanks. ...

Vim: how to temporarily exit vim and go back

Hi, How could I exit Vim, not :q, and then go back to continue edition. Thanks. ...

Can I force gVim to open dragged-in files in a new tab?

I'd like gVim to open files dragged into it to open in a new tab, instead of replacing the current file. This question is on the right track, but I'd like to be able to run multiple instances of gVim, just able to drag files to the window I want. I'm running on Windows 7. ...

Copy from search mode to ex mode

While in the "/" mode to search, what should I do if need to copy it to the ex mode. E.g. I searched for /ab.*xy, now I need it as %s/ab.*xy/.../g. My intention is to test my search and then use that for a search replace ...

vim search-replace question

Hi, I have a few trace lines in my file of the form M_TRACE(EV_TRACE_LEVEL_DEBUG, "some trace"); I want to convert those into M_TRACE(EV_TRACE_LEVEL_DEBUG, "%s: some trace", __FUNCTION__); However I have already a few traces which display the function name also. To make the conversion i am using the following command :%g/M_TRACE/...

Vim problem with gf command

I am using Vim and I have set the path (set path+= c:/work/etc/etc) to my project directory (for C#), but still using command 'gf' give me error: E:447 Can't find file. Is there anything I am doing wrong over here? ...

Interpreting the decimal point in arhithmetic calculations in Vim.

It seems to me that all of a sudden Vim doesn't recognize the decimal point anymore. For example, if I do a : echo 22.0/3.0 then I receive a 2200 This is probably because Vim sees the dot as a string concatenator and so calculates 22 . (0/3) . 0 which is 22 . 0 . 0 which then is 2200. I can confirm this suspicion by doing...

How do I redirect output into Gvim as a list of files to be opened?

I would like findstr /m background *.vim | gvim to open all *.vim files containing background in a single instance of gvim - but I can't get the piping to work. This is very similar to this question but instead of capturing the stdin output I would like GViM to treat the output as a list of files to be opened - and on a dos system so x...

vimdiff as a merge tool

vimdiff helps in showing the diff of two files graphically and allows us to pick the changes from left to right/right to left. The files I am dealing with are huge files and most of the differences vimdiff reports can be auto-merged except a few.As it takes lot of time to go diff by diff in vimdiff and take the action. I would like to k...

Reading the result of an exe file in :vs in vim

Many of my programs are console like applications, which take a data file, and print out the results, either on screen (more often) or in another file. Since these days I'm doing some analysis which requires a lot of little tempting with one input data file, just to get a few numbers, I usually go: edit data file, start program, get res...

Vim: How to manually load an ftplugin after startup?

Say I load a .txt file into Vim. Then I want to change the filetype=html but I also want an associated ftplugin loaded. How can I do this? I've tried stuff like: :set filetype plugin on and :set filtype plugin_name on and also :filetype plugin_name on etc etc., but I can't seem to manually load the ftplugin. Any suggestions? I've tried...

how to comment in Vim's config files "_vimrc"?

how to comment in Vim's configuration files _vimrc? ...

How do I change the font color and weight of gVim's command line (in the bottom)?

When you type a "Not an editor command", below of that it says: "Press ENTER or type command to continue, and it is bold and green. " It is possible to change the color and weight of that line? ...

Weird characters in GVim's visual mode

When I enter visual mode (from normal mode), and when then I press : there are these characters: <,'> after the : They are a feature or a bug? Windows XP SP2 ...

Search and delete multiple lines

In vim :g/George Bush/d deletes all lines with George Bush. What if I wanted to delete 5 lines below that start with George Bush? Another realistic example would be to find all DEBUG in a log4net log and delete up to the end of stack trace (which I know will be another 10 lines below it) ...

how to make gvim on windows behave exacly like linux console vim?

Hi, I have used Vim extensively on linux console, I am used to it's keyboard shortcuts, like Ctrl+V for vertical selection, and many others. I have installed gVim for Windows on my computer at work, and I almost can't use it, as many of keyboard commands were redefined. The Ctrl+V pastes the text from clipboard instead of starting vert...

GVim runs very slowly when editing files on a windows share

On my computer at work, any time I open a file located on a network share, GVim becomes completely unusable. Scrolling through the document can take 15 seconds to go one "page". Even using the movement keys to go from one word to another can take 2 to 3 seconds. This seems to be a new behavior, but for the life of me I can't remember cha...