Skip to main content

3 posts tagged with "Tools"

View All Tags

1. Shortcuts

1.1 Open from Command Line

PyCharm --> Tools --> Create Command-line Launcher

image-20250529103513168

echo 'export PATH="/Applications/PyCharm.app/Contents/MacOS:$PATH"' >> ~/.zshrc
source ~/.zshrc
pycharmToolsOne min read

Shortcuts

1. Plugins

  • intellij-idea-keybindings

  • Material Icon Theme

2. Settings Tips

  • Enable auto-save

  • Set directory indent to a larger value

3. Shortcuts

  • macOS: Command + Shift + P to open command palette, search for shell, install
vscodeToolsOne min read

1.1 View History Commands

1.1.1 Basic Viewing

  1. View all
    • Command line: history
    • Shortcut to view all: Command + Shift + H
  2. Fuzzy matching
    • Command line: history | grep python
    • Shortcut: Ctrl + R

1.2 Using History Completion in iTerm

1.2.1 Built-in Shortcut Command + ;

  1. Enter command prefix:
    • In iTerm's command line, enter a command prefix, for example, gcloud
  2. Press shortcut: Command + ;, iTerm will pop up a window listing all history commands starting with your entered prefix in the current session.
    • Example: Enter a command prefix in iTerm command line: gcloud
  3. Select and complete:
    • Choose the command you need from the popup list, and it will auto-complete. Then you can modify it yourself.

Downside: Display is not complete

Note: To solve the cross-session history saving issue with Command + ; completion in iTerm2 and ensure Shell correctly saves history: vi ~/.zshrc edit the file and add at the end:

# Set history file size and save location
HISTFILE=~/.zsh_history # History file path
HISTSIZE=10000 # Number of history entries saved in memory
SAVEHIST=10000 # Number of entries saved in history file

# Append history (instead of overwriting)
setopt appendhistory # Merge history from multiple sessions
setopt inc_append_history # Append history in real-time (no need to restart session)
setopt share_history # Share history across sessions
setopt extended_history # Record timestamps

Apply changes: source ~/.zshrc

1.2.2 Advanced Completion Feature

If you want to achieve the following effect, showing gray suggestions while typing: iTerm command auto-completion

Configuration Method

Using zsh and oh-my-zsh:

  1. Install oh-my-zsh (if not already installed): Run sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)".
  2. Install zsh-autosuggestions plugin:
  • Clone the plugin to oh-my-zsh's plugin directory: git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
  • Edit .zshrc file, add zsh-autosuggestions to the plugin list: plugins=(zsh-autosuggestions) (add a new line)
  • Save and restart iTerm2, or run source ~/.zshrc to apply the configuration.
...
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
plugins=(zsh-autosuggestions)
...

Usage Method

Similar to before, enter a prefix, and matching history commands will automatically appear in gray. If you accept it, press -> arrow key. If not, use up/down arrows to navigate.

itermTools2 min read