diff options
74 files changed, 5633 insertions, 0 deletions
diff --git a/.Raycast 2025-08-09 16.50.44.rayconfig b/.Raycast 2025-08-09 16.50.44.rayconfig Binary files differnew file mode 100644 index 0000000..a86acc5 --- /dev/null +++ b/.Raycast 2025-08-09 16.50.44.rayconfig diff --git a/.config/.gitignore-template b/.config/.gitignore-template new file mode 100644 index 0000000..6a6b95c --- /dev/null +++ b/.config/.gitignore-template @@ -0,0 +1,26 @@ +# macOS system files +**/.DS_Store + +# Node.js dependencies +node_modules/ + +# Environment variables +**/.env + +# Python cache files +**/__pycache__/ +*.py[cod] + +# Python virtual environments +venv/ +./venv +.env/ +uv.lock + +# .gitignore file +**/.gitignore + +# Jupyter +./.ipynb_checkpoints/ + + diff --git a/.config/Brewfile b/.config/Brewfile new file mode 100644 index 0000000..a008b76 --- /dev/null +++ b/.config/Brewfile @@ -0,0 +1,40 @@ +brew "git" +brew "nvim" +brew "bat" +brew "eza" +brew "fastfetch" +brew "ffmpeg" +brew "fish" +brew "fzf" +brew "fd" +brew "ripgrep" +brew "make" +brew "yazi" +brew "zoxide" +brew "node" +brew "btop" +brew "yarn" +brew "lazygit" +brew "atuin" +brew "starship" + +cask "visual-studio-code" +cask "google-chrome" +cask "middleclick" +cask "obs" +cask "betterdisplay" +cask "coconutbattery" +cask "jordanbaird-ice" +cask "raycast" +cask "karabiner-elements" +cask "keyboardcleantool" +cask "linearmouse" +cask "shottr" +cask "docker" +cask "vlc" +cask "discord" +cask "spotify" +cask "aldente" +cask "ghossty" +cask "vivaldi" +cask "brave" diff --git a/.config/aerospace/aerospace.toml b/.config/aerospace/aerospace.toml new file mode 100644 index 0000000..1e6ad54 --- /dev/null +++ b/.config/aerospace/aerospace.toml @@ -0,0 +1,77 @@ +# You can use it to add commands that run after login to macOS user session. +# 'start-at-login' needs to be 'true' for 'after-login-command' to work +# Available commands: https://nikitabobko.github.io/AeroSpace/commands +# after-login-command = ["exec-and-forget /bin/bash /Users/tomiko/.config/kanata/kanata.sh"] +after-login-command = [] + +# You can use it to add commands that run after AeroSpace startup. +# 'after-startup-command' is run after 'after-login-command' +# Available commands : https://nikitabobko.github.io/AeroSpace/commands +# Run Sketchybar together with AeroSpace +# sketchbar has a built-in detection of already running process, +# so it won't be run twice on AeroSpace restart +after-startup-command = [] + +start-at-login = true + +enable-normalization-flatten-containers = true +enable-normalization-opposite-orientation-for-nested-containers = true + +default-root-container-layout = 'accordion' + +accordion-padding = 0 + +default-root-container-orientation = 'horizontal' + +key-mapping.preset = 'qwerty' + +# Gaps between windows (inner-*) and between monitor edges (outer-*). +# Possible values: +# - Constant: gaps.outer.top = 8 +# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24] +# In this example, 24 is a default value when there is no match. +# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'. +# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors +[gaps] +inner.horizontal = 0 +inner.vertical = 0 +outer.left = 0 +outer.bottom = 0 +outer.top = 0 +outer.right = 0 + +[mode.main.binding] + +# All possible keys: +# - Letters. a, b, c, ..., z +# - Numbers. 0, 1, 2, ..., 9 +# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9 +# - F-keys. f1, f2, ..., f20 +# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, backtick, +# leftSquareBracket, rightSquareBracket, space, enter, esc, backspace, tab +# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual, +# keypadMinus, keypadMultiply, keypadPlus +# - Arrows. left, down, up, right + +# All possible modifiers: cmd, alt, ctrl, shift + +# All possible commands: https://nikitabobko.github.io/AeroSpace/commands +alt-shift-p = 'focus left' +alt-shift-n = 'focus right' + +alt-1 = 'workspace 1' +alt-2 = 'workspace 2' +alt-3 = 'workspace 3' + +alt-shift-1 = 'move-node-to-workspace 1' +alt-shift-2 = 'move-node-to-workspace 2' +alt-shift-3 = 'move-node-to-workspace 3' + + +[[on-window-detected]] +if.app-id = 'com.mitchellh.ghostty' +run = 'move-node-to-workspace 2' +check-further-callbacks = false + +[[on-window-detected]] +run = 'move-node-to-workspace 1' diff --git a/.config/bat/config b/.config/bat/config new file mode 100644 index 0000000..83169f3 --- /dev/null +++ b/.config/bat/config @@ -0,0 +1 @@ +--theme 'Nord' diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf new file mode 100644 index 0000000..21392cb --- /dev/null +++ b/.config/btop/btop.conf @@ -0,0 +1,221 @@ +#? Config file for btop v. 1.4.4 + +#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. +#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" +color_theme = "nord" + +#* If the theme set background should be shown, set to False if you want terminal background transparency. +theme_background = False + +#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. +truecolor = True + +#* Set to true to force tty mode regardless if a real tty has been detected or not. +#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. +force_tty = False + +#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. +#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. +#* Use whitespace " " as separator between different presets. +#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" +presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" + +#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = False + +#* Rounded corners on boxes, is ignored if TTY mode is ON. +rounded_corners = True + +#* Default symbols to use for graph creation, "braille", "block" or "tty". +#* "braille" offers the highest resolution but might not be included in all fonts. +#* "block" has half the resolution of braille but uses more common characters. +#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. +#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. +graph_symbol = "braille" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_cpu = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_mem = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_net = "default" + +# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". +graph_symbol_proc = "default" + +#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace. +shown_boxes = "cpu mem net proc" + +#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. +update_ms = 2000 + +#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", +#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. +proc_sorting = "pid" + +#* Reverse sorting order, True or False. +proc_reversed = False + +#* Show processes as a tree. +proc_tree = False + +#* Use the cpu graph colors in the process list. +proc_colors = True + +#* Use a darkening gradient in the process list. +proc_gradient = True + +#* If process cpu usage should be of the core it's running on or usage of the total available cpu power. +proc_per_core = False + +#* Show process memory as bytes instead of percent. +proc_mem_bytes = True + +#* Show cpu graph for each process. +proc_cpu_graphs = True + +#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) +proc_info_smaps = False + +#* Show proc box on left side of screen instead of right. +proc_left = False + +#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). +proc_filter_kernel = False + +#* In tree-view, always accumulate child process resources in the parent process. +proc_aggregate = False + +#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_upper = "Auto" + +#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available. +#* Select from a list of detected attributes from the options menu. +cpu_graph_lower = "Auto" + +#* Toggles if the lower CPU graph should be inverted. +cpu_invert_lower = True + +#* Set to True to completely disable the lower CPU graph. +cpu_single_graph = False + +#* Show cpu box at bottom of screen instead of top. +cpu_bottom = False + +#* Shows the system uptime in the CPU box. +show_uptime = True + +#* Show cpu temperature. +check_temp = True + +#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. +cpu_sensor = "Auto" + +#* Show temperatures for cpu cores also if check_temp is True and sensors has been found. +show_coretemp = True + +#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. +#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. +#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries. +#* Example: "4:0 5:1 6:3" +cpu_core_map = "" + +#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". +temp_scale = "celsius" + +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = False + +#* Show CPU frequency. +show_cpu_freq = True + +#* Draw a clock at top of screen, formatting according to strftime, empty string to disable. +#* Special formatting: /host = hostname | /user = username | /uptime = system uptime +clock_format = "%X" + +#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. +background_update = True + +#* Custom cpu model name, empty string to disable. +custom_cpu_name = "" + +#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". +#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user" +disks_filter = "" + +#* Show graphs instead of meters for memory values. +mem_graphs = True + +#* Show mem box below net box instead of above. +mem_below_net = False + +#* Count ZFS ARC in cached and available memory. +zfs_arc_cached = True + +#* If swap memory should be shown in memory box. +show_swap = True + +#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. +swap_disk = True + +#* If mem box should be split to also show disks info. +show_disks = True + +#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. +only_physical = True + +#* Read disks list from /etc/fstab. This also disables only_physical. +use_fstab = True + +#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) +zfs_hide_datasets = False + +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + +#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. +show_io_stat = True + +#* Toggles io mode for disks, showing big graphs for disk read/write speeds. +io_mode = False + +#* Set to True to show combined read/write io graphs in io mode. +io_graph_combined = False + +#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". +#* Example: "/mnt/media:100 /:20 /boot:1". +io_graph_speeds = "" + +#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False. +net_download = 100 + +net_upload = 100 + +#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. +net_auto = True + +#* Sync the auto scaling for download and upload to whichever currently has the highest scale. +net_sync = False + +#* Starts with the Network Interface specified here. +net_iface = "" + +#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes. +base_10_bitrate = "Auto" + +#* Show battery stats in top right if battery is present. +show_battery = True + +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + +#* Show power stats of battery next to charge indicator. +show_battery_watts = True + +#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. +log_level = "WARNING" diff --git a/.config/btop/btop.log b/.config/btop/btop.log new file mode 100644 index 0000000..0151b4c --- /dev/null +++ b/.config/btop/btop.log @@ -0,0 +1,6 @@ + +2025/03/03 (02:17:12) | ===> btop++ v.1.4.0 +2025/03/03 (02:17:12) | WARNING: Failed to set locale UTF-8 continuing anyway. + +2025/03/03 (02:17:28) | ===> btop++ v.1.4.0 +2025/03/03 (02:17:28) | WARNING: Failed to set locale UTF-8 continuing anyway. diff --git a/.config/config.yml b/.config/config.yml new file mode 100644 index 0000000..21ea0dc --- /dev/null +++ b/.config/config.yml @@ -0,0 +1,2 @@ +os: + edit: "nvim {{filename}}" diff --git a/.config/fastfetch/config.jsonc b/.config/fastfetch/config.jsonc new file mode 100644 index 0000000..2a40b45 --- /dev/null +++ b/.config/fastfetch/config.jsonc @@ -0,0 +1,115 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "type": "none" + }, + "modules": [ + "break", + { + "type": "custom", + "format": "\u001b[33m┌──────────────────────Hardware──────────────────────┐" + }, + { + "type": "host", + "key": " PC", + "keyColor": "red", + "format": "MacBook Pro (14-inch, 2024)" + }, + { + "type": "cpu", + "key": "│ ├", + "showPeCoreCount": true, + "keyColor": "red" + }, + { + "type": "gpu", + "key": "│ ├", + "keyColor": "red" + }, + { + "type": "memory", + "key": "│ ├", + "keyColor": "red" + }, + { + "type": "disk", + "key": "│ └", + "keyColor": "red", + "format": "{1} / {2} ({3}) - {9}" + }, + { + "type": "custom", + "format": "\u001b[33m└────────────────────────────────────────────────────┘" + }, + "break", + { + "type": "custom", + "format": "\u001b[33m┌──────────────────────Software──────────────────────┐" + }, + { + "type": "os", + "key": " OS", + "keyColor": "green" + }, + { + "type": "kernel", + "key": "│ ├", + "keyColor": "green" + }, + { + "type": "packages", + "key": "│ ├", + "keyColor": "green" + }, + { + "type": "terminal", + "key": "│ ├", + "keyColor": "green" + }, + { + "type": "shell", + "key": "└ └", + "keyColor": "green" + }, + { + "type": "custom", + "format": "\u001b[33m└────────────────────────────────────────────────────┘" + }, + "break", + { + "type": "custom", + "format": "\u001b[33m┌───────────────────Miscellaneous────────────────────┐" + }, + { + "type": "uptime", + "key": " Uptime", + "keyColor": "magenta" + }, + { + "type": "battery", + "key": " Battery", + "keyColor": "magenta", + "format": "{4} ({12} hours, {13} minutes remaining)" + }, + { + "type": "media", + "key": " Music", + "keyColor": "magenta", + "format": "{1} - {4}" + }, + { + "type": "custom", + "format": " A star can only truly be seen in the darkness...", + "outputColor": "cyan" + }, + { + "type": "custom", + "format": "\u001b[33m└────────────────────────────────────────────────────┘" + }, + {"type": "colors", + "paddingLeft": 20, + "symbol": "star" + }, + "break" + ] +} diff --git a/.config/fish/config.fish b/.config/fish/config.fish new file mode 100644 index 0000000..9c5de4a --- /dev/null +++ b/.config/fish/config.fish @@ -0,0 +1,81 @@ +if status is-interactive + clear +end + +function fish_greeting; end + +function f + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end + +function lt; + eza --tree --color=always --icons=always --level=$argv +end + +function a + set max_depth 5 + set current_depth 0 + set dir (pwd) + + while test $current_depth -lt $max_depth + if test -d "$dir/venv" + source "$dir/venv/bin/activate.fish" + return 0 + end + set dir (dirname $dir) + set current_depth (math $current_depth + 1) + end + + echo "venv folder not found within $max_depth levels." + return 1 +end + +function gitzip + git ls-files | zip archive.zip -@ +end + +alias c=clear +alias g=fg +alias v=nvim +alias vv="nvim ." +alias ic="cd ~/Library/Mobile Documents/com~apple~CloudDocs" +alias cc="clear & cd" +alias l="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions --group-directories-first" +alias ll="eza --color=always --long --git --icons=always --no-user --group-directories-first" +alias la="eza -a --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions --group-directories-first" +alias ff="fastfetch" +alias p=pgcli +alias t="tmux attach" +alias d="deactivate" +alias venv="python3 -m venv venv" +alias cd="z" +alias gi="git init && aig" +alias gs="git status" +alias aig="cp ~/.config/.gitignore-template ./.gitignore" +alias u="uv run" + + +function ga + git add -A + git commit -m "auto" +end + +# Created by `pipx` on 2024-11-25 11:43:56 +set PATH $PATH /Users/tom/.local/bin +# Cargo path +set PATH $HOME/.cargo/bin $PATH + +eval "$(/opt/homebrew/bin/brew shellenv)" +zoxide init fish | source +atuin init fish --disable-up-arrow | source +export EDITOR="nvim" + +# uv +fish_add_path "/Users/tomiko/.local/bin" + +starship init fish | source diff --git a/.config/fish/fish_variables b/.config/fish/fish_variables new file mode 100644 index 0000000..eb2b27e --- /dev/null +++ b/.config/fish/fish_variables @@ -0,0 +1,43 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR __fish_initialized:3800 +SETUVAR fish_color_autosuggestion:4c566a +SETUVAR fish_color_cancel:\x2d\x2dreverse +SETUVAR fish_color_command:88c0d0 +SETUVAR fish_color_comment:4c566a\x1e\x2d\x2ditalics +SETUVAR fish_color_cwd:5e81ac +SETUVAR fish_color_cwd_root:bf616a +SETUVAR fish_color_end:81a1c1 +SETUVAR fish_color_error:bf616a +SETUVAR fish_color_escape:ebcb8b +SETUVAR fish_color_history_current:e5e9f0\x1e\x2d\x2dbold +SETUVAR fish_color_host:a3be8c +SETUVAR fish_color_host_remote:ebcb8b +SETUVAR fish_color_keyword:81a1c1 +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:81a1c1 +SETUVAR fish_color_option:8fbcbb +SETUVAR fish_color_param:d8dee9 +SETUVAR fish_color_quote:a3be8c +SETUVAR fish_color_redirection:b48ead\x1e\x2d\x2dbold +SETUVAR fish_color_search_match:\x2d\x2dbold\x1e\x2d\x2dbackground\x3d434c5e +SETUVAR fish_color_selection:d8dee9\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3d434c5e +SETUVAR fish_color_status:bf616a +SETUVAR fish_color_user:a3be8c +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_background:\x1d +SETUVAR fish_pager_color_completion:e5e9f0 +SETUVAR fish_pager_color_description:ebcb8b\x1e\x2d\x2ditalics +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:3b4252\x1e\x2d\x2dbackground\x3dd08770 +SETUVAR fish_pager_color_secondary_background:\x1d +SETUVAR fish_pager_color_secondary_completion:\x1d +SETUVAR fish_pager_color_secondary_description:\x1d +SETUVAR fish_pager_color_secondary_prefix:\x1d +SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3d434c5e +SETUVAR fish_pager_color_selected_completion:\x1d +SETUVAR fish_pager_color_selected_description:\x1d +SETUVAR fish_pager_color_selected_prefix:\x1d +SETUVAR fish_user_paths:/Users/tomiko/\x2elocal/bin diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..1e5e722 --- /dev/null +++ b/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,91 @@ +function fish_prompt + set -l __last_command_exit_status $status + + if not set -q -g __fish_arrow_functions_defined + set -g __fish_arrow_functions_defined + function _git_branch_name + set -l branch (git symbolic-ref --quiet HEAD 2>/dev/null) + if set -q branch[1] + echo (string replace -r '^refs/heads/' '' $branch) + else + echo (git rev-parse --short HEAD 2>/dev/null) + end + end + + function _is_git_dirty + not command git diff-index --cached --quiet HEAD -- &>/dev/null + or not command git diff --no-ext-diff --quiet --exit-code &>/dev/null + end + + function _is_git_repo + type -q git + or return 1 + git rev-parse --git-dir >/dev/null 2>&1 + end + + function _hg_branch_name + echo (hg branch 2>/dev/null) + end + + function _is_hg_dirty + set -l stat (hg status -mard 2>/dev/null) + test -n "$stat" + end + + function _is_hg_repo + fish_print_hg_root >/dev/null + end + + function _repo_branch_name + _$argv[1]_branch_name + end + + function _is_repo_dirty + _is_$argv[1]_dirty + end + + function _repo_type + if _is_hg_repo + echo hg + return 0 + else if _is_git_repo + echo git + return 0 + end + return 1 + end + end + + set -l cyan (set_color -o cyan) + set -l yellow (set_color -o yellow) + set -l red (set_color -o red) + set -l green (set_color -o green) + set -l blue (set_color -o blue) + set -l normal (set_color normal) + + set -l arrow_color "$green" + if test $__last_command_exit_status != 0 + set arrow_color "$red" + end + + set -l arrow "$arrow_color➜ " + if fish_is_root_user + set arrow "$arrow_color# " + end + + set -l cwd $yellow(prompt_pwd) + + set -l repo_info + if set -l repo_type (_repo_type) + set -l repo_branch $red(_repo_branch_name $repo_type) + set repo_info "$cyan $repo_type:($repo_branch$cyan)" + + if _is_repo_dirty $repo_type + set -l dirty "$yellow ✗" + set repo_info "$repo_info$dirty" + end + end + + echo $arrow $cwd $repo_info $normal + # echo $arrow +end diff --git a/.config/ghostty/config b/.config/ghostty/config new file mode 100644 index 0000000..488a14b --- /dev/null +++ b/.config/ghostty/config @@ -0,0 +1,19 @@ +macos-window-shadow = false +theme = nord +font-size = 22 +#font-family = "Maple Mono" +font-family = "IosevkaTerm Nerd Font" +keybind = global:alt+c=toggle_quick_terminal +macos-option-as-alt = true +cursor-style = block +cursor-style-blink = false +shell-integration-features = no-cursor +confirm-close-surface = false +macos-titlebar-style = hidden +quick-terminal-animation-duration = 0 +background = #000000 +background-blur = 15 +background-opacity = 0.8 + +keybind = super+k=text:\x13\x4b +keybind = super+l=text:\x13\x4c diff --git a/.config/install.sh b/.config/install.sh new file mode 100644 index 0000000..89be1d3 --- /dev/null +++ b/.config/install.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Request sudo password at the start (only once) +echo "Requesting sudo privileges..." +sudo -v + +# Check if Homebrew is installed and install it if not +if ! command -v brew &> /dev/null +then + echo "Homebrew not found. Installing Homebrew..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +else + echo "Homebrew is already installed." +fi + +# macOS settings +echo "Configuring macOS system settings..." +defaults write -g NSWindowShouldDragOnGesture -bool true +defaults write com.apple.dock autohide -bool true +defaults write com.apple.dock tilesize -int 30 +defaults write com.apple.dock persistent-apps -array +defaults write com.apple.dock show-recents -bool false +defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false +defaults write -g NSGrammarCheckingEnabled -bool false +defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false +defaults write -g NSAutomaticDashSubstitutionEnabled -bool false +defaults write com.apple.dock autohide-time-modifier -float 0.15; +defaults delete com.apple.dock autohide-delay; +defaults write -g KeyRepeat -int 1 +defaults write -g InitialKeyRepeat -int 20 +killall Dock + +# Ensure Fish shell is available in /etc/shells and set it as the default +grep -qxF "/opt/homebrew/bin/fish" /etc/shells || echo "/opt/homebrew/bin/fish" | sudo tee -a /etc/shells +chsh -s /opt/homebrew/bin/fish + +# Instructions for additional apps +echo "Go to System Settings > Keyboard > Text Input and disable all" + +cd "~/dotfiles/" +stow . +# Install packages with Homebrew +brew bundle diff --git a/.config/karabiner/karabiner.json b/.config/karabiner/karabiner.json new file mode 100644 index 0000000..5f4d55c --- /dev/null +++ b/.config/karabiner/karabiner.json @@ -0,0 +1,368 @@ +{ + "global": { + "show_in_menu_bar": false + }, + "profiles": [ + { + "complex_modifications": { + "rules": [ + { + "description": "left_ctrl -> cmd+tab if pressed alone", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "left_command" + }, + "to": [ + { + "key_code": "left_command" + } + ], + "to_if_alone": [ + { + "key_code": "tab", + "modifiers": [ + "command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Disable Control + Left Click", + "enabled": false, + "manipulators": [ + { + "from": { + "modifiers": { + "mandatory": [ + "control" + ], + "optional": [ + "any" + ] + }, + "pointing_button": "button1" + }, + "to": [ + { + "pointing_button": "button1" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Change caps_lock to Hyper Key (⌃⌥⇧⌘)", + "manipulators": [ + { + "from": { + "key_code": "caps_lock", + "modifiers": { + "optional": [ + "any" + ] + } + }, + "to": [ + { + "key_code": "left_option" + } + ], + "to_if_alone": [ + { + "key_code": "escape" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+h -> left_arrow", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "h", + "modifiers": { + "mandatory": [ + "left_command", + "left_control", + "left_option", + "left_shift" + ] + } + }, + "to": [ + { + "key_code": "left_arrow", + "modifiers": [] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+j -> down_arrow", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "j", + "modifiers": { + "mandatory": [ + "left_command", + "left_control", + "left_option", + "left_shift" + ] + } + }, + "to": [ + { + "key_code": "down_arrow", + "modifiers": [] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+k -> up_arrow", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "k", + "modifiers": { + "mandatory": [ + "left_command", + "left_control", + "left_option", + "left_shift" + ] + } + }, + "to": [ + { + "key_code": "up_arrow", + "modifiers": [] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+l -> right_arrow", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": [ + "left_command", + "left_control", + "left_option", + "left_shift" + ] + } + }, + "to": [ + { + "key_code": "right_arrow", + "modifiers": [] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+s -> left_control+s", + "manipulators": [ + { + "from": { + "key_code": "s", + "modifiers": { + "mandatory": [ + "left_option" + ] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "left_control" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+delete_or_backspace -> left_option+delete_or_backspace", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "delete_or_backspace", + "modifiers": { + "mandatory": [ + "left_shift", + "left_command", + "left_control", + "left_option" + ] + } + }, + "to": [ + { + "key_code": "delete_or_backspace", + "modifiers": [ + "left_option" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+a -> left_control+a", + "manipulators": [ + { + "from": { + "key_code": "a", + "modifiers": { + "mandatory": [ + "left_option" + ] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "left_control" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+tab -> left_command+t", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "tab", + "modifiers": { + "mandatory": [ + "left_shift", + "left_command", + "left_control", + "left_option" + ] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "left_command" + ] + } + ], + "type": "basic" + } + ] + }, + { + "description": "left_control+return_or_enter -> left click", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": [ + "left_control" + ] + } + }, + "to": [ + { + "pointing_button": "button1" + } + ], + "type": "basic" + } + ] + }, + { + "description": "Hyper+q -> right_command+k", + "enabled": false, + "manipulators": [ + { + "from": { + "key_code": "q", + "modifiers": { + "mandatory": [ + "left_option", + "left_shift", + "left_command", + "left_control" + ] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "right_command" + ] + } + ], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "identifiers": { + "is_keyboard": true, + "product_id": 53297, + "vendor_id": 13364 + }, + "ignore": true + }, + { + "identifiers": { + "is_keyboard": true, + "product_id": 166, + "vendor_id": 5426 + }, + "ignore": true + } + ], + "virtual_hid_keyboard": { + "keyboard_type_v2": "ansi" + } + } + ] +} diff --git a/.config/lazygit/config.yml b/.config/lazygit/config.yml new file mode 100644 index 0000000..21ea0dc --- /dev/null +++ b/.config/lazygit/config.yml @@ -0,0 +1,2 @@ +os: + edit: "nvim {{filename}}" diff --git a/.config/linearmouse/linearmouse.json b/.config/linearmouse/linearmouse.json new file mode 100644 index 0000000..9427db9 --- /dev/null +++ b/.config/linearmouse/linearmouse.json @@ -0,0 +1,255 @@ +{ + "schemes" : [ + { + "scrolling" : { + "distance" : { + "vertical" : 3 + }, + "acceleration" : { + "vertical" : 1 + }, + "reverse" : { + "vertical" : true + }, + "speed" : { + "vertical" : 0 + } + }, + "if" : { + "device" : { + "serialNumber" : "000000000000", + "productID" : "0xa6", + "productName" : "Razer Viper V2 Pro", + "category" : "mouse", + "vendorID" : "0x1532" + } + }, + "pointer" : { + "disableAcceleration" : true, + "acceleration" : 1.2 + } + }, + { + "scrolling" : { + "acceleration" : { + "vertical" : 1 + }, + "reverse" : { + "vertical" : true + }, + "speed" : { + "vertical" : 0 + }, + "distance" : { + "vertical" : 3 + } + }, + "if" : { + "device" : { + "productID" : "0x27da", + "serialNumber" : "pqrs.org:Karabiner-DriverKit-VirtualHIDPointing", + "category" : "mouse", + "productName" : "Karabiner DriverKit VirtualHIDPointing 1.7.0", + "vendorID" : "0x16c0" + } + }, + "pointer" : { + "disableAcceleration" : true + } + }, + { + "scrolling" : { + "speed" : 0, + "acceleration" : 1, + "reverse" : { + "vertical" : true + }, + "distance" : 3 + }, + "if" : { + "device" : { + "category" : "mouse", + "productName" : "Logitech Pebble", + "vendorID" : "0x46d", + "serialNumber" : "2E61FDC85A9743AE", + "productID" : "0xb021" + } + }, + "pointer" : { + "disableAcceleration" : true, + "acceleration" : 0.8663 + } + }, + { + "scrolling" : { + "reverse" : true, + "acceleration" : 1, + "speed" : 0, + "distance" : { + "horizontal" : 3, + "vertical" : "auto" + } + }, + "if" : { + "device" : { + "category" : "mouse", + "productID" : "0xd031", + "vendorID" : "0x3434", + "productName" : "Keychron Link " + } + }, + "pointer" : { + "acceleration" : 0.8655, + "disableAcceleration" : true + } + }, + { + "pointer" : { + "disableAcceleration" : true + }, + "if" : { + "device" : { + "category" : "mouse", + "vendorID" : "0x3434", + "serialNumber" : "SN1234567890", + "productID" : "0xd03f", + "productName" : "Keychron M6" + } + }, + "scrolling" : { + "acceleration" : 1, + "reverse" : true, + "distance" : 3, + "speed" : 0 + } + }, + { + "pointer" : { + "disableAcceleration" : true + }, + "if" : { + "device" : { + "category" : "mouse", + "productID" : "0xd03f", + "productName" : "Keychron M6 ", + "vendorID" : "0x3434" + } + }, + "scrolling" : { + "distance" : 3, + "speed" : 0, + "reverse" : true, + "acceleration" : 1 + } + }, + { + "buttons" : { + "universalBackForward" : true + }, + "pointer" : { + "disableAcceleration" : true, + "acceleration" : 0.6 + }, + "if" : { + "device" : { + "productID" : "0x27da", + "category" : "mouse", + "serialNumber" : "pqrs.org:Karabiner-DriverKit-VirtualHIDPointing", + "productName" : "Karabiner DriverKit VirtualHIDPointing 1.8.0", + "vendorID" : "0x16c0" + } + }, + "scrolling" : { + "distance" : { + "vertical" : 3 + }, + "speed" : { + "vertical" : 0 + }, + "reverse" : { + "vertical" : true + }, + "acceleration" : { + "vertical" : 1 + } + } + }, + { + "pointer" : { + "acceleration" : 0.8059 + }, + "if" : { + "device" : { + "category" : "trackpad", + "productID" : "0x0", + "productName" : "Apple Internal Keyboard \/ Trackpad", + "vendorID" : "0x0" + } + } + }, + { + "if" : { + "device" : { + "vendorID" : "0x0", + "productName" : "Apple Internal Keyboard \/ Trackpad", + "productID" : "0x0", + "category" : "trackpad" + }, + "app" : "org.pqrs.Karabiner-Elements.Settings" + }, + "scrolling" : { + "acceleration" : { + "vertical" : 1 + } + } + }, + { + "pointer" : { + "acceleration" : 0.2, + "disableAcceleration" : true, + "speed" : 0.1 + }, + "if" : { + "device" : { + "serialNumber" : "vial:f64c2b3c", + "category" : "mouse", + "vendorID" : "0xc2ab", + "productID" : "0x3939", + "productName" : "Ferris sweep" + } + }, + "scrolling" : { + "distance" : { + "vertical" : 3 + }, + "acceleration" : { + "vertical" : 1 + }, + "speed" : { + "vertical" : 0 + } + } + }, + { + "pointer" : { + "acceleration" : 1.0387, + "disableAcceleration" : true + }, + "if" : { + "device" : { + "category" : "mouse", + "productName" : "Keychron Link ", + "productID" : "0xd030", + "vendorID" : "0x3434" + } + }, + "scrolling" : { + "distance" : 3, + "acceleration" : 1, + "speed" : 0, + "reverse" : true + } + } + ], + "$schema" : "https:\/\/schema.linearmouse.app\/0.10.0" +} diff --git a/.config/nvim/.editorconfig b/.config/nvim/.editorconfig new file mode 100644 index 0000000..9a6cc75 --- /dev/null +++ b/.config/nvim/.editorconfig @@ -0,0 +1,3 @@ +[*.lua] +indent_style = space +indent_size = 2 diff --git a/.config/nvim/.luarc.json b/.config/nvim/.luarc.json new file mode 100644 index 0000000..59e3c38 --- /dev/null +++ b/.config/nvim/.luarc.json @@ -0,0 +1,10 @@ +{ + "diagnostics.globals": [ + "MiniFiles", + "Snacks", + "MiniSplitjoin", + "hipatterns", + "MiniDiff", + "vim" + ] +}
\ No newline at end of file diff --git a/.config/nvim/after/ftplugin/css.lua b/.config/nvim/after/ftplugin/css.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/.config/nvim/after/ftplugin/css.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/.config/nvim/after/ftplugin/html.lua b/.config/nvim/after/ftplugin/html.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/.config/nvim/after/ftplugin/html.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/.config/nvim/after/ftplugin/htmldjango.lua b/.config/nvim/after/ftplugin/htmldjango.lua new file mode 100644 index 0000000..2a12368 --- /dev/null +++ b/.config/nvim/after/ftplugin/htmldjango.lua @@ -0,0 +1,15 @@ +local set = vim.opt_local + +-- set.shiftwidth = 2 + +vim.api.nvim_create_augroup("DjangoTemplates", { clear = true }) + +vim.api.nvim_create_autocmd("FileType", { + group = "DjangoTemplates", + pattern = "htmldjango", + callback = function() + vim.cmd("setlocal syntax=on") + vim.cmd("syntax include @Javascript syntax/javascript.vim") + vim.cmd("syntax region javascript start=/<script>/ end=/<\\/script>/ contains=@Javascript") + end, +}) diff --git a/.config/nvim/after/ftplugin/javascript.lua b/.config/nvim/after/ftplugin/javascript.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/.config/nvim/after/ftplugin/javascript.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/.config/nvim/after/ftplugin/javascriptreact.lua b/.config/nvim/after/ftplugin/javascriptreact.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/.config/nvim/after/ftplugin/javascriptreact.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/.config/nvim/after/ftplugin/json.lua b/.config/nvim/after/ftplugin/json.lua new file mode 100644 index 0000000..a38fed5 --- /dev/null +++ b/.config/nvim/after/ftplugin/json.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.conceallevel = 0 diff --git a/.config/nvim/after/ftplugin/lua.lua b/.config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..c0e2391 --- /dev/null +++ b/.config/nvim/after/ftplugin/lua.lua @@ -0,0 +1,5 @@ +local set = vim.opt_local + +set.shiftwidth = 2 +set.number = true +set.relativenumber = true diff --git a/.config/nvim/after/ftplugin/md.lua b/.config/nvim/after/ftplugin/md.lua new file mode 100644 index 0000000..5b3770c --- /dev/null +++ b/.config/nvim/after/ftplugin/md.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.shiftwidth = 2 diff --git a/.config/nvim/after/ftplugin/rust.lua b/.config/nvim/after/ftplugin/rust.lua new file mode 100644 index 0000000..4060c9d --- /dev/null +++ b/.config/nvim/after/ftplugin/rust.lua @@ -0,0 +1,13 @@ +local bufnr = vim.api.nvim_get_current_buf() +vim.keymap.set("n", "<leader>ca", function() + vim.cmd.RustLsp("codeAction") -- supports rust-analyzer's grouping + -- or vim.lsp.buf.codeAction() if you don't want grouping. +end, { silent = true, buffer = bufnr }) +vim.keymap.set( + "n", + "K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions + function() + vim.cmd.RustLsp({ "hover", "actions" }) + end, + { silent = true, buffer = bufnr } +) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..75ae3e9 --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,5 @@ +vim.g.bullets_enable_in_empty_buffers = 0 +require("config.lazy") +require("options") +require("mappings") +require("autocmds") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..369d7ab --- /dev/null +++ b/.config/nvim/lazy-lock.json @@ -0,0 +1,44 @@ +{ + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "blink-emoji.nvim": { "branch": "master", "commit": "f22ce8cac02a6ece05368220f1e38bd34fe376f9" }, + "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, + "blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" }, + "bullets.vim": { "branch": "master", "commit": "1c13e510e11d08b0259e8e627f128359c5521962" }, + "cmp-sql": { "branch": "master", "commit": "54193ac99e3855c6ffaa36f83a7c50213df03157" }, + "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "fzf-lua": { "branch": "main", "commit": "8c8845ca6d05bc768b7ce27ebe3682ddf7e6a996" }, + "gitsigns.nvim": { "branch": "main", "commit": "8bdaccdb897945a3c99c1ad8df94db0ddf5c8790" }, + "hardtime.nvim": { "branch": "main", "commit": "145b930954a3146cfb5b8a73cdcad42eb7d2740c" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "60eaff7a470b8e78ddff09d847d17a011f560759" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, + "mini.nvim": { "branch": "main", "commit": "de0a88d925c8e69fdbb498141207ee43504e5cd1" }, + "nord.nvim": { "branch": "master", "commit": "80c1e5321505aeb22b7a9f23eb82f1e193c12470" }, + "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" }, + "nvim-lspconfig": { "branch": "master", "commit": "03bc581e05e81d33808b42b2d7e76d70adb3b595" }, + "nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, + "oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" }, + "outline.nvim": { "branch": "main", "commit": "321f89ef79f168a78685f70d70c52d0e7b563abb" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" }, + "render-markdown.nvim": { "branch": "main", "commit": "d69f0d8c80ba293d25dad498ec86e9b583a6bbbf" }, + "rustaceanvim": { "branch": "master", "commit": "5120207f90846704a74cbf043295698b009bd5de" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, + "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, + "vim-tmux-navigator": { "branch": "master", "commit": "96da8e10ce83b754f442c3e25d1bf74451d220f2" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/.config/nvim/lua/autocmds.lua b/.config/nvim/lua/autocmds.lua new file mode 100644 index 0000000..13f235c --- /dev/null +++ b/.config/nvim/lua/autocmds.lua @@ -0,0 +1,28 @@ +vim.api.nvim_create_autocmd("TextYankPost", { + desc = "Highlight when yanking (copying) text", + group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "gitcommit", "markdown" }, + callback = function(event) + vim.keymap.set("i", "`", "`", { buffer = event.buf }) + end, +}) + +vim.api.nvim_create_autocmd("InsertEnter", { + pattern = "*.md", + callback = function() + vim.opt.conceallevel = 0 + end, +}) + +vim.api.nvim_create_autocmd("InsertLeave", { + pattern = "*.md", + callback = function() + vim.opt.conceallevel = 3 + end, +}) diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..ba9b8f3 --- /dev/null +++ b/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,36 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end + +-- Hey! Put lazy into the runtimepath for neovim! +vim.opt.runtimepath:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + { import = "config.plugins" }, + }, + ui = { + backdrop = 100, + }, + change_detection = { + -- automatically check for config file changes and reload the ui + enabled = false, + notify = false, -- get a notification when changes are found + }, +}) diff --git a/.config/nvim/lua/config/plugins/blink-cmp.lua b/.config/nvim/lua/config/plugins/blink-cmp.lua new file mode 100644 index 0000000..d51ba4a --- /dev/null +++ b/.config/nvim/lua/config/plugins/blink-cmp.lua @@ -0,0 +1,114 @@ +return { + { + "saghen/blink.compat", + version = "*", + lazy = true, + opts = {}, + }, + { + "saghen/blink.cmp", + event = "VeryLazy", + -- optional: provides snippets for the snippet source + dependencies = { + "rafamadriz/friendly-snippets", + "moyiz/blink-emoji.nvim", + "ray-x/cmp-sql", + }, + + -- use a release tag to download pre-built binaries + version = "1.*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + opts = { + snippets = { + preset = "luasnip", -- Choose LuaSnip as the snippet engine + }, + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { + preset = "default", + }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { + documentation = { auto_show = true, window = { border = "single" } }, + }, + signature = { enabled = true }, + + sources = { + default = { "lsp", "path", "snippets", "buffer", "emoji", "sql" }, + providers = { + snippets = { + name = "snippets", + module = "blink.cmp.sources.snippets", + enabled = true, + min_keyword_length = 2, + score_offset = 80, + }, + emoji = { + module = "blink-emoji", + name = "Emoji", + score_offset = 15, -- Tune by preference + opts = { insert = true }, -- Insert emoji (default) or complete its name + should_show_items = function() + return vim.tbl_contains( + -- Enable emoji completion only for git commits and markdown. + -- By default, enabled for all file-types. + { "gitcommit", "markdown" }, + vim.o.filetype + ) + end, + }, + sql = { + -- IMPORTANT: use the same name as you would for nvim-cmp + name = "sql", + module = "blink.compat.source", + + -- all blink.cmp source config options work as normal: + score_offset = -3, + + -- this table is passed directly to the proxied completion source + -- as the `option` field in nvim-cmp's source config + -- + -- this is NOT the same as the opts in a plugin's lazy.nvim spec + opts = {}, + should_show_items = function() + return vim.tbl_contains( + -- Enable emoji completion only for git commits and markdown. + -- By default, enabled for all file-types. + { "sql" }, + vim.o.filetype + ) + end, + }, + }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" }, + }, + opts_extend = { "sources.default" }, + }, +} diff --git a/.config/nvim/lua/config/plugins/colorscheme.lua b/.config/nvim/lua/config/plugins/colorscheme.lua new file mode 100644 index 0000000..ea130c7 --- /dev/null +++ b/.config/nvim/lua/config/plugins/colorscheme.lua @@ -0,0 +1,14 @@ +return { + "shaunsingh/nord.nvim", + priority = 1000, + init = function() + vim.cmd.colorscheme("nord") + vim.cmd.hi("Comment gui=none") + -- Set transparency + vim.cmd("hi Normal guibg=NONE ctermbg=NONE") + vim.cmd("hi NormalFloat guibg=NONE ctermbg=NONE") + vim.cmd("hi SignColumn guibg=NONE") + vim.cmd("hi FloatBorder guibg=NONE") + vim.cmd("hi CursorLine guibg=NONE") + end, +} diff --git a/.config/nvim/lua/config/plugins/conform.lua b/.config/nvim/lua/config/plugins/conform.lua new file mode 100644 index 0000000..afc2dd5 --- /dev/null +++ b/.config/nvim/lua/config/plugins/conform.lua @@ -0,0 +1,33 @@ +return { + "stevearc/conform.nvim", + event = "VeryLazy", + keys = { + { + "<leader>f", + function() + require("conform").format({ async = true, lsp_format = "fallback" }) + end, + mode = "", + desc = "Format buffer", + }, + }, + + opts = { + formatters_by_ft = { + lua = { "stylua" }, + python = { "isort", "black" }, + rust = { "rustfmt" }, + javascript = { "prettierd", "prettier", stop_after_first = true }, + typescript = { "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "prettierd", "prettier", stop_after_first = true }, + css = { "prettierd", "prettier", stop_after_first = true }, + html = { "prettierd", "prettier", stop_after_first = true }, + htmldjango = { "djlint" }, + typst = { "prettypst" }, + }, + format_on_save = { + timeout_ms = 500, + lsp_format = "fallback", + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/flash.lua b/.config/nvim/lua/config/plugins/flash.lua new file mode 100644 index 0000000..d4de4ee --- /dev/null +++ b/.config/nvim/lua/config/plugins/flash.lua @@ -0,0 +1,17 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + opts = { + modes = { + search = { enabled = false }, + char = { enabled = false }, + treesitter = { enabled = false }, + remote = { enabled = false }, + }, + }, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + }, +} diff --git a/.config/nvim/lua/config/plugins/fzflua.lua b/.config/nvim/lua/config/plugins/fzflua.lua new file mode 100644 index 0000000..ea8a744 --- /dev/null +++ b/.config/nvim/lua/config/plugins/fzflua.lua @@ -0,0 +1,29 @@ +return { + "ibhagwan/fzf-lua", + event = "VeryLazy", + dependencies = { "echasnovski/mini.icons" }, + opts = { + keymap = { + builtin = { + ["<S-j>"] = "preview-page-down", + ["<S-k>"] = "preview-page-up", + }, + }, + winopts = { + row = 1, + col = 0, + width = 1, + height = 0.4, + title_pos = "left", + preview = { + layout = "horizontal", + title_pos = "right", + }, + }, + files = { + -- Show hidden files but respect .gitignore + rg_opts = [[--color=never --hidden --files -g "!.git" --ignore-file ~/.config/git/ignore]], + fd_opts = [[--color=never --hidden --type f --type l --exclude .git --ignore-file ~/.config/git/ignore]], + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/gitsigns.lua b/.config/nvim/lua/config/plugins/gitsigns.lua new file mode 100644 index 0000000..13c3b20 --- /dev/null +++ b/.config/nvim/lua/config/plugins/gitsigns.lua @@ -0,0 +1,36 @@ +return { + { + "lewis6991/gitsigns.nvim", + event = "VeryLazy", + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end + + -- stylua: ignore start + map("n", "]g", gs.next_hunk, "Next Hunk") + map("n", "[g", gs.prev_hunk, "Prev Hunk") + map({ "n", "v" }, "<leader>gs", ":Gitsigns stage_hunk<CR>", "Stage Hunk") + map({ "n", "v" }, "<leader>gr", ":Gitsigns reset_hunk<CR>", "Reset Hunk") + map("n", "<leader>gS", gs.stage_buffer, "Stage Buffer") + map("n", "<leader>gd", gs.diffthis, "Diff this") + map("n", "<leader>gu", gs.undo_stage_hunk, "Undo Stage Hunk") + map("n", "<leader>gR", gs.reset_buffer, "Reset Buffer") + map("n", "<leader>gp", gs.preview_hunk, "Preview Hunk") + map("n", "<leader>gb", function() gs.blame_line({ full = true }) end, "Blame Line") + map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk") + end, + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/harpoon.lua b/.config/nvim/lua/config/plugins/harpoon.lua new file mode 100644 index 0000000..25168cc --- /dev/null +++ b/.config/nvim/lua/config/plugins/harpoon.lua @@ -0,0 +1,49 @@ +return { + "https://github.com/theprimeagen/harpoon", + branch = "harpoon2", + event = "VeryLazy", + config = function() + local harpoon = require("harpoon") + harpoon.setup({ + settings = { + save_on_toggle = true, + sync_on_ui_close = true, + key = function() + return vim.fn.getcwd() + end, + }, + }) + harpoon:setup() + + local list = harpoon:list("default") + local wk = require("which-key") + + wk.add({ + mode = { "n" }, + { + "<leader>a", + function() + list:add() + end, + hidden = true, + }, + { + "<leader><leader>", + function() + harpoon.ui:toggle_quick_menu(list) + end, + hidden = true, + }, + }) + for i = 1, 6 do + wk.add({ + "<leader>" .. i, + function() + list:select(i) + end, + hidden = true, + mode = "n", + }) + end + end, +} diff --git a/.config/nvim/lua/config/plugins/learn.lua b/.config/nvim/lua/config/plugins/learn.lua new file mode 100644 index 0000000..ebaf057 --- /dev/null +++ b/.config/nvim/lua/config/plugins/learn.lua @@ -0,0 +1,8 @@ +return { + { + "m4xshen/hardtime.nvim", + lazy = false, + dependencies = { "MunifTanjim/nui.nvim" }, + opts = {}, + }, +} diff --git a/.config/nvim/lua/config/plugins/lsp.lua b/.config/nvim/lua/config/plugins/lsp.lua new file mode 100644 index 0000000..dca3f5f --- /dev/null +++ b/.config/nvim/lua/config/plugins/lsp.lua @@ -0,0 +1,236 @@ +return { + "neovim/nvim-lspconfig", + event = "VeryLazy", + dependencies = { + { "williamboman/mason.nvim", opts = {} }, + "williamboman/mason-lspconfig.nvim", + "WhoIsSethDaniel/mason-tool-installer.nvim", + { + "j-hui/fidget.nvim", + opts = { + notification = { + window = { + winblend = 0, + }, + }, + }, + }, + }, + config = function() + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), + callback = function(event) + local map = function(keys, func, desc, mode) + mode = mode or "n" + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) + end + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press <C-t>. + map("gd", require("fzf-lua").lsp_definitions, "Goto Definition") + + map("gk", function() + vim.diagnostic.open_float() + end, "Open floating diagnostic") + + -- Find references for the word under your cursor. + map("gr", require("fzf-lua").lsp_references, "Goto References") + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + map("gI", require("fzf-lua").lsp_implementations, "Goto Implementation") + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + map("<leader>D", require("fzf-lua").lsp_typedefs, "Type Definition") + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map("<leader>ds", require("fzf-lua").lsp_document_symbols, "Document Symbols") + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + map("<leader>ws", require("fzf-lua").lsp_live_workspace_symbols, "Workspace Symbols") + + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map("gR", vim.lsp.buf.rename, "Rename") + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map("<leader>ca", vim.lsp.buf.code_action, "Code Action", { "n", "x" }) + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map("gD", vim.lsp.buf.declaration, "Goto Declaration") + local function client_supports_method(client, method, bufnr) + if vim.fn.has("nvim-0.11") == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if + client + and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) + then + local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd("LspDetach", { + group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf }) + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints in your + -- code, if the language server you are using supports them + -- + vim.api.nvim_set_hl(0, "LspInlayHint", { fg = "#4c566a", bg = "NONE", italic = true }) + + -- This may be unwanted, since they displace some of your code + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + map("<leader>th", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) + end, "Toggle Inlay Hints") + end + end, + }) + + vim.keymap.set("n", "gK", function() + local new_config = not vim.diagnostic.config().virtual_lines + vim.diagnostic.config({ virtual_lines = new_config }) + end, { desc = "Toggle diagnostic virtual_lines" }) + + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config({ + severity_sort = true, + float = { border = "rounded", source = "if_many" }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = " ", + [vim.diagnostic.severity.WARN] = " ", + [vim.diagnostic.severity.INFO] = " ", + [vim.diagnostic.severity.HINT] = " ", + }, + }, + virtual_text = { current_line = true }, + -- virtual_text = { + -- source = "if_many", + -- spacing = 2, + -- format = function(diagnostic) + -- local diagnostic_message = { + -- [vim.diagnostic.severity.ERROR] = diagnostic.message, + -- [vim.diagnostic.severity.WARN] = diagnostic.message, + -- [vim.diagnostic.severity.INFO] = diagnostic.message, + -- [vim.diagnostic.severity.HINT] = diagnostic.message, + -- } + -- return diagnostic_message[diagnostic.severity] + -- end, + -- }, + }) + local original_capabilities = vim.lsp.protocol.make_client_capabilities() + local capabilities = require("blink.cmp").get_lsp_capabilities(original_capabilities) + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- + -- Add any additional override configuration in the following tables. Available keys are: + -- - cmd (table): Override the default command used to start the server + -- - filetypes (table): Override the default list of associated filetypes for the server + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. + -- - settings (table): Override the default settings passed when initializing the server. + -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local servers = { + bashls = {}, + marksman = {}, + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs + -- + -- Some languages (like typescript) have entire language plugins that can be useful: + -- https://github.com/pmizio/typescript-tools.nvim + -- + -- But for many setups, the LSP (`ts_ls`) will work just fine + -- ts_ls = {}, + -- + + lua_ls = { + -- cmd = { ... }, + -- filetypes = { ... }, + -- capabilities = {}, + -- settings = { + -- Lua = { + -- completion = { + -- callSnippet = 'Replace', + -- }, + -- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- -- diagnostics = { disable = { 'missing-fields' } }, + -- }, + -- }, + }, + } + + -- Ensure the servers and tools above are installed + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run + -- :Mason + -- + -- You can press `g?` for help in this menu. + -- + -- `mason` had to be setup earlier: to configure its options see the + -- `dependencies` table for `nvim-lspconfig` above. + -- + -- You can add other tools here that you want Mason to install + -- for you, so that they are available from within Neovim. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + "stylua", + "prettierd", + }) + require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) + + require("mason-lspconfig").setup({ + ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + automatic_installation = false, + handlers = { + function(server_name) + if server_name == "rust_analyzer" then + return + end + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for ts_ls) + server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) + require("lspconfig")[server_name].setup(server) + end, + }, + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/lualine.lua b/.config/nvim/lua/config/plugins/lualine.lua new file mode 100644 index 0000000..466d7b4 --- /dev/null +++ b/.config/nvim/lua/config/plugins/lualine.lua @@ -0,0 +1,218 @@ +return { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + dependencies = { "nvim-tree/nvim-web-devicons" }, + -- Eviline config for lualine + -- Author: shadmansaleh + -- Credit: glepnir + config = function() + local lualine = require("lualine") + + -- Color table for highlights + -- stylua: ignore + local colors = { + bg = '#434c5e', + fg = '#d8dee9', + yellow = '#ebcb8b', + cyan = '#88c0d0', + darkblue = '#5e81ac', + green = '#a3be8c', + orange = '#d08770', + violet = '#b48ead', + blue = '#81a1c1', + red = '#bf616a', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand("%:p:h") + local gitdir = vim.fn.finddir(".git", filepath .. ";") + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + local config = { + options = { + component_separators = "", + section_separators = "", + theme = { + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x at right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + -- ins_left({ + -- function() + -- return "▊" + -- end, + -- color = { fg = colors.blue }, -- Sets highlighting of component + -- padding = { left = 0, right = 1 }, -- We don't need space before this + -- }) + + ins_left({ + -- mode component + function() + return " " .. string.upper(vim.fn.mode()) + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + [""] = colors.blue, + V = colors.blue, + c = colors.violet, + no = colors.red, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + }) + + ins_left({ + "filename", + cond = conditions.buffer_not_empty, + color = { fg = colors.green, gui = "bold" }, + }) + ins_left({ + "filesize", + cond = conditions.buffer_not_empty, + }) + + ins_right({ "location" }) + + ins_right({ "progress", color = { fg = colors.fg, gui = "bold" } }) + + ins_left({ + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = " " }, + diagnostics_color = { + error = { fg = colors.red }, + warn = { fg = colors.yellow }, + info = { fg = colors.cyan }, + }, + }) + -- + -- -- Insert mid section. You can make any number of sections in neovim :) + -- -- for lualine it's any number greater then 2 + -- ins_left({ + -- function() + -- return "%=" + -- end, + -- }) + -- + -- ins_left({ + -- -- Lsp server name . + -- function() + -- local msg = "No Active Lsp" + -- local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) + -- local clients = vim.lsp.get_clients() + -- if next(clients) == nil then + -- return msg + -- end + -- for _, client in ipairs(clients) do + -- local filetypes = client.config.filetypes + -- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + -- return client.name + -- end + -- end + -- return msg + -- end, + -- icon = " LSP:", + -- color = { fg = "#ffffff", gui = "bold" }, + -- }) + + -- ins_right({ + -- "filetype", + -- color = { fg = colors.fg, gui = "bold" }, + -- }) + -- -- Add components to right sections + -- ins_right({ + -- "o:encoding", -- option component same as &encoding in viml + -- fmt = string.upper, -- I'm not sure why it's upper case either ;) + -- cond = conditions.hide_in_width, + -- color = { fg = colors.green, gui = "bold" }, + -- }) + -- + -- ins_right({ + -- "fileformat", + -- fmt = string.upper, + -- color = { fg = colors.green, gui = "bold" }, + -- }) + + -- ins_right({ + -- "branch", + -- icon = "", + -- color = { fg = colors.violet, gui = "bold" }, + -- }) + + -- ins_right({ + -- "diff", + -- symbols = { added = " ", modified = " ", removed = " " }, + -- diff_color = { + -- added = { fg = colors.green }, + -- modified = { fg = colors.orange }, + -- removed = { fg = colors.red }, + -- }, + -- cond = conditions.hide_in_width, + -- }) + + -- ins_right({ + -- function() + -- return "▊" + -- end, + -- color = { fg = colors.blue }, + -- padding = { left = 1 }, + -- }) + + lualine.setup(config) + end, +} diff --git a/.config/nvim/lua/config/plugins/luasnip.lua b/.config/nvim/lua/config/plugins/luasnip.lua new file mode 100644 index 0000000..a051cee --- /dev/null +++ b/.config/nvim/lua/config/plugins/luasnip.lua @@ -0,0 +1,21 @@ +return { + "L3MON4D3/LuaSnip", + version = "v2.*", + event = "VeryLazy", + build = "make install_jsregexp", + config = function() + require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/config/snippets/" }) + local ls = require("luasnip") + vim.keymap.set({ "i", "s" }, "<C-d>", function() + ls.jump(1) + end, { silent = true }) + vim.keymap.set({ "i", "s" }, "<C-u>", function() + ls.jump(-1) + end, { silent = true }) + ls.config.setup({ + enable_autosnippets = true, + region_check_events = "InsertEnter", + delete_check_events = "InsertLeave", + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/markdown.lua b/.config/nvim/lua/config/plugins/markdown.lua new file mode 100644 index 0000000..223d3fb --- /dev/null +++ b/.config/nvim/lua/config/plugins/markdown.lua @@ -0,0 +1,220 @@ +return { + { + "bullets-vim/bullets.vim", + ft = "markdown", + config = function() + vim.g.bullets_delete_last_bullet_if_empty = 1 + end, + }, + { + "stevearc/conform.nvim", + event = "VeryLazy", + optional = true, + opts = { + formatters = { + ["markdownlint-cli2"] = { + condition = function(_, ctx) + local diag = vim.tbl_filter(function(d) + return d.source == "markdownlint" + end, vim.diagnostic.get(ctx.buf)) + return #diag > 0 + end, + }, + }, + formatters_by_ft = { + ["markdown"] = { "prettier", "markdownlint-cli2" }, + ["markdown.mdx"] = { "prettier", "markdownlint-cli2" }, + }, + }, + }, + { + "williamboman/mason.nvim", + event = "VeryLazy", + opts = { ensure_installed = { "markdownlint-cli2" } }, + }, + { + "nvimtools/none-ls.nvim", + event = "VeryLazy", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = vim.list_extend(opts.sources or {}, { + nls.builtins.diagnostics.markdownlint_cli2, + }) + end, + }, + { + "mfussenegger/nvim-lint", + event = "VeryLazy", + + optional = true, + opts = { + linters_by_ft = { + markdown = { "markdownlint-cli2" }, + }, + }, + }, + { + "neovim/nvim-lspconfig", + event = "VeryLazy", + + opts = { + servers = { + marksman = {}, + }, + }, + }, + + { + "iamcco/markdown-preview.nvim", + event = "VeryLazy", + + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = function() + require("lazy").load({ plugins = { "markdown-preview.nvim" } }) + vim.fn["mkdp#util#install"]() + end, + keys = { + { + "<leader>ow", + ft = "markdown", + "<cmd>MarkdownPreviewToggle<cr>", + desc = "Markdown Preview", + }, + }, + config = function() + vim.cmd([[do FileType]]) + end, + }, + + { + "MeanderingProgrammer/render-markdown.nvim", + ft = "markdown", + config = function() + require("render-markdown").setup({ + win_options = { + conceallevel = { + default = 0, -- Set default conceallevel to 0 + rendered = 3, -- Keep rendered mode at 3 + }, + }, + bullet = { + -- Turn on / off list bullet rendering + enabled = true, + }, + latex = { enabled = false }, + checkbox = { + -- Turn on / off checkbox state rendering + enabled = true, + -- Determines how icons fill the available space: + -- inline: underlying text is concealed resulting in a left aligned icon + -- overlay: result is left padded with spaces to hide any additional text + position = "inline", + unchecked = { + -- Replaces '[ ]' of 'task_list_marker_unchecked' + icon = " ", + -- Highlight for the unchecked icon + highlight = "RenderMarkdownUnchecked", + -- Highlight for item associated with unchecked checkbox + scope_highlight = nil, + }, + checked = { + -- Replaces '[x]' of 'task_list_marker_checked' + icon = " ", + -- Highlight for the checked icon + highlight = "RenderMarkdownChecked", + -- Highlight for item associated with checked checkbox + scope_highlight = nil, + }, + }, + html = { + -- Turn on / off all HTML rendering + enabled = true, + comment = { + -- Turn on / off HTML comment concealing + conceal = false, + }, + }, + heading = { + -- left_pad = 1, + sign = false, + icons = { " ", " ", " ", " ", " ", " " }, + backgrounds = { + "Headline1Bg", + "Headline2Bg", + "Headline3Bg", + "Headline4Bg", + "Headline5Bg", + "Headline6Bg", + }, + foregrounds = { + "Headline1Fg", + "Headline2Fg", + "Headline3Fg", + "Headline4Fg", + "Headline5Fg", + "Headline6Fg", + }, + }, + ft = { "markdown" }, + }) + + local color1_bg = "#bf616a" + local color2_bg = "#d08770" + local color5_bg = "#5e81ac" + local color4_bg = "#a3be8c" + local color6_bg = "#b48ead" + local color3_bg = "#ebcb8b" + local color_fg = "#2e3440" + + vim.cmd(string.format([[highlight @markup.strong guifg=%s]], color2_bg)) + vim.cmd(string.format([[highlight @markup.italic guifg=%s]], color2_bg)) + vim.cmd(string.format([[highlight RenderMarkdownCodeInline guifg=%s]], color4_bg)) + + -- Heading background color highlights + vim.cmd(string.format([[highlight Headline1Bg guifg=%s guibg=%s]], color_fg, color1_bg)) + vim.cmd(string.format([[highlight Headline2Bg guifg=%s guibg=%s]], color_fg, color2_bg)) + vim.cmd(string.format([[highlight Headline3Bg guifg=%s guibg=%s]], color_fg, color3_bg)) + vim.cmd(string.format([[highlight Headline4Bg guifg=%s guibg=%s]], color_fg, color4_bg)) + vim.cmd(string.format([[highlight Headline5Bg guifg=%s guibg=%s]], color_fg, color5_bg)) + vim.cmd(string.format([[highlight Headline6Bg guifg=%s guibg=%s]], color_fg, color6_bg)) + + -- Heading foreground color highlights (bold and with specific colors) + vim.cmd(string.format([[highlight Headline1Fg cterm=bold gui=bold guifg=%s]], color1_bg)) + vim.cmd(string.format([[highlight Headline2Fg cterm=bold gui=bold guifg=%s]], color2_bg)) + vim.cmd(string.format([[highlight Headline3Fg cterm=bold gui=bold guifg=%s]], color3_bg)) + vim.cmd(string.format([[highlight Headline4Fg cterm=bold gui=bold guifg=%s]], color4_bg)) + vim.cmd(string.format([[highlight Headline5Fg cterm=bold gui=bold guifg=%s]], color5_bg)) + vim.cmd(string.format([[highlight Headline6Fg cterm=bold gui=bold guifg=%s]], color6_bg)) + + vim.cmd(string.format([[highlight RenderMarkdownH1Bg guifg=%s guibg=%s]], color_fg, color1_bg)) + vim.cmd(string.format([[highlight RenderMarkdownH2Bg guifg=%s guibg=%s]], color_fg, color2_bg)) + vim.cmd(string.format([[highlight RenderMarkdownH3Bg guifg=%s guibg=%s]], color_fg, color3_bg)) + vim.cmd(string.format([[highlight RenderMarkdownH4Bg guifg=%s guibg=%s]], color_fg, color4_bg)) + vim.cmd(string.format([[highlight RenderMarkdownH5Bg guifg=%s guibg=%s]], color_fg, color5_bg)) + vim.cmd(string.format([[highlight RenderMarkdownH6Bg guifg=%s guibg=%s]], color_fg, color6_bg)) + + -- Apply custom foreground colors for headings (bold) + vim.cmd(string.format([[highlight RenderMarkdownH1 guifg=%s guibg=%s cterm=bold gui=bold]], color1_bg, color_fg)) + vim.cmd(string.format([[highlight RenderMarkdownH2 guifg=%s guibg=%s cterm=bold gui=bold]], color2_bg, color_fg)) + vim.cmd(string.format([[highlight RenderMarkdownH3 guifg=%s guibg=%s cterm=bold gui=bold]], color3_bg, color_fg)) + vim.cmd(string.format([[highlight RenderMarkdownH4 guifg=%s guibg=%s cterm=bold gui=bold]], color4_bg, color_fg)) + vim.cmd(string.format([[highlight RenderMarkdownH5 guifg=%s guibg=%s cterm=bold gui=bold]], color5_bg, color_fg)) + vim.cmd(string.format([[highlight RenderMarkdownH6 guifg=%s guibg=%s cterm=bold gui=bold]], color6_bg, color_fg)) + Snacks.toggle({ + name = "Render Markdown", + get = function() + return require("render-markdown.state").enabled + end, + set = function(enabled) + local m = require("render-markdown") + if enabled then + m.enable() + else + m.disable() + end + end, + }):map("<leader>or", { desc = "Toggle Render Markdown" }) + end, + }, +} diff --git a/.config/nvim/lua/config/plugins/mini.lua b/.config/nvim/lua/config/plugins/mini.lua new file mode 100644 index 0000000..fe6a3aa --- /dev/null +++ b/.config/nvim/lua/config/plugins/mini.lua @@ -0,0 +1,27 @@ +return { + { + "echasnovski/mini.nvim", + event = "VeryLazy", + enabled = true, + config = function() + require("mini.icons").setup() + require("mini.move").setup() + require("mini.ai").setup() + require("mini.surround").setup() + require("mini.pairs").setup() + -- + -- HACK: The Key Commands -> for help run ;h nvim-surround.usage + -- + -- Old text Command New text + -- -------------------------------------------------------------------------------- + -- surr*ound_words ysiw) (surround_words) + -- *make strings ys$" "make strings" + -- [delete ar*ound me!] ds] delete around me! + -- remove <b>HTML t*ags</b> dst remove HTML tags + -- 'change quot*es' cs'" "change quotes" + -- <b>or tag* types</b> csth1<CR> <h1>or tag types</h1> + -- delete(functi*on calls) dsf function calls + -- + end, + }, +} diff --git a/.config/nvim/lua/config/plugins/obsidian.lua b/.config/nvim/lua/config/plugins/obsidian.lua new file mode 100644 index 0000000..64992fc --- /dev/null +++ b/.config/nvim/lua/config/plugins/obsidian.lua @@ -0,0 +1,42 @@ +return { + "epwalsh/obsidian.nvim", + event = "VeryLazy", + version = "*", + dependencies = { + "nvim-lua/plenary.nvim", + "ibhagwan/fzf-lua", + }, + opts = { + ui = { enable = false }, + daily_notes = { + date_format = "%Y-%m-%d", + alias_format = "%B %-d, %Y", + default_tags = { "daily" }, + template = nil, + folder = "daily", + }, + dir = "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/", + mappings = {}, + follow_url_func = function(url) + -- Open the URL in the default web browser. + -- if URL contains @ it should be replaced with %40 + vim.fn.jobstart({ "open", url }) -- Mac OS + end, + note_id_func = function(title) + -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. + -- In this case a note with the title 'My new note' will be given an ID that looks + -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' + local suffix = "" + if title ~= nil then + -- If title is given, transform it into valid file name. + suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() + else + -- If title is nil, just add 4 random uppercase letters to the suffix. + for _ = 1, 4 do + suffix = suffix .. string.char(math.random(65, 90)) + end + end + return tostring(os.time()) .. "-" .. suffix + end, + }, +} diff --git a/.config/nvim/lua/config/plugins/oil.lua b/.config/nvim/lua/config/plugins/oil.lua new file mode 100644 index 0000000..555768f --- /dev/null +++ b/.config/nvim/lua/config/plugins/oil.lua @@ -0,0 +1,37 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("oil").setup({ + default_file_explorer = true, + keymaps = { + ["l"] = "actions.select", + ["h"] = "actions.parent", + ["<CR>"] = "actions.select", + ["<C-s>"] = nil, + ["<C-h>"] = nil, + ["<C-l>"] = nil, + }, + delete_to_trash = true, + view_options = { + show_hidden = true, + }, + skip_confirm_for_simple_edits = true, + float = { + max_width = 80, + max_height = 30, + override = function(conf) + return conf + end, + }, + }) + vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = "oil", + callback = function() + vim.opt_local.cursorline = true + end, + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/rustacean.lua b/.config/nvim/lua/config/plugins/rustacean.lua new file mode 100644 index 0000000..849db6e --- /dev/null +++ b/.config/nvim/lua/config/plugins/rustacean.lua @@ -0,0 +1,5 @@ +return { + "mrcjkb/rustaceanvim", + version = "^6", -- Recommended + lazy = false, -- This plugin is already lazy +} diff --git a/.config/nvim/lua/config/plugins/snacks.lua b/.config/nvim/lua/config/plugins/snacks.lua new file mode 100644 index 0000000..b83beb9 --- /dev/null +++ b/.config/nvim/lua/config/plugins/snacks.lua @@ -0,0 +1,83 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + bigfile = { enabled = true }, + notifier = { timeout = 2000 }, + quickfile = { enabled = true }, + statuscolumn = { enabled = true }, + image = { + enabled = true, + doc = { + enabled = true, + float = true, + inline = false, + max_width = 60, + max_height = 30, + }, + }, + dashboard = { + enabled = true, + autokeys = "wert", + preset = { + keys = { + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "g", desc = "Grep", action = ":lua Snacks.dashboard.pick('live_grep')", padding = 1 }, + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + }, + formats = { + key = function(item) + return { { "[", hl = "special" }, { item.key, hl = "key" }, { "]", hl = "special" } } + end, + }, + sections = { + { section = "recent_files", limit = 4, padding = 1 }, + { section = "keys", padding = 1 }, + { section = "startup" }, + }, + }, + styles = { + snacks_image = { + relative = "editor", + col = -1, + }, + lazygit = { + wo = { + winhighlight = "NormalFloat:None,FloatBorder:SnacksInputBorder,FloatTitle:SnacksInputTitle", + cursorline = false, + }, + }, + float = { + backdrop = false, + }, + blame_line = { + backdrop = false, + }, + }, + }, + init = function() + vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + callback = function() + _G.dd = function(...) + Snacks.debug.inspect(...) + end + _G.bt = function() + Snacks.debug.backtrace() + end + vim.print = _G.dd + Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>ts") + Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>tw") + Snacks.toggle.diagnostics():map("<leader>td") + Snacks.toggle + .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) + :map("<leader>tc") + Snacks.toggle.indent():map("<leader>ti") + end, + }) + end, +} diff --git a/.config/nvim/lua/config/plugins/treesitter.lua b/.config/nvim/lua/config/plugins/treesitter.lua new file mode 100644 index 0000000..3c95b41 --- /dev/null +++ b/.config/nvim/lua/config/plugins/treesitter.lua @@ -0,0 +1,41 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", + "lua", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "rust", + }, + auto_install = true, + incremental_selection = { + enable = true, + keymaps = { + node_incremental = "<Enter>", + scope_incremental = false, + node_decremental = "<Backspace>", + }, + }, + highlight = { + enable = true, + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + additional_vim_regex_highlighting = false, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/config/plugins/typst.lua b/.config/nvim/lua/config/plugins/typst.lua new file mode 100644 index 0000000..2443773 --- /dev/null +++ b/.config/nvim/lua/config/plugins/typst.lua @@ -0,0 +1,9 @@ +return { + "chomosuke/typst-preview.nvim", + -- lazy = false, -- or ft = 'typst' + ft = "typst", + version = "1.*", + opts = { + invert_colors = "auto", + }, -- lazy.nvim will implicitly calls `setup {}` +} diff --git a/.config/nvim/lua/config/plugins/ufo.lua b/.config/nvim/lua/config/plugins/ufo.lua new file mode 100644 index 0000000..21380b8 --- /dev/null +++ b/.config/nvim/lua/config/plugins/ufo.lua @@ -0,0 +1,28 @@ +return { + -- { + -- event = "VeryLazy", + -- "kevinhwang91/nvim-ufo", + -- dependencies = { + -- "kevinhwang91/promise-async", + -- }, + -- config = function() + -- require("ufo").setup({ + -- -- treesitter not required + -- -- ufo uses the same query files for folding (queries/<lang>/folds.scm) + -- -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`- + -- provider_selector = function(_, _, _) + -- return { "treesitter", "indent" } + -- end, + -- open_fold_hl_timeout = 0, -- Disable highlight timeout after opening + -- }) + -- + -- vim.o.foldenable = true + -- vim.o.foldcolumn = "0" -- '0' is not bad + -- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + -- vim.o.foldlevelstart = 99 + -- + -- vim.keymap.set("n", "zR", require("ufo").openAllFolds) + -- vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + -- end, + -- }, +} diff --git a/.config/nvim/lua/config/plugins/utils.lua b/.config/nvim/lua/config/plugins/utils.lua new file mode 100644 index 0000000..fd57680 --- /dev/null +++ b/.config/nvim/lua/config/plugins/utils.lua @@ -0,0 +1,71 @@ +return { + { + "ojroques/nvim-osc52", + event = "VeryLazy", + config = function() + vim.keymap.set("v", "Y", require("osc52").copy_visual) + end, + }, + { -- For CSS colors + "NvChad/nvim-colorizer.lua", + event = "BufReadPre", + opts = { + user_default_options = { + names = false, + tailwind = "both", + css = true, + css_fn = true, + mode = "background", + }, + }, + }, + { -- for file outline + "hedyhli/outline.nvim", + event = "VeryLazy", + opts = {}, + }, + { -- Undotree + "mbbill/undotree", + event = "VeryLazy", + config = function() + vim.g.undotree_SplitWidth = 50 + vim.g.undotree_WindowLayout = 3 + end, + }, + { -- for diagnostics + event = "VeryLazy", + "folke/trouble.nvim", + opts = {}, + cmd = "Trouble", + keys = { + { + "<leader>h", + "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", + desc = "Buffer Diagnostics (Trouble)", + }, + }, + }, + { -- for colored brackets and divs + "HiPhish/rainbow-delimiters.nvim", + event = "VeryLazy", + }, + { -- for tmux navigation + event = "VeryLazy", + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" }, + { "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" }, + { "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" }, + { "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" }, + { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" }, + }, + }, +} diff --git a/.config/nvim/lua/config/plugins/which-key.lua b/.config/nvim/lua/config/plugins/which-key.lua new file mode 100644 index 0000000..47098fb --- /dev/null +++ b/.config/nvim/lua/config/plugins/which-key.lua @@ -0,0 +1,29 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + win = { + wo = { + winblend = 0, + }, + }, + preset = "helix", + icons = { + rules = false, + }, + delay = 500, + spec = { + { "<leader>c", group = "Code", mode = { "n", "x" } }, + { "<leader>d", group = "Document" }, + { "<leader>g", group = "Git" }, + { "<leader>m", group = "Marks" }, + { "<leader>o", group = "Obsidian" }, + { "<leader>r", group = "Rename" }, + { "<leader>s", group = "Search" }, + { "<leader>t", group = "Toggle" }, + { "<leader>w", group = "Workspace" }, + { "<leader>l", group = "LSP" }, + { "<leader>x", group = "Trouble" }, + }, + }, +} diff --git a/.config/nvim/lua/config/snippets/all.lua b/.config/nvim/lua/config/snippets/all.lua new file mode 100644 index 0000000..e2a2ef1 --- /dev/null +++ b/.config/nvim/lua/config/snippets/all.lua @@ -0,0 +1,10 @@ +local ls = require("luasnip") +local s = ls.snippet +local t = ls.text_node +local i = ls.insert_node + +return { + s("hi", { + t("Hello, world!"), + }), +} diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua new file mode 100644 index 0000000..31832c1 --- /dev/null +++ b/.config/nvim/lua/mappings.lua @@ -0,0 +1,143 @@ +local wk = require("which-key") + +vim.keymap.set("n", "x", '"_x', { noremap = true, silent = true }) +vim.keymap.set("x", "x", '"_x', { noremap = true, silent = true }) +vim.keymap.set("v", "x", '"_x', { noremap = true, silent = true }) +vim.keymap.set("n", "c", '"_c') +vim.keymap.set("n", "C", '"_C') +vim.keymap.set("n", "cc", '"_cc') +vim.keymap.set("x", "c", '"_c') +vim.keymap.set("n", "<leader>q", vim.cmd.wq, { desc = "Save and quit" }) + +-- for searching all files, hidden aswell +local fzf = require("fzf-lua") +vim.keymap.set("n", "<leader>sa", function() + fzf.files({ fd_opts = "--no-ignore --hidden --type f --type l" }) +end, { desc = "Search including ignored files" }) + +wk.add({ + { + mode = { "v" }, + { "<", "<gv", hidden = true }, + { ">", ">gv", hidden = true }, + { "P", '"_dP', hidden = true }, + }, + { + mode = { "n" }, + { "<leader>-", "<CMD>Oil --float<CR>", desc = "Open directory in float" }, + { "<C-d>", "<C-d>zz", desc = "Move down in buffer with cursor centered" }, + { "<C-u>", "<C-u>zz", desc = "Move up in buffer with cursor centered" }, + { "n", "nzzzv", desc = "Search next with cursor centered" }, + { "N", "Nzzzv", desc = "Search previous with cursor centered" }, + { "<leader>u", "<cmd>UndotreeToggle<CR>", desc = "Toggle undo tree" }, + { "<leader>oo", "<cmd>Outline<CR>", desc = "Toggle Outline" }, + { "<leader>on", "<cmd>ObsidianNew<CR>", desc = "New Obsidian File" }, + { "<leader>ol", "<cmd>ObsidianFollowLink<CR>", desc = "Follow Link" }, + { "<leader>ob", "<cmd>ObsidianBacklinks<CR>", desc = "Search backlinks" }, + { "<leader>ov", "<cmd>ObsidianLinks<CR>", desc = "Search backlinks" }, + { "<leader>ot", "<cmd>ObsidianTag<CR>", desc = "Search Obsidian Tags" }, + { "<leader>os", "<cmd>ObsidianSearch<CR>", desc = "Search Obsidian Files" }, + { "<leader>od", "<cmd>ObsidianToday<CR>", desc = "Open Daily Note" }, + { "<leader>oi", "<cmd>ObsidianPasteImg<CR>", desc = "Paste Image" }, + { + "<leader>of", + function() + local line = vim.api.nvim_get_current_line() + local pattern = "%(([^)]+)%)" + local _, _, path = string.find(line, pattern) + if path then + local absolute_path = "/Users/tomiko/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/" .. path + local command = "!open '" .. absolute_path .. "'" + -- local command = "!open '" .. path .. "'" -- could also open relative + vim.cmd("silent " .. command) + end + end, + desc = "Open File", + }, + + { "<Esc>", "<cmd>nohlsearch<CR>", hidden = true }, -- Unhighlight + { "<C-h>", "<C-w><C-h>", hidden = true }, -- Move to left window + { "<C-l>", "<C-w><C-l>", hidden = true }, -- Move to right window + { "<C-j>", "<C-w><C-j>", hidden = true }, -- Move to lower window + { "<C-k>", "<C-w><C-k>", hidden = true }, -- Move to upper window + { "<C-q>", "<C-w><C-q>", hidden = true }, -- Close window + { + "<leader>sb", + function() + require("fzf-lua").buffers() + end, + desc = "Search Buffers", + }, + { + "<leader>sk", + function() + require("fzf-lua").keymaps() + end, + desc = "Search Keymaps", + }, + { + "<leader>ss", + function() + require("fzf-lua").files() + end, + desc = "Search Files", + }, + { + "<leader>sw", + function() + require("fzf-lua").grep_curbuf() + end, + desc = "Search current Word", + }, + { + "<leader>sg", + function() + require("fzf-lua").live_grep_native() + end, + desc = "Search by Grep", + }, + { + "<leader>sx", + function() + require("fzf-lua").lsp_document_diagnostics() + end, + desc = "Search Diagnostics", + }, + { + "<leader>sd", + function() + require("fzf-lua").lsp_workspace_diagnostics() + end, + desc = "Search Diagnostics", + }, + { + "<leader>sr", + function() + require("fzf-lua").oldfiles() + end, + desc = "Search Recent Files", + }, + { + "<leader>n", + function() + Snacks.notifier.show_history() + end, + desc = "Notification History", + }, + { + "<leader>gg", + function() + Snacks.lazygit() + end, + desc = "Lazygit", + }, + + { + "<leader>gl", + function() + Snacks.lazygit.log() + end, + desc = "Lazygit Log", + }, + }, +}) diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua new file mode 100644 index 0000000..c61f4c9 --- /dev/null +++ b/.config/nvim/lua/options.lua @@ -0,0 +1,36 @@ +local set = vim.opt +local g = vim.g + +g.mapleader = " " +g.maplocalleader = " " +g.have_nerd_font = true +set.number = true +set.relativenumber = true +set.termguicolors = true +set.tabstop = 4 +set.shiftwidth = 4 +set.swapfile = false +set.expandtab = true +set.mouse = "a" +set.showmode = false +set.breakindent = true +set.undofile = true +set.ignorecase = true +set.smartcase = true +set.signcolumn = "yes" +set.updatetime = 250 +set.timeoutlen = 300 +set.splitright = true +set.splitbelow = true +set.list = true +set.listchars = { tab = "» ", trail = "·", nbsp = "␣" } +set.inccommand = "split" +set.cursorline = true +set.scrolloff = 4 +set.sidescrolloff = 4 +set.conceallevel = 2 +set.wrap = false + +vim.schedule(function() + set.clipboard = "unnamedplus" +end) diff --git a/.config/sesh/sesh.toml b/.config/sesh/sesh.toml new file mode 100644 index 0000000..0404b98 --- /dev/null +++ b/.config/sesh/sesh.toml @@ -0,0 +1,4 @@ +[default_session] +startup_command = "nvim ." +startup_command_ignore_dirs = ["~/.config"] +preview_command = "eza --all --git --icons --color=always {}" diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..7f21509 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,4 @@ +[character] +success_symbol = "[λ](bold green)" +error_symbol = "[λ](bold red)" + diff --git a/.config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY b/.config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY diff --git a/.config/yazi/flavors/nord.yazi/flavor.toml b/.config/yazi/flavors/nord.yazi/flavor.toml new file mode 100644 index 0000000..766613c --- /dev/null +++ b/.config/yazi/flavors/nord.yazi/flavor.toml @@ -0,0 +1,152 @@ +# vim:fileencoding=utf-8:foldmethod=marker
+
+# : Manager {{{
+[manager]
+cwd = { fg = "#88c0d0" }
+
+# Hovered
+hovered = { reversed = true }
+preview_hovered = { underline = true }
+
+# Find
+find_keyword = { fg = "#ebcb8b", bold = true, italic = true, underline = true }
+find_position = { fg = "#b48ead", bg = "reset", bold = true, italic = true }
+
+# Marker
+marker_copied = { fg = "#a3be8c", bg = "#a3be8c" }
+marker_cut = { fg = "#bf616a", bg = "#bf616a" }
+marker_marked = { fg = "#88c0d0", bg = "#88c0d0" }
+marker_selected = { fg = "#ebcb8b", bg = "#ebcb8b" }
+
+# Tab
+tab_active = { reversed = true }
+tab_inactive = {}
+tab_width = 1
+
+# Count
+count_copied = { fg = "#2e3440", bg = "#a3be8c" }
+count_cut = { fg = "#2e3440", bg = "#bf616a" }
+count_selected = { fg = "#2e3440", bg = "#ebcb8b" }
+
+# Border
+border_symbol = "│"
+border_style = { fg = "#3b4252" }
+
+# : }}}
+
+# : Status {{{
+
+[status]
+separator_open = ""
+separator_close = ""
+separator_style = { fg = "#434c5e", bg = "#434c5e" }
+
+# Mode
+mode_normal = { fg = "#2e3440", bg = "#5e81ac", bold = true }
+mode_select = { fg = "#2e3440", bg = "#a3be8c", bold = true }
+mode_unset = { fg = "#2e3440", bg = "#f2cdcd", bold = true }
+
+# Progress
+progress_label = { fg = "#eceff4", bold = true }
+progress_normal = { fg = "#5e81ac", bg = "#434c5e" }
+progress_error = { fg = "#bf616a", bg = "#434c5e" }
+
+# Permissions
+permissions_t = { fg = "#5e81ac" }
+permissions_r = { fg = "#ebcb8b" }
+permissions_w = { fg = "#bf616a" }
+permissions_x = { fg = "#a3be8c" }
+permissions_s = { fg = "#7f849c" }
+
+# : }}}
+
+# : Select {{{
+
+[select]
+border = { fg = "#5e81ac" }
+active = { fg = "#b48ead", bold = true }
+inactive = {}
+
+# : }}}
+
+# : Input {{{
+
+[input]
+border = { fg = "#5e81ac" }
+title = {}
+value = {}
+selected = { reversed = true }
+
+# : }}}
+
+# : Completion {{{
+
+[completion]
+border = { fg = "#5e81ac" }
+
+# : }}}
+
+# : Tasks {{{
+
+[tasks]
+border = { fg = "#5e81ac" }
+title = {}
+hovered = { fg = "#b48ead", underline = true }
+
+# : }}}
+
+# : Which {{{
+
+[which]
+mask = { bg = "#2e3440" }
+cand = { fg = "#88c0d0" }
+rest = { fg = "#4c566a" }
+desc = { fg = "#b48ead" }
+separator = " "
+separator_style = { fg = "#585b70" }
+
+# : }}}
+
+# : Help {{{
+
+[help]
+on = { fg = "#88c0d0" }
+run = { fg = "#b48ead" }
+hovered = { reversed = true, bold = true }
+footer = { fg = "#45475a", bg = "#cdd6f4" }
+
+# : }}}
+
+# : Notify {{{
+
+[notify]
+title_info = { fg = "#a3be8c" }
+title_warn = { fg = "#ebcb8b" }
+title_error = { fg = "#bf616a" }
+
+# : }}}
+
+# : File-specific styles {{{
+
+[filetype]
+
+rules = [
+ # Images
+ { mime = "image/*", fg = "#88c0d0" },
+
+ # Media
+ { mime = "{audio,video}/*", fg = "#ebcb8b" },
+
+ # Archives
+ { mime = "application/*zip", fg = "#b48ead" },
+ { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#b48ead" },
+
+ # Documents
+ { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#a3be8c" },
+
+ # Fallback
+ { name = "*", fg = "#e5e9f0" },
+ { name = "*/", fg = "#5e81ac" },
+]
+
+# : }}}
diff --git a/.config/yazi/flavors/nord.yazi/tmtheme.xml b/.config/yazi/flavors/nord.yazi/tmtheme.xml new file mode 100644 index 0000000..c8778de --- /dev/null +++ b/.config/yazi/flavors/nord.yazi/tmtheme.xml @@ -0,0 +1,1873 @@ +<!--
+Copyright (c) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
+Copyright (c) 2017-present Sven Greb <code@svengreb.de>
+
+Project: Nord Sublime Text
+Repository: https://github.com/arcticicestudio/nord-sublime-text
+License: MIT
+References
+ https://www.sublimetext.com/docs/3/color_schemes.html
+ https://www.sublimetext.com/docs/3/themes.html
+ https://www.sublimetext.com/docs/3/scope_naming.html
+-->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>name</key>
+ <string>Nord</string>
+ <key>comment</key>
+ <string>A arctic, north-bluish clean and elegant Visual Studio Code theme.</string>
+ <key>author</key>
+ <string>Arctic Ice Studio</string>
+ <key>semanticClass</key>
+ <string>nord</string>
+ <key>colorSpaceName</key>
+ <string>sRGB</string>
+ <key>settings</key>
+ <array>
+ <!--+ - - - - - - - - +
+ + Global Settings +
+ + - - - - - - - - +-->
+ <dict>
+ <key>settings</key>
+ <dict>
+ <key>background</key>
+ <string>#2e3440</string>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ <key>caret</key>
+ <string>#d8dee9</string>
+ <key>invisibles</key>
+ <string>#4c566a</string>
+ <key>lineHighlight</key>
+ <string>#434c5e52</string>
+ <!-- +- Accents -+ -->
+ <key>misspelling</key>
+ <string>#bf616a</string>
+ <key>minimapBorder</key>
+ <string>#434c5e52</string>
+ <key>accent</key>
+ <string>#88C0D0</string>
+ <!-- +- Gutter -+ -->
+ <key>gutter</key>
+ <string>#2e3440</string>
+ <key>gutterForeground</key>
+ <string>#d8dee966</string>
+ <!-- +- Selection -+ -->
+ <key>selection</key>
+ <string>#434c5ecc</string>
+ <key>selectionBorder</key>
+ <string>#434c5ecc</string>
+ <key>inactiveSelection</key>
+ <string>#434c5e99</string>
+ <!-- +- Find -+ -->
+ <key>highlight</key>
+ <string>#88c0d0</string>
+ <key>findHighlight</key>
+ <string>#88c0d0</string>
+ <key>findHighlightForeground</key>
+ <string>#2e3440</string>
+ <!-- +- Guides -+ -->
+ <key>guide</key>
+ <string>#434c5eb3</string>
+ <key>activeGuide</key>
+ <string>#88c0d0cc</string>
+ <key>stackGuide</key>
+ <string>#88c0d066</string>
+ <!-- +- Brackets -+ -->
+ <key>bracketsOptions</key>
+ <string>underline</string>
+ <key>bracketsForeground</key>
+ <string>#88c0d0</string>
+ <key>bracketsContentsOptions</key>
+ <string>underline</string>
+ <key>bracketsContentsForeground</key>
+ <string>#88c0d0</string>
+ <!-- +- Tags -+ -->
+ <key>tagsOptions</key>
+ <string>underline</string>
+ <key>tagsForeground</key>
+ <string>#88c0d0</string>
+ <!-- +- Shadows -+ -->
+ <key>shadow</key>
+ <string>#2e3440</string>
+ <key>shadowWidth</key>
+ <string>8</string>
+ </dict>
+ </dict>
+ <!--+ - - - - - - -+
+ + Scope Styles +
+ + - - - - - - -+-->
+ <dict>
+ <key>name</key>
+ <string>[Comment] Comment</string>
+ <key>scope</key>
+ <string>
+ comment,
+ punctuation.definition.comment
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#616e88</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Constants] Numeric</string>
+ <key>scope</key>
+ <string>constant.numeric</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#b48ead</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Constants] BuiltIn</string>
+ <key>scope</key>
+ <string>constant.language</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Constants] Escape</string>
+ <key>scope</key>
+ <string>constant.character.escape</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Constants] Placeholder</string>
+ <key>scope</key>
+ <string>constant.other.placeholder</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Constants] Other</string>
+ <key>scope</key>
+ <string>constant.other</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Entity] Class</string>
+ <key>scope</key>
+ <string>entity.name.class</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Struct</string>
+ <key>scope</key>
+ <string>entity.name.struct</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Enum</string>
+ <key>scope</key>
+ <string>entity.name.enum</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Unions</string>
+ <key>scope</key>
+ <string>entity.name.union</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Traits</string>
+ <key>scope</key>
+ <string>entity.name.trait</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Interface</string>
+ <key>scope</key>
+ <string>entity.name.interface</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Type</string>
+ <key>scope</key>
+ <string>entity.name.type</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Inherited Class/Interface/Trait</string>
+ <key>scope</key>
+ <string>entity.other.inherited-class</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Function</string>
+ <key>scope</key>
+ <string>entity.name.function</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Constructor</string>
+ <key>scope</key>
+ <string>entity.name.function.constructor</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Destructor</string>
+ <key>scope</key>
+ <string>entity.name.function.destructor</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Namespace</string>
+ <key>scope</key>
+ <string>entity.name.namespace</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Constant</string>
+ <key>scope</key>
+ <string>entity.name.constant</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Label/Goto</string>
+ <key>scope</key>
+ <string>entity.name.label</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Section</string>
+ <key>scope</key>
+ <string>entity.name.section</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Tag</string>
+ <key>scope</key>
+ <string>entity.name.tag</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Entity] Attribute Name</string>
+ <key>scope</key>
+ <string>entity.other.attribute-name</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Invalid] Illegal</string>
+ <key>scope</key>
+ <string>invalid.illegal</string>
+ <key>settings</key>
+ <dict>
+ <key>background</key>
+ <string>#bf616a</string>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Invalid] Deprecated</string>
+ <key>scope</key>
+ <string>invalid.deprecated</string>
+ <key>settings</key>
+ <dict>
+ <key>background</key>
+ <string>#ebcb8b</string>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Control</string>
+ <key>scope</key>
+ <string>keyword.control</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Control Conditional</string>
+ <key>scope</key>
+ <string>keyword.control.conditional</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Control Import</string>
+ <key>scope</key>
+ <string>keyword.control.import</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Punctuation Definition</string>
+ <key>scope</key>
+ <string>punctuation.definition.keyword</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Other</string>
+ <key>scope</key>
+ <string>keyword.other</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Keyword] Operator</string>
+ <key>scope</key>
+ <string>
+ keyword.operator,
+ keyword.operator.assignment,
+ keyword.operator.arithmetic,
+ keyword.operator.bitwise,
+ keyword.operator.logical,
+ keyword.operator.word
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Markup] Heading</string>
+ <key>scope</key>
+ <string>markup.heading</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] List</string>
+ <key>scope</key>
+ <string>
+ markup.list.unnumbered,
+ markup.list.numbered
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Bold</string>
+ <key>scope</key>
+ <string>markup.bold</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Italic</string>
+ <key>scope</key>
+ <string>markup.italic</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Inserted</string>
+ <key>scope</key>
+ <string>markup.inserted</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Deleted</string>
+ <key>scope</key>
+ <string>markup.deleted</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#bf616a</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Changed</string>
+ <key>scope</key>
+ <string>markup.changed</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Quote</string>
+ <key>scope</key>
+ <string>markup.quote</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#616e88</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Raw</string>
+ <key>scope</key>
+ <string>
+ markup.raw.inline,
+ markup.raw.block
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markup] Other</string>
+ <key>scope</key>
+ <string>markup.other</string>
+ <key>settings</key>
+ <dict>
+ <key>background</key>
+ <string>#eceff4</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Punctuation] Separator/Terminator</string>
+ <key>scope</key>
+ <string>
+ punctuation.separator,
+ punctuation.terminator
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#eceff4</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Punctuation] Separator Continuation/Accessor</string>
+ <key>scope</key>
+ <string>
+ punctuation.separator.continuation,
+ punctuation.accessor
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Punctuation] Definition Tag</string>
+ <key>scope</key>
+ <string>punctuation.definition.tag</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Storage] Type</string>
+ <key>scope</key>
+ <string>
+ storage.type,
+ storage.modifier
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[String] Quoted/Unquoted</string>
+ <key>scope</key>
+ <string>
+ string.quoted.single,
+ string.quoted.double,
+ string.quoted.triple,
+ string.quoted.other,
+ string.unquoted
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[String] Punctuation Definition</string>
+ <key>scope</key>
+ <string>
+ punctuation.definition.string.begin,
+ punctuation.definition.string.end
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[String] RegExp</string>
+ <key>scope</key>
+ <string>string.regexp</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Support] Constant</string>
+ <key>scope</key>
+ <string>support.constant</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Support] Function</string>
+ <key>scope</key>
+ <string>support.function</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Support] Module</string>
+ <key>scope</key>
+ <string>support.module</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Support] Type</string>
+ <key>scope</key>
+ <string>support.type</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Support] Class</string>
+ <key>scope</key>
+ <string>support.class</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Text] HTML/XML</string>
+ <key>scope</key>
+ <string>
+ text.html.basic,
+ text.xml
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#eceff4</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Variable] Other/ReadWrite</string>
+ <key>scope</key>
+ <string>
+ variable.other,
+ variable.other.readwrite
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Punctuation Definition</string>
+ <key>scope</key>
+ <string>punctuation.definition.variable</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Constant</string>
+ <key>scope</key>
+ <string>variable.other.constant</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Language</string>
+ <key>scope</key>
+ <string>variable.language</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Parameter</string>
+ <key>scope</key>
+ <string>variable.parameter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Other Member</string>
+ <key>scope</key>
+ <string>variable.other.member</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Variable] Function</string>
+ <key>scope</key>
+ <string>variable.function</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+
+ <!--+ - - - - - - - +
+ + UI Components +
+ + - - - - - - - +-->
+ <dict>
+ <key>name</key>
+ <string>[Find Results] Gutter Number</string>
+ <key>scope</key>
+ <string>constant.numeric.line-number.find-in-files</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee966</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Find Results] Gutter Number Match</string>
+ <key>scope</key>
+ <string>constant.numeric.line-number.match.find-in-files</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Find Results] Filename</string>
+ <key>scope</key>
+ <string>entity.name.filename.find-in-files</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Find Results] Text</string>
+ <key>scope</key>
+ <string>text.find-in-files</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+
+ <!--+ - - - - - - - - +
+ + Language Scopes +
+ + - - - - - - - - +-->
+ <dict>
+ <key>name</key>
+ <string>[C/C++] Preprocessor/Include</string>
+ <key>scope</key>
+ <string>
+ source.c keyword.control.import.include.c,
+ source.c meta.preprocessor.c keyword.control.import.c,
+ source.c++ keyword.control.import.include.c++,
+ source.c++ meta.preprocessor.c++ keyword.control.import.c++
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[C/C++] BuiltIn Function</string>
+ <key>scope</key>
+ <string>
+ source.c keyword.operator.word.c,
+ source.c++ keyword.operator.word.c++
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[CSS/Sass] Property Name</string>
+ <key>scope</key>
+ <string>
+ source.css support.type.property-name.css,
+ source.sass support.type.property-name.sass,
+ source.css support.type.vendor-prefix.css
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS/Sass] RGB Value</string>
+ <key>scope</key>
+ <string>
+ source.css constant.other.color.rgb-value.css,
+ source.sass constant.other.rgb-value.sass
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#b48ead</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS] Property Value</string>
+ <key>scope</key>
+ <string>
+ source.css support.constant.color.w3c-special-color-keyword.css,
+ source.css support.constant.property-value.css,
+ source.sass support.constant.property-value.sass
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS] Pseudo Class</string>
+ <key>scope</key>
+ <string>source.css entity.other.pseudo-class.css</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS/Sass] At-Rule</string>
+ <key>scope</key>
+ <string>
+ source.css keyword.control.at-rule.media.css,
+ source.css punctuation.definition.keyword.css,
+ source.sass keyword.control.at-rule.sass
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d08770</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS] Color Names</string>
+ <key>scope</key>
+ <string>source.css support.constant.color.w3c-standard-color-name.css</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[CSS/Sass] ID</string>
+ <key>scope</key>
+ <string>
+ source.css entity.other.attribute-name.id.css,
+ source.sass entity.other.attribute-name.id.sass
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[diff] Meta Range Context</string>
+ <key>scope</key>
+ <string>source.diff meta.diff.range.context</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[diff] Meta Header From-File</string>
+ <key>scope</key>
+ <string>source.diff meta.diff.header.from-file</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[diff] Punctuation Definition From-File</string>
+ <key>scope</key>
+ <string>source.diff punctuation.definition.from-file</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8FBCBB</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[diff] Punctuation Definition Separator</string>
+ <key>scope</key>
+ <string>source.diff punctuation.definition.separator</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Go] BuiltIn Function</string>
+ <key>scope</key>
+ <string>source.go support.function.builtin.go</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[HTML] Entity</string>
+ <key>scope</key>
+ <string>text.html.basic constant.character.entity.html</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Java] Annotation</string>
+ <key>scope</key>
+ <string>
+ variable.annotation.java,
+ punctuation.definition.annotation.java
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d08770</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Punctuation</string>
+ <key>scope</key>
+ <string>punctuation.accessor.dot.java</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#eceff4</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Package</string>
+ <key>scope</key>
+ <string>support.other.package.java</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] JavaDoc Comment Block Documentation HTML Entities</string>
+ <key>scope</key>
+ <string>source.java comment.block.documentation.javadoc punctuation.definition.entity.html</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Constant</string>
+ <key>scope</key>
+ <string>source.java entity.name.constant</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] JavaDoc Tags</string>
+ <key>scope</key>
+ <string>
+ source.java keyword.other.documentation,
+ source.java comment.block.documentation.javadoc punctuation.definition.keyword.javadoc
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Generic</string>
+ <key>scope</key>
+ <string>source.java variable.parameter.type.java</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Interface</string>
+ <key>scope</key>
+ <string>source.java entity.other.inherited-class.java</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Java] Implements Keyword</string>
+ <key>scope</key>
+ <string>source.java keyword.declaration.implements.java</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[JSON] Key</string>
+ <key>scope</key>
+ <string>
+ source.json meta.structure.dictionary.json meta.structure.dictionary.key.json string.quoted.double.json,
+ source.json.sublime meta.structure.dictionary.json meta.structure.dictionary.key.json string.quoted.double.json
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[JSON] Quote Punctuation</string>
+ <key>scope</key>
+ <string>
+ source.json meta.structure.dictionary.json punctuation.definition.string.begin.json,
+ source.json meta.structure.dictionary.json punctuation.definition.string.end.json,
+ source.json.sublime meta.structure.dictionary.json punctuation.definition.string.begin.json,
+ source.json.sublime meta.structure.dictionary.json punctuation.definition.string.end.json
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#eceff4</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Fenced Code Block</string>
+ <key>scope</key>
+ <string>
+ text.html.markdown punctuation.definition.raw.code-fence.begin.markdown,
+ text.html.markdown punctuation.definition.raw.code-fence.end.markdown,
+ text.html.markdown markup.raw.code-fence.markdown constant.other.language-name.markdown
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] List Bullet</string>
+ <key>scope</key>
+ <string>
+ text.html.markdown punctuation.definition.list_item.markdown,
+ text.html.markdown markup.list.numbered.bullet.markdown
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Quote Punctuation</string>
+ <key>scope</key>
+ <string>text.html.markdown markup.quote.markdown punctuation.definition.blockquote.markdown</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8FBCBB</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Link Description</string>
+ <key>scope</key>
+ <string>
+ text.html.markdown meta.link.inline.description.markdown,
+ text.html.markdown meta.image.inline.description.markdown,
+ text.html.markdown meta.link.reference.description.markdown,
+ text.html.markdown constant.other.reference.link.markdown,
+ text.html.markdown entity.name.reference.link.markdown
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88C0D0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Link Punctuation</string>
+ <key>scope</key>
+ <string>
+ text.html.markdown punctuation.definition.link.begin.markdown,
+ text.html.markdown punctuation.definition.link.end.markdown,
+ text.html.markdown punctuation.definition.image.begin.markdown,
+ text.html.markdown punctuation.definition.image.end.markdown,
+ text.html.markdown punctuation.definition.constant.begin.markdown,
+ text.html.markdown punctuation.definition.constant.end.markdown
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Table Punctuation</string>
+ <key>scope</key>
+ <string>
+ text.html.markdown punctuation.separator.table-cell.markdown,
+ text.html.markdown punctuation.section.table-header.markdown
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Table Header</string>
+ <key>scope</key>
+ <string>text.html.markdown meta.table.header.markdown</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Markdown] Horizontal Line</string>
+ <key>scope</key>
+ <string>text.html.markdown punctuation.definition.thematic-break.markdown</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[PHP] Embedded Tag</string>
+ <key>scope</key>
+ <string>
+ embedding.php text.html.basic punctuation.section.embedded.begin.php,
+ embedding.php text.html.basic punctuation.section.embedded.end.php
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[PHP] PHPDoc Tag</string>
+ <key>scope</key>
+ <string>embedding.php text.html.basic comment.block.documentation.phpdoc.php keyword.other.phpdoc.php</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[PHP] Namespace</string>
+ <key>scope</key>
+ <string>embedding.php text.html.basic support.other.namespace.php</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Python] Decorator</string>
+ <key>scope</key>
+ <string>
+ source.python meta.annotation.python meta.qualified-name.python support.function.builtin.python,
+ source.python punctuation.definition.annotation.python
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d08770</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Python] BuiltIn Function</string>
+ <key>scope</key>
+ <string>support.function.builtin.python</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Python] Exception</string>
+ <key>scope</key>
+ <string>source.python support.type.exception.python</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Python] Type</string>
+ <key>scope</key>
+ <string>source.python support.type.python</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Sass] Variable</string>
+ <key>scope</key>
+ <string>source.sass variable.parameter.sass</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Ruby] BuiltIn Function</string>
+ <key>scope</key>
+ <string>source.ruby support.function.builtin.ruby</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[Shell] BuiltIn Function</string>
+ <key>scope</key>
+ <string>source.shell support.function.builtin.shell</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[XML] Namespace</string>
+ <key>scope</key>
+ <string>text.xml entity.name.tag.namespace</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[XML] Doctype/Preprocessor</string>
+ <key>scope</key>
+ <string>
+ text.xml meta.tag.sgml.doctype.xml,
+ text.xml meta.tag.preprocessor entity.name.tag,
+ text.xml meta.tag.preprocessor.xml punctuation.definition.tag.begin.xml,
+ text.xml meta.tag.preprocessor.xml punctuation.definition.tag.end.xml,
+ text.xml meta.tag.sgml.doctype.xml punctuation.definition.tag.begin.xml,
+ text.xml meta.tag.sgml.doctype.xml punctuation.definition.tag.end.xml
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[XML] CDATA Tag</string>
+ <key>scope</key>
+ <string>
+ text.xml string.unquoted.cdata.xml punctuation.definition.string.begin.xml,
+ text.xml string.unquoted.cdata.xml punctuation.definition.string.end.xml
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#D08770</string>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[YAML] Entity Name Tag</string>
+ <key>scope</key>
+ <string>source.yaml entity.name.tag</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+
+ <!--+ - - - - - - - - +
+ + Package Support +
+ + - - - - - - - - +-->
+ <!-- UI -->
+ <dict>
+ <key>name</key>
+ <string>[SublimeLinter] Warning</string>
+ <key>scope</key>
+ <string>sublimelinter.mark.warning</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[SublimeLinter] Error</string>
+ <key>scope</key>
+ <string>sublimelinter.mark.error</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#bf616a</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[SublimeLinter] Gutter Mark</string>
+ <key>scope</key>
+ <string>sublimelinter.gutter-mark</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>lime</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[GitGutter] Ignored</string>
+ <key>scope</key>
+ <string>markup.ignored.git_gutter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#616e88</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[GitGutter] Untracked</string>
+ <key>scope</key>
+ <string>markup.untracked.git_gutter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[GitGutter] Inserted</string>
+ <key>scope</key>
+ <string>markup.inserted.git_gutter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[GitGutter] Changed</string>
+ <key>scope</key>
+ <string>markup.changed.git_gutter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#ebcb8b</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[GitGutter] Deleted</string>
+ <key>scope</key>
+ <string>markup.deleted.git_gutter</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#bf616a</string>
+ </dict>
+ </dict>
+
+ <!-- Languages -->
+ <dict>
+ <key>name</key>
+ <string>[Babel] Decorator</string>
+ <key>scope</key>
+ <string>
+ source.js tag.decorator.js entity.name.tag.js,
+ source.js tag.decorator.js punctuation.definition.tag.js
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d08770</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] String (Interpolated/Template Expression)</string>
+ <key>scope</key>
+ <string>
+ source.js string.quoted.js,
+ source.js string.quoted.jsx,
+ source.js meta.class.js meta.class.property.js string.interpolated.js,
+ source.js string.interpolated.js,
+ source.js string.template.js
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Constant</string>
+ <key>scope</key>
+ <string>source.js variable.other.constant.js</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Object Key/Variable</string>
+ <key>scope</key>
+ <string>
+ source.js constant.other.object.key.js string.unquoted.label.js,
+ source.js variable.other.readwrite.js
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Arrow Function</string>
+ <key>scope</key>
+ <string>source.js meta.class.js meta.class.property.js variable.other.property.js</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#88c0d0</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Static Variable</string>
+ <key>scope</key>
+ <string>source.js variable.other.property.static.js</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Class</string>
+ <key>scope</key>
+ <string>source.js variable.other.class.js</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] String Interpolated/Template Expression Keyword</string>
+ <key>scope</key>
+ <string>
+ source.js string.interpolated.js keyword.other.substitution.begin.js,
+ source.js string.interpolated.js keyword.other.substitution.end.js,
+ source.js punctuation.definition.template-expression.begin.js,
+ source.js punctuation.definition.template-expression.end.js
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Spread Operator</string>
+ <key>scope</key>
+ <string>source.js keyword.operator.spread.js</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[Babel] Export</string>
+ <key>scope</key>
+ <string>source.js meta.export.js variable.other.readwrite.js</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Inherited Class</string>
+ <key>scope</key>
+ <string>source.ts meta.class.ts entity.other.inherited-class.ts</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Class/Enum</string>
+ <key>scope</key>
+ <string>
+ source.ts entity.name.type.class.ts,
+ source.ts entity.name.type.enum.ts
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Type</string>
+ <key>scope</key>
+ <string>source.ts entity.name.type.ts</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Primitive</string>
+ <key>scope</key>
+ <string>source.ts support.type.primitive.ts</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#81a1c1</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Decorator</string>
+ <key>scope</key>
+ <string>
+ source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.decorator.ts variable.other.readwrite.ts,
+ source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.decorator.ts punctuation.decorator.ts
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d08770</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Interpolated String Keyword</string>
+ <key>scope</key>
+ <string>
+ source.ts punctuation.definition.template-expression.begin.ts,
+ source.ts punctuation.definition.template-expression.end.ts
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#5e81ac</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Interpolated String</string>
+ <key>scope</key>
+ <string>source.ts string.template.ts</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#a3be8c</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Static Support Function</string>
+ <key>scope</key>
+ <string>source.ts support.function.math.ts</string>
+ <key>settings</key>
+ <dict>
+ <key>fontStyle</key>
+ <string>italic</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] Constant</string>
+ <key>scope</key>
+ <string>
+ source.ts variable.other.constant.property.ts,
+ source.ts variable.other.enummember.ts,
+ source.ts variable.other.constant.ts
+ </string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#d8dee9</string>
+ <key>fontStyle</key>
+ <string>bold</string>
+ </dict>
+ </dict>
+ <dict>
+ <key>name</key>
+ <string>[TypeScript] JSDoc Tag</string>
+ <key>scope</key>
+ <string>source.ts comment.block.documentation.ts storage.type.class.jsdoc</string>
+ <key>settings</key>
+ <dict>
+ <key>foreground</key>
+ <string>#8fbcbb</string>
+ </dict>
+ </dict>
+ </array>
+ <key>uuid</key>
+ <string>8F96BB94-BF86-4D5E-9733-0428E66FB894</string>
+ </dict>
+</plist>
diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml new file mode 100644 index 0000000..5a8bef4 --- /dev/null +++ b/.config/yazi/keymap.toml @@ -0,0 +1,9 @@ +[[mgr.prepend_keymap]] +on = ["c", "a"] +run = "plugin compress" +desc = "Archive selected files" + +[[mgr.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" diff --git a/.config/yazi/keymap.toml-1748684127440481 b/.config/yazi/keymap.toml-1748684127440481 new file mode 100644 index 0000000..ede28eb --- /dev/null +++ b/.config/yazi/keymap.toml-1748684127440481 @@ -0,0 +1,9 @@ +[[manager.prepend_keymap]] +on = ["c", "a"] +run = "plugin compress" +desc = "Archive selected files" + +[[manager.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" diff --git a/.config/yazi/package.toml b/.config/yazi/package.toml new file mode 100644 index 0000000..869975b --- /dev/null +++ b/.config/yazi/package.toml @@ -0,0 +1,12 @@ +[[plugin.deps]] +use = "KKV9/compress" +rev = "60b24af" +hash = "ee025be766240cc98e671754ac836da3" + +[[plugin.deps]] +use = "yazi-rs/plugins:smart-enter" +rev = "600614a" +hash = "c1a2739e9ef2d837030ccb4267be3ed1" + +[flavor] +deps = [] diff --git a/.config/yazi/plugins/compress.yazi/LICENSE b/.config/yazi/plugins/compress.yazi/LICENSE new file mode 100644 index 0000000..7ce7a2f --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Ciarán O'Brien + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.config/yazi/plugins/compress.yazi/README.md b/.config/yazi/plugins/compress.yazi/README.md new file mode 100644 index 0000000..385fe38 --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/README.md @@ -0,0 +1,48 @@ +# ~~archive.yazi~~ compress.yazi + +A Yazi plugin that compresses selected files to an archive. Supporting yazi versions 0.2.5 and up. + +## Supported file types + +| Extention | Unix Command | Windows Command | +| ------------- | ------------- | --------------- | +| .zip | zip -r | 7z a -tzip | +| .7z | 7z a | 7z a | +| .tar | tar rpf | tar rpf | +| .tar.gz | gzip | 7z a -tgzip | +| .tar.xz | xz | 7z a -txz | +| .tar.bz2 | bzip2 | 7z a -tbzip2 | +| .tar.zst | zstd | zstd | + + +**NOTE:** Windows users are required to install 7-Zip and add 7z.exe to the `path` environment variable, only tar archives will be available otherwise. + + +## Install + +```bash +# For Unix platforms +git clone https://github.com/KKV9/compress.yazi.git ~/.config/yazi/plugins/compress.yazi + +## For Windows +git clone https://github.com/KKV9/compress.yazi.git %AppData%\yazi\config\plugins\compress.yazi + +# Or with yazi plugin manager +ya pack -a KKV9/compress +``` + +- Add this to your `keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = [ "c", "a" ] +run = "plugin compress" +desc = "Archive selected files" +``` + +## Usage + + - Select files or folders to add, then press `c` `a` to create a new archive. + - Type a name for the new file. + - The file extention must match one of the supported filetype extentions. + - The desired archive/compression command must be installed on your system. diff --git a/.config/yazi/plugins/compress.yazi/main.lua b/.config/yazi/plugins/compress.yazi/main.lua new file mode 100644 index 0000000..333587f --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/main.lua @@ -0,0 +1,228 @@ +-- Send error notification
+local function notify_error(message, urgency)
+ ya.notify({
+ title = "Archive",
+ content = message,
+ level = urgency,
+ timeout = 5,
+ })
+end
+
+-- Check for windows
+local is_windows = ya.target_family() == "windows"
+
+-- Make table of selected or hovered: path = filenames
+local selected_or_hovered = ya.sync(function()
+ local tab, paths, names, path_fnames = cx.active, {}, {}, {}
+ for _, u in pairs(tab.selected) do
+ paths[#paths + 1] = tostring(u:parent())
+ names[#names + 1] = tostring(u:name())
+ end
+ if #paths == 0 and tab.current.hovered then
+ paths[1] = tostring(tab.current.hovered.url:parent())
+ names[1] = tostring(tab.current.hovered.name)
+ end
+ for idx, name in ipairs(names) do
+ if not path_fnames[paths[idx]] then
+ path_fnames[paths[idx]] = {}
+ end
+ table.insert(path_fnames[paths[idx]], name)
+ end
+ return path_fnames, tostring(tab.current.cwd)
+end)
+
+-- Check if archive command is available
+local function is_command_available(cmd)
+ local stat_cmd
+
+ if is_windows then
+ stat_cmd = string.format("where %s > nul 2>&1", cmd)
+ else
+ stat_cmd = string.format("command -v %s >/dev/null 2>&1", cmd)
+ end
+
+ local cmd_exists = os.execute(stat_cmd)
+ if cmd_exists then
+ return true
+ else
+ return false
+ end
+end
+
+-- Archive command list --> string
+local function find_binary(cmd_list)
+ for _, cmd in ipairs(cmd_list) do
+ if is_command_available(cmd) then
+ return cmd
+ end
+ end
+ return cmd_list[1] -- Return first command as fallback
+end
+
+-- Check if file exists
+local function file_exists(name)
+ local f = io.open(name, "r")
+ if f ~= nil then
+ io.close(f)
+ return true
+ else
+ return false
+ end
+end
+
+-- Append filename to it's parent directory
+local function combine_url(path, file)
+ path, file = Url(path), Url(file)
+ return tostring(path:join(file))
+end
+
+return {
+ entry = function()
+ -- Exit visual mode
+ ya.manager_emit("escape", { visual = true })
+
+ -- Define file table and output_dir (pwd)
+ local path_fnames, output_dir = selected_or_hovered()
+
+ -- Get input
+ local output_name, event = ya.input({
+ title = "Create archive:",
+ position = { "top-center", y = 3, w = 40 },
+ })
+ if event ~= 1 then
+ return
+ end
+
+ -- Use appropriate archive command
+ local archive_commands = {
+ ["%.zip$"] = { command = "zip", args = { "-r" } },
+ ["%.7z$"] = { command = { "7z", "7zz" }, args = { "a" } },
+ ["%.tar.gz$"] = { command = "tar", args = { "rpf" }, compress = "gzip" },
+ ["%.tar.xz$"] = { command = "tar", args = { "rpf" }, compress = "xz" },
+ ["%.tar.bz2$"] = { command = "tar", args = { "rpf" }, compress = "bzip2" },
+ ["%.tar.zst$"] = { command = "tar", args = { "rpf" }, compress = "zstd", compress_args = { "--rm" } },
+ ["%.tar$"] = { command = "tar", args = { "rpf" } },
+ }
+
+ if is_windows then
+ archive_commands = {
+ ["%.zip$"] = { command = "7z", args = { "a", "-tzip" } },
+ ["%.7z$"] = { command = "7z", args = { "a" } },
+ ["%.tar.gz$"] = {
+ command = "tar",
+ args = { "rpf" },
+ compress = "7z",
+ compress_args = { "a", "-tgzip", "-sdel", output_name },
+ },
+ ["%.tar.xz$"] = {
+ command = "tar",
+ args = { "rpf" },
+ compress = "7z",
+ compress_args = { "a", "-txz", "-sdel", output_name },
+ },
+ ["%.tar.bz2$"] = {
+ command = "tar",
+ args = { "rpf" },
+ compress = "7z",
+ compress_args = { "a", "-tbzip2", "-sdel", output_name },
+ },
+ ["%.tar.zst$"] = { command = "tar", args = { "rpf" }, compress = "zstd", compress_args = { "--rm" } },
+ ["%.tar$"] = { command = "tar", args = { "rpf" } },
+ }
+ end
+
+ -- Match user input to archive command
+ local archive_cmd, archive_args, archive_compress, archive_compress_args
+ for pattern, cmd_pair in pairs(archive_commands) do
+ if output_name:match(pattern) then
+ archive_cmd = cmd_pair.command
+ archive_args = cmd_pair.args
+ archive_compress = cmd_pair.compress
+ archive_compress_args = cmd_pair.compress_args or {}
+ end
+ end
+
+ -- Check if archive command has multiple names
+ if type(archive_cmd) == "table" then
+ archive_cmd = find_binary(archive_cmd)
+ end
+
+ -- Check if no archive command is available for the extention
+ if not archive_cmd then
+ notify_error("Unsupported file extention", "error")
+ return
+ end
+
+ -- Exit if archive command is not available
+ if not is_command_available(archive_cmd) then
+ notify_error(string.format("%s not available", archive_cmd), "error")
+ return
+ end
+
+ -- Exit if compress command is not available
+ if archive_compress and not is_command_available(archive_compress) then
+ notify_error(string.format("%s compression not available", archive_compress), "error")
+ return
+ end
+
+ -- If file exists show overwrite prompt
+ local output_url = combine_url(output_dir, output_name)
+ while true do
+ if file_exists(output_url) then
+ local overwrite_answer = ya.input({
+ title = "Overwrite " .. output_name .. "? y/N:",
+ position = { "top-center", y = 3, w = 40 },
+ })
+ if overwrite_answer:lower() ~= "y" then
+ notify_error("Operation canceled", "warn")
+ return -- If no overwrite selected, exit
+ else
+ local rm_status, rm_err = os.remove(output_url)
+ if not rm_status then
+ notify_error(string.format("Failed to remove %s, exit code %s", output_name, rm_err), "error")
+ return
+ end -- If overwrite fails, exit
+ end
+ end
+ if archive_compress and not output_name:match("%.tar$") then
+ output_name = output_name:match("(.*%.tar)") -- Test for .tar and .tar.*
+ output_url = combine_url(output_dir, output_name) -- Update output_url
+ else
+ break
+ end
+ end
+
+ -- Add to output archive in each path, their respective files
+ for path, names in pairs(path_fnames) do
+ local archive_status, archive_err =
+ Command(archive_cmd):args(archive_args):arg(output_url):args(names):cwd(path):spawn():wait()
+ if not archive_status or not archive_status.success then
+ notify_error(
+ string.format(
+ "%s with selected files failed, exit code %s",
+ archive_args,
+ archive_status and archive_status.code or archive_err
+ ),
+ "error"
+ )
+ end
+ end
+
+ -- Use compress command if needed
+ if archive_compress then
+ local compress_status, compress_err =
+ Command(archive_compress):args(archive_compress_args):arg(output_name):cwd(output_dir):spawn():wait()
+ if not compress_status or not compress_status.success then
+ notify_error(
+ string.format(
+ "%s with %s failed, exit code %s",
+ archive_compress,
+ output_name,
+ compress_status and compress_status.code or compress_err
+ ),
+ "error"
+ )
+ end
+ end
+ end,
+}
diff --git a/.config/yazi/plugins/smart-enter.yazi/LICENSE b/.config/yazi/plugins/smart-enter.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/.config/yazi/plugins/smart-enter.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 yazi-rs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.config/yazi/plugins/smart-enter.yazi/README.md b/.config/yazi/plugins/smart-enter.yazi/README.md new file mode 100644 index 0000000..d4c6bbd --- /dev/null +++ b/.config/yazi/plugins/smart-enter.yazi/README.md @@ -0,0 +1,40 @@ +# smart-enter.yazi + +[`Open`][open] files or [`enter`][enter] directories all in one key! + +## Installation + +```sh +ya pack -a yazi-rs/plugins:smart-enter +``` + +## Usage + +Bind your <kbd>l</kbd> key to the plugin, in your `~/.config/yazi/keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" +``` + +## Advanced + +By default, `--hovered` is passed to the [`open`][open] command, make the behavior consistent with [`enter`][enter] avoiding accidental triggers, +which means both will only target the currently hovered file. + +If you still want `open` to target multiple selected files, add this to your `~/.config/yazi/init.lua`: + +```lua +require("smart-enter"):setup { + open_multi = true, +} +``` + +## License + +This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. + +[open]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.open +[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.enter diff --git a/.config/yazi/plugins/smart-enter.yazi/main.lua b/.config/yazi/plugins/smart-enter.yazi/main.lua new file mode 100644 index 0000000..37a465a --- /dev/null +++ b/.config/yazi/plugins/smart-enter.yazi/main.lua @@ -0,0 +1,10 @@ +--- @sync entry + +local function setup(self, opts) self.open_multi = opts.open_multi end + +local function entry(self) + local h = cx.active.current.hovered + ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi }) +end + +return { entry = entry, setup = setup } diff --git a/.config/yazi/theme.toml b/.config/yazi/theme.toml new file mode 100644 index 0000000..651f857 --- /dev/null +++ b/.config/yazi/theme.toml @@ -0,0 +1,2 @@ +[flavor] +use = "nord" diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..465b12c --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,2 @@ +[opener] +edit = [{ run = 'nvim "$@"', block = true }] diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..995566c --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,75 @@ +# Unbinding +unbind r +unbind Space +unbind C-d +unbind C-a +set-option -g set-clipboard on + +# Setting binds +set -g prefix C-s +bind r source-file ~/.tmux.conf +bind-key Space switch-client -l +bind-key ";" split-window -h -c "#{pane_current_path}" +bind-key "'" split-window -v -c "#{pane_current_path}" +bind-key g new-window -n lazygit -c "#{pane_current_path}" "lazygit" +bind-key -n M-h select-window -t -1 +bind-key -n M-l select-window -t +1 +bind -N "⌘+l last-session (via sesh) " L run-shell "sesh last || tmux display-message -d 1000 'Oops, no last sessions found'" +bind -N "⌘+l last-session (via sesh) " C-z run-shell "sesh last || tmux display-message -d 1000 'Oops, no last sessions found'" +bind-key Left swap-window -t -1 \; select-window -t -1 +bind-key Right swap-window -t +1 \; select-window -t +1 + +bind-key "K" run-shell "sesh connect \"$( + sesh list --icons --hide-duplicates | fzf-tmux -p 100%,100% --no-border \ + --ansi \ + --list-border \ + --no-sort --prompt '⚡ ' \ + --color 'list-border:6,input-border:3,preview-border:4,header-bg:-1,header-border:6' \ + --input-border \ + --header-border \ + --bind 'btab:down,tab:up' \ + --bind 'ctrl-b:abort' \ + --bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \ + --bind 'ctrl-t:change-prompt( )+reload(sesh list -t --icons)' \ + --bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \ + --bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \ + --bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \ + --bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \ + --preview-window 'right:70%' \ + --preview 'sesh preview {}' \ +)\"" +set -g detach-on-destroy off +bind-key -n C-a last-window +set -g mouse on +set -gq allow-passthrough on +set -g visual-activity off + +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on +set-option -g status-position top +set -g escape-time 0 +set -g status-interval 3 + +# Plugins +set -g @plugin 'arcticicestudio/nord-tmux' +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +set -g @resurrect-save 'C-e' +set -g @resurrect-restore 'C-r' + +run '~/.tmux/plugins/tpm/tpm' + +set -g status-left "#[fg=black,bold]#S " +set -g status-right "" +set -g window-status-format " #[fg=grey]#I:#W" +set -g window-status-current-format " #[fg=red,bold]#I:#W" +set-option -g status-style bg=default +set -g window-status-separator "" +set -g status-justify absolute-centre +set -g message-style bg=default,fg=cyan,bold |
