vim

How do I operate on highlighted text in VI/VIM?

I want to know how to do some operations on highlighted lines (with v operator) like providing tab to selected line, comment those line, etc. using vi/vim. ...

Vim comma key not working

This is driving me batty. Using Vim 7.2.182 on Gentoo. In insert mode, my comma key does nothing. There's nothing in .vimrc that includes the comma key. :map shows no mapping that includes a comma. It's not a keyboard or similar issue: the comma key works fine in all other applications and in Vim in command mode, etc. But when I go...

How can I open another vertical window (:vsp) on the left in vim?

vim's :vsp command opens a window on right. Is there a way to open it on the left side of the screen? ...

how to load another file's content to current file in vim

As title, any convenient way? I especially need it for some cvs/git commit or sendmail to load a template comment. I think it is a vi environment, not vim. ...

VI/VIM file handling

Nowa days I'm working with the Vi editor with the positive approach that you can do most things using it - unlike other editors. I came across one problem: Let's assume I have open a folder with vi <folder name> so it opens the folder in Vi and lists the files in that folder. I select a file and read the content, then I want to go ba...

Why won't Vim compile my C code?

Possible Duplicate: How can I configure Vim to compile C code using Borlands compiler on Windows? I have been trying to compile a simply c code using Gvim 7.2. I have the Borland bcc32 compiler installed, but I keep getting the message "make is not recognized as an internal or external command". What am I doing wrong? What shou...

How can I search in vim for a line that has 2 specific words?

I want to find a line that has both 'foo' and 'bar' in this order but not necessarily next to each other. I tried the following and it didn't work: /foo.*bar ...

Manipulating huge CSV files with sed

I have a set of 4 massive CSV files that I need to modify. What I need to do is match this expression /^(.*),,/ copy the atom then prepend it to every subsequent line until the atom is matched again. Then I need to rinse and repeat until the end of the file (each file has approx 25k lines in it). Finally I need to go back through and r...

How can I prepend text to multiple lines in vim?

Say I have 10 lines and I want to prepend text to some word that occurs in those lines? It does not have to be at the beginning of the line. sdfsd foo sdfsd sfsd foo fsdf sdfsdf foo sdfsdf to sdfsd bar(foo sdfsd sfsd bar(foo fsdf sdfsdf bar(foo sdfsdf Is it also possible to not only prepend the "bar(" but actually su...

How to set the character encoding for a file in VIM

I'm using :set fileencoding=utf-8 and the file is saved correctly, but the next time I open it, I get garbled characters and :set fileencoding? says the option isn't set. From the docs I understand that I shouldn't touch the encoding option. What's the correct way of specifying an encoding for a file in VIM? ...

How can I solve this cscope problem?

I always use vim+cscope to check sysmbol definition, and I find cscope always take declaration like: struct sk_buff; as a defintiion, which make vim always show a long list files to choose, always drive me crazy. Indeed, I only want the definition: struct sk_buff { ... }; Seems ctags can resolve this problem, but can cscope handl...

VIM: Zero-Indexed Line Numbers in :set number

Using VIM, it is easy to display line numbers for any given file with: :set number However, the line numbering is 1-indexed, this means that the numbering starts at 1. Normally this is exactly what i want, however a particular tool I am using to compile my code reports zero-indexed line numbers - that is, line numbers start at zero. ...

How to: assign vim cursor to a certain line in the window and have the text scroll underneath that cursor position?

You can keep the cursor line in the middle of the screen and then have the text scroll underneath it by setting the scrolloff to a very large number. Ex: :let &scrolloff = 999 To read more about how this works: :help scrolloff I love this feature and use it all the time but I would like the ability to keep the cursor at other locat...

Vim: Change start up directory?

When I start GVim and start writing my little program I'd like to save the file to the Desktop but it seems that Vim is starting the command line in: C:\Windows\System32 How would I go about changing that to: C:\Users\Casey so then I could just: :w Desktop\my_program.py Thank you :) ...

Is there anyway to have vim not count special characters as words?

I'm using VIM do alot of work for me using the macros. There's alot of text in columns and I want the macro to move between columns effortlessly by pressing the w key to "move to the beginning of the next word" For example: DataSourceName string "" DetailFields []string ...

How Does One Refresh the File List Using FuzzyFinder in Vim?

Using the FuzzyFinder plugin in Vim, how does one regenerate the file list displayed? ...

Vim plugins/features you'll die without?

Possible Duplicate: Favorite (G)Vim plugins/scripts? I mostly do front end development and I'm wondering what sort of plugins others have grown accustomed do, that has helped them in their career. I'd greatly appreciate ones related to editing say xml/html markup, plugin to jump back and forth between start/end tags, maybe autom...

To change TYPE to nothing from conf in Vim

My syntax -highlighting is broken for a file which Type is conf as follows: File where the syntax highlighting does not work The syntax highlighting works for all other files with the extension .markdown. However, the only difference between these files is that the other files' type is nothing, while that of a file, which has bug, it...

How can I split horizontally across several vertically split windows in Vim?

Basically, I want to go from 1) to 2) I usually do this by splitting horizontally first and then vertically, but as I want this to do three-way diffs, it is much handier to start vim by running: $ vimdiff file1 file2 file3 And then doing something to open the split window below. 1) +----+----+----+ ¦ ¦ ¦ ¦ ¦ f1 ¦...

Vim: running java from vim command gives error.

I wrote a simple hello world program to test the JDK installation. I can compile from Vim using: :!javac Desktop\HelloWorld.java That works just fine but when I try to run the program using: :!java Desktop\HelloWorld it gives me this error: C:\Windows\system32\cmd.exe /c java "Desktop\HelloWorld" Exception in thread "main" java....