mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-09-29 05:58:57 +02:00
implement nushell support
This commit is contained in:
parent
1d0fb8136d
commit
bbabd015e7
7 changed files with 61 additions and 4 deletions
25
.config/nushell/config.nu.cgt
Normal file
25
.config/nushell/config.nu.cgt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# The default config record. This is where much of your global configuration is setup.
|
||||||
|
$env.config = {
|
||||||
|
show_banner: false
|
||||||
|
|
||||||
|
table: {
|
||||||
|
mode: reinforced
|
||||||
|
index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
|
||||||
|
padding: { left: 0, right: 0 }
|
||||||
|
header_on_separator: true
|
||||||
|
}
|
||||||
|
|
||||||
|
completions: {
|
||||||
|
algorithm: "fuzzy"
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor_shape: {
|
||||||
|
vi_insert: line
|
||||||
|
vi_normal: block
|
||||||
|
}
|
||||||
|
|
||||||
|
edit_mode: vi
|
||||||
|
shell_integration: true
|
||||||
|
use_kitty_protocol: true
|
||||||
|
highlight_resolved_externals: true
|
||||||
|
}
|
5
.config/nushell/env.nu.cgt
Normal file
5
.config/nushell/env.nu.cgt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Nushell Environment Config File
|
||||||
|
#
|
||||||
|
# version = "0.92.1"
|
||||||
|
|
||||||
|
<% opt.system "prompt setup nu" %>
|
2
mzte-nv/conf/lua/pluginconf/p-nu.fnl
Normal file
2
mzte-nv/conf/lua/pluginconf/p-nu.fnl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
(local nu (require :nu))
|
||||||
|
(nu.setup {})
|
|
@ -7,7 +7,7 @@
|
||||||
;; Nix based parsers
|
;; Nix based parsers
|
||||||
(let [path mztenv.reg.tree_sitter_parsers]
|
(let [path mztenv.reg.tree_sitter_parsers]
|
||||||
(when path
|
(when path
|
||||||
(vim.opt.runtimepath:append path)))
|
(vim.opt.runtimepath:prepend path)))
|
||||||
|
|
||||||
(var parser-config (parsers.get_parser_configs))
|
(var parser-config (parsers.get_parser_configs))
|
||||||
|
|
||||||
|
@ -16,7 +16,11 @@
|
||||||
:branch :main}
|
:branch :main}
|
||||||
:filetype :haxe})
|
:filetype :haxe})
|
||||||
|
|
||||||
(configs.setup {:highlight {:enable true}
|
(local install-dir (.. (vim.loop.os_homedir) :/.local/share/nvim/ts-parsers))
|
||||||
|
(vim.opt.runtimepath:append install-dir)
|
||||||
|
|
||||||
|
(configs.setup {:parser_install_dir install-dir
|
||||||
|
:highlight {:enable true}
|
||||||
:autotag {:enable true}
|
:autotag {:enable true}
|
||||||
:indent {:enable true}
|
:indent {:enable true}
|
||||||
:playground {:enable true}
|
:playground {:enable true}
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
:recorder
|
:recorder
|
||||||
:tsn-actions
|
:tsn-actions
|
||||||
:dressing
|
:dressing
|
||||||
:gitsigns])
|
:gitsigns
|
||||||
|
:nu])
|
||||||
|
|
||||||
(local errors {})
|
(local errors {})
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ fn Renderer(comptime Writer: type) type {
|
||||||
|
|
||||||
fn renderShell(self: *Self) !void {
|
fn renderShell(self: *Self) !void {
|
||||||
switch (self.options.shell) {
|
switch (self.options.shell) {
|
||||||
.fish => {},
|
.fish, .nu => {},
|
||||||
.bash => {
|
.bash => {
|
||||||
const bgcol = Color{ .Grey = 150 };
|
const bgcol = Color{ .Grey = 150 };
|
||||||
const fgcol = Color.Black;
|
const fgcol = Color.Black;
|
||||||
|
|
|
@ -11,6 +11,25 @@ const setup_fmtstrs = struct {
|
||||||
\\end
|
\\end
|
||||||
\\
|
\\
|
||||||
;
|
;
|
||||||
|
const nu =
|
||||||
|
\\$env.PROMPT_COMMAND = {{ ||
|
||||||
|
\\ $env.MZPROMPT_SHELL = "nu"
|
||||||
|
\\ $env.MZPROMPT_STATUS = $env.LAST_EXIT_CODE
|
||||||
|
\\ $env.MZPROMPT_VI_MODE = "_none"
|
||||||
|
\\ $env.MZPROMPT_DURATION = $env.CMD_DURATION_MS
|
||||||
|
\\ $env.MZPROMPT_JOBS = 0
|
||||||
|
\\ {[argv0]s} show
|
||||||
|
\\}}
|
||||||
|
\\
|
||||||
|
\\$env.PROMPT_COMMAND_RIGHT = ""
|
||||||
|
\\
|
||||||
|
\\$env.PROMPT_INDICATOR = ""
|
||||||
|
\\$env.PROMPT_INDICATOR_VI_INSERT = ""
|
||||||
|
\\$env.PROMPT_INDICATOR_VI_NORMAL = "〉"
|
||||||
|
\\$env.PROMPT_MULTILINE_INDICATOR = "::: "
|
||||||
|
\\$env.PROMPT_INDICATOR = ""
|
||||||
|
\\
|
||||||
|
;
|
||||||
const bash =
|
const bash =
|
||||||
\\__mzprompt_show() {{
|
\\__mzprompt_show() {{
|
||||||
\\ export MZPROMPT_STATUS="$?"
|
\\ export MZPROMPT_STATUS="$?"
|
||||||
|
@ -27,6 +46,7 @@ const setup_fmtstrs = struct {
|
||||||
|
|
||||||
pub const Shell = enum {
|
pub const Shell = enum {
|
||||||
fish,
|
fish,
|
||||||
|
nu,
|
||||||
bash,
|
bash,
|
||||||
|
|
||||||
pub fn writeInitCode(self: Shell, argv0: []const u8, writer: anytype) !void {
|
pub fn writeInitCode(self: Shell, argv0: []const u8, writer: anytype) !void {
|
||||||
|
|
Loading…
Reference in a new issue