mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
nu
This commit is contained in:
10 files changed
+9
-9
No files matched your search
@@ -0,0 +1,49 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-nushell-editor =
|
||||
{ ... }:
|
||||
{
|
||||
programs.nushell = {
|
||||
environmentVariables = {
|
||||
EDITOR = "hx";
|
||||
VISUAL = "hx";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
e = "hx";
|
||||
cop = "ide ~/copland";
|
||||
};
|
||||
#/nu/#
|
||||
extraConfig = ''
|
||||
def hxf [] {
|
||||
let picked = (
|
||||
do {
|
||||
fd --type f --hidden --exclude .git
|
||||
| fzf --preview 'bat --color=always --style=numbers {}'
|
||||
} | complete
|
||||
)
|
||||
|
||||
if $picked.exit_code != 0 { return }
|
||||
|
||||
let file = ($picked.stdout | str trim)
|
||||
if ($file | is-not-empty) { hx $file }
|
||||
}
|
||||
|
||||
def hxd [rev: string = "@"] {
|
||||
let files = (
|
||||
jj diff --revision $rev --name-only
|
||||
| lines
|
||||
| where { |line| ($line | str trim) != "" }
|
||||
)
|
||||
|
||||
if ($files | is-empty) {
|
||||
print $"(ansi yellow)($rev) no changes (ansi reset)"
|
||||
return
|
||||
}
|
||||
|
||||
hx ...$files
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user