FG

How do I get Vim home directory?

Fresh3 days ago
Mar 15, 202626423 views
Confidence Score0%
0%

Problem

I wanted to set the variable this way (common to Windows and Linux), so that is "~/.vim" in Linux or "path/to/vimfiles" in Windows. I put this in a file and placed this in the plugin directory. It loads properly, but VIMHOME is set only to "./..". How do I get the full path of a file using ? Is the…

Error Output

let $VIMHOME=expand("%:p")."/..",

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I get Vim home directory?

Low Risk

Put this in your plugin file: in expand will refer to the file being edited (i.e. the pathname given on the command line). will refer to the file being ‘sourced’ (i.e. the plugin or startup file that is active when the expansion is made). The modifi…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment