vim

vim syntax highlighting for jinja2?

How do you do jinja2 aware syntax highlighting for vim? ...

Find out to which highlight-group a particular keyword/symbol belongs in vim

I am coming to Vim from TextMate, and I would like to customise my vim colorscheme. It would be really helpful if I could find out to which highlight-group(s) any particular word or symbol belongs. In TextMate, I would place the caret on the word/symbol in question, then hit ctrl-shift-p and a tool tip would appear saying something like:...

Changing drive letter in NERDtree

I started using NERDtree plugin on a a windows platform. I can't seem to find a way to change the drive letter. Going up all the way on the directory tree doesn't lead to the drive letter. Any ideas? (Yes, I know, it's going to be a simple answer) ...

REGEX: replace a specific character after the appearence of another character in string

i have this string: owl:Class rdf:about="#other important people" i want with help of vim regex to replace the space with _ but only after the word starting with #. I mean i want finally: owl:Class rdf:about="#other_important_people" sorry for my poor grammar ...

HTML syntax highlighting in javascript strings in vim

Hello, I don't know if this is possible/sensible, but I was curious to know if I can have my strings in javascript files have html highlighting. I discovered that strings in php could have SQL syntax highlighting, so I believe it is possible. But, I don't know vim-scripting, so any help on this appreciated. I am using the Better Javas...

What are most useful/used vim commands in C/C++ dev environment

Here is the list of mine Unlike me -- as I did it for illustrative purposes -- don't paste too many. And most importantly, provide an explanation Commands shouldn't be generic but relevant to C++/C environment. ctags & scope are welcome too gi .....................init insert mode in last insertion position '0 ...................

How do I yank all matching lines into one buffer?

How do you yank all matching lines into a buffer? Given a file like: match 1 skip skip match 2 match 3 skip I want to be able issue a command to yank all lines that match a pattern (/^match/ for this example) into a single buffer so that I can put it into another doc, or into a summary or whatever. The command should wind up with th...

In VIM, is it possible to use the selected text in the substitute clause without retyping it?

Let's say I have a word selected in visual mode. I would like to perform a substitution on that word and all other instances of that word in a file by using s//. Is there a way to use the highlighted text in the s/<here>/stuff/ part without having to retype it? ...

Automatically center vim search results

When I do a search with vim or gvim, the resulting positioning of the cursor within the window is somewhat random, all too frequently landing on the last (or first) line in the window. Search highlighting helps, but it's still cumbersome to have to look all around on the screen to find the cursor ... and a bit ironic, that after vim loc...

Printing source-level scope variables at vim debugger prompt

Hi, I am using vim debugger for debugging vim scripts [BreakPts]. :BreakPts //will create a new window and populates it with the list of vim functions available/loaded. We can click Enter on any function name to get the function definition and hit to set a break point on any line. Now, the question is how to print the source file sc...

Get offset of current buffer in vim (in particular, via python scripting)

Hi, i want to get the offset of the current cursor position the current selection range in vim, beginning from the start of the file. I do this in python, so hints how to do it with vim's python scripting would be very helpful. I have used vim.current.. before for doing scripting, but it uses lines and columns rather than a gener...

Paste multi-line string into GVIM at cursor position

When I copy a two-line text from (e.g.) a PDF opened in Acrobat Reader into gvim using CTRL-V, the text is inserted above the line in gvim where I was positioned, instead of at the position where my cursor is. (scenario: I want to copy a document title that is spread over two lines and paste it in between a html tag in gvim). If I do th...

How do I use my .vimrc file in Cygwin?

I just installed Cygwin on my work machine and would like to use the .vimrc file I use on my Linux box at home. Is that possible, or does it need to have Cygwin-specific settings? Where would I put the .vimrc file? I'm a little unsure of what directory I'm being dropped into at the bash prompt under Cygwin, but I think I'd create a s...

(G)Vim and scrolling of spelling suggections

When getting spelling suggestions in gvim (z= on a word) the list of suggestions is created rather slowly, I can actually see it scroll up one line at time. When using vim in a terminal the full list seems to be generated instantly and there is no visible scrolling like in gvim. I've tried setting ttyfast, but it has no visible effect ...

Toggle Cursorline on/off with one key press

At the moment I use: map <C-F2> :set cursorcolumn<Bar>set cursorline<CR> map <C-F3> :set nocursorcolumn<Bar>set nocursorline<CR> How to modify the mapping to toggle on/off only by using C-F2? ...

How to use vim registers?

I only know of one instance using registers is via Ctrl-R * whereby I paste text from a clipboard. What are other uses of registers? How to use them? Everything you know about VI registers (let's focus on vi 7.2) -- share with us. Thanks ...

Copy from one register to another - VIM

How to copy the contents of one register to another without pasting on clip board? I'd yanked one text and it got yanked in the default " register. Now i wan't to copy another text without deleting/overwriting " register. So I wan't to move the contents of " register to say some a or b register so that I can copy the new text inside ". H...

What are the most important IDE features missing in Vim?

I have been programming almost exclusively in Vim since 1/1/2001, and I feel that Vim fulfulls all my needs as an editor/IDE, but I can't help but wonder if perhaps there have been some new killer features developed for other IDEs in the last decade that would allow me to be more productive than I can be using Vim. So I ask: What are the...

Faster multi-file keyword completion in Vim?

While searching for my python completion nirvana in vim, I have come to really love <C-x> <C-i>: "keywords in the current and included files". This almost always gets me a long nasty name from another module completed, which is great. (Omni-completion is obviously better when it works, but too often it reports it can't find any matches....

How do you use markers in vi?

I just discovered the existence of markers in vi. How do you use it, what do you know about them? are they useful, say for a C++ developer? ...