I want to set a shortcut to open vscode in the current directory, I have tried

code $(pwd)


alias s1="code $pwd" | s1

It is working in the terminal but not as a shortcut command, is there is a way to do it?

  • Can you please clarify what do you mean by "shortcut command"? Also the "current directory" by which application? On terminal you did it, are you trying to do it from the Files application?
    – endorama
    Sep 23, 2019 at 18:29
  • Shortcuts that can be set in the System Setings are system-wide. They don't see the Files application is open, nor which folder it is in.
    – m93a
    Jan 21, 2020 at 21:45

1 Answer 1


Go to System Settings --> Keyboard --> Shortcut --> Custom and click the + in the lower side of the right panel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.