From 99325b98cf679210b32e4627192a1e7e442d1c58 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 23 Aug 2023 22:59:04 +0200 Subject: [PATCH] Improved multiple config files --- .config/alacritty/alacritty.yml | 135 +---- .config/nushell/alias.nu | 32 +- .config/nushell/config.nu | 816 +-------------------------- .config/nushell/env.nu | 67 +-- .config/nvim/lazy-lock.json | 6 +- .config/nvim/lua/config/autocmds.lua | 11 +- 6 files changed, 36 insertions(+), 1031 deletions(-) diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml index f190e3e..49850cd 100644 --- a/.config/alacritty/alacritty.yml +++ b/.config/alacritty/alacritty.yml @@ -1,154 +1,21 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. TERM: alacritty LANG: "en_US.UTF-8" LC_CTYPE: en_US.UTF-8 - #window: - # Window background opacity - # - # Specified in floating number from `0.0` to `1.0`. - # The value `0.0` is completely transparent and `1.0` is opaque. - #opacity: 1.0 - # Window dimensions (changes require restart) - # - # Specified in number of columns/lines, not pixels. - # If both are `0`, this setting is ignored. - #dimensions: - # columns: 0 - # lines: 0 - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. - #position: - # x: 0 - # y: 0 - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - #padding: - # x: 0 - # y: 0 - # Spread additional padding evenly around the terminal content. - #dynamic_padding: false - # Window decorations - # - # Values for `decorations`: - # - full: Borders and title bar - # - none: Neither borders nor title bar - # - # Values for `decorations` (macOS only): - # - transparent: Title bar, transparent background and title bar buttons - # - buttonless: Title bar, transparent background, but no title bar buttons - #decorations: full - # Startup Mode (changes require restart) - # - # Values for `startup_mode`: - # - Windowed - # - Maximized - # - Fullscreen - # - # Values for `startup_mode` (macOS only): - # - SimpleFullscreen - #startup_mode: Windowed - # Window title - #title: Alacritty - # Window class (Linux/BSD only): - #class: - # Application instance name - #instance: Alacritty - # General application class - #general: Alacritty - # GTK theme variant (Linux/BSD only) - # - # Override the variant of the GTK theme. Commonly supported values are `dark` and `light`. - # Set this to `None` to use the default theme variant. - #gtk_theme_variant: None - #scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - #history: 10000 - # Number of lines the viewport will move for every line scrolled when - # scrollback is enabled (history > 0). - #multiplier: 3 -# Font configuration font: - # Normal (roman) font face normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux/BSD) monospace - # - (Windows) Consolas family: "UbuntuMono Nerd Font" - - # The `style` can be specified to pick a specific face. style: Regular - # Bold font face - #bold: - # Font family - # - # If the bold family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - # The `style` can be specified to pick a specific face. - #style: Bold - # Italic font face - #italic: - # Font family - # - # If the italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - # The `style` can be specified to pick a specific face. - #style: Italic - # Bold italic font face - #bold_italic: - # Font family - # - # If the bold italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: monospace - # The `style` can be specified to pick a specific face. - #style: Bold Italic - # Point size size: 14 - # Offset is the extra space around each character. `offset.y` can be thought of - # as modifying the line spacing, and `offset.x` as modifying the letter spacing. - #offset: - # x: 0 - # y: 0 - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the right, - # increasing `y` moves the glyph upwards. - #glyph_offset: - # x: 0 - # y: 0 key_bindings: - { key: F11, action: ToggleFullscreen } window: - opacity: 1.0 - #startup_mode: "Fullscreen" + opacity: 0.9 -# If `true`, bold text is drawn using the bright color variants. -#draw_bold_text_with_bright_colors: false -# Colors (Tomorrow Night Bright) colors: name: vscode (dark) author: senpai-10 diff --git a/.config/nushell/alias.nu b/.config/nushell/alias.nu index 2999e55..2a2c756 100644 --- a/.config/nushell/alias.nu +++ b/.config/nushell/alias.nu @@ -1,21 +1,19 @@ -# Environment -$env.EDITOR = 'nvim' -$env.GOPATH = $"($env.HOME)/.go" - -# Aliases -alias gb = go build -alias gt = go test -alias gd = git diff -alias gp = git pull -alias gs = git status +# System +alias cls = clear alias hex = hexdump -C -alias home = git $"--git-dir=($env.HOME)/.home/" $"--work-tree=($env.HOME)" alias ll = ls -la -alias n = nvim alias p = cd ~/projects -# Functions -def np [] { - p - n -} +# Go +alias gb = go build +alias gt = go test + +# Git +alias gd = git diff +alias gl = git log --oneline +alias gp = git pull +alias gs = git status +alias home = git $"--git-dir=($env.HOME)/.home/" $"--work-tree=($env.HOME)" + +# Neovim +alias e = nvim diff --git a/.config/nushell/config.nu b/.config/nushell/config.nu index 5ba8c04..69e171e 100644 --- a/.config/nushell/config.nu +++ b/.config/nushell/config.nu @@ -1,811 +1,7 @@ -# Nushell Config File -# -# version = 0.82.1 - -# For more information on defining custom themes, see -# https://www.nushell.sh/book/coloring_and_theming.html -# And here is the theme collection -# https://github.com/nushell/nu_scripts/tree/main/themes -let dark_theme = { - # color for nushell primitives - separator: white - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - # Closures can be used to choose colors for specific values. - # The value (in this case, a bool) is piped into the closure. - bool: {|| if $in { 'light_cyan' } else { 'light_gray' } } - int: white - filesize: {|e| - if $e == 0b { - 'white' - } else if $e < 1mb { - 'cyan' - } else { 'blue' } - } - duration: white - date: {|| (date now) - $in | - if $in < 1hr { - 'purple' - } else if $in < 6hr { - 'red' - } else if $in < 1day { - 'yellow' - } else if $in < 3day { - 'green' - } else if $in < 1wk { - 'light_green' - } else if $in < 6wk { - 'cyan' - } else if $in < 52wk { - 'blue' - } else { 'dark_gray' } - } - range: white - float: white - string: white - nothing: white - binary: white - cellpath: white - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - search_result: {bg: red fg: white} - shape_and: purple_bold - shape_binary: purple_bold - shape_block: blue_bold - shape_bool: light_cyan - shape_closure: green_bold - shape_custom: green - shape_datetime: cyan_bold - shape_directory: cyan - shape_external: cyan - shape_externalarg: green_bold - shape_filepath: cyan - shape_flag: blue_bold - shape_float: purple_bold - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: white bg: red attr: b} - shape_globpattern: cyan_bold - shape_int: purple_bold - shape_internalcall: cyan_bold - shape_list: cyan_bold - shape_literal: blue - shape_match_pattern: green - shape_matching_brackets: { attr: u } - shape_nothing: light_cyan - shape_operator: yellow - shape_or: purple_bold - shape_pipe: purple_bold - shape_range: yellow_bold - shape_record: cyan_bold - shape_redirection: purple_bold - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_table: blue_bold - shape_variable: purple - shape_vardecl: purple -} - -let light_theme = { - # color for nushell primitives - separator: dark_gray - leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off - header: green_bold - empty: blue - # Closures can be used to choose colors for specific values. - # The value (in this case, a bool) is piped into the closure. - bool: {|| if $in { 'dark_cyan' } else { 'dark_gray' } } - int: dark_gray - filesize: {|e| - if $e == 0b { - 'dark_gray' - } else if $e < 1mb { - 'cyan_bold' - } else { 'blue_bold' } - } - duration: dark_gray - date: {|| (date now) - $in | - if $in < 1hr { - 'purple' - } else if $in < 6hr { - 'red' - } else if $in < 1day { - 'yellow' - } else if $in < 3day { - 'green' - } else if $in < 1wk { - 'light_green' - } else if $in < 6wk { - 'cyan' - } else if $in < 52wk { - 'blue' - } else { 'dark_gray' } - } - range: dark_gray - float: dark_gray - string: dark_gray - nothing: dark_gray - binary: dark_gray - cellpath: dark_gray - row_index: green_bold - record: white - list: white - block: white - hints: dark_gray - search_result: {fg: white bg: red} - shape_and: purple_bold - shape_binary: purple_bold - shape_block: blue_bold - shape_bool: light_cyan - shape_closure: green_bold - shape_custom: green - shape_datetime: cyan_bold - shape_directory: cyan - shape_external: cyan - shape_externalarg: green_bold - shape_filepath: cyan - shape_flag: blue_bold - shape_float: purple_bold - # shapes are used to change the cli syntax highlighting - shape_garbage: { fg: white bg: red attr: b} - shape_globpattern: cyan_bold - shape_int: purple_bold - shape_internalcall: cyan_bold - shape_list: cyan_bold - shape_literal: blue - shape_match_pattern: green - shape_matching_brackets: { attr: u } - shape_nothing: light_cyan - shape_operator: yellow - shape_or: purple_bold - shape_pipe: purple_bold - shape_range: yellow_bold - shape_record: cyan_bold - shape_redirection: purple_bold - shape_signature: green_bold - shape_string: green - shape_string_interpolation: cyan_bold - shape_table: blue_bold - shape_variable: purple - shape_vardecl: purple -} - -# External completer example -# let carapace_completer = {|spans| -# carapace $spans.0 nushell $spans | from json -# } - - -# The default config record. This is where much of your global configuration is setup. -$env.config = { - show_banner: false # true or false to enable or disable the welcome banner at startup - - ls: { - use_ls_colors: true # use the LS_COLORS environment variable to colorize output - clickable_links: true # enable or disable clickable links. Your terminal has to support links. - } - - rm: { - always_trash: false # always act as if -t was given. Can be overridden with -p - } - - cd: { - abbreviations: false # allows `cd s/o/f` to expand to `cd some/other/folder` - } - - table: { - mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other - index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column - show_empty: true # show 'empty list' and 'empty record' placeholders for command output - trim: { - methodology: wrapping # wrapping or truncating - wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology - truncating_suffix: "..." # A suffix used by the 'truncating' methodology - } - } - - # datetime_format determines what a datetime rendered in the shell would look like. - # Behavior without this configuration point will be to "humanize" the datetime display, - # showing something like "a day ago." - datetime_format: { - # normal: '%a, %d %b %Y %H:%M:%S %z' # shows up in displays of variables or other datetime's outside of tables - # table: '%m/%d/%y %I:%M:%S%p' # generally shows up in tabular outputs such as ls. commenting this out will change it to the default human readable datetime format - } - - explore: { - try: { - border_color: {fg: "white"} - }, - status_bar_background: {fg: "#1D1F21", bg: "#C4C9C6"}, - command_bar_text: {fg: "#C4C9C6"}, - highlight: {fg: "black", bg: "yellow"}, - status: { - error: {fg: "white", bg: "red"}, - warn: {} - info: {} - }, - table: { - split_line: {fg: "#404040"}, - selected_cell: {}, - selected_row: {}, - selected_column: {}, - cursor: true, - line_head_top: true, - line_head_bottom: true, - line_shift: true, - line_index: true, - }, - config: { - border_color: {fg: "white"} - cursor_color: {fg: "black", bg: "light_yellow"} - }, - } - - history: { - max_size: 100_000 # Session has to be reloaded for this to take effect - sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file - file_format: "sqlite" # "sqlite" or "plaintext" - isolation: true # only available with sqlite file_format. true enables history isolation, false disables it. true will allow the history to be isolated to the current session using up/down arrows. false will allow the history to be shared across all sessions. - } - - completions: { - case_sensitive: false # set to true to enable case-sensitive completions - quick: true # set this to false to prevent auto-selecting completions when only one remains - partial: true # set this to false to prevent partial filling of the prompt - algorithm: "prefix" # prefix or fuzzy - external: { - enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow - max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options - completer: null # check 'carapace_completer' above as an example - } - } - - filesize: { - metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard) - format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, auto - } - - cursor_shape: { - emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line (line is the default) - vi_insert: block # block, underscore, line , blink_block, blink_underscore, blink_line (block is the default) - vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line (underscore is the default) - } - - color_config: {} # if you want a more interesting theme, you can replace the empty record with `$dark_theme`, `$light_theme` or another custom record - use_grid_icons: true - footer_mode: "25" # always, never, number_of_rows, auto - float_precision: 2 # the precision for displaying floats in tables - buffer_editor: "" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL - use_ansi_coloring: true - bracketed_paste: true # enable bracketed paste, currently useless on windows - edit_mode: emacs # emacs, vi - shell_integration: false # enables terminal shell integration. Off by default, as some terminals have issues with this. - 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. - - hooks: { - pre_prompt: [{ null }] # run before the prompt is shown - pre_execution: [{ null }] # run before the repl input is run - env_change: { - PWD: [{|before, after| null }] # run if the PWD environment is different since the last repl input - } - display_output: { table } # run before the output of a command is drawn, example: `{ if (term size).columns >= 100 { table -e } else { table } }` - command_not_found: { null } # return an error message when a command is not found - } - - menus: [ - # Configuration for default nushell menus - # Note the lack of source parameter - { - name: completion_menu - only_buffer_difference: false - marker: "| " - type: { - layout: columnar - columns: 4 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width - col_padding: 2 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - { - name: history_menu - only_buffer_difference: true - marker: "? " - type: { - layout: list - page_size: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - { - name: help_menu - only_buffer_difference: true - marker: "? " - type: { - layout: description - columns: 4 - col_width: 20 # Optional value. If missing all the screen width is used to calculate column width - col_padding: 2 - selection_rows: 4 - description_rows: 10 - } - style: { - text: green - selected_text: green_reverse - description_text: yellow - } - } - ] - - keybindings: [ - { - name: completion_menu - modifier: none - keycode: tab - mode: [emacs vi_normal vi_insert] - event: { - until: [ - { send: menu name: completion_menu } - { send: menunext } - ] - } - } - { - name: history_menu - modifier: control - keycode: char_r - mode: [emacs, vi_insert, vi_normal] - event: { send: menu name: history_menu } - } - { - name: help_menu - modifier: none - keycode: f1 - mode: [emacs, vi_insert, vi_normal] - event: { send: menu name: help_menu } - } - { - name: completion_previous_menu - modifier: shift - keycode: backtab - mode: [emacs, vi_normal, vi_insert] - event: { send: menuprevious } - } - { - name: next_page_menu - modifier: control - keycode: char_x - mode: emacs - event: { send: menupagenext } - } - { - name: undo_or_previous_page_menu - modifier: control - keycode: char_z - mode: emacs - event: { - until: [ - { send: menupageprevious } - { edit: undo } - ] - } - } - { - name: escape - modifier: none - keycode: escape - mode: [emacs, vi_normal, vi_insert] - event: { send: esc } # NOTE: does not appear to work - } - { - name: cancel_command - modifier: control - keycode: char_c - mode: [emacs, vi_normal, vi_insert] - event: { send: ctrlc } - } - { - name: quit_shell - modifier: control - keycode: char_d - mode: [emacs, vi_normal, vi_insert] - event: { send: ctrld } - } - { - name: clear_screen - modifier: control - keycode: char_l - mode: [emacs, vi_normal, vi_insert] - event: { send: clearscreen } - } - { - name: search_history - modifier: control - keycode: char_r - mode: [emacs, vi_normal, vi_insert] - event: { send: searchhistory } - } - { - name: open_command_editor - modifier: control - keycode: char_o - mode: [emacs, vi_normal, vi_insert] - event: { send: openeditor } - } - { - name: move_up - modifier: none - keycode: up - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: menuup} - {send: up} - ] - } - } - { - name: move_down - modifier: none - keycode: down - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: menudown} - {send: down} - ] - } - } - { - name: move_left - modifier: none - keycode: left - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: menuleft} - {send: left} - ] - } - } - { - name: move_right_or_take_history_hint - modifier: none - keycode: right - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: historyhintcomplete} - {send: menuright} - {send: right} - ] - } - } - { - name: move_one_word_left - modifier: control - keycode: left - mode: [emacs, vi_normal, vi_insert] - event: {edit: movewordleft} - } - { - name: move_one_word_right_or_take_history_hint - modifier: control - keycode: right - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: historyhintwordcomplete} - {edit: movewordright} - ] - } - } - { - name: move_to_line_start - modifier: none - keycode: home - mode: [emacs, vi_normal, vi_insert] - event: {edit: movetolinestart} - } - { - name: move_to_line_start - modifier: control - keycode: char_a - mode: [emacs, vi_normal, vi_insert] - event: {edit: movetolinestart} - } - { - name: move_to_line_end_or_take_history_hint - modifier: none - keycode: end - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: historyhintcomplete} - {edit: movetolineend} - ] - } - } - { - name: move_to_line_end_or_take_history_hint - modifier: control - keycode: char_e - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: historyhintcomplete} - {edit: movetolineend} - ] - } - } - { - name: move_to_line_start - modifier: control - keycode: home - mode: [emacs, vi_normal, vi_insert] - event: {edit: movetolinestart} - } - { - name: move_to_line_end - modifier: control - keycode: end - mode: [emacs, vi_normal, vi_insert] - event: {edit: movetolineend} - } - { - name: move_up - modifier: control - keycode: char_p - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: menuup} - {send: up} - ] - } - } - { - name: move_down - modifier: control - keycode: char_t - mode: [emacs, vi_normal, vi_insert] - event: { - until: [ - {send: menudown} - {send: down} - ] - } - } - { - name: delete_one_character_backward - modifier: none - keycode: backspace - mode: [emacs, vi_insert] - event: {edit: backspace} - } - { - name: delete_one_word_backward - modifier: control - keycode: backspace - mode: [emacs, vi_insert] - event: {edit: backspaceword} - } - { - name: delete_one_character_forward - modifier: none - keycode: delete - mode: [emacs, vi_insert] - event: {edit: delete} - } - { - name: delete_one_character_forward - modifier: control - keycode: delete - mode: [emacs, vi_insert] - event: {edit: delete} - } - { - name: delete_one_character_forward - modifier: control - keycode: char_h - mode: [emacs, vi_insert] - event: {edit: backspace} - } - { - name: delete_one_word_backward - modifier: control - keycode: char_w - mode: [emacs, vi_insert] - event: {edit: backspaceword} - } - { - name: move_left - modifier: none - keycode: backspace - mode: vi_normal - event: {edit: moveleft} - } - { - name: newline_or_run_command - modifier: none - keycode: enter - mode: emacs - event: {send: enter} - } - { - name: move_left - modifier: control - keycode: char_b - mode: emacs - event: { - until: [ - {send: menuleft} - {send: left} - ] - } - } - { - name: move_right_or_take_history_hint - modifier: control - keycode: char_f - mode: emacs - event: { - until: [ - {send: historyhintcomplete} - {send: menuright} - {send: right} - ] - } - } - { - name: redo_change - modifier: control - keycode: char_g - mode: emacs - event: {edit: redo} - } - { - name: undo_change - modifier: control - keycode: char_z - mode: emacs - event: {edit: undo} - } - { - name: paste_before - modifier: control - keycode: char_y - mode: emacs - event: {edit: pastecutbufferbefore} - } - { - name: cut_word_left - modifier: control - keycode: char_w - mode: emacs - event: {edit: cutwordleft} - } - { - name: cut_line_to_end - modifier: control - keycode: char_k - mode: emacs - event: {edit: cuttoend} - } - { - name: cut_line_from_start - modifier: control - keycode: char_u - mode: emacs - event: {edit: cutfromstart} - } - { - name: swap_graphemes - modifier: control - keycode: char_t - mode: emacs - event: {edit: swapgraphemes} - } - { - name: move_one_word_left - modifier: alt - keycode: left - mode: emacs - event: {edit: movewordleft} - } - { - name: move_one_word_right_or_take_history_hint - modifier: alt - keycode: right - mode: emacs - event: { - until: [ - {send: historyhintwordcomplete} - {edit: movewordright} - ] - } - } - { - name: move_one_word_left - modifier: alt - keycode: char_b - mode: emacs - event: {edit: movewordleft} - } - { - name: move_one_word_right_or_take_history_hint - modifier: alt - keycode: char_f - mode: emacs - event: { - until: [ - {send: historyhintwordcomplete} - {edit: movewordright} - ] - } - } - { - name: delete_one_word_forward - modifier: alt - keycode: delete - mode: emacs - event: {edit: deleteword} - } - { - name: delete_one_word_backward - modifier: alt - keycode: backspace - mode: emacs - event: {edit: backspaceword} - } - { - name: delete_one_word_backward - modifier: alt - keycode: char_m - mode: emacs - event: {edit: backspaceword} - } - { - name: cut_word_to_right - modifier: alt - keycode: char_d - mode: emacs - event: {edit: cutwordright} - } - { - name: upper_case_word - modifier: alt - keycode: char_u - mode: emacs - event: {edit: uppercaseword} - } - { - name: lower_case_word - modifier: alt - keycode: char_l - mode: emacs - event: {edit: lowercaseword} - } - { - name: capitalize_char - modifier: alt - keycode: char_c - mode: emacs - event: {edit: capitalizechar} - } - ] -} - +source ~/.config/nushell/prompt.nu source ~/.config/nushell/alias.nu + +$env.config.show_banner = false +$env.config.history.file_format = "sqlite" +$env.config.history.isolation = true +$env.config.hooks.pre_prompt = [{print $"(ansi title)(whoami)@(hostname)(ansi st)"}] diff --git a/.config/nushell/env.nu b/.config/nushell/env.nu index 67e6d01..855aa1d 100644 --- a/.config/nushell/env.nu +++ b/.config/nushell/env.nu @@ -1,65 +1,2 @@ -# Nushell Environment Config File -# -# version = 0.82.1 - -def create_left_prompt [] { - mut home = "" - try { - if $nu.os-info.name == "windows" { - $home = $env.USERPROFILE - } else { - $home = $env.HOME - } - } - - let dir = ([ - ($env.PWD | str substring 0..($home | str length) | str replace --string $home "~"), - ($env.PWD | str substring ($home | str length)..) - ] | str join) - - let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold }) - let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold }) - let path_segment = $"($path_color)($dir)" - - $path_segment | str replace --all --string (char path_sep) $"($separator_color)/($path_color)" -} - -# Use nushell functions to define your right and left prompt -$env.PROMPT_COMMAND = {|| create_left_prompt } -# $env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt } -$env.PROMPT_COMMAND_RIGHT = "" - -# The prompt indicators are environmental variables that represent -# the state of the prompt -$env.PROMPT_INDICATOR = {|| " > " } -$env.PROMPT_INDICATOR_VI_INSERT = {|| " : " } -$env.PROMPT_INDICATOR_VI_NORMAL = {|| " > " } -$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " } - -# Specifies how environment variables are: -# - converted from a string to a value on Nushell startup (from_string) -# - converted from a value back to a string when running external commands (to_string) -# Note: The conversions happen *after* config.nu is loaded -$env.ENV_CONVERSIONS = { - "PATH": { - from_string: { |s| $s | split row (char esep) | path expand --no-symlink } - to_string: { |v| $v | path expand --no-symlink | str join (char esep) } - } - "Path": { - from_string: { |s| $s | split row (char esep) | path expand --no-symlink } - to_string: { |v| $v | path expand --no-symlink | str join (char esep) } - } -} - -# Directories to search for scripts when calling source or use -$env.NU_LIB_DIRS = [ - # ($nu.default-config-dir | path join 'scripts') # add /scripts -] - -# Directories to search for plugin binaries when calling register -$env.NU_PLUGIN_DIRS = [ - # ($nu.default-config-dir | path join 'plugins') # add /plugins -] - -# To add entries to PATH (on Windows you might use Path), you can use the following pattern: -# $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path') +$env.EDITOR = "nvim" +$env.GOPATH = $"($env.HOME)/.go" diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 84384ac..faefec5 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,15 +7,15 @@ "flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" }, "gitsigns.nvim": { "branch": "main", "commit": "749267aaa863c30d721c9913699c5d94e0c07dd3" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, - "neodev.nvim": { "branch": "main", "commit": "02d5988929635fe913daa60f19b909e6a7b23c58" }, + "neodev.nvim": { "branch": "main", "commit": "f8a4200951189f7c831cfb698a2e05791e9fd83c" }, "noice.nvim": { "branch": "main", "commit": "894db25ec726d32047799d4d0a982b701bec453b" }, "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, - "nvim-lspconfig": { "branch": "master", "commit": "93c6826b16217eaef568ca5c224ea5d0c12bbb82" }, + "nvim-lspconfig": { "branch": "master", "commit": "1cfb96490c3889a2c57d1ef5e1acc59e9b47c455" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-spectre": { "branch": "master", "commit": "eb17a856a6f17e03d8d610cbc00cd9f2f39e3fd7" }, "nvim-tree.lua": { "branch": "master", "commit": "920868dba13466586897a8f40220eca6b2caac41" }, - "nvim-treesitter": { "branch": "master", "commit": "2ee71c1a2fa74c10692be10ae420ff0c3a02eb3c" }, + "nvim-treesitter": { "branch": "master", "commit": "05fe2c38a3bd4f889ac13f1735685ab348d95346" }, "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, "nvterm": { "branch": "main", "commit": "5ae78fb332e92447121d2af58a6313189a7799fb" }, "onedark.nvim": { "branch": "master", "commit": "09b71d84bd2524438e48c0aa5b54d855cc72af32" }, diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index 0466de8..2497866 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -2,13 +2,18 @@ local on = vim.api.nvim_create_autocmd on("VimEnter", { callback = function() - require("nvim-tree.api").tree.toggle({ focus = false }) + local files = require("nvim-tree.api") + local width = vim.go.columns + + if width > 120 then + files.tree.toggle({ focus = false }) + end end, }) on({ "TermOpen", "TermEnter" }, { callback = function() - vim.wo.signcolumn = "no" + vim.opt_local.signcolumn = "no" end, }) @@ -19,3 +24,5 @@ on({ "BufNewFile", "BufRead" }, { vim.opt_local.signcolumn = "no" end, }) + +