The following source code block defines a nixon
configuration using YAML
:
# Enable "exact" matching algorithm.
exact_match: true
# Ignore case by default.
ignore_case: true
# Evaluate direnv environments.
use_direnv: true
# Evaluate nix shell environments.
use_nix: true
# Location of project directories.
project_dirs:
- ~/src
# Project types, with marker file detection.
project_types:
- name: cabal
test: ["cabal.project"]
desc: Cabal new-style project,
- name: npm
test: ["package.json"]
desc: NPM project,
- name: nix
test: ["flake.nix"]
desc: Nix flake project,
- name: git
test: [".git"]
desc: Git repository,
- name: rust
test: ["Cargo.toml"]
desc: Rust project,
- name: project
desc: Generic project
x-terminal-emulator
emacs
[
{"title": "Norwegian", "value": "Hei, Verden!"},
{"title": "English", "value": "Hello, World!"},
{"title": "French", "value": "Bonjour, Monde!"}
]
Select from one or more greetings in a JSON format.
cat
Use nmcli
to list available networks.
nmcli connection
Use the networks
placeholder to select a network to connect to.
# nmcli connection up "$1"
echo "$@"
The current project directory is available through the $nixon_project_path
environment variable.
echo "Project dir: $nixon_project_path"
nix-build
nix-shell
List all npm
scripts in a package.json
.
jq '.scripts | to_entries | map({ title: (.key + " → " + .value), value: .key })' package.json
Run a npm
script from package.json
.
npm run "$1"
npm install
yarn run "$1"
yarn install
cabal build
cabal run
cabal test
git log --oneline --color
git ls-files
Invoke git show
on commits selected from git log
. It uses multiple selection
and a field selector of 1
to pick the commit SHA1
from the log.
git show "$@"
Basic check for stdin
is readable when there are no stdin
placeholder args.
cat
rg --files
Open files in vim
passing files to open in through stdin
and xargs
.
xargs vim -p
Open files in vim
passing files to open in through stdin
and xargs
concatenating every stdin
input.
xargs vim -p
Open files in vim
passing files as a single positional argument.
vim -p "$1"
Open files in vim
passing files as positional arguments.
vim -p "$@"
Open files in vim
passing files in an environment variable.
vim -p $rg_files
Open files in vim
passing files in an environment variable.
vim -p $FILES