gvim

Replace Tab with Spaces in VIM

I would like to convert tab to spaces in gvim. I added the following codes to my _vimrc: set tabstop=2 It works to stop at 2 spaces but it still looks like one tab key is inserted (I tried to use h key to count spaces afterwards). Not sure what should I do to make gvim to convert tab to spaces? ...

Double quotes in vim/ubuntu?

I apologize profusely for the incredibly newbish question I'm about to ask, but for some reason, my brain's locked up: I'm trying to code in C on gvim on a virtual machine running Ubuntu, but my Hello World throws compiler errors which I suspect has to do with the quotes being different ascii(unicode?) codes than standard quotes. It do...

Correct indentation of HTML and PHP using Vim

I've been using Vim for a while, and I can't get proper HTML indentation working in PHP files. For example, what I want is for each child to be indented one tab more than it's parent, as shown below. <?php if(isset($sports)) { //Do something ?> <div> <label>Uniform Size</label> <ul> <li class="left"><label for="s" class="small">S<...

How to use multiple tabs when tagging to a function in Vim

I use ctags with my Vim and I rely heavily on C-] and C-T to tag back and froth between various functions in my project. But if the function is in a different file, I'd like Vim to automatically open it in a new tab instead of the current tab. If I pop my tag stack using the C-T, I'd like it go back to the original tab where I pressed b...

How can I have a green font in *NIX's gvim?

I have noted that I cannot affect MacVim's colorscheme by commands in vimrc. I have now a gray font on black background, which makes reading hard. ...

Vim encryption: how to break it?

Recently I decided to encrypt my engineering log using vim's :X encryption feature. I wrote down the password, but evidently I misspelled something or messed something up because decrypting the file just gives gibberish. To make matters worse, all my backups are somehow corrupted (don't ask, I am not sure how either). I am not going...

Is it possible to get gVim to remember window size?

I know how to set the initial window size in gVim, but how do I get it to automatically restore the window dimensions from last session? Is this even possible? ...

Opening vim help in a vertical split window

Is there a way to get vim help to open in a vertical split pane rather than a horizontal one? EDIT: to add to 42's answer, you can also control whether the window splits on the left/top (to[pleft]) or right/bottom (bo[tright]) e.g. :vert bo help ...

How can I spellcheck in gvim?

What is the best way to spellcheck in gvim? Is there an add-on or something? Update: I would like it to offer corrections as well. ...

How to configure IPython to use gvim on Windows?

This really looks like something I should be able to find on Google, but for some reason I can't make heads or tails of it. There's the EDITOR environment variable, the ipy_user_conf.py file, the ipythonrc file, some weird thing about running gvim in server mode and a bunch of other stuff I can't wrap my head around (probably because of ...

VIM: substitute with contents of register / lines range

I'm using VIM, and I want to substitute some placeholder text with a long string, that spans several lines, which is already written somewhere else in the file. Is it possible to replace a pattern with the contents of a register? Something like :%s/foo/<contents of register A> Otherwise, is it possible to replace with a range of line...

Running :make from gVim in Background

I use gVim in windows to edit my code (mostly C++). I use :make in gVim to compile the project, but this is a blocking operation, that prevents me from using gVim until the compilation is complete. How can I do :make asynchronously and still get the benefits of reading the errors back into Vim and jump to the errors in source code? Bonus...

C++ development on linux Code::Blocks, EMACS or GVIM

I am not looking for an IDE suggestion for C++ development. I have found many discussions on that and tried EMACS, GVIM and Code::Blocks. I liked Code::Blocks very much than the other two. But it looks like most of the developer community is using tools like EMACS or GVIM. Is there a reason for this? Why Code::Blocks is less used? I fou...

Go to the end of the C++ function in Vim

If I am in the middle of the function, I would like go to the very end of it in vim. I run into this problem as we sometimes have function of 500+ lines long (don't ask why). I use vim, gvim. ...

Global "Go to definition" in vim for Ruby?

I've been using vi/vim since '97 for various quick edits and administration tasks, but have only recently considered using it to replace Netbeans as my ruby editor of choice. One thing I find extremely useful in both Netbeans and Eclipse is the Ctrl+Click "Go to definition" feature, where you can ctrl+click on a class or method and it wi...

VIM: how to color my vim grep result patterns?

When using VIM is there a way that :grep or :vimgrep will color the patterns returned to the buffer? Thanks! ...

Is there any way to highlight multiple searches in (g)vim?

I want to search for multiple strings in vim/gvim and have them highlighted in different colours. Is there a way of doing this with out-the-box vim or with a plug-in? ...

Closing files in Vim from directory and its subdirectories

Is there a way in vim to close all files (buffers, let's not get into that) from some directory and its subdirectories? ...

How can I use gvim to add a carriage return (aka ENTER) to a pattern?

What's the vi/gvim syntax to replace a pattern with a pattern that includes <ENTER>? I know this is possible but never felt like diving too deep in the documentation to know how to do it. Something like this: :s/\(word\)/\1<ENTER>/ But correctly :) Thanks ...

Word wrap in Gvim

How do I make Gvim word wrap in such a way that doesn't break words in the middle? ...