salesforce.com / force.com plugin for Vim version 7.4 (with job
& channel
support) or later.
Note 1: Vim 9 release contains a bug 11534 which breaks vim-force.com plugin. Use Vim 8.2 release or nightly build of Vim 9, e.g. v9.0.1950.
Note 1:
Majority of plugin functions have been migrated to async jobs and
channels added in vim not so long ago.
You may need to update to a very recent version of your vim flavour because some initial versions (e.g. MacVim) with job
support had problems with properly handling this functionality.
As always - make sure that you use latest tooling-force.com.jar.
Note 2:
Minimum MacVim version which is known to (almost) work is 7.4, Included patches: 1-1831
.
Current versions of MacVim GUI (as well as GVim) suffer from this issue.
The problem only manifests itelf if your java
& tooling-force.com.jar
config is wrong. If in doubt - test your config with :ApexValidateJavaConfig
Note 3:
This version has not been fully tested on MS Windows yet.
If you want to try it out - make sure to use latest vim version.
Note 4:
If you have to use older vim version or want to continue using synchronous
version of all commands then switch to
legacy-vim-sync branch.
If you do not get code coverage data when running :ApexTestWithCoverage
using
one of meta-*
flags then you are most likely affected by a
bug in Metadata API Summer'15.
Workaround 1: use :ApexTestWithCoverage
with tooling-sync
or tooling-async
flag.
Workaround 2: fall back to tooling-force.com-0.3.3.3.jar.
Note: you will lose some of newer functions.
If you are getting Internal Server Error
when trying to deploy/save list of files which contain both Aura bundle(s) and Apex Class/Page then you are most likely affected by what appears to be a bug in Spring'15.
Current workaround is to deploy Apex Classes/Pages first (:ApexDeployOne or :ApexDeployOpen or :ApexDeployStaged) and then call :ApexDeploy or :ApexSave as usual.
'master' branch of vim-force.com is no longer based on Ant and force.com migration tool. This version requires config changes, see :help force.com-installation
, :help g:apex_tooling_force_dot_com_path
and :help force.com-config-example
.
If you want to continue using Ant + ant-salesforce.jar then switch to ant-based branch.
vim-force.com plugin is a bunch of .vim scripts that allow to develop on force.com platform using Vim.
It is designed for those who do not feel productive in Force.com IDE for Eclipse.
General vim-force.com overview - http://www.youtube.com/watch?v=x5zKA6V__co
:ApexRetrieve
command demo - http://youtu.be/umO86ji2Iqw
:ApexStage
command demo - http://youtu.be/zQg8LORh8uc
Apex Code completion demo - http://youtu.be/u-6JQNuWRdE
Other vim plugins recommended for use alongside vim-force.com plugin
Build/Save to SFDC
Deploy from one Org to Another
Delete selected metadata from SFDC
Execute Anonymous
Execute SOQL query
Persistent "Stage" for cherry-picking and re-using list of components to be deployed or deleted
Load/update metadata from SFDC
Create triggers/classes/pages
Refresh project from SFDC
Search
Syntax highlighting
List candidates for auto-completion in Apex classes. Invoked using vim omni-completion: Ctrl-X,Ctrl-O
List candidates (field names, object types, relationships, etc) for auto-completion in SOQL expressions. Invoked using vim omni-completion: Ctrl-X,Ctrl-O
Most commands (where it makes sense) can be run against different orgs without leaving current project.
e.g.
:ApexQuery
will run selected SOQL query against the Org configured for current project
:ApexQuery <api> MyOtherOrg
will run the same query against 'MyOtherOrg'.
Org name supports auto completion.
Handling content of zipped .resource files
Basic (really basic) Visualforce code completion
< Ctrl-X,Ctrl-U
<apex: Ctrl-X,Ctrl-U
<chatter Ctrl-X,Ctrl-U
Initial support for aura/lightning
Salesforce.com API does not (in most cases) report error line numbers in Visualforce pages, making it impossible to go-to actual problem line if compile/save fails due to a syntax error.
Apex/SOQL auto-completion is a work in progress and there are many cases when it may not work as expected.
Before vim-force.com plugin can be used the following requirements must be met:
Vim version 7.4 (with job
& channel
support) or later, with :set nocompatible
Java JDK/JRE, Version 8 or greater
Tooling-force.com
download jar from 'releases' page
the rest see in vim doc :help force.com-system-requirements
or directly in force.com.txt.
There is a number of great Vim plugins which you may want to consider
Author: Andrey Gavrikov
Credit must go out to Bram Moolenaar and all the Vim developers for making the world's best editor (IMHO). I also want to thank everyone who helped and gave me suggestions. I wouldn't want to leave anyone out so I won't list names.