how and '#' in vim but not used with Comments

This question already has an answer here: Start a git commit message with a hashmark (#) 8 answers i want add a git commit by use vim, like the picture. second line, I want add a commit text "#2355 fix a bug of this issues", but the vim think th

Hiding tab characters in Vim

I've just begun learning Go, and upon running go fmt, I am finding tab ^I characters appear in my code: package main import "fmt" func main() { ^Ifmt.Println("Hello world!") } Is there a way I can configure Vim to not display these cha

Divide the global arguments of a function?

Is there any command in vim that can split the arguments of this function and put them in a list: qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); to get ["void *base", "size_t nmemb", "size

How to map keys to another key

I have just started learning VIM using gvim. When I am in the insert mode, and after I have copied stuff ,I usually use CTRL+R + Shift * key combination to paste the stuff in. I would like to map those keys to CTRL+V . Can you please let me know what

How to write the function `tabline` in vim?

I would like tabs in Vim (not the gVim) look as follows: Explanation: Sequence number of tab (1, 2, 3, 4 etc) Name of file (no path, no shortened path) If there are more than one file opened, list them in a tab. If there are duplicate tabs (hence the

vim how to / uncomment with a mapping

This question already has an answer here: What's a quick way to comment/uncomment lines in Vim? 43 answers I'm new(bie) in vim. I've got the following mapping to comment my python code : nmap cc 0i#<ESC> I would like to have the same mapping to unco

Install GVIM on Windows with Python3 support?

How do I install GVIM for Windows with Python3 support? I have installed VIM 7.4 which says in it's version file (run :version command) "+python3/dyn" and "-DDYNAMIC_PYTHON3_DLL=\"python32.dll\". So it looks like it's ready to sup

Can vim diff use the patience algorithm?

Is there any way to set vimdiff's diff strategy to be the patience algorithm? It's built into git and seems to be much better than a normal diff. For reference: How to set patience as default git diff algorithm Where can I find the patience diff impl

AutoHotkey Diacrictic mappings do not work properly with Vim

I've been using some mappings in Vim to avoid having to switch keyboard layouts to type in diacritics in my language (Croatian). However, now I wanted to move these mappings "up" so that they're available globally. I tried using AutoHotkey for t

Ruby Segmentation fault under vim

I'm developing ruby application in vim. When I run rspec from vim (using :!rspec), I got this strange error. Can anyone point me to the right direction and find out what the problem is? And why its fine if I use spec outside of vim? rspec spec/telepr

ImportError: No module named VIM site and Enthought Canopy

I was using vim and python perfectly fine till I upgrade to Maverick. Now I have a similar issue as here. When I remove remove canopy path from bash_profile and use default python path , vim works fine, otherwise I am getting the above error. You can

Vim find and replace. How can I do this?

I have an XML file that I want to make some changes to. For example I want to open the file in Vim and run a find and replace all instances of memory="..." attribute to memory="24G" but only if the element is from name="node-0...&

How do I repeat any command on the regular interval in vim?

Actually I want to autosave my current file, :w command writes the file so I thought that when I will repeat this command at regular interval (say each 30secs.) I will achieve what I want. But how can I do so?Take a look into :help autosave

Vim Split window when opening multiple files

I would like to put something into my vimrc so that if I open 2 files they automatically open in separate split windows. I don't want to start it with -o because I sometimes open a lot of files at once and having 15+ splits would not work very good.

In Vim, how to remove the suffix of a word?

In vim, in normal mode, if the cursor is in a word, not the last letter, de deletes the suffix of the word, from the position of the cursor. If the cursor is on the last letter, x does it too, while de would jump to the end of the next word. What com

Open before the open buffer in the vertical window in vim

I have two opened buffers (i.e. A and B) and one window. Currently I see A, I would like to open B in vertical window. To do it in horizontal window I can hit Ctrl+w ^, how to do it in vertical window? And how to change horizontal windows to vertical

Can not move cursor in Insert mode

Just noted I can't move cursor to left or right (up and down works correctly) in Insert mode while editing an .sql file, with other files it works ok also. Any hint?. Vim: 7.2.330 - Ubuntu 10.04 x86_64Install "vim". It lets you to traverse text

How to shorten the diamond character in vim

In the dictionary file, which I am editing I often need to insert character "◊" on place of <>. Is there a way to map "◊" to some key so that I press "r" for replace and then my_shortcut to have <> replaced by &qu

Detect if a key is linked to something in vim

I'd like to know if there is a way to figure out if a key does something in vim. I know that I can use :map to see user-defined mappings, but is there something for the built-in stuff? For example, I always had CTRL-W bound to close tab, because I th

How to use variables in my .vimrc file?

I have a small problem with "tab size" and different project, some like 2 or 4 and the Linux kernel like 8 spaces per tab. And this is not a big problem since I can just change a couple of settings in my .vimrc set tabstop=4 set shiftwidth=4 set

Switch to the last active tab in VIM

In Vim, is there a way to quickly toggle between the current tab and the last active tab? Sort of the way '' toggles between the current line and the last active line. Plugins / keyboard mappings / voodoo all acceptable.Put this in your .vimrc: let g

VIM substitution: using the current line as a search string

Assuming the following text file, which is actually a data dump of funds and price statistics: PBCPDF 05/01/2006 0.0000 0.0000 PBCPDF 0.0000 06/01/2006 0.0000 0.0000 PBCPDF 0.0082 [- lines repeat -] What I wanted to achieve is to delete all instances

Empty all methods in a file in vim, regex?

I am using the vim editor and I wanted to empty out all methods in the class, for instance class A { public: int getNumber() const { return number; } void setNumber(int num) { number = num; } }; I wanted to have a regex where I could substitute so th

Can I prevent vimrc settings from being replaced by plugins?

This question follows on from this vim search question I have a setting in my .vimrc which excludes $ as a valid part of a word: set iskeyword-=$ This works fine for most files but isn't working in PHP. I assume it is being overwritten by a php plugi