commit 2d9f13f9ab3e7f73c4bf254e32af9e3877011510 Author: hmeens Date: Fri Mar 20 16:44:13 2026 +0100 feat: initial commit diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..9971731 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,8 @@ +[font] +# size = 8.0 +size = 12.0 +[general] + +# import = [ +# "~/.config/alacritty/color.toml" +# ] diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..6abfe63 --- /dev/null +++ b/.config/alacritty/alacritty.yml @@ -0,0 +1,896 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# 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 + +#window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + #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 and no title bar buttons + #decorations: full + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + #opacity: 1.0 + + # 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 + + # Allow terminal applications to change Alacritty's window title. + #dynamic_title: true + + # Window class (Linux/BSD only): + #class: + # Application instance name + #instance: Alacritty + # General application class + #general: Alacritty + + # Decorations theme variant (Linux/BSD only) + # + # Override the variant of the GTK theme/Wayland client side decorations. + # Commonly supported values are `dark` and `light`. Set this to `None` to use + # the default theme variant. + #decorations_theme_variant: None + +#scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + #history: 10000 + + # Scrolling distance multiplier. + #multiplier: 3 + +# Font configuration +font: + # Normal (roman) font face + #normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + #family: monospace + + # 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: 8.0 + + # 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 upward. + #glyph_offset: + # x: 0 + # y: 0 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + #builtin_box_drawing: true + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: false + +# Colors (Tomorrow Night) +#colors: + # Default colors + #primary: + # background: '#1d1f21' + # foreground: '#c5c8c6' + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not + # present. If the bright foreground color is not set, or + # `draw_bold_text_with_bright_colors` is `false`, the normal foreground + # color will be used. + #dim_foreground: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #cursor: + # text: CellBackground + # cursor: CellForeground + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #vi_mode_cursor: + # text: CellBackground + # cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + #search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #matches: + # foreground: '#000000' + # background: '#ffffff' + #focused_match: + # foreground: '#ffffff' + # background: '#000000' + + # Keyboard hints + #hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #start: + # foreground: '#1d1f21' + # background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #end: + # foreground: '#e9ff5e' + # background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + #footer_bar: + # background: '#c5c8c6' + # foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + #selection: + # text: CellBackground + # background: CellForeground + + # Normal colors + #normal: + # black: '#1d1f21' + # red: '#cc6666' + # green: '#b5bd68' + # yellow: '#f0c674' + # blue: '#81a2be' + # magenta: '#b294bb' + # cyan: '#8abeb7' + # white: '#c5c8c6' + + # Bright colors + #bright: + # black: '#666666' + # red: '#d54e53' + # green: '#b9ca4a' + # yellow: '#e7c547' + # blue: '#7aa6da' + # magenta: '#c397d8' + # cyan: '#70c0b1' + # white: '#eaeaea' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '#131415' + # red: '#864343' + # green: '#777c44' + # yellow: '#9e824c' + # blue: '#556a7d' + # magenta: '#75617b' + # cyan: '#5b7d78' + # white: '#828482' + + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + #duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +#selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + #save_to_clipboard: false + +#cursor: + # Cursor style + #style: + # Cursor shape + # + # Values for `shape`: + # - ▇ Block + # - _ Underline + # - | Beam + #shape: Block + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + #blinking: Off + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + #vi_mode_style: None + + # Cursor blinking interval in milliseconds. + #blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + #blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + #unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + #thickness: 0.15 + +# Live config reload (changes require restart) +#live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Send ESC (\x1b) before characters when alt is pressed. +#alt_send_esc: true + +# Offer IPC using `alacritty msg` (unix only) +#ipc_socket: true + +#mouse: + # Click settings + # + # The `double_click` and `triple_click` settings control the time + # alacritty should wait for accepting multiple clicks as one double + # or triple click. + #double_click: { threshold: 300 } + #triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + #hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +#hints: + # Keys used for the hint labels. + #alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + #enabled: + # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + # [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + # hyperlinks: true + # command: xdg-open + # post_processing: true + # mouse: + # enabled: true + # mods: None + # binding: + # key: U + # mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +#mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } +# - { mouse: Middle, mode: ~Vi, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +#key_bindings: + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: SpawnNewInstance } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false + diff --git a/.config/alacritty/color.toml b/.config/alacritty/color.toml new file mode 100644 index 0000000..4c6524a --- /dev/null +++ b/.config/alacritty/color.toml @@ -0,0 +1,36 @@ +# github Alacritty Colors + +# Default colors +[colors.primary] +background = '#ffffff' +foreground = '#24292f' + +# Normal colors +[colors.normal] +black = '#24292e' +red = '#d73a49' +green = '#28a745' +yellow = '#dbab09' +blue = '#0366d6' +magenta = '#5a32a3' +cyan = '#0598bc' +white = '#6a737d' + +# Bright colors +[colors.bright] +black = '#959da5' +red = '#cb2431' +green = '#22863a' +yellow = '#b08800' +blue = '#005cc5' +magenta = '#5a32a3' +cyan = '#3192aa' +white = '#d1d5da' + +[[colors.indexed_colors]] +index = 16 +color = '#d18616' + +[[colors.indexed_colors]] +index = 17 +color = '#cb2431' diff --git a/.config/sway/config b/.config/sway/config new file mode 100644 index 0000000..e08a21f --- /dev/null +++ b/.config/sway/config @@ -0,0 +1,292 @@ +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables + +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +set $primary_monitor eDP-1 +set $secondary_monitor DP-3 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term alacritty +# Your preferred application launcher +set $menu wmenu-run +set $menu rofi -show run + +### Output configuration +# +# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) +# output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill +# +# Example configuration: +# +output eDP-1 resolution 2256x1504 position 0,0 scale 1.2 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +input type:keyboard { + repeat_delay 200 + repeat_rate 30 + xkb_layout us,fr +} + +input type:touchpad { + dwt enabled + tap enabled + middle_emulation enabled + pointer_accel 0.155 +} +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Lock + bindsym Ctrl+Mod1+l exec ~/.config/swaylock/lock.sh + + # Keyboard layout + bindsym $mod+space input type:keyboard xkb_switch_layout next + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Move focus back and forth + bindsym Mod1+Tab workspace back_and_forth + + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + workspace 1 output eDP-1 + workspace 2 output eDP-1 + workspace 3 output eDP-1 + workspace 4 output eDP-1 + workspace 5 output eDP-1 + workspace 11 output eDP-1 + workspace 6 output $secondary_monitor + workspace 7 output $secondary_monitor + workspace 8 output $secondary_monitor + workspace 9 output $secondary_monitor + workspace 10 output $secondary_monitor + + # Switch to workspace + bindcode --to-code $mod+10 workspace number 1 + bindcode --to-code $mod+11 workspace number 2 + bindcode --to-code $mod+12 workspace number 3 + bindcode --to-code $mod+13 workspace number 4 + bindcode --to-code $mod+14 workspace number 5 + bindcode --to-code $mod+15 workspace number 6 + bindcode --to-code $mod+16 workspace number 7 + bindcode --to-code $mod+17 workspace number 8 + bindcode --to-code $mod+18 workspace number 9 + bindcode --to-code $mod+19 workspace number 10 + bindcode --to-code $mod+25 workspace number 11 + + # Move focused container to workspace + bindcode --to-code $mod+Shift+10 move container to workspace number 1 + bindcode --to-code $mod+Shift+11 move container to workspace number 2 + bindcode --to-code $mod+Shift+12 move container to workspace number 3 + bindcode --to-code $mod+Shift+13 move container to workspace number 4 + bindcode --to-code $mod+Shift+14 move container to workspace number 5 + bindcode --to-code $mod+Shift+15 move container to workspace number 6 + bindcode --to-code $mod+Shift+16 move container to workspace number 7 + bindcode --to-code $mod+Shift+17 move container to workspace number 8 + bindcode --to-code $mod+Shift+18 move container to workspace number 9 + bindcode --to-code $mod+Shift+19 move container to workspace number 10 + bindcode --to-code $mod+Shift+25 move container to workspace number 11 + + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. + exec_always autotiling +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + # bindsym $mod+b splith + # bindsym $mod+v splitv + + # Switch the current container between different layout styles + # bindsym $mod+s layout stacking + # bindsym $mod+w layout tabbed + # bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + # bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $up resize grow height 10px + bindsym $down resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Up resize grow height 10px + bindsym Down resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" +# +# Utilities: +# + # Special keys to adjust volume + bindsym --locked XF86AudioMute exec pamixer --toggle-mute + bindsym --locked XF86AudioLowerVolume exec pamixer -d 5 + bindsym --locked XF86AudioRaiseVolume exec pamixer -i 5 + # Special keys to adjust brightness via brightnessctl + bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%- + bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+ + # Special key to take a screenshot with grim + bindsym --locked XF86PowerOff exec ~/.config/swaylock/lock.sh & systemctl hibernate + bindsym $mod+Shift+s exec QT_SCREEN_SCALE_FACTORS="1;1" QT_QPA_PLATFORM=wayland flameshot gui --accept-on-select --raw | wl-copy + bindsym --locked Print exec flameshot gui --raw | wl-copy + bindsym $mod+Shift+Alt+s exec grim -g "$(slurp)" - | wl-copy + +# +# Status Bar: +# +# Read `man 5 sway-bar` for more information about this section. +bar { + position top + swaybar_command waybar + + # When the status_command prints a new line to stdout, swaybar updates. + # The default just shows the current date and time. + # status_command while date +'%Y-%m-%d %X'; do sleep 1; done + + # colors { + # statusline #ffffff + # background #323232 + # inactive_workspace #32323200 #32323200 #5c5c5c + # } +} + +# +# Notifications +# +exec swaync +bindsym $mod+Shift+n exec swaync-client -t -sw + +# +# Windows +# +font none 10 +titlebar_padding 1 +# exec seat seat0 xcursor_theme phinger-cursors-light 36 +# exec_always { +# gsettings set $gnome-schema gtk-cursor-theme-name Adwaita +# gsettings set $gnome-schema gtk-cursor-theme-size 24 +# } +# seat * xcursor_theme Vimix-White 32 + +exec systemctl --user import-environment +include @sysconfdir@/sway/config.d/* diff --git a/.config/sway/outputs b/.config/sway/outputs new file mode 100644 index 0000000..44c4e5e --- /dev/null +++ b/.config/sway/outputs @@ -0,0 +1,11 @@ +# Generated by nwg-displays on 2025-01-05 at 22:39:56. Do not edit manually. + +output "eDP-1" { + mode 2256x1504@59.999Hz + pos 0 0 + transform normal + scale 1.2000000476837158 + scale_filter linear + adaptive_sync off + dpms on +} diff --git a/.config/swaylock/lock.sh b/.config/swaylock/lock.sh new file mode 100755 index 0000000..2830773 --- /dev/null +++ b/.config/swaylock/lock.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +# Background (--color=rrggbb or --image=path) +#BACKGROUND="--image=${HOME}/wallpaper-lock.jpg" + +# Foreground color (rrggbbaa) +COLOR_FG="ffffffff" +COLOR_SCREEN="000000ff"; + +# Ring color during incorrect password flash (rrggbbaa) +COLOR_RINGWRONG="ff0000ff"; + +COLOR_TEXT="ffffffff"; +# Date string format (see `man strftime.3`) +FORMAT_DATE="%A, %B %e" +FORMAT_TIME="%H:%M" + +# Main font (for time and greeter) +FONT="sans-serif:light" +# Alternative font (for date) +FONT_ALT="sans-serif:thin" + +# Time font size +SIZE_TIME=144 +# Date font size +SIZE_DATE=48 + + # "${BACKGROUND}" \ +swaylock \ + --ignore-empty-password \ + --show-keyboard-layout \ + --color="${COLOR_SCREEN}" \ + --indicator-radius=105 \ + --font="${FONT}" \ + --font-size=30 \ + --text-color="${COLOR_TEXT}" \ + --text-clear-color="${COLOR_TEXT}" \ + -f +# \ + # --clock \ + # --datestr="${FORMAT_DATE}" \ + # --timestr="${FORMAT_TIME}" + # --screen=0 \ + # --show-failed-attempts \ + # --inside-color="${COLOR_SCREEN}" \ + # --ring-color="${COLOR_SCREEN}" \ + # --insidever-color="${COLOR_SCREEN}" \ + # --ringver-color="${COLOR_SCREEN}" \ + # --insidewrong-color="${COLOR_SCREEN}" \ + # --ringwrong-color="${COLOR_RINGWRONG}" \ + # --layout-color="${COLOR_TEXT}" \ + # --time-color="${COLOR_TEXT}" \ + # --date-color="${COLOR_TEXT}" \ + # --greeter-color="${COLOR_TEXT}" \ + # --noinput-text="clear" \ + # --pass-screen-keys \ + # --pass-power-keys \ + # --pass-volume-keys \ diff --git a/.config/swaync/config.json b/.config/swaync/config.json new file mode 100644 index 0000000..3ba9df0 --- /dev/null +++ b/.config/swaync/config.json @@ -0,0 +1,74 @@ +{ + "$schema": "/etc/xdg/swaync/configSchema.json", + "positionX": "right", + "positionY": "top", + "layer": "overlay", + "control-center-layer": "top", + "layer-shell": true, + "cssPriority": "application", + "control-center-margin-top": 0, + "control-center-margin-bottom": 0, + "control-center-margin-right": 0, + "control-center-margin-left": 0, + "notification-2fa-action": true, + "notification-inline-replies": false, + "notification-icon-size": 64, + "notification-body-image-height": 100, + "notification-body-image-width": 200, + "timeout": 4, + "timeout-low": 5, + "timeout-critical": 0, + "fit-to-screen": false, + "relative-timestamps": true, + "control-center-width": 500, + "control-center-height": 809, + "notification-window-width": 500, + "keyboard-shortcuts": true, + "image-visibility": "when-available", + "transition-time": 200, + "hide-on-clear": false, + "hide-on-action": true, + "script-fail-notify": true, + "scripts": { + "open-screenshot-folder": { + "exec": "sh -c 'dolphin ~/Documents/Screenshots'", + "summary": "Screenshot", + "run-on": "action" + } + }, + "notification-visibility": { + "example-name": { + "state": "normal", + "app-name": "Spotify" + } + }, + "widgets": [ + "inhibitors", + "title", + "dnd", + "notifications", + ], + "widget-config": { + "inhibitors": { + "text": "Inhibitors", + "button-text": "Clear All", + "clear-all-button": true + }, + "title": { + "text": "Notifications", + "clear-all-button": true, + "button-text": "󰎟" + }, + "dnd": { + "text": "Do Not Disturb" + }, + "label": { + "max-lines": 5, + "text": "Label Text" + }, + "mpris": { + "image-size": 96, + "image-radius": 12 + } + } +} diff --git a/.config/swaync/style.css b/.config/swaync/style.css new file mode 100644 index 0000000..0092e57 --- /dev/null +++ b/.config/swaync/style.css @@ -0,0 +1,198 @@ +@define-color switch_checked #f38ba8; /* red */ +@define-color green #a6e3a1; +@define-color lavender #b4befe; +@define-color text #cdd6f4; +@define-color subtext1 #bac2de; +@define-color subtext0 #a6adc8; +@define-color overlay0 #6c7086; +@define-color surface2 #585b70; +@define-color surface1 #45475a; +@define-color surface0 #313244; + +* { + font-family: "IBM Plex Sans"; + background-color: transparent; +} + +.control-center { + background: alpha(@overlay0, 0.95); + margin: 5px 10px 0 0; + border: 2px solid @text; + border-radius: 15px; + color: @text; +} + +.widget-title { + padding: 10px 10px 0px 10px; + font-size: 22px; + color: @text; +} + +.widget-title>button { + font-family: JetBrains Mono Nerd; + border: 2px solid @text; + background: transparent; + font-size: inherit; + padding: 0 35px 0 30px; +} + +.widget-title>button:hover { + background: @surface2; +} + +.widget-title>button:active { + background: @surface1; +} + +.widget-dnd { + padding: 0px 10px 5px 10px; + background-color: transparent; + color: transparent; +} + +.widget-dnd>label { + color: @subtext1; +} + +.widget-dnd>switch { + background-color: @surface2; +} + +.widget-dnd>switch:checked { + background-color: @switch_checked; +} + +.widget-dnd>switch slider { + background-color: @surface2; + border: 2px solid @text; + border-radius: 99px; +} + +.notification-row { + margin: 0px; + padding: 0px; + color: @text; +} + +.notification { + background-color: @surface2; + box-shadow: none; + margin: 0px; + border: 2px solid @lavender; + color: @text; +} + +.notification-content { + padding: 5px; +} + +.notification-group { + background-color: transparent; +} + +.notification-group-icon { + color: @lavender; +} + +.notification-group-collapse-button, +.notification-group-close-all-button { + background-color: @lavender; + border: 2px solid @lavender; +} + +.notification-group.collapsed:hover .notification { + background-color: @surface1; +} + +.notification-default-action:hover { + background-color: @surface1; +} + +.notification-action:hover { + background-color: @surface0; +} + +.notification-default-action:active, +.notification-action:active { + background-color: @surface1; +} + +.notification-content .text-box { + padding: 0px 5px; +} + +.close-button { + background-color: @lavender; +} + +.widget-volume { + background-color: @surface2; + border-radius: 20px; + margin: 0 10px; +} + +trough highlight { + background-color: @text; +} + +scale trough { + background-color: transparent; + border: transparent; + padding: 0px; + min-height: 5px; + margin: 0 0 0 10px; + font-family: JetBrains Mono Nerd Font; +} + +slider { + background-color: @overlay0; + border: 2px solid @text; +} + +.widget-volume label { + padding: 0 0 0 10px; +} + +.widget-volume trough highlight { + background: @lavender; + border: unset; +} + +.widget-volume button { + background-color: inherit; + box-shadow: unset; + font-size: 20px; + padding: 0 20px 0 0; + border-radius: 20px; + color: @lavender; + font-family: "JetBrains Mono NerdFont"; +} + +.widget-buttons-grid { + background-color: transparent; + margin: 0 0 0 278px; +} + +.widget-buttons-grid>flowbox>flowboxchild>button { + background-color: transparent; + border-radius: 99px; + border: unset; + box-shadow: unset; + min-width: 30px; + min-height: 30px; +} + +.widget-buttons-grid>flowbox>flowboxchild>button:hover { + background-color: @surface2; +} + +.widget-buttons-grid>flowbox>flowboxchild>button:active { + background-color: @surface1; +} + +.widget-buttons-grid>flowbox>flowboxchild>button label { + color: @green; + font-family: "JetBrains Mono NerdFont"; + font-size: 20px; +} + diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..bc382ca --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,82 @@ +{ + "layer": "top", + "modules-left": ["sway/workspaces", "sway/window", "sway/mode"], + "modules-center": [], + "modules-right": ["pulseaudio", "network", "tray", "custom/keyboard", "backlight", "cpu", "memory", "battery", "clock"], + "sway/window": { + "max-length": 50 + }, + "battery": { + "format": "{capacity}% {icon}", + "format-plugged": "{capacity}% ", + "format-charging": "{capacity}% ", + "format-alt": "{time}", + "format-icons": ["", "", "", "", ""], + }, + "clock": { + "format": "{:%a, %b %e %H:%M}", + "format-alt": "{:%a, %d. %b %H:%M:%S}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": true + }, + "memory": { + "format": "{avail} GiB" + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + //"battery": { + // "states": { + // "good": 95, + // "warning": 30, + // "critical": 15 + // }, + // "format": "{capacity}% ", + // "format-charging": "{capacity}%", + // "format-plugged": "{capacity}%", + // "format-alt": "{time} ", + // // "format-good": "", // An empty format will hide the module + // // "format-full": "", + // // "format-icons": ["", "", "", "", ""] + //}, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ", + "format-alt": "{ifname}: {ipaddr}/{cidr}", + "on-click": "nm-connection-editor" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}%  | {format_source}", + "format-bluetooth": "{volume}% {format_source}", + "format-bluetooth-muted": " {format_source}", + "format-muted": "0%  | {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "on-click": "pavucontrol" + }, + //"custom/keyboard": { + // "exec": "swaymsg -t get_inputs | grep active_layout_name | grep -v En | awk 'END{if(NR == 0){print \"EN\"}else{print toupper(substr($2,2,2))}}'", + // "format": " {} ", + // "interval": 1 + //}, + "tray": { + "icon-size": 21, + "spacing": 10 + } +} diff --git a/nvim/README.md b/nvim/README.md new file mode 100644 index 0000000..dc7634e --- /dev/null +++ b/nvim/README.md @@ -0,0 +1,8 @@ +nodejs + +clang + + +:CocInstall coc-clangd + +:CocCommand clangd.install diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100755 index 0000000..fb78bcf --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,28 @@ +vim.g.mapleader = " " + + +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not vim.loop.fs_stat(lazypath) then + vim.fn.system { + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', -- latest stable release + lazypath, + } +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup("plugins", { + dev = { + -- directory where you store your local plugin projects + path = "~/lua/nvim-plugins", + fallback = true, -- Fallback to git when local plugin doesn't exist + }, +}) + +require("settings") +require("mappings") +require("setup") + diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..1aec8e7 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,37 @@ +{ + "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "gitlinker.nvim": { "branch": "master", "commit": "bbe2a1254fc8fce21f3bbf9a020266a1c49799f7" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "linediff.vim": { "branch": "main", "commit": "29fa617fc10307a1e0ae82a8761114e465d17b06" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.files": { "branch": "main", "commit": "57eb96a828f80efb8095a611e3aafcfa43548f8b" }, + "neogen": { "branch": "main", "commit": "23e7e9f883d01289ebd90e98025acc860ea26366" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, + "nvim-lspconfig": { "branch": "master", "commit": "dc2f86d2b66a6e01a98c37cdadd3be3e90f8ab9a" }, + "nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "9a8e39993e3b895601bf8227124a48ea8268149e" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, + "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vimtex": { "branch": "master", "commit": "82d2305ff71dfb3bd91602534cc9bb9a195bcb38" } +} diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua new file mode 100644 index 0000000..935e8e9 --- /dev/null +++ b/nvim/lua/mappings.lua @@ -0,0 +1,69 @@ +local u = require("utils") + +vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "h", ":noh") + +--move line shortcut +vim.keymap.set("n", "", ":m +1==", {noremap = true}) +vim.keymap.set("n", "", ":m -2==", {noremap = true}) + +vim.keymap.set("v", "", ":m '>+1gv=gv", {noremap = true}) +vim.keymap.set("v", "", ":m '<-2gv=gv", {noremap = true}) + +vim.keymap.set("n", "", "zz", {noremap = true}) +vim.keymap.set("n", "", "zz", {noremap = true}) + +vim.keymap.set("x", "p", "\"_dP") + +--tab buffer +vim.keymap.set("n", "fn", ":bnext", {noremap = true}) +vim.keymap.set("n", "fp", ":bprev", {noremap = true}) + +-- wrap toggle +vim.keymap.set("n", "w", function() vim.o.wrap = not vim.o.wrap end, {noremap = true}) + +vim.o.clipboard = 'unnamedplus' + +-- Diff mappings put/get then move to next change +-- u.nmap("dg", "diffget]c") +-- u.nmap("dp", "diffput]c") +-- +-- u.nmap("dp", "diffput]c") +-- +-- -- Remap movement to move by column layout +-- u.nvmap("j", "gj") +-- u.nvmap("k", "gk") +-- +-- u.nvmap(";", ":") + +-- Window splitting remap" +u.nmap("", "h") +u.nmap("", "k") +u.nmap("", "l") +u.nmap("", "j") +-- u.nmap("z", ":cclose") +-- +-- -- Exit terminal insert mode +-- u.tmap("", "") +-- +-- -- Delete buffer without closing the window +-- u.nmap("q", ":bpspbnbd") +-- +-- Fugitive +-- u.nmap("gw", ":Gwrite") +-- u.nmap("gr", ":Gread") +-- u.nmap("gc", ":Git commit -v") +-- u.nmap("gC", ":Git commit -v --amend") +-- u.nmap("gs", ":Git") +-- u.nmap("gd", ":Gdiff") +u.nmap("gb", ":Git blame") + +u.nmap("rl", ":RustFmt") + +vim.keymap.set("n", "ri", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end) +u.nmap("d", ":lua vim.lsp.buf.hover()") + + +require("telescope-config") +require("minifiles-config") +require("vimtex-config") diff --git a/nvim/lua/minifiles-config.lua b/nvim/lua/minifiles-config.lua new file mode 100644 index 0000000..76ec814 --- /dev/null +++ b/nvim/lua/minifiles-config.lua @@ -0,0 +1,52 @@ +require('mini.files').setup({ + -- Customization of shown content + content = { + -- Predicate for which file system entries to show + filter = nil, + -- What prefix to show to the left of file system entry + prefix = nil, + -- In which order to show file system entries + sort = nil, + }, + + -- Module mappings created only inside explorer. + -- Use `''` (empty string) to not create one. + mappings = { + close = 'q', + go_in = 'l', + go_in_plus = 'L', + go_out = 'h', + go_out_plus = 'H', + reset = '', + reveal_cwd = '@', + show_help = 'g?', + synchronize = '=', + trim_left = '<', + trim_right = '>', + }, + + -- General options + options = { + -- Whether to delete permanently or move into module-specific trash + permanent_delete = true, + -- Whether to use for editing directories + use_as_default_explorer = true, + }, + + -- Customization of explorer windows + windows = { + -- Maximum number of windows to show side by side + max_number = math.huge, + -- Whether to show preview of file/directory under cursor + preview = false, + -- Width of focused window + width_focus = 50, + -- Width of non-focused window + width_nofocus = 15, + -- Width of preview window + width_preview = 25, + }, +}) + +vim.keymap.set("n", "-", 'lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()', { desc = 'Open MiniFiles' }) +vim.keymap.set("n", "", 'lua MiniFiles.close()', { desc = 'Close MiniFiles' }) diff --git a/nvim/lua/packer-plugins.lua b/nvim/lua/packer-plugins.lua new file mode 100644 index 0000000..2e87b53 --- /dev/null +++ b/nvim/lua/packer-plugins.lua @@ -0,0 +1,93 @@ +return require('packer').startup(function() + use 'wbthomason/packer.nvim' + use 'sonph/onehalf' + use 'navarasu/onedark.nvim' + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.4', + -- or , branch = '0.1.x', + requires = { {'nvim-lua/plenary.nvim'} } + } + + require('onedark').setup { + style = 'darker' + } + require('onedark').load() + -- use({ + -- 'rose-pine/neovim', + -- as = 'rose-pine', + -- config = function() + -- vim.cmd('colorscheme rose-pine') + -- end + -- }) + + use { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + 'neovim/nvim-lspconfig' + } + use 'hrsh7th/nvim-cmp' -- Autocompletion plugin + use 'hrsh7th/cmp-nvim-lsp' -- Autocompletion with LSPs + use 'hrsh7th/cmp-buffer' + use 'hrsh7th/cmp-path' + + use {'neoclide/coc.nvim', branch = 'release'} + + use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) + + --use { + -- 'VonHeikemen/lsp-zero.nvim', + -- branch = 'v2.x', + -- requires = { + -- -- LSP Support + -- {'neovim/nvim-lspconfig'}, + -- {'williamboman/mason.nvim', run = function() + -- pcall(vim.cmd, 'MasonUpdate') + -- end,}, + -- {'williamboman/mason-lspconfig.nvim'}, -- Optional + + -- -- Autocompletion + -- {'hrsh7th/nvim-cmp'}, -- Required + -- {'hrsh7th/cmp-nvim-lsp'}, -- Required + -- {'L3MON4D3/LuaSnip'}, -- Required + -- } + --} + + -- Auto pairs + use { + "windwp/nvim-autopairs", + config = function() require("nvim-autopairs").setup {} end + } + + --harpoon + use("theprimeagen/harpoon") + + ---- neogen + --local i = require("neogen.types.template").item + --local annotation = { + -- { nil, "/**", { no_results = true, type = { "func", "file", "class" } } }, + -- { nil, "** \\file", { no_results = true, type = { "file" } } }, + -- { nil, "** \\brief $1", { no_results = true, type = { "func", "file", "class" } } }, + -- { nil, "*/", { no_results = true, type = { "func", "file", "class" } } }, + -- { nil, "", { no_results = true, type = { "file" } } }, + + -- { nil, "/**", { type = { "func", "class", "type" } } }, + -- { i.ClassName, "** @class %s", { type = { "class" } } }, + -- { i.Type, "** @typedef %s", { type = { "type" } } }, + -- { nil, "** \\brief $1", { type = { "func", "class", "type" } } }, + -- { nil, "**", { type = { "func", "class", "type" } } }, + -- { i.Tparam, "** \\tparam %s $1" }, + -- { i.Parameter, "** \\param %s $1" }, + -- { i.Return, "** \\return $1" }, + -- { nil, "*/", { type = { "func", "class", "type" } } }, + --} + --require("neogen").setup({ + -- languages = { + -- c = { + -- template = { + -- annotation_convention = "my_annotation", + -- my_annotation = annotation + -- } + -- } + -- } + --}) +end) diff --git a/nvim/lua/plugins/navic.lua b/nvim/lua/plugins/navic.lua new file mode 100644 index 0000000..7868982 --- /dev/null +++ b/nvim/lua/plugins/navic.lua @@ -0,0 +1,6 @@ +return { + { + "SmiteshP/nvim-navic", + requires = "neovim/nvim-lspconfig" + } +} diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua new file mode 100644 index 0000000..8a9cb6f --- /dev/null +++ b/nvim/lua/plugins/plugins.lua @@ -0,0 +1,246 @@ +return { + -- Theme + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + lazy = false, + config = function() + require('onedark').setup { + -- Set a style preset. 'dark' is default. + style = 'dark', -- dark, darker, cool, deep, warm, warmer, light + hightlights = { + Comment = { fg = '#5c6370', bg = 'NONE', fmt = 'italic' }, -- gray foreground + ["@comment"] = { fg = '#5c6370', bg = 'NONE', fmt = 'italic' }, -- gray foreground + ["@comment.go"] = { fg = '#5c6370', fmt = 'italic' }, + } + } + require('onedark').load() + + -- Force override after theme loads + vim.schedule(function() + local comment_gray = '#5c6370' + vim.api.nvim_set_hl(0, 'Comment', { fg = comment_gray, italic = true }) + vim.api.nvim_set_hl(0, '@comment', { fg = comment_gray, italic = true }) + vim.api.nvim_set_hl(0, '@comment.go', { fg = comment_gray, italic = true }) + vim.api.nvim_set_hl(0, '@comment.documentation', { fg = comment_gray, italic = true }) + vim.api.nvim_set_hl(0, 'SpecialComment', { fg = comment_gray, italic = true }) + vim.api.nvim_set_hl(0, '@lsp.type.comment', { fg = comment_gray, italic = true }) + end) + + end, + }, + + -- Icons (used by telescope, mini.files, etc.) + "nvim-tree/nvim-web-devicons", + + -- Vim plugins + "windwp/nvim-autopairs", + + -- Git + "tpope/vim-fugitive", + "tpope/vim-rhubarb", + { + "linrongbin16/gitlinker.nvim", + cmd = "GitLink", + opts = {}, + keys = { + { "gy", "GitLink", mode = { "n", "v" }, desc = "Yank git link" }, + { "gY", "GitLink!", mode = { "n", "v" }, desc = "Open git link" }, + }, + }, + + -- Vim + { + "lervag/vimtex", + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + -- VimTeX configuration goes here, e.g. + vim.g.vimtex_view_method = "zathura" + end + }, + + + "tpope/vim-commentary", + "tpope/vim-surround", + -- "christoomey/vim-tmux-navigator", + "AndrewRadev/linediff.vim", + { "echasnovski/mini.files", version = false }, + + + -- Nvim plugins + {"nvim-treesitter/nvim-treesitter", branch = 'master', lazy = false, build = ":TSUpdate"}, + { "nvim-treesitter/nvim-treesitter-context" }, + 'danymat/neogen', + "lukas-reineke/indent-blankline.nvim", + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip" + }, + config = function() + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local cmp = require('cmp') + local luasnip = require('luasnip') + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end + }, + completion = { + autocomplete = { require('cmp.types').cmp.TriggerEvent.TextChanged }, + }, + mapping = cmp.mapping.preset.insert ({ + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select=true }), + }), + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + } + }) + end + }, + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-path", + { + "neovim/nvim-lspconfig", + dependencies = { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim" + }, + config = function() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + require('mason').setup() + require('mason-lspconfig').setup({ + ensure_installed = { "pyright", "gopls" }, + handlers = { + -- Default handler for all servers + function(server_name) + require('lspconfig')[server_name].setup({ + capabilities = capabilities, + }) + end, + -- gopls with Go-specific settings + ["gopls"] = function() + require('lspconfig').gopls.setup({ + capabilities = capabilities, + settings = { + gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + gofumpt = true, + }, + }, + }) + end, + }, + }) + end + }, + "nvim-lua/plenary.nvim", + -- "jose-elias-alvarez/null-ls.nvim", + -- "jose-elias-alvarez/typescript.nvim", + -- "iamcco/markdown-preview.nvim", -- { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} + -- { "olimorris/persisted.nvim", dev = true }, + -- "folke/tokyonight.nvim", -- { 'branch': 'main' } + "lewis6991/gitsigns.nvim", + "williamboman/mason.nvim", -- { 'do': ':MasonUpdate' } + "williamboman/mason-lspconfig.nvim", + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + opts = { + menu = { + width = vim.api.nvim_win_get_width(0) - 4, + }, + }, + keys = { + { + 'q', + function() + require('harpoon'):list():add() + end, + desc = 'Harpoon File', + }, + { + '', + function() + local harpoon = require('harpoon') + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = 'Harpoon Quick Menu', + }, + { + '', + function() + require('harpoon'):list():select(1) + end, + desc = 'Harpoon to File 1', + }, + { + '', + function() + require('harpoon'):list():select(2) + end, + desc = 'Harpoon to File 2', + }, + { + '', + function() + require('harpoon'):list():select(3) + end, + desc = 'Harpoon to File 3', + }, + { + '', + function() + require('harpoon'):list():select(4) + end, + desc = 'Harpoon to File 4', + }, + { + '', + function() + require('harpoon'):list():select(5) + end, + desc = 'Harpoon to File 5', + }, + }, + }, +} diff --git a/nvim/lua/plugins/rust-tools.lua b/nvim/lua/plugins/rust-tools.lua new file mode 100644 index 0000000..16f19fa --- /dev/null +++ b/nvim/lua/plugins/rust-tools.lua @@ -0,0 +1,122 @@ +local opts = { + tools = { -- rust-tools options + + -- how to execute terminal commands + -- options right now: termopen / quickfix / toggleterm / vimux + -- executor = require("rust-tools.executors").termopen, + + -- callback to execute once rust-analyzer is done initializing the workspace + -- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error" + on_initialized = nil, + + -- automatically call RustReloadWorkspace when writing to a Cargo.toml file. + reload_workspace_from_cargo_toml = true, + + -- These apply to the default RustSetInlayHints command + inlay_hints = { + -- automatically set inlay hints (type hints) + -- default: true + auto = false, + + -- Only show inlay hints for the current line + only_current_line = false, + + -- whether to show parameter hints with the inlay hints or not + -- default: true + show_parameter_hints = true, + + -- prefix for parameter hints + -- default: "<-" + parameter_hints_prefix = "<- ", + + -- prefix for all the other hints (type, chaining) + -- default: "=>" + other_hints_prefix = "=> ", + + -- whether to align to the length of the longest line in the file + max_len_align = false, + + -- padding from the left if max_len_align is true + max_len_align_padding = 1, + + -- whether to align to the extreme right or not + right_align = false, + + -- padding from the right if right_align is true + right_align_padding = 7, + + -- The color of the hints + highlight = "Comment", + }, + + -- options same as lsp hover / vim.lsp.util.open_floating_preview() + hover_actions = { + + -- the border that is used for the hover window + -- see vim.api.nvim_open_win() + border = { + { "╭", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╮", "FloatBorder" }, + { "│", "FloatBorder" }, + { "╯", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╰", "FloatBorder" }, + { "│", "FloatBorder" }, + }, + + -- Maximal width of the hover window. Nil means no max. + max_width = nil, + + -- Maximal height of the hover window. Nil means no max. + max_height = nil, + + -- whether the hover action window gets automatically focused + -- default: false + auto_focus = false, + }, + }, + + -- all the opts to send to nvim-lspconfig + -- these override the defaults set by rust-tools.nvim + -- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer + server = { + settings = { + ["rust-analyzer"] = { + -- cargo = { + -- features = "all", + -- check = { + -- overrideCommand = { + -- "cargo check --quiet --message-format=json --all-targets", + -- }, + -- }, + -- buildScripts = { + -- overideCommand = { + -- "cargo check --quiet --message-format=json --all-targets", + -- }, + -- }, + -- }, + }, + }, + + on_attach = function(client, bufnr) + if client.server_capabilities.inlayHintProvider then + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + -- vim.api.nvim_set_keymap("n", "ri", "lua vim.lsp.inlay_hint(0)", { noremap = true }) + end + end, + }, -- rust-analyzer options + + -- debugging stuff + -- dap = { + -- adapter = { + -- type = "executable", + -- command = "lldb-vscode", + -- name = "rt_lldb", + -- }, + -- }, +} + +return { + { "simrat39/rust-tools.nvim" }, +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..e2e55d2 --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,34 @@ +return { + { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { + + "nvim-telescope/telescope-live-grep-args.nvim" , + -- This will not install any breaking changes. + -- For major updates, this must be adjusted manually. + version = "^1.0.0", + }, + }, + }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { + "nvim-telescope/telescope-file-browser.nvim", + dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, + }, + config = function() + local telescope = require("telescope") + + -- first setup telescope + telescope.setup({ + -- your config + }) + + -- then load the extension + telescope.load_extension("live_grep_args") + end + -- "debugloop/telescope-undo.nvim", + -- "nvim-telescope/telescope-ui-select.nvim", +} diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua new file mode 100644 index 0000000..eec2f65 --- /dev/null +++ b/nvim/lua/settings.lua @@ -0,0 +1,48 @@ +local opt = vim.o-- global options + +vim.lsp.log.set_level("off") + +-- Theme +-- Options +opt.relativenumber = true +opt.colorcolumn = "80" +opt.number = true +opt.tabstop = 2 +opt.softtabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = true +opt.smartindent = true + +-- Make line numbers default +vim.wo.number = true + +-- Enable mouse mode +opt.mouse = 'a' + +-- Sync clipboard between OS and Neovim. +opt.clipboard = 'unnamedplus' + +-- Enable break indent +opt.breakindent = true + +-- Save undo history +opt.undofile = true + +-- Keep signcolumn on by default +vim.wo.signcolumn = 'yes' + +-- Decrease update time +opt.updatetime = 250 +opt.timeoutlen = 300 + +-- Set completeopt to have a better completion experience +opt.completeopt = 'menuone,noselect' + +--ignore case if pattern doesn't contain upper case +opt.ignorecase = true +opt.smartcase = true + +--number of line to show around the cursor +opt.scrolloff = 8 + +-- vim.g.rustfmt_autosave = 1 diff --git a/nvim/lua/setup.lua b/nvim/lua/setup.lua new file mode 100644 index 0000000..bd1db70 --- /dev/null +++ b/nvim/lua/setup.lua @@ -0,0 +1,90 @@ +-- nvim-autopairs +require("nvim-autopairs").setup() + +-- gitsigns +require("gitsigns").setup() + +require'treesitter-context'.setup{ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + multiwindow = false, -- Enable multiwindow support. + max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. + line_numbers = true, + multiline_threshold = 20, -- Maximum number of lines to show for a single context + trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' + separator = nil, + zindex = 20, -- The Z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching +} + +-- Tree sitter +require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", "cpp", "go", "lua", "markdown", "python", "rust", "tsx", "typescript", "vim" + }, + highlight = { + enable = true, + }, + indent = { + enable = true, + }, + context_commentstring = { enable = true }, + playground = { enable = true }, + query_linter = { enable = true }, + locals = { enable = true }, +}) + +-- Telescope +local actions = require("telescope.actions") +local previewers = require("telescope.previewers") +local builtin = require("telescope.builtin") +require("telescope").setup({ + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + }, + }, +}) + +require("telescope").load_extension("fzf") + +-- Disable underline +vim.diagnostic.config({ + virtual_text = true, + underline = false, +}) + +require('neogen').setup {} +vim.keymap.set('n', 'ne', ':lua require("neogen").generate()', { desc = '[G]enerate [D]ocumentation' }) + +-- Key bindings + +-- common lsp +vim.api.nvim_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", { silent = true }) +vim.api.nvim_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", { silent = true }) +vim.keymap.set("n", "gr", "Telescope lsp_references", { silent = true }) +vim.api.nvim_set_keymap("n", "K", "lua vim.lsp.buf.hover()", { silent = true }) +vim.api.nvim_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", { silent = true }) +vim.api.nvim_set_keymap("n", "k", "lua vim.lsp.buf.signature_help()", { silent = true }) +vim.api.nvim_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", { silent = true }) +vim.api.nvim_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", { silent = true }) +vim.api.nvim_set_keymap("n", "t", "lua vim.lsp.buf.format()", { silent = true }) +vim.api.nvim_set_keymap( + "n", + "wl", + "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", + { silent = true } +) +vim.api.nvim_set_keymap("n", "D", "lua vim.lsp.buf.type_definition()", { silent = true }) +vim.api.nvim_set_keymap("n", "rn", "lua vim.lsp.buf.rename()", { silent = true }) +vim.api.nvim_set_keymap("n", "ca", "lua vim.lsp.buf.code_action()", { silent = true }) +vim.api.nvim_set_keymap("n", "e", "lua vim.diagnostic.open_float()", { silent = true }) +vim.api.nvim_set_keymap("n", "[d", "lua vim.diagnostic.goto_prev()", { silent = true }) +vim.api.nvim_set_keymap("n", "]d", "lua vim.diagnostic.goto_next()", { silent = true }) diff --git a/nvim/lua/telescope-config.lua b/nvim/lua/telescope-config.lua new file mode 100644 index 0000000..b506329 --- /dev/null +++ b/nvim/lua/telescope-config.lua @@ -0,0 +1,24 @@ +local telescope = require('telescope') +local lga_actions = require("telescope-live-grep-args.actions") +local builtin = require('telescope.builtin') +local live_grep_args_shortcuts = require("telescope-live-grep-args.shortcuts") + +telescope.setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + [""] = lga_actions.quote_prompt(), + }, + }, + }, +} +telescope.load_extension("live_grep_args") + +vim.keymap.set('n', 'pf', builtin.find_files, {noremap = true}) +vim.keymap.set("n", "pg", telescope.extensions.live_grep_args.live_grep_args) +-- vim.keymap.set('n', 'lg', builtin.live_grep, {noremap = true}) +vim.keymap.set('n', 'gs', builtin.grep_string, {noremap = true}) + +vim.keymap.set("n", "pw", live_grep_args_shortcuts.grep_word_under_cursor) diff --git a/nvim/lua/utils.lua b/nvim/lua/utils.lua new file mode 100644 index 0000000..c3d9b19 --- /dev/null +++ b/nvim/lua/utils.lua @@ -0,0 +1,27 @@ +local M = {} + +M.map = function(mode, shortcut, command) + vim.keymap.set(mode, shortcut, command, { noremap = true, silent = true }) +end + +M.nmap = function(shortcut, command) + M.map("n", shortcut, command) +end + +M.imap = function(shortcut, command) + M.map("i", shortcut, command) +end + +M.vmap = function(shortcut, command) + M.map("v", shortcut, command) +end + +M.nvmap = function(shortcut, command) + M.map({ "n", "v" }, shortcut, command) +end + +M.tmap = function(shortcut, command) + M.map("t", shortcut, command) +end + +return M diff --git a/nvim/lua/vimtex-config.lua b/nvim/lua/vimtex-config.lua new file mode 100644 index 0000000..987894c --- /dev/null +++ b/nvim/lua/vimtex-config.lua @@ -0,0 +1,46 @@ +-- " This is necessary for VimTeX to load properly. The "indent" is optional. +-- " Note: Most plugin managers will do this automatically! +-- filetype plugin indent on + +-- " This enables Vim's and neovim's syntax-related features. Without this, some +-- " VimTeX features will not work (see ":help vimtex-requirements" for more +-- " info). +-- " Note: Most plugin managers will do this automatically! +-- syntax enable + +-- " Viewer options: One may configure the viewer either by specifying a built-in +-- " viewer method: +-- let g:vimtex_view_method = 'zathura' + +-- " Or with a generic interface: +-- let g:vimtex_view_general_viewer = 'okular' +-- let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' + +-- " VimTeX uses latexmk as the default compiler backend. If you use it, which is +-- " strongly recommended, you probably don't need to configure anything. If you +-- " want another compiler backend, you can change it as follows. The list of +-- " supported backends and further explanation is provided in the documentation, +-- " see ":help vimtex-compiler". +-- let g:vimtex_compiler_method = 'latexrun' + +-- " Most VimTeX mappings rely on localleader and this can be changed with the +-- " following line. The default is usually fine and is the symbol "\". +vim.cmd("filetype plugin indent on") +vim.cmd("syntax enable") +vim.g.vimtex_view_method = 'zathura' +vim.g.vimtex_compiler_method = 'latexrun' +vim.g.vimtex_toc_config = { + name = 'TOC', + layers = { 'content', 'todo', 'include' }, + resize = 1, + split_width = 50, + todo_sorted = 0, + show_help = 1, + show_numbers = 1, + mode = 2, +} +-- Key mappings +vim.api.nvim_set_keymap('n', 'm', ':VimtexTocOpen', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'v', ':VimtexView', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', 'c', ':VimtexCompile', { noremap = true, silent = true }) + diff --git a/nvim/plugin/harpoon.lua b/nvim/plugin/harpoon.lua new file mode 100644 index 0000000..930ec8a --- /dev/null +++ b/nvim/plugin/harpoon.lua @@ -0,0 +1,11 @@ +local harpoon = require("harpoon") +harpoon:setup() +-- +-- vim.keymap.set("n", "q", function() harpoon:list().append() end) +-- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) +-- +-- vim.keymap.set("n", "", function() harpoon:list():select(1) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(2) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(3) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(4) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(5) end) diff --git a/nvim/plugin/minifiles.lua b/nvim/plugin/minifiles.lua new file mode 100644 index 0000000..76ec814 --- /dev/null +++ b/nvim/plugin/minifiles.lua @@ -0,0 +1,52 @@ +require('mini.files').setup({ + -- Customization of shown content + content = { + -- Predicate for which file system entries to show + filter = nil, + -- What prefix to show to the left of file system entry + prefix = nil, + -- In which order to show file system entries + sort = nil, + }, + + -- Module mappings created only inside explorer. + -- Use `''` (empty string) to not create one. + mappings = { + close = 'q', + go_in = 'l', + go_in_plus = 'L', + go_out = 'h', + go_out_plus = 'H', + reset = '', + reveal_cwd = '@', + show_help = 'g?', + synchronize = '=', + trim_left = '<', + trim_right = '>', + }, + + -- General options + options = { + -- Whether to delete permanently or move into module-specific trash + permanent_delete = true, + -- Whether to use for editing directories + use_as_default_explorer = true, + }, + + -- Customization of explorer windows + windows = { + -- Maximum number of windows to show side by side + max_number = math.huge, + -- Whether to show preview of file/directory under cursor + preview = false, + -- Width of focused window + width_focus = 50, + -- Width of non-focused window + width_nofocus = 15, + -- Width of preview window + width_preview = 25, + }, +}) + +vim.keymap.set("n", "-", 'lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()', { desc = 'Open MiniFiles' }) +vim.keymap.set("n", "", 'lua MiniFiles.close()', { desc = 'Close MiniFiles' }) diff --git a/nvim/plugin/rustaceanvim.lua b/nvim/plugin/rustaceanvim.lua new file mode 100644 index 0000000..c61053d --- /dev/null +++ b/nvim/plugin/rustaceanvim.lua @@ -0,0 +1,50 @@ +-- vim.g.auto_ra_attach = true +-- +-- vim.g.rustaceanvim = { +-- -- Plugin configuration +-- tools = {}, +-- -- LSP configuration +-- ---@type RustaceanLspClientOpts +-- server = { +-- load_vscode_settings = true, +-- auto_attach = function(bufnr) +-- return vim.g.auto_ra_attach +-- end, +-- on_attach = function(client, _) +-- client.server_capabilities.workspace.didChangeWatchedFiles = { +-- dynamicRegistration = false, +-- relativePatternSupport = false, +-- } +-- +-- vim.api.nvim_create_autocmd({ 'BufEnter' }, { +-- desc = 'Resize splits when resizing the window', +-- pattern = { '*.rs' }, +-- callback = function() +-- vim.cmd('RustAnalyzer reloadSettings') +-- end, +-- }) +-- end, +-- default_settings = { +-- ['rust-analyzer'] = { +-- cachePriming = false, +-- rustfmt = { +-- extraArgs = { +-- '--config', +-- 'comment_width=120,condense_wildcard_suffixes=false,format_code_in_doc_comments=true,format_macro_bodies=true,hex_literal_case=Upper,imports_granularity=One,normalize_doc_attributes=true,wrap_comments=true', +-- }, +-- }, +-- }, +-- }, +-- }, +-- -- DAP configuration +-- dap = {}, +-- } +-- +-- return { +-- { +-- 'mrcjkb/rustaceanvim', +-- version = '^4', -- Recommended +-- ft = { 'rust' }, +-- dev = true, +-- }, +-- } diff --git a/nvim/plugin/telescope.lua b/nvim/plugin/telescope.lua new file mode 100644 index 0000000..3edc053 --- /dev/null +++ b/nvim/plugin/telescope.lua @@ -0,0 +1,18 @@ +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +local builtin = require('telescope.builtin') + +vim.keymap.set('n', 'pf', builtin.find_files, {noremap = true}) +vim.keymap.set('n', 'pg', builtin.live_grep, {noremap = true}) +vim.keymap.set('n', '', builtin.git_files, {noremap = true})