Fig is an app for autocomplete in terminal in mac. Homebrew Install package manager for mac Homebrew if you did't before /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" . iTerm Install iTerm . Oh My Zsh Install Oh My Zsh framework for ZSH terminal sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" . Make ZSH the default terminal chsh -s /bin/zsh powerlevel10k Install a powerlevel10k theme for the zsh terminal git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k Do not forget about MesloLGS NF fonts Configure theme by command p10k configure Now terminal looks like Make sure that zsh configuration file uses powerlevel10k theme by opening file code -a ~/.zshrc and checking existence of the line ZSH_THEME="powerlevel10k/powerlevel10k" VSCode To use iTerm app as VSCode terminal add following int VSCode json configuration file
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.fontFamily": "MesloLGS NF",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.lineHeight": 1,
Autocomplete via FIG Download Fig for autocomplete and IntelliSense in iTerm. We got IntelliSense in the terminal inside VSCode. Path autocomplete Git autocomplete Custom IntelliSense Instruction how to add your custom IntelliSense can be found here . Firstly clone Fig repo from GitHub to your computer by git clone git@github.com:withfig/autocomplete.git figAutocomplete To create our own autocomplete we need to create it with internal tool and re-build the project. That is why drop into Fig project cd figAutocomplete & install all internal packages npm i Create an own snippet file with npm run create-spec myOwnSnippet & run dev mode npm run dev Open the snippet boiler plate and modify it code src/myOwnSnippet.ts
const completionSpec: Fig.Spec = {
name: "myOwnSnippet",
description: "Some description",
subcommands: [{
name: "my_subcommand",
description: "Example subcommand",
subcommands: [{
name: "my_nested_subcommand",
description: "Nested subcommand, example usage: 'myOwnSnippet my_subcommand my_nested_subcommand'"
}],
}],
options: [{
name: ["--help", "-h"],
description: "Show help for myOwnSnippet",
}],
// Only uncomment if myOwnSnippet takes an argument
// args: {}
};
export default completionSpec;
Ones we done npm run build && npm run copy:all Your .js file transpiled from the .ts one can be found and read from Fig folder code ~/.fig/autocomplete/build/myOwnSnippet.js My completion for Git Open the file with completions for git code ~/Git/figAutocomplete/src/git.ts and add following to the end of the file.
additionalSuggestions: [
{
name: "commit -m 'msg'",
description: "Git commit shortcut",
insertValue: "commit -m '{cursor}'",
icon: "fig://template?color=2ecc71&badge=🔥",
// type: "shortcut",
},
{
name: "git add . && git commit -m 'msg' && git push",
description: "My git shortcut",
insertValue: "add . && git commit -m '{cursor}' && git push",
icon: "fig://template?color=2ecc71&badge=💩",
// type: "shortcut",
},
],
Run npm run build && npm run copy:all Settings code ~/.fig/settings.json open settings file. Ruby & python version in right corner After React Native installation I got annoying ruby logo with version at the end of every line in terminal. To remove it... code ~/.p10k.zsh Just play with configurations using as minimal options as possible Highlighting https://fig.io/plugins/other/zsh-syntax-highlighting Some commands fig doctor check status of fig fig restart restart