vimrc

How to unload all the plugins from vim and change VIMRUNTIME ?

Hello my problem is this: I have an account at my hosting providers server and I can't install my own copy of vim. So the only personalization I can make is editing .vimrc in my account, but it won't suffice What I'd Like to do is: on startup I'd like to unload all the plugins and loaded stuff, and tell vim to use other folder as its' r...

How to execute Vim commands in a file, like .vimrc?

I need to create a file with a list of commands (in particular key mappings) that I may sometimes need, like a .vimrc that I can execute inside Vim when I need them. ...

Is there a way to append a folder to the PATH environment variable in vimrc?

I'm running portable python and portable gvim. When I run gVimPortable, I want it to append python to the PATH environment variable. This is the command I would run in a command prompt: path=%path%;C:\portable\PortablePython_1.1_py2.5.4 Is there a way to automate this in the vimrc file or some other way? ...

Can't get "syntax on" to work in my gvim.

(I'm new to Linux and Vim, and I'm trying to learn Vim but I'm having some issues with it that I can't seen do fix) I'm in a Linux installation (Ubuntu 8.04) that I can't update, using Vim 7.1.138. My vim installation is in /usr/share/vim/vim71/. /home/user/ My .vimrc file is in /home/user/.vimrc, as follows: fun! MySys() return ...

What vimrc settings to speed up scrolling?

I use gvim pretty heavily at work, typically logged into a server farm. This works great while I'm directly on the corporate LAN, but when I VPN in from home and resume my sessions, gvim scrolls almost intolerably slow. Every time I page up or down, the scrolling does a lot of unnecessary screen refreshes before it gets to the final ...

Vimrc: how to reuse code and definitions for differnt file types?

I have defined my own file types using vim. For example I have: .classNotes .reportJotNotes .homework These file types are defined in .vim files: ~/.vim/syntax/homework.vim ~/.vim/syntax/reportJotNotes.vim ~/.vim/syntax/homework.vim Many of these things have several of the same code in them. Ie they all have this for titles: sy...

How do I turn off automatic saving of a vim file with a ~ suffix

In my environment, I share vim configuration with other developers (and have my own configuration additions as well) in various .vimrc files. Some places in the environment, I edit a file in vim and automagically a copy of that file with a trailing tilde suffix appears. What vim options control this? I'd like to turn the feature off, a...

how do I detect OS X in my .vimrc file, so certain configurations will only apply to OS X?

I use my .vimrc file on my laptop (OS X) and several servers (Solaris & Linux), and could hypothetically someday use it on a Windows box. I know how to detect unix generally, and windows, but how do I detect OS X? (And for that matter, is there a way to distinguish between Linux and Solaris, etc. And is there a list somewhere of all...

How-to handle errors in Vim Script ?

In my .vimrc file, I have the following function, which folds the licensing information on the top of some .hpp and .cpp files: " Skip license function! FoldLicense() if !exists("b:foldedLicense") let b:foldedLicense = 1 1;/\*\//fold endif endfunction au BufRead *.hpp call FoldLicense() au BufRead *.cpp call Fo...

How do you disable a specific plugin in Vim?

I have Vim set up to use the excellent NERDTree plugin. However, there are some environments where I do not want this plugin to be loaded. In my .vimrc I have a sections that are only run when specific environment variables are true. In one of these sections I would like to disable the loading of NERDTree but all of the information I've...

Best way to organize filetype settings in .vim and .vimrc?

I'm going through my vim dotfiles to tidy them up. I've noticed that through time I've added various filetype specific settings in various inconsistent ways. Let's suppose I'm customizing for Python: au BufRead,BufNewfFile *.py (do something). I don't like this because some Python files might not have the .py termination. au FileType ...

Is there a way to use a substring function on variables in .vimrc?

I have gVim and portable python stored in a DropBox folder on several machines. The location of the DropBox folder is different on each computer. However, I'd like to be able to setup the .vimrc so that it automatically references the correct python folder no matter what computer it's on. For example, I have gVim in C:\DropBox\gVimPor...

Vim - Activiting html snippets on php files

Hello i am using vim and snipMate i very times i need to name the html files to php, just because 1 or 2 lines of code. I every time i create an php file no introduce html and i have to activate the html snippets manually with the command set ft=php.html I intend to activate it automatically in this this line on my vimrc autocmd Buf...

vim remapping the hjkl

I am trying to map the letter hjkl to jkl; in my .vimrc file so that i can have my fingers the way they always are on the keyboard, while writing in vim. the problem is that as i map k to l, it jumps into the l to ;. so k becomes the same as ;. the same off course happens to all of them. so all the keys become one because they copy thr...

How can I map a key to execute a program, and show its output in GVim?

On my .gvimrc, I have the following line: map <f4> :!./%< On a source file, I have to press F4 and then enter, but it works correctly, shows the output, and hangs until I press enter again. If I change it for: map <f4> :!./%< <CR> It behaves shows the output, but doesn't wait until I press enter (and so the output becomes imposs...

auto-fold Oracle inline views in Vim using .vimrc

I've seen magical Vim commands before that you could add to your .vimrc to have folds created upon opening a particular type of file. I remember having such code that would create the folds, upon opening the file, at every Ruby method and class. Then, with one command, I could collapse all those method folds. Does anyone know how to d...

How do I source a list of files from vimrc?

I basically want to add something like source ~/.vim/source.d/*.vim to vimrc. Is it possible to loop over a set of globbed files? ...

Vim change configuration in folder viewing mode

When I enter a folder in vim by pressing gf while over a path, I enter some kind of folder viewing mode. I don't have for instance, line numbers set in it automatically. How do i change the configuration for the folder viewing mode in Vim? ...

How can i set the plugin's option in .vimrc

I use NERDTree plugin. Now i want to set the 'NERETreeHijackNetrw' option to value 0. what should i write into my .vimrc ...

Insert empty lines without entering insert mode

I often find myself bouncing on o or O and ctrl{ to insert blank lines and get back out of insert mode. Thinking there must be a simpler way, and hoping to retain my cursor position, I hacked together these sloppy macros: map <Leader>O :let cursorpos = getpos(".")<CR>:i<CR><CR>.<CR>:let cursorpos[1] = cursorpos[1] + 1<CR>:call setpos('...