Skip to content

Instantly share code, notes, and snippets.

@jstvz
Last active June 21, 2022 21:15
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jstvz/c76bb890cecb60e16c7542be35ddf7dc to your computer and use it in GitHub Desktop.
Save jstvz/c76bb890cecb60e16c7542be35ddf7dc to your computer and use it in GitHub Desktop.
*DEPRECATED*: Salesforce DX aliases and shell completions for working with sfdx in zsh and vim
" SFDX mappings
" Requires https://github.com/skywind3000/asyncrun.vim
let mapleader = "\<Space>"
nmap <leader>fst :AsyncRun sfdx force:source:status<CR>
nmap <leader>fsp :AsyncRun sfdx force:source:push<CR>
nmap <leader>wfsp :w<CR> :AsyncRun sfdx force:source:push<CR>
nmap <leader>fsl :AsyncRun sfdx force:source:pull<CR>
nmap <leader>fol :AsyncRun sfdx force:org:list<CR>
nmap <leader>fod :AsyncRun sfdx force:org:display<CR>
nmap <leader>fop :AsyncRun sfdx force:org:open<CR>
nmap <leader>foc :AsyncRun sfdx force:org:create<CR>
nmap <leader>fcl :AsyncRun sfdx force:config:list<CR>
nmap <leader>fcs :AsyncRun sfdx force:config:set<CR>
nmap <leader>fcg :AsyncRun sfdx force:config:get<CR>
nmap <leader>fmc :AsyncRun sfdx force:mdapi:convert<CR>
nmap <leader>fmd :AsyncRun sfdx force:mdapi:deploy<CR>
nmap <leader>fmr :AsyncRun sfdx force:mdapi:retrieve<CR>
nmap <leader>fawl :AsyncRun sfdx force:auth:web:login<CR>
nmap <leader>fdte :AsyncRun sfdx force:data:tree:export<CR>
nmap <leader>fdti :AsyncRun sfdx force:data:tree:import<CR>
nmap <leader>fat :AsyncRun sfdx force:apex:test:run -d /tmp/apex_tests -c -r human<CR>
@jstvz
Copy link
Author

jstvz commented Aug 27, 2017

Updated for salesforcedx 40.7.0

@jstvz
Copy link
Author

jstvz commented Oct 10, 2017

@zaki-yama
Copy link

@jstvz
Thank you very much for your zsh completion! It's really helpful.

I'd like to ask you one question. How did you generate this completion function? Did you write it manually?
I just wondered how you're following the updates of sfdx CLI.

@wadewegner
Copy link

My guess is he's using sfdx force:doc:commands:display --json | jq -r . and then autogenerating.

@wadewegner
Copy link

And if so, I'd love to see the script!

@wadewegner
Copy link

Looks like this was a port of the Heroku completion script. I did something similar and included the script here: https://github.com/wadewegner/salesforce-cli-zsh-completion

@jstvz
Copy link
Author

jstvz commented Jan 9, 2018

Looks good, @wadewegner!

Also, you are correct, I based this on the Heroku plugin included in OMZ. I was text munging the help output with a python script... using jq is much cleaner.

@PedroPTavaresJr
Copy link

hey, hi.
i'm a bit new to VSCO, used to do things with mavens and sublime text ..
where did i put this alias to use then?

@srlawr
Copy link

srlawr commented Sep 10, 2020

The alias file now has at least two conflicts in it

alias fpvu="sfdx force:package2:version:uninstall"
alias fpvu="sfdx force:package2:version:update"

and

alias fsp="sfdx force:source:pull"
alias fsp="sfdx force:source:push"

Which is a definite breaking issue! Needs a pattern decision making

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment