mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-21 08:21:24 +02:00
feat: adjust nushell
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@@ -1177,11 +1177,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718333206,
|
"lastModified": 1718376599,
|
||||||
"narHash": "sha256-eilG1IDuHUiTCiE7gx+UbtbRPjSiEi600zg/eZeDIuw=",
|
"narHash": "sha256-cTFGqLYTrIxORc673fUUCecQVXiXHDj6Z8vFQ5K4SDg=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1740b0f87b1c4ff0ed5a499c0109fb71e7b6fd78",
|
"rev": "3bac01780f87646b70326db70920902bc4d49fab",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -115,6 +115,33 @@ $env.config = {
|
|||||||
# buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
# buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
||||||
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||||
edit_mode: emacs # emacs, vi
|
edit_mode: emacs # emacs, vi
|
||||||
shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
|
shell_integration: {
|
||||||
|
# osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
|
||||||
|
osc2: true
|
||||||
|
# osc7 is a way to communicate the path to the terminal, this is helpful for spawning new tabs in the same directory
|
||||||
|
osc7: true
|
||||||
|
# osc8 is also implemented as the deprecated setting ls.show_clickable_links, it shows clickable links in ls output if your terminal supports it. show_clickable_links is deprecated in favor of osc8
|
||||||
|
osc8: true
|
||||||
|
# osc9_9 is from ConEmu and is starting to get wider support. It's similar to osc7 in that it communicates the path to the terminal
|
||||||
|
osc9_9: false
|
||||||
|
# osc133 is several escapes invented by Final Term which include the supported ones below.
|
||||||
|
# 133;A - Mark prompt start
|
||||||
|
# 133;B - Mark prompt end
|
||||||
|
# 133;C - Mark pre-execution
|
||||||
|
# 133;D;exit - Mark execution finished with exit code
|
||||||
|
# This is used to enable terminals to know where the prompt is, the command is, where the command finishes, and where the output of the command is
|
||||||
|
osc133: true
|
||||||
|
# osc633 is closely related to osc133 but only exists in visual studio code (vscode) and supports their shell integration features
|
||||||
|
# 633;A - Mark prompt start
|
||||||
|
# 633;B - Mark prompt end
|
||||||
|
# 633;C - Mark pre-execution
|
||||||
|
# 633;D;exit - Mark execution finished with exit code
|
||||||
|
# 633;E - NOT IMPLEMENTED - Explicitly set the command line with an optional nonce
|
||||||
|
# 633;P;Cwd=<path> - Mark the current working directory and communicate it to the terminal
|
||||||
|
# and also helps with the run recent menu in vscode
|
||||||
|
osc633: true
|
||||||
|
# reset_application_mode is escape \x1b[?1l and was added to help ssh work better
|
||||||
|
reset_application_mode: true
|
||||||
|
}
|
||||||
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
let
|
{pkgs-unstable, ...}: let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ in {
|
|||||||
|
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs-unstable.nushell;
|
||||||
configFile.source = ./config.nu;
|
configFile.source = ./config.nu;
|
||||||
inherit shellAliases;
|
inherit shellAliases;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
dependencies = {
|
||||||
|
-- NOTE: additional parser
|
||||||
|
{ "nushell/tree-sitter-nu" },
|
||||||
|
},
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.incremental_selection = {
|
opts.incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ in {
|
|||||||
use ${nu_scripts}/share/nu_scripts/custom-completions/cargo/cargo-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/cargo/cargo-completions.nu *
|
||||||
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
||||||
# alias
|
# alias
|
||||||
use ${nu_scripts}/share/nu_scripts/aliases/git/git-aliases.nu *
|
# use ${nu_scripts}/share/nu_scripts/aliases/git/git-aliases.nu *
|
||||||
use ${nu_scripts}/share/nu_scripts/aliases/eza/eza-aliases.nu *
|
use ${nu_scripts}/share/nu_scripts/aliases/eza/eza-aliases.nu *
|
||||||
# use ${nu_scripts}/share/nu_scripts/aliases/bat/bat-aliases.nu *
|
use ${nu_scripts}/share/nu_scripts/aliases/bat/bat-aliases.nu *
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
##########################################################################
|
##########################################################################
|
||||||
@@ -80,7 +81,7 @@ in {
|
|||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
environment.shells = [
|
environment.shells = [
|
||||||
pkgs.zsh
|
pkgs.zsh
|
||||||
pkgs.nushellFull # my custom shell
|
pkgs-unstable.nushell # my custom shell
|
||||||
];
|
];
|
||||||
|
|
||||||
# homebrew need to be installed manually, see https://brew.sh
|
# homebrew need to be installed manually, see https://brew.sh
|
||||||
@@ -103,7 +104,7 @@ in {
|
|||||||
Wechat = 836500024;
|
Wechat = 836500024;
|
||||||
QQ = 451108668;
|
QQ = 451108668;
|
||||||
WeCom = 1189898970; # Wechat for Work
|
WeCom = 1189898970; # Wechat for Work
|
||||||
TecentMetting = 1484048379;
|
TecentMeeting = 1484048379;
|
||||||
QQMusic = 595615424;
|
QQMusic = 595615424;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -164,7 +165,7 @@ in {
|
|||||||
# Misc
|
# Misc
|
||||||
"shadowsocksx-ng" # proxy tool
|
"shadowsocksx-ng" # proxy tool
|
||||||
"iina" # video player
|
"iina" # video player
|
||||||
"raycast" # (HotKey: alt/option + space)search, caculate and run scripts(with many plugins)
|
"raycast" # (HotKey: alt/option + space)search, calculate and run scripts(with many plugins)
|
||||||
"stats" # beautiful system status monitor in menu bar
|
"stats" # beautiful system status monitor in menu bar
|
||||||
# "reaper" # audio editor
|
# "reaper" # audio editor
|
||||||
"sonic-pi" # music programming
|
"sonic-pi" # music programming
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# add user's shell into /etc/shells
|
# add user's shell into /etc/shells
|
||||||
environment.shells = with pkgs; [
|
environment.shells = with pkgs; [
|
||||||
bashInteractive
|
bashInteractive
|
||||||
nushellFull
|
pkgs-unstable.nushell
|
||||||
];
|
];
|
||||||
# set user's default shell system-wide
|
# set user's default shell system-wide
|
||||||
users.defaultUserShell = pkgs.bashInteractive;
|
users.defaultUserShell = pkgs.bashInteractive;
|
||||||
|
|||||||
Reference in New Issue
Block a user