gvim

gvim and gdb for C?

In emacs there is a handy way to launch the gdb and gui options for gdb, the C debugger. Is there a similar option in gvim? ...

How do I get the terminal within GVim to react to mouse scrolls?

I'm on a Hardy Heron Ubuntu build, BTW. ...

how do I add a font in gVim on windows system

I wanted to add a UTF-8 font in Gvim but I could not find out how to do this. I tried to follow the step on this manual but it still did not work. http://www.inter-locale.com/whitepaper/learn/learn_to_type.html (vim section halfway the page) Can anyone tell me how to add a font in Vim so I can have Japanese characters displayed ? ...

Vim Configure Line Number Coloring

I'm looking for a way to configure the color used for line numbering (as in: :set nu) in Vim. The default on most platforms seems to be yellow (which is also used for some highlighted tokens). I would like to color the line numbers a dim gray; somewhere in the vicinity of #555. I'm not picky though, any subdued color would be acceptab...

How do I insert text at beginning of a multi-line selection in VI/VIM?

In vim, how would I go about inserting characters at the beginning of each line in a selection? For instance, let's say I want to comment out a block of code by prepending '//' at the beginning of each line (assuming my language's comment system doesn't allow block commenting like /* */). How would I do this? ...

What feature is missing or hidden in Vim?

I thought I'd have a try at using Win32 GVim, and I'm finding that it's much more versatile than I realised. At this point I'm finding that for myself a lot of its features are still hidden. As an example I'm used to having a button on the toolbar to run external commands and capturing the output but I found in Vim it's :%!<command> to g...

Cygwin + git permission problems when trying to create a commit message

When I try to commit the first revision to my git repository (git commit) from Cygwin, I'm getting an error in gvim which says "Unable to open swap file for "foo\.git\COMMIT_EDITMSG" [New Directory]. I think it might be some sort of permission problem, but I've tried removing the read-only flag from the folder, as well as recursively adj...

VIM: Close file without quiting VIM application?

I am new to VIM. I use e and w commands to edit and to write a file. It is very convenient. I am not sure if there is "close" command to close the current file without leaving VIM? I know that q command can be used to close a file. But if it is the last file, the VIM is closed as well(actually on Mac the MacVIM does quit. Only the VIM w...

How do I set up vim to automatically change my background color depending on whether CAPS LOCK is on or not?

I'm an avid vim user and have started to write some SQL code recently. I like to write my SQL statements in CAPS and sometimes forget to switch CAPS LOCK off and I then quickly wreak havoc on my code before I realise what's happening. I have so far not found any way to tell whether the CAPS LOCK key is on other than looking at my keyboa...

Why does < C-a> (CTRL+A) not work under gvim on windows?

I'm trying to use the < C-a> (CTRL+A) shorcut under vim to increment a variable under the cursor. This works fine under vim running on Linux. However when I try to do this in gvim under windows it "selects all" (i.e. highlights or visually selects all text in the current window). How can I change this behaviour or alternatively how can I...

Vim: how to paste over without overwriting register

Does anyone know of a way that I can paste over a visually selected area without having the selection placed in the default register? I know I can solve the problem by always pasting from an expicit register. But it's a pain in the neck to type "xp instead of just p Thanks ...

Using gvim to print diffs?

Is there a way to print out the diffs like they show when you open them with "gvim -d", with all the common code folded away and only the diffs showing in context? I tried the print menu option, but it printed the entire file that I was currently "in", rather than printing the folded diffs. ...

Using vim Sessions Only With GUI?

My usage-scenario may seem a bit unusual, but here it is: When using vim (it's one of about 4 different editors I use regularly), I use it in two different situations. The first is via the GUI, in which I'll have multiple buffers and have some settings different than when I use it from the command-line (by testing "if has('gui_running')"...

Vim: \n vs. \r

I haven't used vim in a Unix system in a while, but as I recall there was no \r, it was always \n. I'm using gVim under windows and when I search for new line characters I use \n. Searching for \r returns nothing. But when I replace the characters I have to use \r's. \n's give me ^@ Can anyone explain what's going on here? ...

How to get rid of GVim folding comments in your code?

There is someone in my team that swears by using some kind of GVim feature to do manually code folding. As I'm using another editor and do not really need the folding feature, I think it only pollutes the source code with tags like: /* {{{1 */ Convincing the person not to use this folding is not an option (got into some heated discus...

In VIM, how do I apply a macro to a set of lines?

I have a file with a bunch of lines. I have recorded a macro that performs an operation on a single line. I want to repeat that macro on all of the remaining lines in the file. Is there a quick way to do this? I tried Ctrl+Q, highlighted a set of lines, and pressed @@, but that didn't seem to do the trick. ...

In Vim, what is the simplest way to join all lines in a file into a single line?

I want to join all lines in a file into a single line. What is the simplest way of doing this? I've had poor luck trying to use substitution (\r\n or \n doesn't seem to get picked up correctly in the case of s/\r\n// on Windows). Using 'J' in a range expression doesn't seem to work either (probably because the range is no longer in 's...

Can you grab or delete between parentheses in vi/vim?

Given this line of code in C: printf("%3.0f\t%6.1f\n", fahr, ((5.0/9.0) * (fahr-32))); Is there a way to delete or yank from the first bold parenthesis to its matching parenthesis? I thought about df), but that only will get you to just after the 9.0. Is there a similar way to get vim to grab everything between matching braces, re...

How can I indent code in the Vim editor on Windows?

Duplicate: How to indent a selection in gvim (win32)? How do I indent multiple lines quickly in vi? Using vim under linux I can indent a block of code using the VISUAL mode and pressing ">". In vim under Windows this does not happen. This is what happens: Press V, the VIM enter in the VISUAL mode Press 'Down', the VIM exit ...

VIM Ctrl-V Conflict with Windows Paste

I am using VIM in Windows. The problem is that I want to use Ctrl-V as a visual mode. However, this key has conflict with Windows paste. How can I reset this key back to VIM visual mode instead of pasting. I prefer to set this in my _vimrc configuration file. Thanks for any help! ...