vim

vim's taglist plugin not recognizing filetype for .sqC files

Hi, I have been using ctags for a while. I recently downloaded taglist plugin for vim. its cool. But i am facing one problem. While building the ctags file, i used langmap option to intrepret my embededed SQL files ( .sqC file extension) to C++. But when i try to use the taglist it is not recognizing the filetype for these files and Tlis...

VIM and NERD Tree - closing a buffer properly

Does anyone know how to close a buffer in VIM when using NERDTree without messing up all your windows? NERD Tree normally breaks up your display into two vertical windows (the browser on your left, and then your main window on the right). If you close a buffer, then you are reduced to one giant file browsing window. If you select anot...

Mapping mouse events in vim through putty not working...

I'm using Vim 6.3.81 on a x-term through putty. I wanted to map mouse events (like wheel-button click , double click) to specific events using my .vimrc . I've looked at the vim wiki and based on it, defined the following map in my .vimrc: :nnoremap <2-LeftMouse> :set invnumber<CR> However , it is not working - double-click is not tog...

Scroll up/down while selecting multi-page block of text in Vim through putty

I'm using vim 6.3.81 on a xterm through putty. When I use set mouse=a , I can scroll through the file , but not select text. When mouse is disabled using set mouse=, I can select text with mouse (automatically copied to a buffer) , but if the text block is over one page long , I can't scroll up/down (and have to select text one screen at...

XPTemplate new snippet for a new language - how ?

Okey, simple problem, but I'm stupid and am not seeing it. Can somebody give me an example what needs to be done to create a new snippet (preferably if someone could give a simple example) for a new language in XPTemplate (Vim plugin). Its syntax files are a total mess from my point of view. ...

Textmate and vim modes

Hello. It is possible to emulate vim modes, macros and bindings in textmate? ...

gvim: Is there any way to get an array of strings?

I have in my .vimrc: let g:PROJECT1="/a/b/c" let g:PROJECT2="/d/e/f" I then do a bunch of operations on the above strings: let str=":!/usr/bin/ctags ".g:FLAGS_CPP." -f ".g:TAG_FILE." ".g:PROJECT1 exec(str) let str=":!/usr/bin/ctags ".g:FLAGS_CPP." -f ".g:TAG_FILE." ".g:PROJECT2 exec(str) I want to replace the above code with a for ...

Associationg vim syntax with file extension

Hi, how do I tell vim to use a certain syntax definition with a new file extension ? Let's say I have files that are some kind of xml, but have a different extension, how do I let vim know that it should use syntax=xml by default for that new type ? Any help appreciated. ...

What is the easiest/most elegant way to iterate over matches in a vim script/function?

Hello I am looking for an elegant solution to (within vim script) iterate over all matches of a regular expression in a buffer. That would be something like fu! DoSpecialThingsWithMatchedLines() for matched_line_no in (GetMatchedPositions("/foo\\>.*\\<bar")) let line = getline(matched_line_no) call DoItPlease(line) en...

Copy text from Vim 7.2 running in xterm to windows clipboard

I'm using Vim 7.2 , compiled with +xterm_clipboard , in a xterm through putty . I've put set clipboard=unnamed in .vimrc , and from what i've read in other threads , this should put all yanks/deletes to the system clipboard. However , when I'm trying to paste whatever i've yanked to a MS app like notepad, its not working. When I select ...

How to sort using statement of C# code in vim?

Recently I edit C# code in vim. And the build system has StyleCop enabled so that all using statement should be in alphabetical order. So, I tried to select below lines of code in visual mode, then type ":sort". using System.Security.Permissions; using System.Runtime.Serialization; using System.Security; using System.ServiceModel; Th...

XML Schema reading/editing in vim?

Hi all, As XML Schemas can be tedious to read (yes, just want to read through the schema) in their normal form, I'm wondering if anyone knows of an existing plugin for vim which will display the schema in tree form, as several XML editors do? Selection of a node in this tree to navigate to the relevant section of the schema would be a g...

Wrap long lines in Vim?

I've noticed that gq does not work when I paste in a long line. For example, with a textwidth=72 and formatoptions=tcroqbnl, gq refuses to wrap this (in insert mode, I pasted the entire label contents, and then exited insert mode with ESC): <label for="contact_reason_1">To get assistance with or to confirm a tire replace...

how to replace a current line with what in a buffer using vi

Say i have line stored in buffer k. how do I replace some line with the content of the buffer? ...

How to debug broken vim completefunc in haml files?

I'm using rails.vim and I love how you can use ctrl-x ctrl-u in insert mode to autocomplete long method names like distance_of_time_in_words and accepts_nested_attributes_for. But for some reason it doesn't work in haml files and I can't seem to figure out what's wrong or how to fix it. :help i_CTRL-X_CTRL-U says the autocompletion is u...

VIM: How to move between matching tags?

I'm a big fan of ctags, but sometimes it is hard to use it. In case when I have a few declaration of the functions with the same name - "ctrl + ]" throws you to the first occurrence - which is not always what I need. How can I see the full list of matching tags so I can choose which one to open? ...

Vim: how to redefine tab as 4 spaces

Hi folks: My current setting assumes 8 spaces; how could i redefine it? Thanks. ...

Vim: how to temporarily exit vim and go back

Hi, How could I exit Vim, not :q, and then go back to continue edition. Thanks. ...

how to move a word to the beginning of the sentence in vim

say I have this line = function (x, y, word); and I want to convert it to word = function (x,y); Thus far, I have been manually selecting the word, then 'x', and then paste it at the beginning. And then I would remove unnecessary comma. Is there a more efficient way to accomplish the same thing? ...

What is your favorite way to comment several lines in vim?

It happens more often than not that I have to comment several lines at once in vim. Methods that I know are not as fast as say TextMate way to comment lines out. What is your favorite way to do it? I currently use Method 1: - go to first char of a line and use blockwise visual mode (CTRL-V) - go down/up until first char of all li...