This repository contains a clink setup to be used with Windows Terminal.
Via Scoop (preferred)
The easiest way to get started is to install scoop for all the dependencies.
- Install Scoop
Open a powershell terminal:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
- Install a nerd font for the terminal (Cascadia Code here, but any other nerd font will work)
scoop bucket add nerd-fonts
scoop install cascadiacode-nf
- Install clink-terminal
scoop bucket add narnaud https://github.com/narnaud/scoop-bucket
scoop install clink-terminal narnaud/clink-completions narnaud/clink-flex-prompt
- Go to the Releases page
- Download the latest
clink-terminal.zip
file - Extract the files from it into a directory.
- open the Terminal
- go to the settings
- pick the
Command Prompt
settings - change the command line to
cmd.exe /s /k clink-terminal
Also go to the Defaults
and change the Appearance>Font face to CaskaydiaCove Nerd Font
.
The first time you start clink-terminal, it will show something like that:
To configure a new prompt, run the configruation wizard with:
flexprompt configure
Note
Probably one of the best feature of the prompt is that the git status is asynchrone, so you never have to wait for it to finish before being able to enter a command.
The configuration has some aliases already, but you are free to add more by creating a %USERPROFILE%\.alias.json
, here is an example file:
{
"l": "git log --graph --pretty=format:\"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit --date=relative",
"s": "git status",
"d": "git diff",
"more": "bat -f -p",
"np": "\"C:\\Program Files\\Notepad++\\notepad++.exe\"",
"xhost": "sudo code C:\\Windows\\tem32\\Drivers\\etc\\hosts",
}
fzf
is integrated all the way into this current terminal configuration. The default shortcuts are:
- Ctrl+T: lists files recursively; choose one or multiple to insert them,
- Ctrl+R: lists history entries; choose one to insert it,
- Alt+C: lists subdirectories; choose one to 'cd /d' to it,
- Alt+B: lists key bindings; choose one to invoke it,
- Ctrl+Space: uses fzf to filter match completions (and supports '**' for recursive)
It's also used for more advanced views (Ctrl+\
will change the preview position or hide it):
- Ctrl+E: explorer like view, with directory or file previews
- Ctrl+G,Ctr+F: git status, with diff for each file
- Ctrl+G,Ctr+S: git stashes list, with diff for each file
- Ctrl+G,Ctr+H: git log, with diff for each hash
- Ctrl+G,Ctr+B: git branches, with log for each branch
If you set the terminal.update_title
settings to true, you can change the terminal title based on the current folder and git branch.
clink set terminal.update_title true
Once done, the terminal title will change:
- if it's a normal folder: "folder_name"
- if it's a git folder: "git_topfolder_name - [branch_name]"
It comes with other nice tools:
bat
: a better cat with syntax highlightingfd
: find files in your filesystemrg
(ripgrep): recursive search pattern in directoriesz
(zoxide): a smartercd
command
Tools you should install:
- jq: lightweight and flexible command-line JSON processor
- use: command line tool to setup environment defined in a json file
- yazi: blazing fast terminal file manager written in Rust, based on async I/O
To install those:
scoop install use yazi
clink-terminal
comes y
shell wrapper that provides the ability to change the current working directory when exiting Yazi:
- Q will exit and change the current working directory
- shift-Q` will exit without changing the current working directory
This won't be possible without the help of those giants: