
In combination with modifier keys, this offers dozens of custom function keys you can use for arbitrary snippets or commands. You can also begin the string with a Control-C to discard the current command-line input if necessary, making it safer to type the key without intermingling new text with old. You can use this to conveniently enter information like host names, or entire ssh commands including a linefeed, so typing a single key will start the connection. Terminal > Preferences > Profiles > Keyboard You can assign arbitrary strings to the function keys in To make it convenient to run them, you can put them in the Dock, or a collection of them in a folder in the Dock.Īfter creating a ".command" file, make it executable with chmod +x /path/to/mand. You can save shell commands (or, indeed, entire shell scripts) in a file with the filename extension ".command", and if you open one of these files Terminal will open a new terminal window and tell the shell to execute the commands in the file.
#Mac terminal vim how to save plus
"Safe" commands include anything run from the New Remote Connection dialog, any shell listed in /etc/shells, plus emacs, vi/vim, pico, nano, screen, tmux and top. If you save them in a window group, it will automatically restore (re-run) "safe" commands, and there's a checkbox to tell it to restore all commands. If you use the Shell > New Command or New Remote Connection commands to create terminals, the command is recorded with the window/tab.
#Mac terminal vim how to save mac os x
In Mac OS X Lion 10.7 this gets simpler: you can tell Terminal to remember the commands for individual windows without creating a custom profile for each one. Terminal > Preferences > Startup Improvements in Mac OS X Lion 10.7 You can even tell Terminal to open a particular window group each time Terminal starts in: When you open the window group it will restore all the windows/tabs and run the commands associated with each profile. If you want to automatically create several terminals at a time (which will also run their profile commands), you can create a set of terminal windows/tabs using each profile, then save them as a window group with: Running Multiple Commands at a Time with Window Groups If you want to create a new file, type the editor name, followed by a space and the pathname of the file. Choose one to create a new terminal and run the associated command. In the Terminal app on your Mac, invoke a command-line editor by typing the name of the editor, followed by a space and then the name of the file you want to open. Profiles appear in the Shell > New Window and New Tab submenus. Terminal > Preferences > Profiles > Shell > Run Command Then either create a new profile or duplicate an existing one (there's a Duplicate command in the action menu at the bottom of the profiles list) and then customize the command:

Profiles serve as both appearance "themes" and as "bookmarks" for commands and remote connections.

You can create new settings profiles, each with a different ssh command. There are a few different ways to create ssh command bookmarks.
