An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
April 10, 2022 05:28 am GMT
Original Link: https://dev.to/timwjames/command-line-tools-for-productive-developers-pph
Command Line Tools for Productive Developers
This guide is a compilation of various command line tools that will improve your productivity in addition to various quality-of-life features.
Note: for any npm
packages, make sure to install globally with -g
.
Getting Started
- Download a Nerd Font and set your favourite terminal to use it. I like
Cascaydia Cove Nerd Font
the best. - See my guide for setting up a custom prompt and various plugins using oh-my-zsh. This also includes some useful aliases, keybinds and terminals to use for different platforms.
General Productivity
tmux
: Terminal multiplexer that gives you tabs, panes and more natively in the shell. With tmux, you can detach terminal sessions so that they continue running in the background, restore sessions, and even reattach them to a different terminal.bat
: Bettercat
- supports syntax highlighting for a large number of programming and markup languages.diff-so-fancy
: Makes your diffs human readable instead of machine readable. Go here to see usage with Git.- Can be used with
diff
, as in this alias:
- Can be used with
diffs() { diff -u $1 $2 | diff-so-fancy}
tldr
: Betterman
(manual) pages.thefuck
: Corrects errors in previous console commands.how2
: Finds the simplest way to do something in a unix shell using a natural language query.direnv
: Load and unload environment variables depending on the current directory (foroh-my-zsh
users, see this alternative)glow
: Terminal based markdown reader.
Search
fzf
: General-purpose command-line fuzzy finder.- fzf can be used for tab completion, history search and more.
- If you are using oh-my-zsh, add
fzf
to your plugins for keybinds and more. - You can use fzf to search and
bat
for file previews using this alias:
if [[ -x "$(command -v fzf)" ]] && [[ -x "$(command -v bat)" ]]; then alias fp="fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'"fi
rg
: Bettergrep
- ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.
Directory Navigation & Management
colorls
: Colorizes thels
output with color and icons (requiresgem
).- Includes many useful flags, such as
--gs
for Git status, or-t
for a tree view: - I use an alias to replace
ls
withcolorls
:
- Includes many useful flags, such as
if [ -x "$(command -v colorls)" ]; then alias ls="colorls" alias la="colorls -al"fi
exa
: Alternative tocolorls
(though without the icons).tree
: Visualize directories in a tree-like format (lightweight alternative tocolorls
with the-t
flag).z
: Quickly jump between directories based on history (Forzsh
users, it is easier to install this plugin)
Utilities
vtop
: A graphical activity monitor for the command line.croc
: Simple file transfer via CLI.secman
: CLI password manager.
Git
- 'gh': GitHub CLI - view pull requests, issues, and other GitHub concepts in the terminal.
gitui
: Git GUI in your terminal.diff-so-fancy
: Makes your diffs human readable instead of machine readable.- Add the following to your
.gitconfig
:
- Add the following to your
[alias] dsf = diff --color[interactive] diffFilter = diff-so-fancy --patch[color] ui = true[color "diff-highlight"] oldNormal = red bold oldHighlight = red bold 52 newNormal = green bold newHighlight = green bold 22[color "diff"] meta = 11 frag = magenta bold func = 146 bold commit = yellow bold old = red bold new = green bold whitespace = red reverse
- commitizen: Get prompted to fill out any required commit fields at commit time.
Specialized Tools
Depending on what technologies you work with day-to-day,
jq
: JSON processor.- 'httpie`: Command-line HTTP client (better
curl
). k9s
: Manage your Kubernetes clusters in style.
Next Steps
- Use oh-my-zsh to install some zsh plugins. I've created a guide for that here. Some notable plugins include:
- Autocomplete
- Autosuggestions
- Syntax highlighting
.env
auto loading- Clipboard CLI utilities
web-search
for using search engines via CLI
- Create some aliases for frequently used commands. See all my aliases in my
aliases.zsh
. Note that for git aliases, it is best to define them in your.gitconfig
.
Original Link: https://dev.to/timwjames/command-line-tools-for-productive-developers-pph
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To