gvim

How to map Ctrl+A and Ctrl+Shift+A differently?

In a terminal, one cannot distinguish Ctrl+A and Ctrl+Shift+A as they both emit the same key code, so I can see why vim can't do it. But gvim, being an X application, can differentiate Ctrl+A and Ctrl+Shift+A. So is there any way to map those two things differently? For starter, I'd like to do something like the following, to make "past...

Vim Ctrl-Left/Ctrl-Right keys behaviour

Is it possible to specify the symbols where cursor will stop after pressing Ctrl-Left/Ctrl-Right keys in VIM? Is it possible to make it's behaviour like in windows? Cursor jumps too far when using these combinations. Also, 'b'/'e' keys help a bit but they make cursor to jump to shorter distance. Thanks. ...

Define colored keywords working with all syntax-files

What I want is to define a list of approx. 20 keywords which will be same coloured independet from the active syntax-file. I copied and and pasted the following to my .vimrc to highlight the word DONE, but it won't work. syn match tododone /DONE/ syn region done start=/\*\*DONE/ end=/\*\*/ hi link tododone tDone hi link done tD...

How to get visually selected text in VimScript

I'm able to get the cursor position with getpos(), but I want to retrieve the selected text within a line, that is '<,'>. How's this done? UPDATE I think I edited out the part where I explained that I want to get this text from a Vim script... ...

Using css_color plugin for vim causes omni completion not to work

I am using the css_color.vim script with gvim 7.2 on vista. Because of this script I am not able to use omni-completion for css that came with the gvim I installed, which works perfectly fine if I rename the css.vim file to css.vim.bak or something. I usually open omni-completion drop down using <C-x><C-o>, but with the css.vim, when I ...

Is it possible to have a Vim syntax file command span multiple lines?

I'm trying to create a syntax file and I want to create some keyword groups for different colour highlighting (e.g. reserved words, operators etc. would be different colours). I can get this to work by doing one of the following two options: Option 1 syn keyword MyLangOperators operator1 operator2 operator3 syn keyword MyLangOperators ...

Mapping of <ctrl-#> characters

I've been trying to map certain sequences to parenthesis/bracket completion without any success. I've been trying the following commands to map certain control sequences but they don't seem to work. Does anyone know what I'm doing wrong here? :imap <ctrl-9> ( )hha :imap <ctrl-(> ( )hha ...

Organising vim plugins into separate directories

Is it possible to place each of my vim plugins in a separate directory within my ~/.vim directory? Unpacking everything into the same place seems kind of messy. ...

Vim omnicompletion for Java

I've read heaps of blogs on Vim's supposedly great omnicompletion, and yet no matter what I do I can't get it to work satisfactorily. It took me ages to figure discover that the version of ctags that is preinstalled on my system was the emacs one, and didn't have the --recurse option, but now that I've run ctags-exuberant on my copy of t...

VIM: Deleting from current position until a space

Often when developing I am confronted with a nested object that I'd like to delete from code in the middle of a line like this: htmlDoc.WriteLine("<b><h3>" + this.cbAllSyncs.SelectedItem.ToString() + "</h3></b>"); The part that I'd like to delete is: this.cbAllSyncs.SelectedItem.ToString() I know I can count the number of words and...

Multiple selections in VIM

Is it possible to select multiple non-consecutive lines (or sections) in VIM's visual mode? If so, how? ...

Highlight text ranges in Vim

Is it possible to mark a range of text in Vim and change the highlight color of it (to red) than select another range of text and change that color (to green) keeping the previous highlight and so on? ...

What's the relative order with which Windows seach for executable files in PATH?

If I have a.com, a.cmd, a.bat, and a.exe files %PATH%, which one would Windows pick if I invoke just the command "a"? Is this officially spec-ed somewhere by M$? I just wanted to wrap my gvim.exe executable with -n, but my gvim.bat doesn't appear to get run neither from the command line, nor from the Run dialog. ...

what's the syntax for telling VI to read/write a source file with soft-tabs and a specified indentation?

Someplace I saw a snippet of code which told vi to use soft tabs and set the size of a tab. If you put this snippet at the bottom of a source file, then vi would magically use those settings for that file. What is the syntax and rules for including that snippet in a source file? Can emacs be made to use these settings as well? ...

Make Vim show ALL white spaces as a character

I can't find a way to make Vim show all white spaces as a character. All I found was about tabs, trailing spaces etc. ...

Mouse input in gvim

Can standard mouse input be customized in vim (in my case gvim)? Plugins are acceptable options too. I'm specifically interested in "overriding" a double-click on a word, so that instead of just highlighting the word, gvim does a search and thus highlights all instances of this word in the file. I've seen this functionality in other edi...

Profiling vim startup time

I've got alot of plugins enabled when using vim which I've collected over the years. I'm a bit fed up with how long vim takes to start now so I'd like to profile it's startup and see which of the many plugins I have are responsible. Is there anyway to profile vim startup or script running? Ideally I'd like to know how long vim spent i...

valid string in vim?

Hi, Handy shortcut "*" - which reads the "string" under the cursor and goes to the next place it appears. can some one clarify what comprises a valid "string" in vim. I am facing a problem that when i use "*" with cursor on word "function" on the following line function(val) {} it selects the text "function(val)" and searches for t...

GVim taking forever to load when connected to office network

When I load GVim from the Cygwin command line or when I'm not connected to the office network (mapped to U:/) it loads instantaneously. It takes a good minute or so to open when I'm on the network. What is going on here? ...

Vim: Traversing text in Insert mode

While in Insert Mode in Vim, is there any way to traverse the text (like moving some characters forward and backward) other than using the arrow keys ? This is because obviously if you press h, j, k and l while in Insert mode, the actual characters are printed on screen instead of moving through the text. The way I'm doing it atm is ha...