Skip to content

Instantly share code, notes, and snippets.

@andre3k1
Created November 27, 2018 20:27
Show Gist options
  • Save andre3k1/e1b791ae0402f31a2d3213c17c630899 to your computer and use it in GitHub Desktop.
Save andre3k1/e1b791ae0402f31a2d3213c17c630899 to your computer and use it in GitHub Desktop.
Editing long shell commands in Sublime Text with edit-and-execute-command
## Editing long shell commands in Sublime Text with edit-and-execute-command
##
##
## Typing "subl" on command line will open Sublime Text by adding this symlink
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl
##
##
## Make Sublime Text the default editor...
##
## ...if using BASH
cat <<EOL >> ~/.bashrc
export VISUAL='subl -w'
export EDITOR="$VISUAL"
EOL
##
## ...or if using ZSHELL
cat <<EOL >> ~/.zshrc
export VISUAL='subl -w'
export EDITOR="$VISUAL"
EOL
##
## All done! Try typing Ctrl-x Ctrl-e
##
## Type (Ctrl-x Ctrl-e) on the command line to open the current line in
## Sublime Text, and once you save & close the Sublime window, your shell
## will execute the command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment