Create an awesome development environment with the terminal in Mac OS like Linux window manager
this article is based on LESVIM, Nvim config focus on Javascript, Typescript, Rust and Lua. please see this github repo an give a star to it.
First of all let’s introduce several (rust) tools and write some config for its.
1. Wezterm
WezTerm is a GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust.
You can install it simply by homebrow (found more installation instruction)
$ brew tap wez/wezterm
$ brew install --cask wez/wezterm/wezterm
The best features of wezterm are : (you can found a full list of features can be found here)
- Runs on Linux, macOS, Windows 10 and FreeBSD
- Multiplex terminal panes, tabs and windows on local and remote hosts, with native mouse and scrollback
- Ligatures, Color Emoji and font fallback, with true color and dynamic color schemes.
- Hyperlinks
this is my wezterm config you should put it on $HOME/.config/wezterm/wezterm.lua:
before anything else you should install this fonts on your Mac:
- Cascadia Code
- MesloLGS NF
you can easily install Cascadia Code with homebrew
brew tap homebrew/cask-fonts
brew install --cask font-cascadia-code
you can found more details for installation here
for installing MesloLGS NF
please see here, briefly download this file
and Double-click on each file and click “Install”.
know with this config you can use this short-key:
Tabs and Pane’s creation deletion
command + shift + N
orsuper + shift + N
shortcut to create a new terminal window.command + ctrl+ f
orsuper + ctrl + f
toggle full screen windows.command + shift+ L
orsuper + shift + L
show launcher.command + t
orsuper + t
shortcut to create a new terminal tab.command + w
orsuper + w
shortcut to close the current terminal tab.command + '
orsuper + '
shortcut to create a new vertical terminal split pane.command + /
orsuper + /
shortcut to create new horizontal terminal split pane.command + x
orsuper + x
shortcut to close the current terminal pane.command + z
orsuper + z
shortcut to toggle the current terminal pane zoom.
Tabs navigation
command + ,
orsuper + ,
goes to the right available tab.command + m
orsuper + m
goes to the left available tab.command shift + T
orsuper + shift + T
show tabs navigator menu.
Pane navigation
command + ctrl + h
orsuper + ctrl + h
goes to the left available pane.command + ctrl + l
orsuper + ctrl + l
goes to the right available pane.command + ctrl + k
orsuper + ctrl + k
goes to the top available pane.command + ctrl + j
orsuper + ctrl + j
goes to the bottom available pane.
Pane cycles
command + [
orsuper + [
goes to the next available pane.command + ]
orsuper + ]
goes to the prev available pane.
Pane resizing
command + shift + H
orsuper + shift + H
increase right available pane to left.command + shift + L
orsuper + shift + L
increase left available pane to right.command + shift + K
orsuper + shift + K
increase the bottom available pane to the top.command + shift + J
orsuper + shift + J
increase the top available pane to the bottom.
Searching
command + shift + F
orsuper + shift + F
search for the string "hash" matches regardless of case.command + shift + space
orsuper + shift + space
go to quick search tools.
You might have already noticed that all the shortcuts here begin with command
or super
key except the ctrl + tab
which is switched between available tabs, so we try not to use command
or super
key in vim
short-key.
2. Fish shell and Starship
Fish shell is a user-friendly command-line shell. you can read install instruction it from here.
Fish has great features like autocomplete and suggests everything; it is the most user-friendly and interactive shell, and it has a great performance especially when we combine it with starship, we can use a newer and more robust shell like nutshell, but I think they don’t have enough reputation to use.
if you want to setup nice header and greeting message for fish shell put below code to $HOME/.config/fish/config.fish
:
it’s also enable vim key binding to fish shell.
what is starship
: It is the minimal, blazing-fast, and infinitely customizable prompt for any shell!
after installing starship and setup it for fish shell please put my configuration here :$HOME/.config/starship.toml
now you should see something like this when opening wezterm
3. Zoxid
Using zoxide
as a cd
command in terminal:
A smarter cd command. Supports all major shells. you can read install instruction from here.
zoxide is really awesome and with that you can easily find any path in your terminal. believe me it changing your life.
4. Exa
Using exa
as a ls
command in the terminal. you can read install instruction from here.
A modern replacement for ‘ls’. it’s a nice and cool tool you can use for decorating the terminal.
it’s my short-key for list command in fish shell you can put it here : ~/.config/fish/functions
.
5. RipGrep
Using RipGrep
as a replacement for grep.
you can read installation instruction here.
ripgrep recursively searches directories for a regex pattern while respecting your gitignore.
6. Bat
Using Bat
as a replacement for cat
. you can read installation instruction here.
A cat(1) clone with wings.
7. FD
Using fd
as a replacement for find
. you can read installation instruction here.
A simple, fast, and user-friendly alternative to ‘find’
8. GitUI
Using GitUI
for interacting with GIT. you can read installation instruction here.
Blazing 💥 fast terminal-UI for git written in rust 🦀
to add Vim like key-binding and some configutation add these file here : ~/.config/gitui
I hope in the future I can publish a new story about LESVIM and describe some vim/neovim and some of its packages.