Skip to content

cdelmoral/salesforcedx.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

salesforcedx.nvim

Neovim plugin that allows you to use the Salesforce CLI, similar to the Visual Studio Code plugin, but for your favorite code editor.

Demo

Prerequisites

Installation

You can install salesforcedx.nvim with any plugin manager.

{
  "cdelmoral/salesforcedx.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-telescope/telescope.nvim",
    "rcarriga/nvim-notify",
  },
  config = function()
    require("salesforcedx").setup()
  end,
}

Usage

salesforcedx.nvim provides the SalesforceDX command that opens the Salesforce command palette.

You can also configure key mappings to execute the Salesforce commands, for example:

vim.keymap.set("n", "<leader>sfd", '<cmd>lua require("salesforcedx.commands").deploy_start()<CR>')
vim.keymap.set("n", "<leader>sft", '<cmd>lua require("salesforcedx.commands").execute_test_method()<CR>')
vim.keymap.set("n", "<leader>sfT", '<cmd>lua require("salesforcedx.commands").execute_test_class()<CR>')
vim.keymap.set("n", "<leader>sfa", '<cmd>lua require("salesforcedx.commands").generate_apex_class()<CR>')

Status Line Integration

salesforcedx.nvim includes the get_default_target_org function which can be used to display the configured default scratch org in the status line.

For example, for lualine.nvim add this to your configuration:

{
  require("salesforcedx").get_default_target_org,
  cond = require("salesforcedx").is_salesforce_project_directory,
  icon = { "󰅟", align = "left", color = { fg = "cyan" } },
}