neowit / vim-force.com

Vim plugin for force.com
113 stars 25 forks source link
apex salesforce salesforce-apex salesforce-developers salesforce-metadata sfdc vim-plugins

Vim plugin for developing on force.com

salesforce.com / force.com plugin for Vim version 7.4 (with job & channel support) or later.

Update September 2023

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.

Update September 2016

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.

Update July 2015

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.

Update March 2015

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.

Update Feb. 2014

'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.

DESCRIPTION

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

FEATURES

LIMITATIONS

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.

Installation/System requirements

Before vim-force.com plugin can be used the following requirements must be met:

  1. Vim version 7.4 (with job & channel support) or later, with :set nocompatible

  2. Java JDK/JRE, Version 8 or greater

  3. Tooling-force.com
    download jar from 'releases' page

  4. the rest see in vim doc :help force.com-system-requirements or directly in force.com.txt.

RECOMMENDED-PLUGINS

There is a number of great Vim plugins which you may want to consider

CREDITS

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.