mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 19:17:45 +00:00
Add copy to clipboard command to nushell
This commit is contained in:
parent
8a118cc51a
commit
152d5d259e
4 changed files with 18 additions and 4 deletions
|
@ -231,6 +231,16 @@ $env.config.menus = [
|
||||||
]
|
]
|
||||||
|
|
||||||
$env.config.keybindings = [
|
$env.config.keybindings = [
|
||||||
|
{
|
||||||
|
name: copy_commandline
|
||||||
|
modifier: alt
|
||||||
|
keycode: char_c
|
||||||
|
mode: [ vi_normal vi_insert ]
|
||||||
|
event: {
|
||||||
|
send: executehostcommand
|
||||||
|
cmd: 'commandline | nu-highlight | $"```ansi\n($in)\n```" | copy'
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name: completion_menu
|
name: completion_menu
|
||||||
modifier: none
|
modifier: none
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ config, lib, pkgs, ... }: let
|
{ config, lib, pkgs, ... }: let
|
||||||
inherit (lib) enabled const filter first foldl' getExe last match mkIf nameValuePair optionalAttrs readFile removeAttrs splitString;
|
inherit (lib) enabled filter first foldl' getExe last match mkIf nameValuePair optionalAttrs readFile removeAttrs splitString;
|
||||||
in {
|
in {
|
||||||
users = optionalAttrs config.isLinux { defaultUserShell = pkgs.nushell; };
|
users = optionalAttrs config.isLinux { defaultUserShell = pkgs.nushell; };
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,16 @@ $env.ENV_CONVERSIONS.PATH = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def --env mc [path: path] {
|
def copy []: string -> nothing {
|
||||||
|
print -n $"(ansi osc)52;c;($in | encode base64)(ansi st)"
|
||||||
|
}
|
||||||
|
|
||||||
|
def --env mc [path: path]: nothing -> nothing {
|
||||||
mkdir $path
|
mkdir $path
|
||||||
cd $path
|
cd $path
|
||||||
}
|
}
|
||||||
|
|
||||||
def --env mcg [path: path] {
|
def --env mcg [path: path]: nothing -> nothing {
|
||||||
mkdir $path
|
mkdir $path
|
||||||
cd $path
|
cd $path
|
||||||
git init
|
git init
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
def main --wrapped [
|
def main --wrapped [
|
||||||
host: string = "" # The host to build.
|
host: string = "" # The host to build.
|
||||||
...arguments # The arguments to pass to `nixos-rebuild switch`.
|
...arguments # The arguments to pass to `nixos-rebuild switch`.
|
||||||
] {
|
]: nothing -> nothing {
|
||||||
let host = if ($host | is-not-empty) {
|
let host = if ($host | is-not-empty) {
|
||||||
$host
|
$host
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue