feat: morden cli tools

This commit is contained in:
Ryan Yin
2024-01-22 15:23:30 +08:00
parent 4f1c138a01
commit f51242ae08
5 changed files with 101 additions and 51 deletions

View File

@@ -32,7 +32,6 @@
# misc
pkgs-unstable.devbox
glow # markdown previewer
fzf
gdu # disk usage analyzer, required by AstroNvim
bfg-repo-cleaner # remove large files from git history
k6 # load testing tool

View File

@@ -43,6 +43,7 @@ in {
## Optional dependencies
fd # faster projectile indexing
imagemagick # for image-dired
fd # faster projectile indexing
zstd # for undo-fu-session/undo-tree compression
# go-mode

View File

@@ -132,7 +132,13 @@ Press `<Space> + D` to view available bindings and options.
| Description | Shortcut |
| ------------------------------------------------------------ | ---------------------------------------------------------------- |
| Open spectre.nvim search and replace panel | `<Space> + ss` |
| Search and replace in command line(need install `sad` first) | `find -name "*.nix" \| sad '<pattern>' '<replacement>' \| delta` |
Search and replace via cli(fd + sad + delta):
```bash
fd "\\.nix$" . | sad '<pattern>' '<replacement>' | delta
```
### Surrounding Characters

View File

@@ -1,21 +0,0 @@
{
pkgs,
nur-ryan4yin,
...
}: {
# a cat(1) clone with syntax highlighting and Git integration.
programs.bat = {
enable = true;
config = {
pager = "less -FR";
theme = "catppuccin-mocha";
};
themes = {
# https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme
catppuccin-mocha = {
src = nur-ryan4yin.packages.${pkgs.system}.catppuccin-bat;
file = "Catppuccin-mocha.tmTheme";
};
};
};
}

View File

@@ -1,13 +1,11 @@
{pkgs, ...}: {
{
pkgs,
nur-ryan4yin,
...
}: {
home.packages = with pkgs; [
neofetch
# archives
zip
xz
unzip
p7zip
# networking tools
mtr # A network diagnostic tool
iperf3
@@ -18,43 +16,66 @@
nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses
# Text Processing
# Docs: https://github.com/learnbyexample/Command-line-text-processing
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
gnused # GNU sed, very powerful(mainly for replacing text in files)
gnumake
just # a command runner like make, but simpler
gawk # GNU awk, a pattern scanning and processing language
delta # A viewer for git and diff output
# A fast and polyglot tool for code searching, linting, rewriting at large scale
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
ast-grep
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processer https://github.com/mikefarah/yq
sad # CLI search and replace, with diff preview, really useful!!!
lazygit # Git terminal UI.
# archives
zip
xz
unzip
p7zip
# misc
tldr
cowsay
file
findutils
which
tree
gnutar
zstd
caddy
gnupg
rsync
# Text Processing
# Docs: https://github.com/learnbyexample/Command-line-text-processing
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
gnused # GNU sed, very powerful(mainly for replacing text in files)
gnumake
gawk # GNU awk, a pattern scanning and processing language
jq # A lightweight and flexible command-line JSON processor
# morden cli tools, replacement of grep/sed/...
# Interactively filter its input using fuzzy searching, not limit to filenames.
fzf
# search for files by name, faster than find
fd
# search for files by its content, replacement of grep
(ripgrep.override {withPCRE2 = true;})
# A fast and polyglot tool for code searching, linting, rewriting at large scale
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
ast-grep
sad # CLI search and replace, just like sed, but with diff preview.
yq-go # yaml processer https://github.com/mikefarah/yq
just # a command runner like make, but simpler
delta # A viewer for git and diff output
lazygit # Git terminal UI.
hyperfine # command-line benchmarking tool
gping # ping, but with a graph(TUI)
doggo # DNS client for humans
duf # Disk Usage/Free Utility - a better 'df' alternative
du-dust # A more intuitive version of `du` in rust
ncdu # analyzer your disk usage Interactively, via TUI(replacement of `du`)
# nix related
#
# it provides the command `nom` works just like `nix
# with more details log output
nix-output-monitor
nodePackages.node2nix
# productivity
caddy
hugo # static site generator
glow # markdown previewer in terminal
];
@@ -69,6 +90,22 @@
icons = true;
};
# a cat(1) clone with syntax highlighting and Git integration.
bat = {
enable = true;
config = {
pager = "less -FR";
theme = "catppuccin-mocha";
};
themes = {
# https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme
catppuccin-mocha = {
src = nur-ryan4yin.packages.${pkgs.system}.catppuccin-bat;
file = "Catppuccin-mocha.tmTheme";
};
};
};
# A command-line fuzzy finder
fzf = {
enable = true;
@@ -90,11 +127,39 @@
};
};
# skim provides a single executable: sk.
# Basically anywhere you would want to use grep, try sk instead.
skim = {
# zoxide is a smarter cd command, inspired by z and autojump.
# It remembers which directories you use most frequently,
# so you can "jump" to them in just a few keystrokes.
# zoxide works on all major shells.
#
# z foo # cd into highest ranked directory matching foo
# z foo bar # cd into highest ranked directory matching foo and bar
# z foo / # cd into a subdirectory starting with foo
#
# z ~/foo # z also works like a regular cd command
# z foo/ # cd into relative path
# z .. # cd one level up
# z - # cd into previous directory
#
# zi foo # cd with interactive selection (using fzf)
#
# z foo<SPACE><TAB> # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only)
zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableNushellIntegration = true;
};
# Atuin replaces your existing shell history with a SQLite database,
# and records additional context for your commands.
# Additionally, it provides optional and fully encrypted
# synchronisation of your history between machines, via an Atuin server.
atuin = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableNushellIntegration = true;
};
};
}