vimrc

What is in your .vimrc?

Vi and Vim allow for really awesome customization, typically stored inside a .vimrc file. Typical features for a programmer would be syntax highlighting, smart indenting and so on. What other tricks for productive programming have you got, hidden in your .vimrc? I am mostly interested in refactorings, auto classes and similar productiv...

Vim File Explorer Configuration

I'm setting the below variables in my vimrc to control how windows get split when I bring up the file explorer plugin for vim. But it appears these variables are not being read because they have no effect on how the file explorer window is displayed. I'm new to vim. I know the vimrc file is being read because I can make other setting cha...

Can I stop settings in vimrc from being overwritten 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 plugin, but since plugins are loaded after .vimrc I can't work out how to overwrite this s...

What setting in vim counteracts smartindent's refusal to indent # comments in shell scripts?

I recently started using vim 7 (previously vim 6) and the smartindent setting. For the most part, it works well, though I'm so used to typing a tab after an open brace that it is almost counter-productive. However, there is one piece of maniacal behaviour. When editing a shell script, I try to create a comment at the current indent le...

vim Comment Newlines Unexpected Behavior

In using vim, when I start a comment with //, immediately after I type a space, it begins a new comment line. For instance, if I typed the following: //hello world my name is stefan I would get: //hello //world //my //name //is //stefan This behavior has manifested itself in python code as well, where if I begin a line with print,...

compile directly from vim

I'd like to compile cpp file w/o turning off vi. I know the :!g++ file.cpp but I prefer :make so I added this line in .vimrc file au FileType C set makeprg=gcc\ % au FileType Cpp set makeprg=g++\ % but I keep getting "make: * No targets specified and no makefile found. Stop.** "message. can anyone tell me what is wrong with my ...

How can I make hard-coded strings heinous-looking in VIM?

I was inspired by this (number 2) to make my hard-coded strings ugly. How can I do this in VIM? Thanks! ...

How to detect vi (not vim) in .vimrc?

I carry a vimrc to all the machines that I work on and it naturally contains options that are not present in old vi. If I accidentally start a vi session on a machine where vi is not an alias to vim and/or vim is not installed, vi reads vimrc and throws a bunch of annoying errors to let me know that option such and such are unsupported....

netbeans jvi vimrc file location

I have started using netbeans vim plugin Jvi and i cant seem to find the vimrc file location I found an option that seem to say that it will save the vimrc in the home folder, but there isnt one there. I am using Ubuntu. thanks ...

Writing a vim function to insert a block of static text

I'd like to be able to do something like this in vim (you can assume v7+ if it helps). Type in a command like this (or something close) :inshtml and have vim dump the following into the current file at the current cursor location <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm...

Vim: how to use variables in vimrc?

Hello, here what I am trying to do, a simple function to increment a global variable. It works fine. let g:high_ind = 1 fun! IncHighlightInd() let g:high_ind = (g:high_ind + 1) %10 return g:high_ind endf I want to use this variable in a map map <C-h> :call IncHighlightInd() <CR> :Highlight g:high_ind <CR> But g:high_ind is no...

how to prevent vim from creating (and leaving) temporary files?

Why does vim create <filename>~ files? Is there a way to disable that? If it's for backup (or something), thanks but no thanks, I use git so I don't need your silly backup. Also, these .<filename.with.path.hints>.swp files too. How do I tell vim not to create those? or at the least to cleanup after itself? EDIT wops, duplicate: ...

gVim tabline

In gvim, is it possible to have multiple rows of file tabs? That is, instead of showing left/right arrows to navigate around the tabline (for tabs that don't fit into the tabline), it should "start" a new row of tabs. Thanks in advance. ...

In vim, how do I get a file to open at the same line number I closed it at last time?

I want to configure vim to open a file at the same place I left off at. ...

assembly vim syntax highlighting

The default assembly syntax file didn't works well,and after a searching on the web about gas assembly,found nothing about gas(AT&T syntax) syntax file for vim.. anyone found this??? I can't write my own syntax file.. ft=nasm ft=asm(default) ft=tasm ...

How do I "source" something in my .vimrc file?

I've been working on expanding my vim-foo lately and I've run across a couple of plugins (autotag.vim for example) that require them to be "sourced" in my .vimrc file. What exactly does this mean and how do I do it? ...

How do I enable vim7 spellchecking inside the POD sections when editing perl files?

Hi folks, I'm a long time vim user, but only recently learned that vim7 has some awesome spelling features baked in now. I've been using all sorts of external spelling tools and plugins so far, and am very excited about ditching all of them for the builtin spelling. So here's the problem. I did review :help spell and the spelling loo...

Vim visual mode scripting: searching the text surrounding the visual selection

I'll try to explain by example.. If we have a piece of code like this in vim: if ($feck == true && $drink == false) { echo 'They lie in wait like wolves..'; } And I go to visual mode and select "$drink" for example, is there a way to: detect whether the current selection is one of vim's text-objects (word, WORD, inner {, etc.) ...

Unable to understand a line in .vimrc

I do not understand what the following line does in .vimrc nmap <silent> <leader>v :EditConfig<cr> It seems that nmap mean noremap silent seems to mean apparently no beep in Vim leader seems to mean the first character in the mode : v seems to mean visual mode EditConfig should be a command in vim in the mode : (However, it is not.)...

making vim load omnicomplete from current working directory

Hi, I am trying to make vim portable by statically compiling it and then using my own vimrc and plugins and stuff that lives in my portable directory... I have recently used vi omnicomplete plugin that says to install it in ~/.vim/ directory... It works fine... but i want my portable vim to locate the omnicomplete plugin from the curr...