vimrc

Is there a not user-hostile tool for making/editing vimrc files?

Implicit in that question is that if you enjoy editing .vimrc files by hand and have posted it on the net to brag about your vim-fu, then you and I don't live on the same planet. Also, I'm furiously resenting your petty sense of superiority and am busy making really unfair generalizations about the number of times you've watched Cowboy ...

Tab to exit quotes in Vim

Usually when I code in Python, I have to create a dictionary, and I press " once and it creates "|", being | my cursor. I'm using TAB key in the snipMate plugin to use snippets. I would like to press tab, when inside quotes after writing a string, that "exits" the quotes, but mantain snipMate. Example: "name|", and, pressing TAB, to be...

Formatting DateTime in VIM without leading zeroes on Month, Day, and Hour.

Does anyone know if there's a way to format the date generated by strftime in Vim (under MS Windows) such that Month, Day, and Hour are not padded to two digits with a leading zero? For example, the following commands in vimrc: nmap <F3> a<C-R>=strftime("%I:%M %p %m/%d/%Y ")<CR><Esc> imap <F3> <C-R>=strftime("%I:%M %p %m/%d/%Y ")<CR> ...

How can I stop vim from loading a syntax file automatically for certain file types?

I am working on a project writing a GLSL fragment shader, and it just so happens it has the file extension .fs, thus vim automatically loads the forth syntax upon opening the file. This normally would be no problem, I could just change the syntax using au BufRead but for some reason the forth syntax is loaded first, which completely me...

vimrc to be cross-plataform and synced with Dropbox.

I'v been using vim/gVim so far in my Linux Machine, and I have a Windows machine as well. In this windows machine I'm mainly notepad++. I would like to store all my .vimrc settings and .vim folder in Dropbox, and create symbolic links in Linux pointing to them, and them do the same in my Windows machine. I have plenty of "home shortcut...

set gvim font in .vimrc file

Hi all I am using the gVim7.2 on Windows 7.I can set the gui font as Consolas 10(font size) from menu . I am trying to set this in .vimrc file like below set guifont=Consolas\ 10 But it deosn't work. Does anyone set this before? ...

Map a caps lock key that is mapped to ctrl system wide to Escape just in vim

Hi all, i have mapped my caps lock key to ctrl with the following command under linux: setxkbmap -option ctrl:nocaps I really like this mapping and want to keep it, but I also would like to map the caps lock key to Escape when I am inside vim. But when I try to map it with :map <C> <Esc> or similar it does not seem to work, presum...

Disable Vim plugin for certain filetypes

Hi all, I'd like to disable a plugin for certain filetypes in Vim. I'm a Vim newbie, so take it slow with me :) I have the autocomplpop plugin, and I really like it. However, if I'm editing a LaTeX file, it shows completions for every single English language word I've already used. It's distracting! I'd like to disable it for .tex file...

Run vim script from vim commandline

Over the last couple of months, I've built a series of files full of vim-commands to auto-generate boilerplate code for my projects. It's allowed me to work faster. However, the only way I know how to run these scripts is by assigning them to key-combinations in ~/.vimrc. There's only so many keys I can remap. Is there a way to run t...

How can I override ~/.vim and ~/.vimrc paths (but no others) in vim?

Let's say I have a tarball of all my vim config - everything normally inside ~/.vim (plugins, autoload, colours, all that stuff), and a vimrc file. I extract this to a directory somewhere. So in the directory where I am ($PWD), there is a "vim" folder and a "vimrc" file. (note: this directory will be read-only, so vim shouldn't try to wr...

How to remap <C> (control) modifier key in vim?

I avoid the "control" key, AKA <C> in vim parlance, on my laptop; I hate where Apple put it. I would really like to remap all of the vim commands using control to instead use "command", but this does not seem possible on a Mac, despite what I have read. I have read that I should use <Leader> to set such mappings, but I want to avoid rema...

Vim: Highlight keyword pairs in Ruby (def/end, do/end, etc)

In one of the Eclipse-based editors that I tried out recently (I think it was RubyMine), when a Ruby keyword that either opened or closed a method or block was selected, the corresponding open/close keyword was highlighted. Similar to the way that Vim is able to highlight a corresponding open/close parenthesis. For instance, if I select...

vim replace for a pattern

<created> [email protected] </created> I want to replace the above with but the username may vary i.e,[email protected] ,[email protected]... <created> [email protected] </created> What is the command to replace this in vim %s/<created>\r*\r</created>/new string ...

Only load a plugin when +python is enabled

I have a plugin that will only run if vim has been compiled with +python pythonhelper. I share my .vim with a number of machines, and some of the machines don't have vim compiled with python mode turned on. So, I would want to know: is there a vim command I can put in my vimrc so I can conditionally include the plugin? Something like: ...

[MAC|G] VIM: highlight all occurrence of a selected word?

How can I highlight all occurrence of a selected word in gvim? (like notepad++..) ...

How to disable vim's indentation of switch case?

I'm currently fighting with Vim, I can't seem to make the indentation options do what I want. Here are my settings, I put them at the bottom of .vimrc to make sure they take precedence. As you can see I'm going a little crazy, so I tried turning off almost everything: set cindent set cinkeys=o,O set cinoptions= set cinwords= set indent...

vim: disable mswin (turn off windows shortcut keys)

I just installed vim on Windows XP machine. When logged on to another user a little bit ago, I went to C:\program files\vim\_vimrc and commented out the following lines "source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim "behave mswin and then Ctrl-X didn't cut text -- which is good. However, when I logged in as admi...

Git using non-standard .vimrc?

I've noticed that git seems to use different vim settings any time I'm writing a commit message. I have the git+svn install off Macports, and I've checked the $MYVIMRC variable: it's set to the correct file. Still, every time I go to commit a message I have a restriction on 80 characters per line, case sensitive search, and none of the p...

Run the CommandTFlush command when a new file is written

Hi, I'm trying to make Vim run the command 'CommandTFlush' whenever a new file is writte. For those not using the Command-T plugin, the 'CommandTFlush' command is used to rebuild an index of files in the current directory. What I want to do is run the command after the file is written to disk, so that CommandTFlush will find the file ...

vimrc make comments italic

How do I change the vimrc to have the comments in my code italicized? in my vimrc file i have: highlight Comment ctermfg=blue that makes the comment blue. ...