Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Vim plugin for force.com
VimL
branch: master

new config variable - 'g:apex_OnCommandComplete'

execute a shell command upon completion of long running Apex command
latest commit 7980a88ed0
@neowit authored

README.md

Vim plugin for developing on force.com

salesforce.com / force.com plugin for Vim version 7.3 or later.

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 Oct. 2014

Best way to take advantage of Apex code completion is to use "server" mode.
If you are using server mode on MS Windows then you must have python available to vim. Read :help server-mode in vim-force.com documentation carefully.

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

  • Build/Save to SFDC

    • with error reporting
    • "Run test"
      • Execute unit tests in all modified files
      • Execute unit tests in a selected Class
      • Execute selected test method in a selected Class
      • Display code coverage after running test
  • Deploy from one Org to Another

  • Delete selected metadata from SFDC

  • Execute Anonymous

    • whole buffer or selected lines
  • Execute SOQL query

  • Persistent "Stage" for cherry-picking and re-using list of components to be deployed or deleted

  • Load/update metadata from SFDC

    • Retrieve All or Selected components of given metadata type.
      Support for metadata types that reside inside folders (e.g. Document, Dashboard or Report) is limited because requires querying data (in addition to metadata).
  • Create triggers/classes/pages

  • Refresh current file from SFDC, Refresh whole project from SFDC

  • Search

    • find word in classes/triggers
    • find word everywhere
    • find visual selection
  • Syntax highlighting

    • supports syntax highlighting of Apex Classes, Triggers, Pages, JS Resources
  • List candidates for auto-completion in Apex classes

    • try following in .cls file
      String str = 'abc';
      str. Ctrl-X,Ctrl-O
  • List candidates (field names, object types, relationships, etc) for auto-completion in SOQL expressions (requires tooling-force.com v0.3.3.0 or above). Invoked using vim omni-completion: Ctrl-X,Ctrl-O

  • Most commands (where it makes sence) 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 MyOtherOrg will run the same query against 'MyOtherOrg'
    Org name supports auto completion.

  • Handling content of zipped .resource files

    • useful when working with rich UIs with lots of javascript and CSS files
  • Basic (really basic) Visualforce code completion

    • try following in .page file
      < Ctrl-X,Ctrl-U
      <apex: Ctrl-X,Ctrl-U
      <chatter Ctrl-X,Ctrl-U
  • Initial support for aura/lightning

    • insert/delete/update/query for all aura file types is fully supported but there is currently no file templates or wizard to create various types of aura files. Use standard vim/file-system tools to create relevant files/folders.

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.3 or later with :set nocompatible

  2. Java JDK/JRE, Version 7 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

  • Fugitive - git support
  • unite.vim or ctrl-p - quick file/buffer open
  • NERDTree - project/file-system browsing
  • Pathogen - manage individually installed plugins in ~/.vim/bundle
  • Session - save/restore open files, like IDE Project
  • UltiSnip - implements some of TextMate's snippets features in Vim
  • TagBar - a source code browser plugin for Vim

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.

Something went wrong with that request. Please try again.