mirror of
https://github.com/belsabbagh/dotfiles.git
synced 2026-06-12 11:39:51 +00:00
Compare commits
4 Commits
c9c27d1554
...
elnady
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ab87c01b4 | ||
|
|
de7981555e | ||
|
|
dc3f2ada8f | ||
|
|
dcfdf27c64 |
@@ -39,9 +39,83 @@ x = 2
|
||||
y = 2
|
||||
[env]
|
||||
TERM = "xterm-256color"
|
||||
# Dracula theme for Alacritty
|
||||
# https://draculatheme.com/alacritty
|
||||
#
|
||||
# Color palette
|
||||
# https://spec.draculatheme.com
|
||||
#
|
||||
# Instructions
|
||||
# https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
|
||||
|
||||
[colors.primary]
|
||||
|
||||
background = "#282a36"
|
||||
foreground = "#f8f8f2"
|
||||
bright_foreground = "#ffffff"
|
||||
|
||||
[colors.cursor]
|
||||
|
||||
text = "#282a36"
|
||||
cursor = "#f8f8f2"
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
|
||||
text = "CellBackground"
|
||||
cursor = "CellForeground"
|
||||
|
||||
[colors.selection]
|
||||
|
||||
text = "CellForeground"
|
||||
background = "#44475a"
|
||||
|
||||
[colors.normal]
|
||||
|
||||
black = "#21222c"
|
||||
red = "#ff5555"
|
||||
green = "#50fa7b"
|
||||
yellow = "#f1fa8c"
|
||||
blue = "#bd93f9"
|
||||
magenta = "#ff79c6"
|
||||
cyan = "#8be9fd"
|
||||
white = "#f8f8f2"
|
||||
|
||||
[colors.bright]
|
||||
|
||||
black = "#6272a4"
|
||||
red = "#ff6e6e"
|
||||
green = "#69ff94"
|
||||
yellow = "#ffffa5"
|
||||
blue = "#d6acff"
|
||||
magenta = "#ff92df"
|
||||
cyan = "#a4ffff"
|
||||
white = "#ffffff"
|
||||
|
||||
[colors.search.matches]
|
||||
|
||||
foreground = "#44475a"
|
||||
background = "#50fa7b"
|
||||
|
||||
[colors.search.focused_match]
|
||||
|
||||
foreground = "#44475a"
|
||||
background = "#ffb86c"
|
||||
|
||||
[colors.footer_bar]
|
||||
|
||||
background = "#282a36"
|
||||
foreground = "#f8f8f2"
|
||||
|
||||
[colors.hints.start]
|
||||
|
||||
foreground = "#282a36"
|
||||
background = "#f1fa8c"
|
||||
|
||||
[colors.hints.end]
|
||||
|
||||
foreground = "#f1fa8c"
|
||||
background = "#282a36"
|
||||
|
||||
[general]
|
||||
live_config_reload = true
|
||||
import = [
|
||||
"~/.config/alacritty/themes/gruvbox_material.toml"
|
||||
]
|
||||
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
# Dracula theme for Alacritty
|
||||
# https://draculatheme.com/alacritty
|
||||
#
|
||||
# Color palette
|
||||
# https://spec.draculatheme.com
|
||||
#
|
||||
# Instructions
|
||||
# https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
|
||||
|
||||
[colors.primary]
|
||||
|
||||
background = "#282a36"
|
||||
foreground = "#f8f8f2"
|
||||
bright_foreground = "#ffffff"
|
||||
|
||||
[colors.cursor]
|
||||
|
||||
text = "#282a36"
|
||||
cursor = "#f8f8f2"
|
||||
|
||||
[colors.vi_mode_cursor]
|
||||
|
||||
text = "CellBackground"
|
||||
cursor = "CellForeground"
|
||||
|
||||
[colors.selection]
|
||||
|
||||
text = "CellForeground"
|
||||
background = "#44475a"
|
||||
|
||||
[colors.normal]
|
||||
|
||||
black = "#21222c"
|
||||
red = "#ff5555"
|
||||
green = "#50fa7b"
|
||||
yellow = "#f1fa8c"
|
||||
blue = "#bd93f9"
|
||||
magenta = "#ff79c6"
|
||||
cyan = "#8be9fd"
|
||||
white = "#f8f8f2"
|
||||
|
||||
[colors.bright]
|
||||
|
||||
black = "#6272a4"
|
||||
red = "#ff6e6e"
|
||||
green = "#69ff94"
|
||||
yellow = "#ffffa5"
|
||||
blue = "#d6acff"
|
||||
magenta = "#ff92df"
|
||||
cyan = "#a4ffff"
|
||||
white = "#ffffff"
|
||||
|
||||
[colors.search.matches]
|
||||
|
||||
foreground = "#44475a"
|
||||
background = "#50fa7b"
|
||||
|
||||
[colors.search.focused_match]
|
||||
|
||||
foreground = "#44475a"
|
||||
background = "#ffb86c"
|
||||
|
||||
[colors.footer_bar]
|
||||
|
||||
background = "#282a36"
|
||||
foreground = "#f8f8f2"
|
||||
|
||||
[colors.hints.start]
|
||||
|
||||
foreground = "#282a36"
|
||||
background = "#f1fa8c"
|
||||
|
||||
[colors.hints.end]
|
||||
|
||||
foreground = "#f1fa8c"
|
||||
background = "#282a36"
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# Colors (Gruvbox Material Dark Medium)
|
||||
|
||||
[colors.primary]
|
||||
background = '#282828'
|
||||
foreground = '#dfbf8e'
|
||||
|
||||
[colors.normal]
|
||||
black = '#665c54'
|
||||
red = '#ea6962'
|
||||
green = '#a9b665'
|
||||
yellow = '#e78a4e'
|
||||
blue = '#7daea3'
|
||||
magenta = '#d3869b'
|
||||
cyan = '#89b482'
|
||||
white = '#dfbf8e'
|
||||
|
||||
[colors.bright]
|
||||
black = '#928374'
|
||||
red = '#ea6962'
|
||||
green = '#a9b665'
|
||||
yellow = '#e3a84e'
|
||||
blue = '#7daea3'
|
||||
magenta = '#d3869b'
|
||||
cyan = '#89b482'
|
||||
white = '#dfbf8e'
|
||||
@@ -1,38 +0,0 @@
|
||||
# Colors (Kanagawa Dragon)
|
||||
# Source https//github.com/rebelot/kanagawa.nvim
|
||||
|
||||
[colors.primary]
|
||||
background = '#181616'
|
||||
foreground = '#c5c9c5'
|
||||
|
||||
[colors.normal]
|
||||
black = '#0d0c0c'
|
||||
blue = '#8ba4b0'
|
||||
cyan = '#8ea4a2'
|
||||
green = '#8a9a7b'
|
||||
magenta = '#a292a3'
|
||||
red = '#c4746e'
|
||||
white = '#C8C093'
|
||||
yellow = '#c4b28a'
|
||||
|
||||
[colors.bright]
|
||||
black = '#a6a69c'
|
||||
blue = '#7FB4CA'
|
||||
cyan = '#7AA89F'
|
||||
green = '#87a987'
|
||||
magenta = '#938AA9'
|
||||
red = '#E46876'
|
||||
white = '#c5c9c5'
|
||||
yellow = '#E6C384'
|
||||
|
||||
[colors.selection]
|
||||
background = '#2d4f67'
|
||||
foreground = '#c8c093'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 16
|
||||
color = '#ffa066'
|
||||
|
||||
[[colors.indexed_colors]]
|
||||
index = 17
|
||||
color = '#ff5d62'
|
||||
@@ -1,18 +1,18 @@
|
||||
#? Config file for btop v.1.4.6
|
||||
#? Config file for btop v. 1.4.0
|
||||
|
||||
#* 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 = "/usr/share/btop/themes/gruvbox_dark_v2.theme"
|
||||
color_theme = "/usr/share/btop/themes/dracula.theme"
|
||||
|
||||
#* If the theme set background should be shown, set to False if you want terminal background transparency.
|
||||
theme_background = true
|
||||
theme_background = True
|
||||
|
||||
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
|
||||
truecolor = true
|
||||
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
|
||||
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.
|
||||
@@ -22,13 +22,10 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul
|
||||
|
||||
#* 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
|
||||
vim_keys = False
|
||||
|
||||
#* Rounded corners on boxes, is ignored if TTY mode is ON.
|
||||
rounded_corners = true
|
||||
|
||||
#* Use terminal synchronized output sequences to reduce flickering on supported terminals.
|
||||
terminal_sync = true
|
||||
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.
|
||||
@@ -63,40 +60,37 @@ update_ms = 100
|
||||
proc_sorting = "memory"
|
||||
|
||||
#* Reverse sorting order, True or False.
|
||||
proc_reversed = false
|
||||
proc_reversed = False
|
||||
|
||||
#* Show processes as a tree.
|
||||
proc_tree = false
|
||||
proc_tree = False
|
||||
|
||||
#* Use the cpu graph colors in the process list.
|
||||
proc_colors = true
|
||||
proc_colors = True
|
||||
|
||||
#* Use a darkening gradient in the process list.
|
||||
proc_gradient = true
|
||||
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
|
||||
proc_per_core = False
|
||||
|
||||
#* Show process memory as bytes instead of percent.
|
||||
proc_mem_bytes = true
|
||||
proc_mem_bytes = True
|
||||
|
||||
#* Show cpu graph for each process.
|
||||
proc_cpu_graphs = true
|
||||
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
|
||||
proc_info_smaps = False
|
||||
|
||||
#* Show proc box on left side of screen instead of right.
|
||||
proc_left = false
|
||||
proc_left = False
|
||||
|
||||
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
|
||||
proc_filter_kernel = false
|
||||
proc_filter_kernel = False
|
||||
|
||||
#* In tree-view, always accumulate child process resources in the parent process.
|
||||
proc_aggregate = false
|
||||
|
||||
#* Should cpu and memory usage display be preserved for dead processes when paused.
|
||||
keep_dead_proc_usage = false
|
||||
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.
|
||||
@@ -110,28 +104,25 @@ cpu_graph_lower = "Auto"
|
||||
show_gpu_info = "Auto"
|
||||
|
||||
#* Toggles if the lower CPU graph should be inverted.
|
||||
cpu_invert_lower = true
|
||||
cpu_invert_lower = True
|
||||
|
||||
#* Set to True to completely disable the lower CPU graph.
|
||||
cpu_single_graph = false
|
||||
cpu_single_graph = False
|
||||
|
||||
#* Show cpu box at bottom of screen instead of top.
|
||||
cpu_bottom = false
|
||||
cpu_bottom = False
|
||||
|
||||
#* Shows the system uptime in the CPU box.
|
||||
show_uptime = true
|
||||
|
||||
#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo.
|
||||
show_cpu_watts = true
|
||||
show_uptime = True
|
||||
|
||||
#* Show cpu temperature.
|
||||
check_temp = true
|
||||
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
|
||||
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.
|
||||
@@ -143,66 +134,63 @@ cpu_core_map = ""
|
||||
temp_scale = "celsius"
|
||||
|
||||
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
|
||||
base_10_sizes = false
|
||||
base_10_sizes = False
|
||||
|
||||
#* Show CPU frequency.
|
||||
show_cpu_freq = true
|
||||
|
||||
#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average".
|
||||
freq_mode = "first"
|
||||
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
|
||||
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"
|
||||
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
|
||||
disks_filter = ""
|
||||
|
||||
#* Show graphs instead of meters for memory values.
|
||||
mem_graphs = true
|
||||
mem_graphs = True
|
||||
|
||||
#* Show mem box below net box instead of above.
|
||||
mem_below_net = false
|
||||
mem_below_net = False
|
||||
|
||||
#* Count ZFS ARC in cached and available memory.
|
||||
zfs_arc_cached = true
|
||||
zfs_arc_cached = True
|
||||
|
||||
#* If swap memory should be shown in memory box.
|
||||
show_swap = true
|
||||
show_swap = True
|
||||
|
||||
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
|
||||
swap_disk = true
|
||||
swap_disk = True
|
||||
|
||||
#* If mem box should be split to also show disks info.
|
||||
show_disks = true
|
||||
show_disks = True
|
||||
|
||||
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
|
||||
only_physical = true
|
||||
only_physical = True
|
||||
|
||||
#* Read disks list from /etc/fstab. This also disables only_physical.
|
||||
use_fstab = true
|
||||
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
|
||||
zfs_hide_datasets = False
|
||||
|
||||
#* Set to true to show available disk space for privileged users.
|
||||
disk_free_priv = false
|
||||
disk_free_priv = False
|
||||
|
||||
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
|
||||
show_io_stat = true
|
||||
show_io_stat = True
|
||||
|
||||
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
|
||||
io_mode = false
|
||||
io_mode = False
|
||||
|
||||
#* Set to True to show combined read/write io graphs in io mode.
|
||||
io_graph_combined = false
|
||||
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".
|
||||
@@ -214,44 +202,32 @@ 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
|
||||
net_auto = True
|
||||
|
||||
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
|
||||
net_sync = true
|
||||
net_sync = True
|
||||
|
||||
#* 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
|
||||
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
|
||||
show_battery_watts = True
|
||||
|
||||
#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
|
||||
#* 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"
|
||||
|
||||
#* Automatically save current settings to config file on exit.
|
||||
save_config_on_exit = true
|
||||
|
||||
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
|
||||
nvml_measure_pcie_speeds = true
|
||||
|
||||
#* Measure PCIe throughput on AMD cards, may impact performance on certain cards.
|
||||
rsmi_measure_pcie_speeds = true
|
||||
nvml_measure_pcie_speeds = True
|
||||
|
||||
#* Horizontally mirror the GPU graph.
|
||||
gpu_mirror_graph = true
|
||||
|
||||
#* Set which GPU vendors to show. Available values are "nvidia amd intel"
|
||||
shown_gpus = "nvidia amd intel"
|
||||
gpu_mirror_graph = True
|
||||
|
||||
#* Custom gpu0 model name, empty string to disable.
|
||||
custom_gpu_name0 = ""
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
# You can split this configuration into multiple files
|
||||
# Create your files separately and then link them to this file like this:
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
source = ~/.config/hypr/keymaps.conf
|
||||
|
||||
env = XDG_CURRENT_DESKTOP,Hyprland
|
||||
env = XDG_SESSION_TYPE,wayland
|
||||
env = XDG_SESSION_DESKTOP,Hyprland
|
||||
@@ -38,7 +36,7 @@ env = XCURSOR_SIZE,24
|
||||
################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=,preferred,auto,auto
|
||||
monitor=,preferred,auto,1
|
||||
|
||||
|
||||
###################
|
||||
@@ -48,12 +46,32 @@ monitor=,preferred,auto,auto
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
|
||||
# Set programs that you use
|
||||
$terminal = alacritty
|
||||
$fileManager = dolphin
|
||||
$menu = wofi --show drun
|
||||
$terminal = alacritty
|
||||
$fileManager = thunar
|
||||
$menu = hyprlauncher
|
||||
$browser = zen-browser
|
||||
|
||||
exec-once = ~/.config/hypr/start.sh
|
||||
#################
|
||||
### AUTOSTART ###
|
||||
#################
|
||||
|
||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
# exec-once = $terminal
|
||||
# exec-once = nm-applet &
|
||||
# exec-once = waybar & hyprpaper & firefox
|
||||
exec-once = ssh-agent & waybar & hyprpaper & kdeconnect-indicator & hypridle
|
||||
exec-once = systemctl --user start hyprpolkitagent
|
||||
#############################
|
||||
### ENVIRONMENT VARIABLES ###
|
||||
#############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Environment-variables/
|
||||
|
||||
env = XCURSOR_SIZE,24
|
||||
env = HYPRCURSOR_SIZE,24
|
||||
|
||||
|
||||
#####################
|
||||
### LOOK AND FEEL ###
|
||||
@@ -79,6 +97,7 @@ general {
|
||||
allow_tearing = false
|
||||
|
||||
layout = dwindle
|
||||
|
||||
}
|
||||
|
||||
cursor {
|
||||
@@ -140,6 +159,7 @@ misc {
|
||||
animate_manual_resizes = true
|
||||
animate_mouse_windowdragging = true
|
||||
enable_swallow = true
|
||||
render_ahead_of_time = false
|
||||
disable_hyprland_logo = true
|
||||
}
|
||||
|
||||
@@ -162,6 +182,11 @@ input {
|
||||
}
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||
gestures {
|
||||
workspace_swipe = false
|
||||
}
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
||||
device {
|
||||
@@ -169,12 +194,107 @@ device {
|
||||
sensitivity = -0.5
|
||||
}
|
||||
|
||||
|
||||
####################
|
||||
### KEYBINDINGSS ###
|
||||
####################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||
|
||||
|
||||
exec-once = wl-paste --type text --watch cliphist store
|
||||
exec-once = wl-paste --type image --watch cliphist store
|
||||
bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
bind = $mainMod, Return, exec, $terminal
|
||||
bind = $mainMod, Q, killactive,
|
||||
bind = $mainMod ALT, Q, exit,
|
||||
bind = $mainMod, E, exec, $fileManager
|
||||
bind = $mainMod, B, exec, $browser
|
||||
bind = $mainMod, T, togglefloating,
|
||||
bind = $mainMod, F, fullscreen,
|
||||
bind = $mainMod, R, exec, $menu
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, J, togglesplit, # dwindle
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
|
||||
# Moving windows
|
||||
bind = $mainMod SHIFT, left, swapwindow, l
|
||||
bind = $mainMod SHIFT, right, swapwindow, r
|
||||
bind = $mainMod SHIFT, up, swapwindow, u
|
||||
bind = $mainMod SHIFT, down, swapwindow, d
|
||||
|
||||
# Window resizing X Y
|
||||
bind = $mainMod CTRL, left, resizeactive, -60 0
|
||||
bind = $mainMod CTRL, right, resizeactive, 60 0
|
||||
bind = $mainMod CTRL, up, resizeactive, 0 -60
|
||||
bind = $mainMod CTRL, down, resizeactive, 0 60
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
bind = $mainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
bind = , XF86MonBrightnessDown, exec, brightnessctl set 5%-
|
||||
bind = , XF86MonBrightnessUp, exec, brightnessctl set 5%+
|
||||
|
||||
bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
|
||||
bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||
bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||
# Requires playerctl
|
||||
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||
bindl = , XF86AudioNext, exec, playerctl next
|
||||
|
||||
bind = $mainMod SHIFT, H, exec, $terminal -e sh -c "nvim ~/.config/hypr/hyprland.conf"
|
||||
bind = $mainMod SHIFT, W, exec, $terminal -e sh -c "nvim ~/.config/waybar/config"
|
||||
|
||||
bind = $mainMod SHIFT, S, exec, grimblast copysave area
|
||||
##############################
|
||||
### WINDOWS AND WORKSPACES ###
|
||||
##############################
|
||||
|
||||
windowrule {
|
||||
name = windowrule-1
|
||||
suppress_event = maximize
|
||||
match:class = .* # You'll probably like this.
|
||||
}
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
# Example windowrule v1
|
||||
# windowrule = float, ^(kitty)$
|
||||
|
||||
# Example windowrule v2
|
||||
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
|
||||
|
||||
windowrulev2 = suppressevent maximize, class:.* # You'll probably like this.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
$path = ~/Pictures/Wallpapers/kdh.jpg
|
||||
wallpaper {
|
||||
monitor = eDP-1
|
||||
path = $path
|
||||
fit_mode= cover
|
||||
}
|
||||
$path = ~/Pictures/Wallpapers/dracula-mnt-6272a4.png
|
||||
|
||||
preload = $path
|
||||
wallpaper = ,$path
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
$terminal = alacritty
|
||||
$fileManager = dolphin
|
||||
$menu = wofi --show drun
|
||||
$browser = zen-browser
|
||||
|
||||
####################
|
||||
### KEYBINDINGSS ###
|
||||
####################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/
|
||||
$mainMod = SUPER # Sets "Windows" key as main modifier
|
||||
|
||||
|
||||
exec-once = wl-paste --type text --watch cliphist store
|
||||
exec-once = wl-paste --type image --watch cliphist store
|
||||
bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
bind = $mainMod, Return, exec, $terminal
|
||||
bind = $mainMod, Q, killactive,
|
||||
bind = $mainMod ALT, Q, exit,
|
||||
bind = $mainMod, E, exec, $fileManager
|
||||
bind = $mainMod, B, exec, $browser
|
||||
bind = $mainMod, T, togglefloating,
|
||||
bind = $mainMod, F, fullscreen,
|
||||
bind = $mainMod, R, exec, $menu
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, J, togglesplit, # dwindle
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
|
||||
# Moving windows
|
||||
bind = $mainMod SHIFT, left, swapwindow, l
|
||||
bind = $mainMod SHIFT, right, swapwindow, r
|
||||
bind = $mainMod SHIFT, up, swapwindow, u
|
||||
bind = $mainMod SHIFT, down, swapwindow, d
|
||||
|
||||
# Window resizing X Y
|
||||
bind = $mainMod CTRL, left, resizeactive, -60 0
|
||||
bind = $mainMod CTRL, right, resizeactive, 60 0
|
||||
bind = $mainMod CTRL, up, resizeactive, 0 -60
|
||||
bind = $mainMod CTRL, down, resizeactive, 0 60
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, mouse_down, workspace, e+1
|
||||
bind = $mainMod, mouse_up, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
bind = , XF86MonBrightnessDown, exec, brightnessctl set 5%-
|
||||
bind = , XF86MonBrightnessUp, exec, brightnessctl set 5%+
|
||||
|
||||
bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
|
||||
bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
|
||||
bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||
# Requires playerctl
|
||||
bindl = , XF86AudioPlay, exec, playerctl play-pause
|
||||
bindl = , XF86AudioPrev, exec, playerctl previous
|
||||
bindl = , XF86AudioNext, exec, playerctl next
|
||||
|
||||
bind = $mainMod SHIFT, C, exec, $terminal -e sh -c "nvim ~/.config/"
|
||||
|
||||
bind = $mainMod SHIFT, S, exec, grimblast copysave area
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Redirect all output to start.log (overwriting previous logs)
|
||||
exec > "$HOME/start.log" 2>&1
|
||||
|
||||
# Function to log and time each command
|
||||
run_and_time() {
|
||||
echo "[$(date +'%H:%M:%S')] Starting: $1"
|
||||
# /usr/bin/time -f "Took: %E" $1 &
|
||||
# Note: Since most of these are backgrounded (&),
|
||||
# we use a subshell to capture the duration of the launch itself.
|
||||
start_time=$(date +%s%N)
|
||||
"$@" &
|
||||
end_time=$(date +%s%N)
|
||||
|
||||
# Calculate duration in milliseconds (simple shell math)
|
||||
duration=$(( (end_time - start_time) / 1000000 ))
|
||||
echo " -> Launched in ${duration}ms"
|
||||
}
|
||||
|
||||
echo "--- Hyprland Startup: $(date) ---"
|
||||
|
||||
run_and_time qs -c nucleus-shell
|
||||
# run_and_time systemctl --user start hyprpaper
|
||||
# run_and_time systemctl --user start hypridle
|
||||
# run_and_time systemctl --user start hyprpolkitagent
|
||||
run_and_time ssh-agent
|
||||
run_and_time copyq
|
||||
run_and_time kdeconnect-indicator
|
||||
run_and_time dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
|
||||
|
||||
echo "--- All processes dispatched ---"
|
||||
@@ -2,9 +2,11 @@ vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.have_nerd_font = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
-- vim.opt.mouse = 'a'
|
||||
vim.opt.showmode = false
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.undofile = true
|
||||
vim.opt.ignorecase = true
|
||||
@@ -19,10 +21,9 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
vim.opt.inccommand = 'split'
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.scrolloff = 10
|
||||
-- vim.opt.textwidth = 80
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
vim.opt.textwidth = 80
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||
@@ -72,150 +73,3 @@ require('lazy').setup({ spec = { import = 'plugins' } }, {
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('blink.cmp').get_lsp_capabilities({}, false))
|
||||
|
||||
vim.lsp.config('*', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- Diagnostic Config & Keymaps
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config {
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
|
||||
-- Can switch between these as you prefer
|
||||
virtual_text = true, -- Text shows up at the end of the line
|
||||
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
|
||||
|
||||
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||
jump = { float = true },
|
||||
}
|
||||
|
||||
-- Brief aside: **What is LSP?**
|
||||
--
|
||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||
--
|
||||
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
||||
-- and language tooling communicate in a standardized fashion.
|
||||
--
|
||||
-- In general, you have a "server" which is some tool built to understand a particular
|
||||
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
||||
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
||||
-- processes that communicate with some "client" - in this case, Neovim!
|
||||
--
|
||||
-- LSP provides Neovim with features like:
|
||||
-- - Go to definition
|
||||
-- - Find references
|
||||
-- - Autocompletion
|
||||
-- - Symbol Search
|
||||
-- - and more!
|
||||
--
|
||||
-- Thus, Language Servers are external tools that must be installed separately from
|
||||
-- Neovim. This is where `mason` and related plugins come into play.
|
||||
--
|
||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
||||
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
||||
|
||||
-- This function gets run when an LSP attaches to a particular buffer.
|
||||
-- That is to say, every time a new file is opened that is associated with
|
||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||
-- function will be executed to configure the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or 'n'
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
-- Rename the variable under your cursor.
|
||||
-- Most Language Servers support renaming across files, etc.
|
||||
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
|
||||
-- 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, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||
|
||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||
---@param client vim.lsp.Client
|
||||
---@param method vim.lsp.protocol.Method
|
||||
---@param bufnr? integer some lsp support methods only in specific files
|
||||
---@return boolean
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
return client:supports_method(method, bufnr)
|
||||
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
|
||||
--
|
||||
-- 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, '[T]oggle Inlay [H]ints')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.lsp.enable {
|
||||
'astrols',
|
||||
'bashls',
|
||||
'clangd',
|
||||
'gopls',
|
||||
'luals',
|
||||
-- 'pyright',
|
||||
'ruff',
|
||||
'julials',
|
||||
'svelte-language-server',
|
||||
'rust-analyzer',
|
||||
'emmet-language-server',
|
||||
'tinymist',
|
||||
'tsgo',
|
||||
'tsls',
|
||||
'qmlls',
|
||||
'yamlls',
|
||||
'ty',
|
||||
}
|
||||
|
||||
vim.o.background = 'dark'
|
||||
vim.cmd [[colorscheme gruvbox]]
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/withastro/language-tools/tree/main/packages/language-server
|
||||
---
|
||||
--- `astro-ls` can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm install -g @astrojs/language-server
|
||||
--- ```
|
||||
|
||||
return {
|
||||
cmd = { 'astro-ls', '--stdio' },
|
||||
filetypes = { 'astro' },
|
||||
root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' },
|
||||
init_options = {
|
||||
typescript = {},
|
||||
},
|
||||
before_init = function(_, config)
|
||||
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
|
||||
config.init_options.typescript.tsdk = 'node_modules/typescript/lib'
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/bash-lsp/bash-language-server
|
||||
---
|
||||
--- `bash-language-server` can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm i -g bash-language-server
|
||||
--- ```
|
||||
---
|
||||
--- Language server for bash, written using tree sitter in typescript.
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'bash-language-server', 'start' },
|
||||
settings = {
|
||||
bashIde = {
|
||||
-- Glob pattern for finding and parsing shell script files in the workspace.
|
||||
-- Used by the background analysis features across files.
|
||||
|
||||
-- Prevent recursive scanning which will cause issues when opening a file
|
||||
-- directly in the home directory (e.g. ~/foo.sh).
|
||||
--
|
||||
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
|
||||
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
|
||||
},
|
||||
},
|
||||
filetypes = { 'bash', 'sh' },
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
---@brief
|
||||
--- https://biomejs.dev
|
||||
---
|
||||
--- Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome).
|
||||
---
|
||||
--- ```sh
|
||||
--- npm install [-g] @biomejs/biome
|
||||
--- ```
|
||||
---
|
||||
--- ### Monorepo support
|
||||
---
|
||||
--- `biome` supports monorepos by default. It will automatically find the `biome.json` corresponding to the package you are working on, as described in the [documentation](https://biomejs.dev/guides/big-projects/#monorepo). This works without the need of spawning multiple instances of `biome`, saving memory.
|
||||
|
||||
local util = require 'lspconfig.util'
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = function(dispatchers, config)
|
||||
local cmd = 'biome'
|
||||
local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/biome'
|
||||
if local_cmd and vim.fn.executable(local_cmd) == 1 then
|
||||
cmd = local_cmd
|
||||
end
|
||||
return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers)
|
||||
end,
|
||||
filetypes = {
|
||||
'astro',
|
||||
'css',
|
||||
'graphql',
|
||||
'html',
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'json',
|
||||
'jsonc',
|
||||
'svelte',
|
||||
'typescript',
|
||||
'typescript.tsx',
|
||||
'typescriptreact',
|
||||
'vue',
|
||||
},
|
||||
workspace_required = true,
|
||||
root_dir = function(bufnr, on_dir)
|
||||
-- The project root is where the LSP can be started from
|
||||
-- As stated in the documentation above, this LSP supports monorepos and simple projects.
|
||||
-- We select then from the project root, which is identified by the presence of a package
|
||||
-- manager lock file.
|
||||
local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' }
|
||||
-- Give the root markers equal priority by wrapping them in a table
|
||||
root_markers = vim.fn.has 'nvim-0.11.3' == 1 and { root_markers, { '.git' } } or vim.list_extend(root_markers, { '.git' })
|
||||
-- We fallback to the current working directory if no project root is found
|
||||
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
|
||||
|
||||
-- We know that the buffer is using Biome if it has a config file
|
||||
-- in its directory tree.
|
||||
local filename = vim.api.nvim_buf_get_name(bufnr)
|
||||
local biome_config_files = { 'biome.json', 'biome.jsonc' }
|
||||
biome_config_files = util.insert_package_json(biome_config_files, 'biome', filename)
|
||||
local is_buffer_using_biome = vim.fs.find(biome_config_files, {
|
||||
path = filename,
|
||||
type = 'file',
|
||||
limit = 1,
|
||||
upward = true,
|
||||
stop = vim.fs.dirname(project_root),
|
||||
})[1]
|
||||
if not is_buffer_using_biome then
|
||||
return
|
||||
end
|
||||
|
||||
on_dir(project_root)
|
||||
end,
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
return {
|
||||
-- From the clangd configuration in <rtp>/lsp/clangd.lua
|
||||
cmd = { 'clangd' },
|
||||
-- From the clangd configuration in <rtp>/lsp/clangd.lua
|
||||
-- Overrides the "*" configuration in init.lua
|
||||
root_markers = { '.clangd', 'compile_commands.json' },
|
||||
-- From the clangd configuration in init.lua
|
||||
-- Overrides the clangd configuration in <rtp>/lsp/clangd.lua
|
||||
filetypes = { 'c', 'cpp' },
|
||||
-- From the "*" configuration in init.lua
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
semanticTokens = {
|
||||
multilineTokenSupport = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
return {
|
||||
cmd = { 'emmet-language-server', '--stdio' },
|
||||
filetypes = {
|
||||
'astro',
|
||||
'css',
|
||||
'eruby',
|
||||
'html',
|
||||
'htmlangular',
|
||||
'htmldjango',
|
||||
'javascriptreact',
|
||||
'less',
|
||||
'pug',
|
||||
'sass',
|
||||
'scss',
|
||||
'svelte',
|
||||
'templ',
|
||||
'typescriptreact',
|
||||
'vue',
|
||||
},
|
||||
root_markers = { '.git' },
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go' },
|
||||
root_markers = {
|
||||
'go.mod',
|
||||
'go.sum',
|
||||
},
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/julia-vscode/julia-vscode
|
||||
---
|
||||
--- LanguageServer.jl can be installed with `julia` and `Pkg`:
|
||||
--- ```sh
|
||||
--- julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer")'
|
||||
--- ```
|
||||
--- where `~/.julia/environments/nvim-lspconfig` is the location where
|
||||
--- the default configuration expects LanguageServer.jl to be installed.
|
||||
---
|
||||
--- To update an existing install, use the following command:
|
||||
--- ```sh
|
||||
--- julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()'
|
||||
--- ```
|
||||
---
|
||||
--- Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a
|
||||
--- Julia project, you must make sure that the project is instantiated:
|
||||
--- ```sh
|
||||
--- julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()'
|
||||
--- ```
|
||||
---
|
||||
--- Note: The julia programming language searches for global environments within the `environments/`
|
||||
--- folder of `$JULIA_DEPOT_PATH` entries. By default this simply `~/.julia/environments`
|
||||
|
||||
local root_files = { 'Project.toml', 'JuliaProject.toml' }
|
||||
|
||||
local function activate_env(path)
|
||||
-- assert(vim.fn.has 'nvim-0.10' == 1, 'requires Nvim 0.10 or newer')
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local julials_clients = vim.lsp.get_clients { bufnr = bufnr, name = 'julials' }
|
||||
assert(#julials_clients > 0, 'method julia/activateenvironment is not supported by any servers active on the current buffer')
|
||||
local function _activate_env(environment)
|
||||
if environment then
|
||||
for _, julials_client in ipairs(julials_clients) do
|
||||
julials_client:notify('julia/activateenvironment', { envPath = environment })
|
||||
end
|
||||
vim.notify('Julia environment activated: \n`' .. environment .. '`', vim.log.levels.INFO)
|
||||
end
|
||||
end
|
||||
if path then
|
||||
path = vim.fs.normalize(vim.fn.fnamemodify(vim.fn.expand(path), ':p'))
|
||||
local found_env = false
|
||||
for _, project_file in ipairs(root_files) do
|
||||
local file = vim.uv.fs_stat(vim.fs.joinpath(path, project_file))
|
||||
if file and file.type then
|
||||
found_env = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not found_env then
|
||||
vim.notify('Path is not a julia environment: \n`' .. path .. '`', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
_activate_env(path)
|
||||
else
|
||||
local depot_paths = vim.env.JULIA_DEPOT_PATH and vim.split(vim.env.JULIA_DEPOT_PATH, vim.fn.has 'win32' == 1 and ';' or ':') or { vim.fn.expand '~/.julia' }
|
||||
local environments = {}
|
||||
vim.list_extend(environments, vim.fs.find(root_files, { type = 'file', upward = true, limit = math.huge }))
|
||||
for _, depot_path in ipairs(depot_paths) do
|
||||
local depot_env = vim.fs.joinpath(vim.fs.normalize(depot_path), 'environments')
|
||||
vim.list_extend(
|
||||
environments,
|
||||
vim.fs.find(function(name, env_path)
|
||||
return vim.tbl_contains(root_files, name) and string.sub(env_path, #depot_env + 1):match '^/[^/]*$'
|
||||
end, { path = depot_env, type = 'file', limit = math.huge })
|
||||
)
|
||||
end
|
||||
environments = vim.tbl_map(vim.fs.dirname, environments)
|
||||
vim.ui.select(environments, { prompt = 'Select a Julia environment' }, _activate_env)
|
||||
end
|
||||
end
|
||||
|
||||
local cmd = {
|
||||
'julia',
|
||||
'--startup-file=no',
|
||||
'--history-file=no',
|
||||
'-e',
|
||||
[[
|
||||
# Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig
|
||||
# with the regular load path as a fallback
|
||||
ls_install_path = joinpath(
|
||||
get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")),
|
||||
"environments", "lsp"
|
||||
)
|
||||
pushfirst!(LOAD_PATH, ls_install_path)
|
||||
using LanguageServer
|
||||
popfirst!(LOAD_PATH)
|
||||
depot_path = get(ENV, "JULIA_DEPOT_PATH", "")
|
||||
project_path = let
|
||||
dirname(something(
|
||||
## 1. Finds an explicitly set project (JULIA_PROJECT)
|
||||
Base.load_path_expand((
|
||||
p = get(ENV, "JULIA_PROJECT", nothing);
|
||||
p === nothing ? nothing : isempty(p) ? nothing : p
|
||||
)),
|
||||
## 2. Look for a Project.toml file in the current working directory,
|
||||
## or parent directories, with $HOME as an upper boundary
|
||||
Base.current_project(),
|
||||
## 3. First entry in the load path
|
||||
get(Base.load_path(), 1, nothing),
|
||||
## 4. Fallback to default global environment,
|
||||
## this is more or less unreachable
|
||||
Base.load_path_expand("@v#.#"),
|
||||
))
|
||||
end
|
||||
@info "Running language server" VERSION pwd() project_path depot_path
|
||||
server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)
|
||||
server.runlinter = true
|
||||
run(server)
|
||||
]],
|
||||
}
|
||||
|
||||
return {
|
||||
cmd = cmd,
|
||||
filetypes = { 'julia' },
|
||||
root_markers = root_files,
|
||||
on_attach = function()
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspJuliaActivateEnv', activate_env, {
|
||||
desc = 'Activate a Julia environment',
|
||||
nargs = '?',
|
||||
complete = 'file',
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
return {
|
||||
cmd = { 'lua-language-server' },
|
||||
-- Filetypes to automatically attach to.
|
||||
filetypes = { 'lua' },
|
||||
-- Sets the "root directory" to the parent directory of the file in the
|
||||
-- current buffer that contains either a ".luarc.json" or a
|
||||
-- ".luarc.jsonc" file. Files that share a root directory will reuse
|
||||
-- the connection to the same LSP server.
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc' },
|
||||
-- Specific settings to send to the server. The schema for this is
|
||||
-- defined by the server. For example the schema for lua-language-server
|
||||
-- can be found here https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' }, -- Add 'vim' to the list of global variables
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = true,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
'$XDG_DATA_HOME/nvim/lazy',
|
||||
'${3rd}/luv/library',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
local function set_python_path(path)
|
||||
local clients = vim.lsp.get_clients {
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
name = 'pyright',
|
||||
}
|
||||
for _, client in ipairs(clients) do
|
||||
if client.settings then
|
||||
client.settings.python = vim.tbl_deep_extend('force', client.settings.python, { pythonPath = path })
|
||||
else
|
||||
client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } })
|
||||
end
|
||||
client.notify('workspace/didChangeConfiguration', { settings = nil })
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
cmd = { 'pyright-langserver', '--stdio' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'requirements.txt',
|
||||
'Pipfile',
|
||||
'pyrightconfig.json',
|
||||
},
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
client:exec_cmd {
|
||||
command = 'pyright.organizeimports',
|
||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||
}
|
||||
end, {
|
||||
desc = 'Organize Imports',
|
||||
})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, {
|
||||
desc = 'Reconfigure pyright with the provided python path',
|
||||
nargs = 1,
|
||||
complete = 'file',
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://doc.qt.io/qt-6/qtqml-tooling-qmlls.html
|
||||
---
|
||||
--- > QML Language Server is a tool shipped with Qt that helps you write code in your favorite (LSP-supporting) editor.
|
||||
---
|
||||
--- Source in the [QtDeclarative repository](https://code.qt.io/cgit/qt/qtdeclarative.git/)
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'qmlls' },
|
||||
filetypes = { 'qml', 'qmljs' },
|
||||
root_markers = { '.git', 'shell.qml' },
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/astral-sh/ruff
|
||||
---
|
||||
--- A Language Server Protocol implementation for Ruff, an extremely fast Python linter and code formatter, written in Rust. It can be installed via `pip`.
|
||||
---
|
||||
--- ```sh
|
||||
--- pip install ruff
|
||||
--- ```
|
||||
---
|
||||
--- **Available in Ruff `v0.4.5` in beta and stabilized in Ruff `v0.5.3`.**
|
||||
---
|
||||
--- This is the new built-in language server written in Rust. It supports the same feature set as `ruff-lsp`, but with superior performance and no installation required. Note that the `ruff-lsp` server will continue to be maintained until further notice.
|
||||
---
|
||||
--- Server settings can be provided via:
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.config('ruff', {
|
||||
--- init_options = {
|
||||
--- settings = {
|
||||
--- -- Server settings should go here
|
||||
--- }
|
||||
--- }
|
||||
--- })
|
||||
--- ```
|
||||
---
|
||||
--- Refer to the [documentation](https://docs.astral.sh/ruff/editors/) for more details.
|
||||
return {
|
||||
cmd = { 'ruff', 'server' },
|
||||
filetypes = { 'python' },
|
||||
root_markers = { 'pyproject.toml', 'ruff.toml', '.ruff.toml', '.git' },
|
||||
settings = {},
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/rust-lang/rust-analyzer
|
||||
---
|
||||
--- rust-analyzer (aka rls 2.0), a language server for Rust
|
||||
---
|
||||
---
|
||||
--- See [docs](https://rust-analyzer.github.io/book/configuration.html) for extra settings. The settings can be used like this:
|
||||
--- ```lua
|
||||
--- vim.lsp.config('rust_analyzer', {
|
||||
--- settings = {
|
||||
--- ['rust-analyzer'] = {
|
||||
--- diagnostics = {
|
||||
--- enable = false;
|
||||
--- }
|
||||
--- }
|
||||
--- }
|
||||
--- })
|
||||
--- ```
|
||||
---
|
||||
--- Note: do not set `init_options` for this LS config, it will be automatically populated by the contents of settings["rust-analyzer"] per
|
||||
--- https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26.
|
||||
|
||||
local function reload_workspace(bufnr)
|
||||
local clients = vim.lsp.get_clients { bufnr = bufnr, name = 'rust_analyzer' }
|
||||
for _, client in ipairs(clients) do
|
||||
vim.notify 'Reloading Cargo Workspace'
|
||||
client.request('rust-analyzer/reloadWorkspace', nil, function(err)
|
||||
if err then
|
||||
error(tostring(err))
|
||||
end
|
||||
vim.notify 'Cargo workspace reloaded'
|
||||
end, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local function is_library(fname)
|
||||
local user_home = vim.fs.normalize(vim.env.HOME)
|
||||
local cargo_home = os.getenv 'CARGO_HOME' or user_home .. '/.cargo'
|
||||
local registry = cargo_home .. '/registry/src'
|
||||
local git_registry = cargo_home .. '/git/checkouts'
|
||||
|
||||
local rustup_home = os.getenv 'RUSTUP_HOME' or user_home .. '/.rustup'
|
||||
local toolchains = rustup_home .. '/toolchains'
|
||||
|
||||
for _, item in ipairs { toolchains, registry, git_registry } do
|
||||
if vim.fs.relpath(item, fname) then
|
||||
local clients = vim.lsp.get_clients { name = 'rust_analyzer' }
|
||||
return #clients > 0 and clients[#clients].config.root_dir or nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
cmd = { 'rust-analyzer' },
|
||||
filetypes = { 'rust' },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
local reused_dir = is_library(fname)
|
||||
if reused_dir then
|
||||
on_dir(reused_dir)
|
||||
return
|
||||
end
|
||||
|
||||
local cargo_crate_dir = vim.fs.root(fname, { 'Cargo.toml' })
|
||||
local cargo_workspace_root
|
||||
|
||||
if cargo_crate_dir == nil then
|
||||
on_dir(vim.fs.root(fname, { 'rust-project.json' }) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]))
|
||||
return
|
||||
end
|
||||
|
||||
local cmd = {
|
||||
'cargo',
|
||||
'metadata',
|
||||
'--no-deps',
|
||||
'--format-version',
|
||||
'1',
|
||||
'--manifest-path',
|
||||
cargo_crate_dir .. '/Cargo.toml',
|
||||
}
|
||||
|
||||
vim.system(cmd, { text = true }, function(output)
|
||||
if output.code == 0 then
|
||||
if output.stdout then
|
||||
local result = vim.json.decode(output.stdout)
|
||||
if result['workspace_root'] then
|
||||
cargo_workspace_root = vim.fs.normalize(result['workspace_root'])
|
||||
end
|
||||
end
|
||||
|
||||
on_dir(cargo_workspace_root or cargo_crate_dir)
|
||||
else
|
||||
vim.schedule(function()
|
||||
vim.notify(('[rust_analyzer] cmd failed with code %d: %s\n%s'):format(output.code, cmd, output.stderr))
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
capabilities = {
|
||||
experimental = {
|
||||
serverStatusNotification = true,
|
||||
},
|
||||
},
|
||||
before_init = function(init_params, config)
|
||||
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
|
||||
if config.settings and config.settings['rust-analyzer'] then
|
||||
init_params.initializationOptions = config.settings['rust-analyzer']
|
||||
end
|
||||
end,
|
||||
on_attach = function()
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspCargoReload', function()
|
||||
reload_workspace(0)
|
||||
end, { desc = 'Reload current cargo workspace' })
|
||||
end,
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/sveltejs/language-tools/tree/master/packages/language-server
|
||||
---
|
||||
--- Note: assuming that [ts_ls](#ts_ls) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage).
|
||||
---
|
||||
--- `svelte-language-server` can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm install -g svelte-language-server
|
||||
--- ```
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'svelteserver', '--stdio' },
|
||||
filetypes = { 'svelte' },
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
-- Svelte LSP only supports file:// schema. https://github.com/sveltejs/language-tools/issues/2777
|
||||
if vim.uv.fs_stat(fname) ~= nil then
|
||||
local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock', 'deno.lock' }
|
||||
root_markers = vim.fn.has 'nvim-0.11.3' == 1 and { root_markers, { '.git' } } or vim.list_extend(root_markers, { '.git' })
|
||||
-- We fallback to the current working directory if no project root is found
|
||||
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
|
||||
on_dir(project_root)
|
||||
end
|
||||
end,
|
||||
on_attach = function(client, bufnr)
|
||||
-- Workaround to trigger reloading JS/TS files
|
||||
-- See https://github.com/sveltejs/language-tools/issues/2008
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
pattern = { '*.js', '*.ts' },
|
||||
group = vim.api.nvim_create_augroup('lspconfig.svelte', {}),
|
||||
callback = function(ctx)
|
||||
-- internal API to sync changes that have not yet been saved to the file system
|
||||
client:notify('$/onDidChangeTsOrJsFile', { uri = ctx.match })
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspMigrateToSvelte5', function()
|
||||
client:exec_cmd {
|
||||
title = 'Migrate Component to Svelte 5 Syntax',
|
||||
command = 'migrate_to_svelte_5',
|
||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||
}
|
||||
end, { desc = 'Migrate Component to Svelte 5 Syntax' })
|
||||
end,
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/Myriad-Dreamin/tinymist
|
||||
--- An integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese.
|
||||
---
|
||||
--- Currently some of Tinymist's workspace commands are supported, namely:
|
||||
--- `LspTinymistExportSvg`, `LspTinymistExportPng`, `LspTinymistExportPdf`,
|
||||
--- `LspTinymistExportMarkdown`, `LspTinymistExportText`, `LspTinymistExportQuery`,
|
||||
--- `LspTinymistExportAnsiHighlight`, `LspTinymistGetServerInfo`,
|
||||
--- `LspTinymistGetDocumentTrace`, `LspTinymistGetWorkspaceLabels`,
|
||||
--- `LspTinymistGetDocumentMetrics`, and `LspTinymistPinMain`.
|
||||
|
||||
---@param command_name string
|
||||
---@param client vim.lsp.Client
|
||||
---@param bufnr integer
|
||||
---@return fun():nil run_tinymist_command, string cmd_name, string cmd_desc
|
||||
local function create_tinymist_command(command_name, client, bufnr)
|
||||
local export_type = command_name:match 'tinymist%.export(%w+)'
|
||||
local info_type = command_name:match 'tinymist%.(%w+)'
|
||||
local cmd_display = export_type or info_type:gsub('^get', 'Get'):gsub('^pin', 'Pin')
|
||||
---@return nil
|
||||
local function run_tinymist_command()
|
||||
local arguments = { vim.api.nvim_buf_get_name(bufnr) }
|
||||
local title_str = export_type and ('Export ' .. cmd_display) or cmd_display
|
||||
---@type lsp.Handler
|
||||
local function handler(err, res)
|
||||
if err then
|
||||
return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
||||
end
|
||||
vim.notify(vim.inspect(res), vim.log.levels.INFO)
|
||||
end
|
||||
return client:exec_cmd({
|
||||
title = title_str,
|
||||
command = command_name,
|
||||
arguments = arguments,
|
||||
}, { bufnr = bufnr }, handler)
|
||||
end
|
||||
-- Construct a readable command name/desc
|
||||
local cmd_name = export_type and ('TinymistExport' .. cmd_display) or ('Tinymist' .. cmd_display) ---@type string
|
||||
local cmd_desc = export_type and ('Export to ' .. cmd_display) or ('Get ' .. cmd_display) ---@type string
|
||||
return run_tinymist_command, cmd_name, cmd_desc
|
||||
end
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'tinymist' },
|
||||
filetypes = { 'typst' },
|
||||
root_markers = { '.git' },
|
||||
on_attach = function(client, bufnr)
|
||||
for _, command in ipairs {
|
||||
'tinymist.exportSvg',
|
||||
'tinymist.exportPng',
|
||||
'tinymist.exportPdf',
|
||||
-- 'tinymist.exportHtml', -- Use typst 0.13
|
||||
'tinymist.exportMarkdown',
|
||||
'tinymist.exportText',
|
||||
'tinymist.exportQuery',
|
||||
'tinymist.exportAnsiHighlight',
|
||||
'tinymist.getServerInfo',
|
||||
'tinymist.getDocumentTrace',
|
||||
'tinymist.getWorkspaceLabels',
|
||||
'tinymist.getDocumentMetrics',
|
||||
'tinymist.pinMain',
|
||||
} do
|
||||
local cmd_func, cmd_name, cmd_desc = create_tinymist_command(command, client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Lsp' .. cmd_name, cmd_func, { nargs = 0, desc = cmd_desc })
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/microsoft/typescript-go
|
||||
---
|
||||
--- `typescript-go` is experimental port of the TypeScript compiler (tsc) and language server (tsserver) to the Go programming language.
|
||||
---
|
||||
--- `tsgo` can be installed via npm `npm install @typescript/native-preview`.
|
||||
---
|
||||
--- ### Monorepo support
|
||||
---
|
||||
--- `tsgo` supports monorepos by default. It will automatically find the `tsconfig.json` or `jsconfig.json` corresponding to the package you are working on.
|
||||
--- This works without the need of spawning multiple instances of `tsgo`, saving memory.
|
||||
---
|
||||
--- It is recommended to use the same version of TypeScript in all packages, and therefore have it available in your workspace root. The location of the TypeScript binary will be determined automatically, but only once.
|
||||
---
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = function(dispatchers, config)
|
||||
local cmd = 'tsgo'
|
||||
local local_cmd = (config or {}).root_dir and config.root_dir .. '/node_modules/.bin/tsgo'
|
||||
if local_cmd and vim.fn.executable(local_cmd) == 1 then
|
||||
cmd = local_cmd
|
||||
end
|
||||
return vim.lsp.rpc.start({ cmd, '--lsp', '--stdio' }, dispatchers)
|
||||
end,
|
||||
filetypes = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
},
|
||||
root_dir = function(bufnr, on_dir)
|
||||
-- The project root is where the LSP can be started from
|
||||
-- As stated in the documentation above, this LSP supports monorepos and simple projects.
|
||||
-- We select then from the project root, which is identified by the presence of a package
|
||||
-- manager lock file.
|
||||
local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' }
|
||||
-- Give the root markers equal priority by wrapping them in a table
|
||||
root_markers = vim.fn.has 'nvim-0.11.3' == 1 and { root_markers, { '.git' } } or vim.list_extend(root_markers, { '.git' })
|
||||
|
||||
-- exclude deno
|
||||
if vim.fs.root(bufnr, { 'deno.json', 'deno.jsonc', 'deno.lock' }) then
|
||||
return
|
||||
end
|
||||
|
||||
-- We fallback to the current working directory if no project root is found
|
||||
local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd()
|
||||
|
||||
on_dir(project_root)
|
||||
end,
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/typescript-language-server/typescript-language-server
|
||||
---
|
||||
--- `ts_ls`, aka `typescript-language-server`, is a Language Server Protocol implementation for TypeScript wrapping `tsserver`. Note that `ts_ls` is not `tsserver`.
|
||||
---
|
||||
--- `typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`:
|
||||
--- ```sh
|
||||
--- npm install -g typescript typescript-language-server
|
||||
--- ```
|
||||
---
|
||||
--- To configure typescript language server, add a
|
||||
--- [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or
|
||||
--- [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your
|
||||
--- project.
|
||||
---
|
||||
--- Here's an example that disables type checking in JavaScript files.
|
||||
---
|
||||
--- ```json
|
||||
--- {
|
||||
--- "compilerOptions": {
|
||||
--- "module": "commonjs",
|
||||
--- "target": "es6",
|
||||
--- "checkJs": false
|
||||
--- },
|
||||
--- "exclude": [
|
||||
--- "node_modules"
|
||||
--- ]
|
||||
--- }
|
||||
--- ```
|
||||
---
|
||||
--- Use the `:LspTypescriptSourceAction` command to see "whole file" ("source") code-actions such as:
|
||||
--- - organize imports
|
||||
--- - remove unused code
|
||||
---
|
||||
--- ### Vue support
|
||||
---
|
||||
--- As of 2.0.0, Volar no longer supports TypeScript itself. Instead, a plugin
|
||||
--- adds Vue support to this language server.
|
||||
---
|
||||
--- *IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions.
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.config('ts_ls', {
|
||||
--- init_options = {
|
||||
--- plugins = {
|
||||
--- {
|
||||
--- name = "@vue/typescript-plugin",
|
||||
--- location = "/usr/local/lib/node_modules/@vue/typescript-plugin",
|
||||
--- languages = {"javascript", "typescript", "vue"},
|
||||
--- },
|
||||
--- },
|
||||
--- },
|
||||
--- filetypes = {
|
||||
--- "javascript",
|
||||
--- "typescript",
|
||||
--- "vue",
|
||||
--- },
|
||||
--- })
|
||||
---
|
||||
--- -- You must make sure volar is setup
|
||||
--- -- e.g. vim.lsp.config('volar')
|
||||
--- -- See volar's section for more information
|
||||
--- ```
|
||||
---
|
||||
--- `location` MUST be defined. If the plugin is installed in `node_modules`,
|
||||
--- `location` can have any value.
|
||||
---
|
||||
--- `languages` must include `vue` even if it is listed in `filetypes`.
|
||||
---
|
||||
--- `filetypes` is extended here to include Vue SFC.
|
||||
|
||||
return {
|
||||
init_options = {
|
||||
hostInfo = 'neovim',
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = '@vue/typescript-plugin',
|
||||
location = '/usr/local/lib/node_modules/@vue/typescript-plugin',
|
||||
languages = { 'javascript', 'typescript', 'vue' },
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
'javascript',
|
||||
'typescript',
|
||||
'vue',
|
||||
},
|
||||
},
|
||||
cmd = { 'typescript-language-server', '--stdio' },
|
||||
filetypes = {
|
||||
'vue',
|
||||
},
|
||||
root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json', '.git' },
|
||||
handlers = {
|
||||
-- handle rename request for certain code actions like extracting functions / types
|
||||
['_typescript.rename'] = function(_, result, ctx)
|
||||
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
|
||||
vim.lsp.util.show_document({
|
||||
uri = result.textDocument.uri,
|
||||
range = {
|
||||
start = result.position,
|
||||
['end'] = result.position,
|
||||
},
|
||||
}, client.offset_encoding)
|
||||
vim.lsp.buf.rename()
|
||||
return vim.NIL
|
||||
end,
|
||||
},
|
||||
on_attach = function(client)
|
||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspTypescriptSourceAction', function()
|
||||
local source_actions = vim.tbl_filter(function(action)
|
||||
return vim.startswith(action, 'source.')
|
||||
end, client.server_capabilities.codeActionProvider.codeActionKinds)
|
||||
|
||||
vim.lsp.buf.code_action {
|
||||
context = {
|
||||
only = source_actions,
|
||||
diagnostics = {},
|
||||
},
|
||||
}
|
||||
end, {})
|
||||
end,
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
cmd = { 'ty', 'server' },
|
||||
filetypes = { 'python' },
|
||||
root_dir = vim.fs.root(0, { '.git/', 'pyproject.toml' }),
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
---@brief
|
||||
---
|
||||
--- https://github.com/redhat-developer/yaml-language-server
|
||||
---
|
||||
--- `yaml-language-server` can be installed via `yarn`:
|
||||
--- ```sh
|
||||
--- yarn global add yaml-language-server
|
||||
--- ```
|
||||
---
|
||||
--- To use a schema for validation, there are two options:
|
||||
---
|
||||
--- 1. Add a modeline to the file. A modeline is a comment of the form:
|
||||
---
|
||||
--- ```
|
||||
--- # yaml-language-server: $schema=<urlToTheSchema|relativeFilePath|absoluteFilePath}>
|
||||
--- ```
|
||||
---
|
||||
--- where the relative filepath is the path relative to the open yaml file, and the absolute filepath
|
||||
--- is the filepath relative to the filesystem root ('/' on unix systems)
|
||||
---
|
||||
--- 2. Associated a schema url, relative , or absolute (to root of project, not to filesystem root) path to
|
||||
--- the a glob pattern relative to the detected project root. Check `:checkhealth vim.lsp` to determine the resolved project
|
||||
--- root.
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.config('yamlls', {
|
||||
--- ...
|
||||
--- settings = {
|
||||
--- yaml = {
|
||||
--- ... -- other settings. note this overrides the lspconfig defaults.
|
||||
--- schemas = {
|
||||
--- ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
||||
--- ["../path/relative/to/file.yml"] = "/.github/workflows/*",
|
||||
--- ["/path/from/root/of/project"] = "/.github/workflows/*",
|
||||
--- },
|
||||
--- },
|
||||
--- }
|
||||
--- })
|
||||
--- ```
|
||||
---
|
||||
--- Currently, kubernetes is special-cased in yammls, see the following upstream issues:
|
||||
--- * [#211](https://github.com/redhat-developer/yaml-language-server/issues/211).
|
||||
--- * [#307](https://github.com/redhat-developer/yaml-language-server/issues/307).
|
||||
---
|
||||
--- To override a schema to use a specific k8s schema version (for example, to use 1.18):
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.lsp.config('yamlls', {
|
||||
--- ...
|
||||
--- settings = {
|
||||
--- yaml = {
|
||||
--- ... -- other settings. note this overrides the lspconfig defaults.
|
||||
--- schemas = {
|
||||
--- ["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.32.1-standalone-strict/all.json"] = "/*.k8s.yaml",
|
||||
--- ... -- other schemas
|
||||
--- },
|
||||
--- },
|
||||
--- }
|
||||
--- })
|
||||
--- ```
|
||||
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = { 'yaml-language-server', '--stdio' },
|
||||
filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab', 'yaml.helm-values' },
|
||||
root_markers = { '.git' },
|
||||
settings = {
|
||||
-- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
||||
redhat = { telemetry = { enabled = false } },
|
||||
-- formatting disabled by default in yaml-language-server; enable it
|
||||
yaml = { format = { enable = true } },
|
||||
},
|
||||
on_init = function(client)
|
||||
--- https://github.com/neovim/nvim-lspconfig/pull/4016
|
||||
--- Since formatting is disabled by default if you check `client:supports_method('textDocument/formatting')`
|
||||
--- during `LspAttach` it will return `false`. This hack sets the capability to `true` to facilitate
|
||||
--- autocmd's which check this capability
|
||||
client.server_capabilities.documentFormattingProvider = true
|
||||
end,
|
||||
}
|
||||
5
.config/nvim/lua/custom/plugins/init.lua
Normal file
5
.config/nvim/lua/custom/plugins/init.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
52
.config/nvim/lua/kickstart/health.lua
Normal file
52
.config/nvim/lua/kickstart/health.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
--[[
|
||||
--
|
||||
-- This file is not required for your own configuration,
|
||||
-- but helps people determine if their system is setup correctly.
|
||||
--
|
||||
--]]
|
||||
|
||||
local check_version = function()
|
||||
local verstr = tostring(vim.version())
|
||||
if not vim.version.ge then
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
return
|
||||
end
|
||||
|
||||
if vim.version.ge(vim.version(), '0.10-dev') then
|
||||
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||
else
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
end
|
||||
end
|
||||
|
||||
local check_external_reqs = function()
|
||||
-- Basic utils: `git`, `make`, `unzip`
|
||||
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
|
||||
local is_executable = vim.fn.executable(exe) == 1
|
||||
if is_executable then
|
||||
vim.health.ok(string.format("Found executable: '%s'", exe))
|
||||
else
|
||||
vim.health.warn(string.format("Could not find executable: '%s'", exe))
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
return {
|
||||
check = function()
|
||||
vim.health.start 'kickstart.nvim'
|
||||
|
||||
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
|
||||
|
||||
Fix only warnings for plugins and languages you intend to use.
|
||||
Mason will give warnings for languages that are not installed.
|
||||
You do not need to install, unless you want to use those languages!]]
|
||||
|
||||
local uv = vim.uv or vim.loop
|
||||
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
|
||||
|
||||
check_version()
|
||||
check_external_reqs()
|
||||
end,
|
||||
}
|
||||
16
.config/nvim/lua/kickstart/plugins/autopairs.lua
Normal file
16
.config/nvim/lua/kickstart/plugins/autopairs.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require('nvim-autopairs').setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
local cmp = require 'cmp'
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
105
.config/nvim/lua/kickstart/plugins/debug.lua
Normal file
105
.config/nvim/lua/kickstart/plugins/debug.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
-- NOTE: Yes, you can install new plugins here!
|
||||
'mfussenegger/nvim-dap',
|
||||
-- NOTE: And you can specify dependencies as well
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Required dependency for nvim-dap-ui
|
||||
'nvim-neotest/nvim-nio',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
},
|
||||
keys = function(_, keys)
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
return {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
|
||||
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
|
||||
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
|
||||
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
|
||||
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
|
||||
{
|
||||
'<leader>B',
|
||||
function()
|
||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||
end,
|
||||
desc = 'Debug: Set Breakpoint',
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
|
||||
unpack(keys),
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
'delve',
|
||||
},
|
||||
}
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup {
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = '⏸',
|
||||
play = '▶',
|
||||
step_into = '⏎',
|
||||
step_over = '⏭',
|
||||
step_out = '⏮',
|
||||
step_back = 'b',
|
||||
run_last = '▶▶',
|
||||
terminate = '⏹',
|
||||
disconnect = '⏏',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require('dap-go').setup {
|
||||
delve = {
|
||||
-- On Windows delve must be run attached or it crashes.
|
||||
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
|
||||
detached = vim.fn.has 'win32' == 0,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
61
.config/nvim/lua/kickstart/plugins/gitsigns.lua
Normal file
61
.config/nvim/lua/kickstart/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||
-- config. This will add also the recommended keymaps.
|
||||
|
||||
return {
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = require 'gitsigns'
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { ']c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'next'
|
||||
end
|
||||
end, { desc = 'Jump to next git [c]hange' })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { '[c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'prev'
|
||||
end
|
||||
end, { desc = 'Jump to previous git [c]hange' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'stage git hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'reset git hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
||||
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||
map('n', '<leader>hD', function()
|
||||
gitsigns.diffthis '@'
|
||||
end, { desc = 'git [D]iff against last commit' })
|
||||
-- Toggles
|
||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
9
.config/nvim/lua/kickstart/plugins/indent_line.lua
Normal file
9
.config/nvim/lua/kickstart/plugins/indent_line.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
{ -- Add indentation guides even on blank lines
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
55
.config/nvim/lua/kickstart/plugins/lint.lua
Normal file
55
.config/nvim/lua/kickstart/plugins/lint.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
|
||||
{ -- Linting
|
||||
'mfussenegger/nvim-lint',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
}
|
||||
|
||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||
-- instead set linters_by_ft like this:
|
||||
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
||||
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
||||
--
|
||||
-- However, note that this will enable a set of default linters,
|
||||
-- which will cause errors unless these tools are available:
|
||||
-- {
|
||||
-- clojure = { "clj-kondo" },
|
||||
-- dockerfile = { "hadolint" },
|
||||
-- inko = { "inko" },
|
||||
-- janet = { "janet" },
|
||||
-- json = { "jsonlint" },
|
||||
-- markdown = { "vale" },
|
||||
-- rst = { "vale" },
|
||||
-- ruby = { "ruby" },
|
||||
-- terraform = { "tflint" },
|
||||
-- text = { "vale" }
|
||||
-- }
|
||||
--
|
||||
-- You can disable the default linters by setting their filetypes to nil:
|
||||
-- lint.linters_by_ft['clojure'] = nil
|
||||
-- lint.linters_by_ft['dockerfile'] = nil
|
||||
-- lint.linters_by_ft['inko'] = nil
|
||||
-- lint.linters_by_ft['janet'] = nil
|
||||
-- lint.linters_by_ft['json'] = nil
|
||||
-- lint.linters_by_ft['markdown'] = nil
|
||||
-- lint.linters_by_ft['rst'] = nil
|
||||
-- lint.linters_by_ft['ruby'] = nil
|
||||
-- lint.linters_by_ft['terraform'] = nil
|
||||
-- lint.linters_by_ft['text'] = nil
|
||||
|
||||
-- Create autocommand which carries out the actual linting
|
||||
-- on the specified events.
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
25
.config/nvim/lua/kickstart/plugins/neo-tree.lua
Normal file
25
.config/nvim/lua/kickstart/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
-- Neo-tree is a Neovim plugin to browse the file system
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
opts = {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
51
.config/nvim/lua/plugins/codeium.lua
Normal file
51
.config/nvim/lua/plugins/codeium.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
return {
|
||||
'exafunction/codeium.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'hrsh7th/nvim-cmp',
|
||||
},
|
||||
config = function()
|
||||
require('codeium').setup {
|
||||
-- Optionally disable cmp source if using virtual text only
|
||||
enable_cmp_source = false,
|
||||
virtual_text = {
|
||||
enabled = true,
|
||||
|
||||
-- These are the defaults
|
||||
|
||||
-- Set to true if you never want completions to be shown automatically.
|
||||
manual = false,
|
||||
-- A mapping of filetype to true or false, to enable virtual text.
|
||||
filetypes = {},
|
||||
-- Whether to enable virtual text of not for filetypes not specifically listed above.
|
||||
default_filetype_enabled = true,
|
||||
-- How long to wait (in ms) before requesting completions after typing stops.
|
||||
idle_delay = 75,
|
||||
-- Priority of the virtual text. This usually ensures that the completions appear on top of
|
||||
-- other plugins that also add virtual text, such as LSP inlay hints, but can be modified if
|
||||
-- desired.
|
||||
virtual_text_priority = 65535,
|
||||
-- Set to false to disable all key bindings for managing completions.
|
||||
map_keys = true,
|
||||
-- The key to press when hitting the accept keybinding but no completion is showing.
|
||||
-- Defaults to \t normally or <c-n> when a popup is showing.
|
||||
accept_fallback = nil,
|
||||
-- Key bindings for managing completions in virtual text mode.
|
||||
key_bindings = {
|
||||
-- Accept the current completion.
|
||||
accept = '<Tab>',
|
||||
-- Accept the next word.
|
||||
accept_word = false,
|
||||
-- Accept the next line.
|
||||
accept_line = false,
|
||||
-- Clear the virtual text.
|
||||
clear = false,
|
||||
-- Cycle to the next completion.
|
||||
next = '<M-]>',
|
||||
-- Cycle to the previous completion.
|
||||
prev = '<M-[>',
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = 'rafamadriz/friendly-snippets',
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '*',
|
||||
-- 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',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept, C-n/C-p for up/down)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys for up/down)
|
||||
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help
|
||||
--
|
||||
-- See the full "keymap" documentation for information on defining your own keymap.
|
||||
keymap = { preset = 'default', ['<C-h>'] = { 'show', 'show_documentation', 'hide_documentation' } },
|
||||
|
||||
appearance = {
|
||||
-- Sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||
-- Useful for when your theme doesn't support blink.cmp
|
||||
-- Will be removed in a future release
|
||||
use_nvim_cmp_as_default = false,
|
||||
-- Set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono',
|
||||
},
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- Blink.cmp uses a Rust fuzzy matcher by default 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' },
|
||||
|
||||
completion = {
|
||||
accept = {
|
||||
-- experimental auto-brackets support
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
draw = {
|
||||
treesitter = { 'lsp' },
|
||||
},
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 200,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = vim.g.ai_cmp,
|
||||
},
|
||||
},
|
||||
},
|
||||
opts_extend = { 'sources.default' },
|
||||
}
|
||||
102
.config/nvim/lua/plugins/debugger.lua
Normal file
102
.config/nvim/lua/plugins/debugger.lua
Normal file
@@ -0,0 +1,102 @@
|
||||
local js_based_languages = {
|
||||
'typescript',
|
||||
'javascript',
|
||||
'typescriptreact',
|
||||
'javascriptreact',
|
||||
'vue',
|
||||
}
|
||||
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'nvim-neotest/nvim-nio',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>db',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'<leader>dr',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"<C-'>",
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'<C-;>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'<C-:>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
dap.adapters.firefox = {
|
||||
type = 'executable',
|
||||
command = 'node',
|
||||
args = {
|
||||
require('mason-registry').get_package('firefox-debug-adapter'):get_install_path() .. '/dist/adapter.bundle.js',
|
||||
},
|
||||
}
|
||||
-- Configuration for JavaScript/TypeScript languages
|
||||
for _, language in ipairs(js_based_languages) do
|
||||
dap.configurations[language] = {
|
||||
{
|
||||
type = 'firefox',
|
||||
request = 'launch',
|
||||
name = 'Launch & Debug in Firefox',
|
||||
url = function()
|
||||
local co = coroutine.running()
|
||||
return coroutine.create(function()
|
||||
vim.ui.input({
|
||||
prompt = 'Enter URL: ',
|
||||
default = 'http://localhost:8080',
|
||||
}, function(url)
|
||||
if url == nil or url == '' then
|
||||
return
|
||||
else
|
||||
coroutine.resume(co, url)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end,
|
||||
webRoot = vim.fn.getcwd(),
|
||||
firefoxExecutable = '/usr/bin/firefox', -- Adjust if needed
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
-- Set up dap-ui
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open { reset = true }
|
||||
end
|
||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
require('nvim-dap-virtual-text').setup {
|
||||
enabled = true,
|
||||
enabled_commands = true,
|
||||
highlight_changed_variables = true,
|
||||
highlight_new_as_changed = false,
|
||||
show_stop_reason = true,
|
||||
commented = false,
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
'vyfor/cord.nvim',
|
||||
build = ':Cord update',
|
||||
priority = 15,
|
||||
-- opts = {}
|
||||
-- }
|
||||
}
|
||||
@@ -4,78 +4,37 @@ return {
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
-- Customize or remove this keymap to your liking
|
||||
'<leader>f',
|
||||
'<leader>cf',
|
||||
function()
|
||||
require('conform').format { async = true }
|
||||
require('conform').format { async = true, lsp_format = 'fallback' }
|
||||
end,
|
||||
mode = '',
|
||||
desc = 'Format buffer',
|
||||
desc = '[C]ode [F]ormat',
|
||||
},
|
||||
},
|
||||
-- This will provide type hinting with LuaLS
|
||||
---@module "conform"
|
||||
---@type conform.setupOpts
|
||||
opts = {
|
||||
notify_on_error = true,
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 1000,
|
||||
lsp_format = 'fallback',
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
|
||||
go = { 'gofmt' },
|
||||
python = { 'ruff', 'black', stop_after_first = true },
|
||||
python = { 'ruff' },
|
||||
javascript = { 'biome', 'prettier', stop_after_first = true },
|
||||
typescript = { 'biome', 'prettier', stop_after_first = true },
|
||||
html = { 'prettier', stop_after_first = true },
|
||||
css = { 'biome', 'prettier', stop_after_first = true },
|
||||
yaml = { 'prettier' },
|
||||
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||
json = { 'biome', 'prettier', stop_after_first = true },
|
||||
astro = { 'prettier', 'biome', stop_after_first = true },
|
||||
vue = { 'biome', 'prettier' },
|
||||
svelte = { 'prettier', 'biome', stop_after_first = true },
|
||||
yaml = { 'prettier' },
|
||||
php = { 'pint', stop_after_first = true },
|
||||
typst = { 'typstyle', stop_after_first = true },
|
||||
php = { 'pint', 'intelephense', stop_after_first = true },
|
||||
},
|
||||
formatters = {
|
||||
biome = {
|
||||
meta = {
|
||||
url = 'https://github.com/biomejs/biome',
|
||||
description = 'A toolchain for web projects, aimed to provide functionalities to maintain them.',
|
||||
},
|
||||
command = 'biome',
|
||||
stdin = true,
|
||||
args = { 'format', '--stdin-file-path', '$FILENAME' },
|
||||
},
|
||||
---@type conform.FileFormatterConfig
|
||||
ruff = {
|
||||
meta = {
|
||||
url = 'https://docs.astral.sh/ruff/',
|
||||
description = 'An extremely fast Python linter, written in Rust. Formatter subcommand.',
|
||||
},
|
||||
command = 'ruff',
|
||||
args = {
|
||||
'format',
|
||||
'--force-exclude',
|
||||
'--stdin-filename',
|
||||
'$FILENAME',
|
||||
'-',
|
||||
},
|
||||
range_args = function(self, ctx)
|
||||
return {
|
||||
'format',
|
||||
'--force-exclude',
|
||||
'--range',
|
||||
string.format('%d:%d-%d:%d', ctx.range.start[1], ctx.range.start[2] + 1, ctx.range['end'][1], ctx.range['end'][2] + 1),
|
||||
'--stdin-filename',
|
||||
'$FILENAME',
|
||||
'-',
|
||||
}
|
||||
end,
|
||||
stdin = true,
|
||||
intelephense = {
|
||||
command = 'intelephense',
|
||||
args = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
19
.config/nvim/lua/plugins/git.lua
Normal file
19
.config/nvim/lua/plugins/git.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
lazy = true,
|
||||
cmd = {
|
||||
'LazyGit',
|
||||
'LazyGitConfig',
|
||||
'LazyGitCurrentFile',
|
||||
'LazyGitFilter',
|
||||
'LazyGitFilterCurrentFile',
|
||||
},
|
||||
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
|
||||
keys = {
|
||||
{ '<leader>gg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
'm4xshen/hardtime.nvim',
|
||||
lazy = false,
|
||||
dependencies = { 'MunifTanjim/nui.nvim' },
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,31 +1,10 @@
|
||||
return {
|
||||
{
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua', -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
opts = {
|
||||
library = {
|
||||
|
||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
},
|
||||
{ -- optional blink completion source for require statements and module annotations
|
||||
'saghen/blink.cmp',
|
||||
opts = {
|
||||
sources = {
|
||||
-- add lazydev to your completion providers
|
||||
default = { 'lazydev', 'lsp', 'path', 'snippets', 'buffer' },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = 'LazyDev',
|
||||
module = 'lazydev.integrations.blink',
|
||||
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||
score_offset = 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
|
||||
}
|
||||
|
||||
83
.config/nvim/lua/plugins/linter.lua
Normal file
83
.config/nvim/lua/plugins/linter.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
return {
|
||||
'mfussenegger/nvim-lint',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
},
|
||||
config = function()
|
||||
local lint = require 'lint'
|
||||
-- Define a custom biome linter
|
||||
local mason_registry = require 'mason-registry'
|
||||
local biome_path = mason_registry.get_package('biome'):get_install_path() .. '/node_modules/@biomejs/biome/bin/biome'
|
||||
lint.linters.biome = {
|
||||
name = 'biome',
|
||||
cmd = biome_path, -- Command to run the linter
|
||||
args = { 'lint' }, -- Arguments for the command
|
||||
stdin = false, -- Send content via stdin
|
||||
append_fname = true, -- Automatically add the current file name to the command arguments
|
||||
stream = 'both', -- Result stream
|
||||
ignore_exitcode = true, -- Treat exit code != 1 as an error
|
||||
parser = function(output)
|
||||
local diagnostics = {}
|
||||
|
||||
-- The diagnostic details we need are spread in the first 3 lines of
|
||||
-- each error report. These variables are declared out of the FOR
|
||||
-- loop because we need to carry their values to parse multiple lines.
|
||||
local fetch_message = false
|
||||
local lnum, col, code, message
|
||||
|
||||
-- When a lnum:col:code line is detected fetch_message is set to true.
|
||||
-- While fetch_message is true we will search for the error message.
|
||||
-- When a error message is detected, we will create the diagnostic and
|
||||
-- set fetch_message to false to restart the process and get the next
|
||||
-- diagnostic.
|
||||
for _, line in ipairs(vim.fn.split(output, '\n')) do
|
||||
if fetch_message then
|
||||
_, _, message = string.find(line, '%s×(.+)')
|
||||
|
||||
if message then
|
||||
message = (message):gsub('^%s+×%s*', '')
|
||||
|
||||
table.insert(diagnostics, {
|
||||
source = 'biomejs',
|
||||
lnum = tonumber(lnum) - 1,
|
||||
col = tonumber(col),
|
||||
message = message,
|
||||
code = code,
|
||||
})
|
||||
|
||||
fetch_message = false
|
||||
end
|
||||
else
|
||||
_, _, lnum, col, code = string.find(line, '[^:]+:(%d+):(%d+)%s([%a%/]+)')
|
||||
|
||||
if lnum then
|
||||
fetch_message = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return diagnostics
|
||||
end, -- Custom parser for output
|
||||
}
|
||||
-- Set up linters by filetype
|
||||
lint.linters_by_ft = {
|
||||
vue = { 'biome' }, -- Lint Vue files using the overridden biome command
|
||||
javascript = { 'biome' },
|
||||
json = { 'biome' },
|
||||
typescript = { 'biome' },
|
||||
javascriptreact = { 'biome' },
|
||||
typescriptreact = { 'biome' },
|
||||
python = { 'ruff', 'mypy' },
|
||||
-- Add more filetypes as needed
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1 +1,194 @@
|
||||
return {}
|
||||
return {
|
||||
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
},
|
||||
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
|
||||
|
||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) 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
|
||||
|
||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
||||
map('<leader>th', function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
||||
end, '[T]oggle Inlay [H]ints')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
||||
local mason_registry = require 'mason-registry'
|
||||
local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() .. '/node_modules/@vue/language-server'
|
||||
local servers = {
|
||||
rust_analyzer = {
|
||||
filetypes = { 'rust' },
|
||||
capabilities = capabilities,
|
||||
},
|
||||
vtsls = {
|
||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact' },
|
||||
settings = {
|
||||
vtsls = {
|
||||
-- autoUseWorkspaceTsdk = true,
|
||||
tsserver = {
|
||||
globalPlugins = {
|
||||
{
|
||||
name = '@vue/typescript-plugin',
|
||||
location = vue_language_server_path,
|
||||
languages = { 'vue' },
|
||||
configNamespace = 'typescript',
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
},
|
||||
biome = {
|
||||
capabilities = capabilities,
|
||||
},
|
||||
phpactor = {
|
||||
filetypes = { 'php' },
|
||||
capabilities = capabilities,
|
||||
},
|
||||
vuels = {
|
||||
filetypes = { 'vue' },
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
config = {
|
||||
css = {},
|
||||
emmet = {},
|
||||
html = {
|
||||
suggest = {},
|
||||
},
|
||||
javascript = {
|
||||
format = {},
|
||||
},
|
||||
stylusSupremacy = {},
|
||||
typescript = {
|
||||
format = {},
|
||||
},
|
||||
vetur = {
|
||||
completion = {
|
||||
autoImport = true,
|
||||
tagCasing = 'kebab',
|
||||
useScaffoldSnippets = true,
|
||||
},
|
||||
format = {
|
||||
defaultFormatter = {
|
||||
js = 'biome',
|
||||
ts = 'biome',
|
||||
},
|
||||
defaultFormatterOptions = {},
|
||||
scriptInitialIndent = false,
|
||||
styleInitialIndent = false,
|
||||
},
|
||||
useWorkspaceDependencies = false,
|
||||
validation = {
|
||||
script = true,
|
||||
style = true,
|
||||
template = true,
|
||||
templateProps = true,
|
||||
interpolation = true,
|
||||
},
|
||||
experimental = {
|
||||
templateInterpolationService = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
pyright = {
|
||||
settings = {
|
||||
pyright = {
|
||||
disableOrganizeImports = true, -- Using Ruff
|
||||
},
|
||||
python = {
|
||||
analysis = {
|
||||
ignore = { '*' }, -- Using Ruff
|
||||
typeCheckingMode = 'off', -- Using mypy
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
gopls = {
|
||||
capabilities = capabilities,
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require('mason').setup()
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua',
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {
|
||||
options = {
|
||||
section_separators = { left = '', right = '' },
|
||||
@@ -16,12 +17,6 @@ return {
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
'lsp_status',
|
||||
icon = '',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
1
.config/nvim/lua/plugins/luvit-meta.lua
Normal file
1
.config/nvim/lua/plugins/luvit-meta.lua
Normal file
@@ -0,0 +1 @@
|
||||
return { 'Bilal2453/luvit-meta', lazy = true }
|
||||
@@ -1,12 +1,9 @@
|
||||
return {
|
||||
'mason-org/mason.nvim',
|
||||
'williamboman/mason.nvim',
|
||||
opts = {
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = '✓',
|
||||
package_pending = '➜',
|
||||
package_uninstalled = '✗',
|
||||
},
|
||||
ensure_installed = {
|
||||
'typescript-language-server',
|
||||
'biome',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
return {
|
||||
'nvim-mini/mini.nvim',
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
require('mini.ai').setup { n_lines = 500 }
|
||||
require('mini.surround').setup {
|
||||
@@ -13,31 +13,7 @@ return {
|
||||
},
|
||||
}
|
||||
require('mini.pairs').setup()
|
||||
require('mini.pick').setup()
|
||||
require('mini.icons').setup()
|
||||
-- require('mini.statusline').setup({
|
||||
-- content = {
|
||||
-- active = function()
|
||||
-- local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
||||
-- local git = MiniStatusline.section_git({ trunc_width = 40 })
|
||||
-- local diff = MiniStatusline.section_diff({ trunc_width = 75 })
|
||||
-- local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
||||
-- local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
|
||||
-- local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
||||
-- local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
||||
-- local location = MiniStatusline.section_location({ trunc_width = 75 })
|
||||
-- local search = MiniStatusline.section_searchcount({ trunc_width = 75 })
|
||||
--
|
||||
-- return MiniStatusline.combine_groups({
|
||||
-- { hl = mode_hl, strings = { mode } },
|
||||
-- { hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics, diff } },
|
||||
-- '%<', -- Mark truncation point
|
||||
-- { hl = 'MiniStatuslineFilename', strings = { filename } },
|
||||
-- '%=', -- Fill rest of screen
|
||||
-- { hl = 'MiniStatuslineFileinfo', strings = { lsp, fileinfo } },
|
||||
-- { hl = mode_hl, strings = { location } },
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
}
|
||||
|
||||
59
.config/nvim/lua/plugins/nvim-cmp.lua
Normal file
59
.config/nvim/lua/plugins/nvim-cmp.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
build = (function()
|
||||
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
||||
return
|
||||
end
|
||||
return 'make install_jsregexp'
|
||||
end)(),
|
||||
dependencies = {},
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-path',
|
||||
},
|
||||
config = function()
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<C-l>'] = cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<C-h>'] = cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'lazydev', priority = 1001 },
|
||||
{ name = 'nvim_lsp', priority = 1000 },
|
||||
{ name = 'luasnip', priority = 750 },
|
||||
{ name = 'buffer', priority = 500 },
|
||||
{ name = 'path', priority = 250 },
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
@@ -4,31 +4,6 @@ return {
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
view_options = {
|
||||
-- Show files and directories that start with "."
|
||||
show_hidden = true,
|
||||
-- This function defines what is considered a "hidden" file
|
||||
is_hidden_file = function(name, bufnr)
|
||||
local m = name:match '^%.'
|
||||
return m ~= nil
|
||||
end,
|
||||
-- This function defines what will never be shown, even when `show_hidden` is set
|
||||
is_always_hidden = function(name, bufnr)
|
||||
return false
|
||||
end,
|
||||
-- Sort file names with numbers in a more intuitive order for humans.
|
||||
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
|
||||
natural_order = 'fast',
|
||||
-- Sort file and directory names case insensitive
|
||||
case_insensitive = false,
|
||||
sort = {
|
||||
-- sort order can be "asc" or "desc"
|
||||
-- see :help oil-columns to see which columns are sortable
|
||||
{ 'type', 'asc' },
|
||||
{ 'name', 'asc' },
|
||||
},
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
|
||||
}
|
||||
|
||||
@@ -1,540 +0,0 @@
|
||||
return {
|
||||
'folke/snacks.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
picker = { enabled = true },
|
||||
toggle = { enabled = true },
|
||||
},
|
||||
keys = {
|
||||
-- Top Pickers & Explorer
|
||||
{
|
||||
'<leader><space>',
|
||||
function()
|
||||
Snacks.picker.smart()
|
||||
end,
|
||||
desc = 'Smart Find Files',
|
||||
},
|
||||
{
|
||||
'<leader>,',
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = 'Buffers',
|
||||
},
|
||||
{
|
||||
'<leader>/',
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = 'Grep',
|
||||
},
|
||||
{
|
||||
'<leader>:',
|
||||
function()
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = 'Command History',
|
||||
},
|
||||
{
|
||||
'<leader>n',
|
||||
function()
|
||||
Snacks.picker.notifications()
|
||||
end,
|
||||
desc = 'Notification History',
|
||||
},
|
||||
{
|
||||
'<leader>e',
|
||||
function()
|
||||
Snacks.explorer()
|
||||
end,
|
||||
desc = 'File Explorer',
|
||||
},
|
||||
-- find
|
||||
{
|
||||
'<leader>fb',
|
||||
function()
|
||||
Snacks.picker.buffers()
|
||||
end,
|
||||
desc = 'Buffers',
|
||||
},
|
||||
{
|
||||
'<leader>fc',
|
||||
function()
|
||||
Snacks.picker.files { cwd = vim.fn.stdpath 'config' }
|
||||
end,
|
||||
desc = 'Find Config File',
|
||||
},
|
||||
{
|
||||
'<leader>ff',
|
||||
function()
|
||||
Snacks.picker.files()
|
||||
end,
|
||||
desc = 'Find Files',
|
||||
},
|
||||
{
|
||||
'<leader>fg',
|
||||
function()
|
||||
Snacks.picker.git_files()
|
||||
end,
|
||||
desc = 'Find Git Files',
|
||||
},
|
||||
{
|
||||
'<leader>fp',
|
||||
function()
|
||||
Snacks.picker.projects()
|
||||
end,
|
||||
desc = 'Projects',
|
||||
},
|
||||
{
|
||||
'<leader>fr',
|
||||
function()
|
||||
Snacks.picker.recent()
|
||||
end,
|
||||
desc = 'Recent',
|
||||
},
|
||||
-- git
|
||||
{
|
||||
'<leader>gb',
|
||||
function()
|
||||
Snacks.picker.git_branches()
|
||||
end,
|
||||
desc = 'Git Branches',
|
||||
},
|
||||
{
|
||||
'<leader>gl',
|
||||
function()
|
||||
Snacks.picker.git_log()
|
||||
end,
|
||||
desc = 'Git Log',
|
||||
},
|
||||
{
|
||||
'<leader>gL',
|
||||
function()
|
||||
Snacks.picker.git_log_line()
|
||||
end,
|
||||
desc = 'Git Log Line',
|
||||
},
|
||||
{
|
||||
'<leader>gs',
|
||||
function()
|
||||
Snacks.picker.git_status()
|
||||
end,
|
||||
desc = 'Git Status',
|
||||
},
|
||||
{
|
||||
'<leader>gS',
|
||||
function()
|
||||
Snacks.picker.git_stash()
|
||||
end,
|
||||
desc = 'Git Stash',
|
||||
},
|
||||
{
|
||||
'<leader>gd',
|
||||
function()
|
||||
Snacks.picker.git_diff()
|
||||
end,
|
||||
desc = 'Git Diff (Hunks)',
|
||||
},
|
||||
{
|
||||
'<leader>gf',
|
||||
function()
|
||||
Snacks.picker.git_log_file()
|
||||
end,
|
||||
desc = 'Git Log File',
|
||||
},
|
||||
-- gh
|
||||
{
|
||||
'<leader>gi',
|
||||
function()
|
||||
Snacks.picker.gh_issue()
|
||||
end,
|
||||
desc = 'GitHub Issues (open)',
|
||||
},
|
||||
{
|
||||
'<leader>gI',
|
||||
function()
|
||||
Snacks.picker.gh_issue { state = 'all' }
|
||||
end,
|
||||
desc = 'GitHub Issues (all)',
|
||||
},
|
||||
{
|
||||
'<leader>gp',
|
||||
function()
|
||||
Snacks.picker.gh_pr()
|
||||
end,
|
||||
desc = 'GitHub Pull Requests (open)',
|
||||
},
|
||||
{
|
||||
'<leader>gP',
|
||||
function()
|
||||
Snacks.picker.gh_pr { state = 'all' }
|
||||
end,
|
||||
desc = 'GitHub Pull Requests (all)',
|
||||
},
|
||||
-- Grep
|
||||
{
|
||||
'<leader>sb',
|
||||
function()
|
||||
Snacks.picker.lines()
|
||||
end,
|
||||
desc = 'Buffer Lines',
|
||||
},
|
||||
{
|
||||
'<leader>sB',
|
||||
function()
|
||||
Snacks.picker.grep_buffers()
|
||||
end,
|
||||
desc = 'Grep Open Buffers',
|
||||
},
|
||||
{
|
||||
'<leader>sg',
|
||||
function()
|
||||
Snacks.picker.grep()
|
||||
end,
|
||||
desc = 'Grep',
|
||||
},
|
||||
{
|
||||
'<leader>sw',
|
||||
function()
|
||||
Snacks.picker.grep_word()
|
||||
end,
|
||||
desc = 'Visual selection or word',
|
||||
mode = { 'n', 'x' },
|
||||
},
|
||||
-- search
|
||||
{
|
||||
'<leader>s"',
|
||||
function()
|
||||
Snacks.picker.registers()
|
||||
end,
|
||||
desc = 'Registers',
|
||||
},
|
||||
{
|
||||
'<leader>s/',
|
||||
function()
|
||||
Snacks.picker.search_history()
|
||||
end,
|
||||
desc = 'Search History',
|
||||
},
|
||||
{
|
||||
'<leader>sa',
|
||||
function()
|
||||
Snacks.picker.autocmds()
|
||||
end,
|
||||
desc = 'Autocmds',
|
||||
},
|
||||
{
|
||||
'<leader>sb',
|
||||
function()
|
||||
Snacks.picker.lines()
|
||||
end,
|
||||
desc = 'Buffer Lines',
|
||||
},
|
||||
{
|
||||
'<leader>sc',
|
||||
function()
|
||||
Snacks.picker.command_history()
|
||||
end,
|
||||
desc = 'Command History',
|
||||
},
|
||||
{
|
||||
'<leader>sC',
|
||||
function()
|
||||
Snacks.picker.commands()
|
||||
end,
|
||||
desc = 'Commands',
|
||||
},
|
||||
{
|
||||
'<leader>sd',
|
||||
function()
|
||||
Snacks.picker.diagnostics()
|
||||
end,
|
||||
desc = 'Diagnostics',
|
||||
},
|
||||
{
|
||||
'<leader>sD',
|
||||
function()
|
||||
Snacks.picker.diagnostics_buffer()
|
||||
end,
|
||||
desc = 'Buffer Diagnostics',
|
||||
},
|
||||
{
|
||||
'<leader>sh',
|
||||
function()
|
||||
Snacks.picker.help()
|
||||
end,
|
||||
desc = 'Help Pages',
|
||||
},
|
||||
{
|
||||
'<leader>sH',
|
||||
function()
|
||||
Snacks.picker.highlights()
|
||||
end,
|
||||
desc = 'Highlights',
|
||||
},
|
||||
{
|
||||
'<leader>si',
|
||||
function()
|
||||
Snacks.picker.icons()
|
||||
end,
|
||||
desc = 'Icons',
|
||||
},
|
||||
{
|
||||
'<leader>sj',
|
||||
function()
|
||||
Snacks.picker.jumps()
|
||||
end,
|
||||
desc = 'Jumps',
|
||||
},
|
||||
{
|
||||
'<leader>sk',
|
||||
function()
|
||||
Snacks.picker.keymaps()
|
||||
end,
|
||||
desc = 'Keymaps',
|
||||
},
|
||||
{
|
||||
'<leader>sl',
|
||||
function()
|
||||
Snacks.picker.loclist()
|
||||
end,
|
||||
desc = 'Location List',
|
||||
},
|
||||
{
|
||||
'<leader>sm',
|
||||
function()
|
||||
Snacks.picker.marks()
|
||||
end,
|
||||
desc = 'Marks',
|
||||
},
|
||||
{
|
||||
'<leader>sM',
|
||||
function()
|
||||
Snacks.picker.man()
|
||||
end,
|
||||
desc = 'Man Pages',
|
||||
},
|
||||
{
|
||||
'<leader>sp',
|
||||
function()
|
||||
Snacks.picker.lazy()
|
||||
end,
|
||||
desc = 'Search for Plugin Spec',
|
||||
},
|
||||
{
|
||||
'<leader>sq',
|
||||
function()
|
||||
Snacks.picker.qflist()
|
||||
end,
|
||||
desc = 'Quickfix List',
|
||||
},
|
||||
{
|
||||
'<leader>sR',
|
||||
function()
|
||||
Snacks.picker.resume()
|
||||
end,
|
||||
desc = 'Resume',
|
||||
},
|
||||
{
|
||||
'<leader>su',
|
||||
function()
|
||||
Snacks.picker.undo()
|
||||
end,
|
||||
desc = 'Undo History',
|
||||
},
|
||||
{
|
||||
'<leader>uC',
|
||||
function()
|
||||
Snacks.picker.colorschemes()
|
||||
end,
|
||||
desc = 'Colorschemes',
|
||||
},
|
||||
-- LSP
|
||||
{
|
||||
'gd',
|
||||
function()
|
||||
Snacks.picker.lsp_definitions()
|
||||
end,
|
||||
desc = 'Goto Definition',
|
||||
},
|
||||
{
|
||||
'gD',
|
||||
function()
|
||||
Snacks.picker.lsp_declarations()
|
||||
end,
|
||||
desc = 'Goto Declaration',
|
||||
},
|
||||
{
|
||||
'gr',
|
||||
function()
|
||||
Snacks.picker.lsp_references()
|
||||
end,
|
||||
nowait = true,
|
||||
desc = 'References',
|
||||
},
|
||||
{
|
||||
'gI',
|
||||
function()
|
||||
Snacks.picker.lsp_implementations()
|
||||
end,
|
||||
desc = 'Goto Implementation',
|
||||
},
|
||||
{
|
||||
'gy',
|
||||
function()
|
||||
Snacks.picker.lsp_type_definitions()
|
||||
end,
|
||||
desc = 'Goto T[y]pe Definition',
|
||||
},
|
||||
{
|
||||
'gai',
|
||||
function()
|
||||
Snacks.picker.lsp_incoming_calls()
|
||||
end,
|
||||
desc = 'C[a]lls Incoming',
|
||||
},
|
||||
{
|
||||
'gao',
|
||||
function()
|
||||
Snacks.picker.lsp_outgoing_calls()
|
||||
end,
|
||||
desc = 'C[a]lls Outgoing',
|
||||
},
|
||||
{
|
||||
'<leader>ss',
|
||||
function()
|
||||
Snacks.picker.lsp_symbols()
|
||||
end,
|
||||
desc = 'LSP Symbols',
|
||||
},
|
||||
{
|
||||
'<leader>sS',
|
||||
function()
|
||||
Snacks.picker.lsp_workspace_symbols()
|
||||
end,
|
||||
desc = 'LSP Workspace Symbols',
|
||||
},
|
||||
-- Other
|
||||
{
|
||||
'<leader>z',
|
||||
function()
|
||||
Snacks.zen()
|
||||
end,
|
||||
desc = 'Toggle Zen Mode',
|
||||
},
|
||||
{
|
||||
'<leader>Z',
|
||||
function()
|
||||
Snacks.zen.zoom()
|
||||
end,
|
||||
desc = 'Toggle Zoom',
|
||||
},
|
||||
{
|
||||
'<leader>.',
|
||||
function()
|
||||
Snacks.scratch()
|
||||
end,
|
||||
desc = 'Toggle Scratch Buffer',
|
||||
},
|
||||
{
|
||||
'<leader>S',
|
||||
function()
|
||||
Snacks.scratch.select()
|
||||
end,
|
||||
desc = 'Select Scratch Buffer',
|
||||
},
|
||||
{
|
||||
'<leader>n',
|
||||
function()
|
||||
Snacks.notifier.show_history()
|
||||
end,
|
||||
desc = 'Notification History',
|
||||
},
|
||||
{
|
||||
'<leader>bd',
|
||||
function()
|
||||
Snacks.bufdelete()
|
||||
end,
|
||||
desc = 'Delete Buffer',
|
||||
},
|
||||
{
|
||||
'<leader>cR',
|
||||
function()
|
||||
Snacks.rename.rename_file()
|
||||
end,
|
||||
desc = 'Rename File',
|
||||
},
|
||||
{
|
||||
'<leader>gB',
|
||||
function()
|
||||
Snacks.gitbrowse()
|
||||
end,
|
||||
desc = 'Git Browse',
|
||||
mode = { 'n', 'v' },
|
||||
},
|
||||
{
|
||||
'<leader>gg',
|
||||
function()
|
||||
Snacks.lazygit()
|
||||
end,
|
||||
desc = 'Lazygit',
|
||||
},
|
||||
{
|
||||
'<leader>un',
|
||||
function()
|
||||
Snacks.notifier.hide()
|
||||
end,
|
||||
desc = 'Dismiss All Notifications',
|
||||
},
|
||||
{
|
||||
'<c-/>',
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = 'Toggle Terminal',
|
||||
},
|
||||
{
|
||||
'<c-_>',
|
||||
function()
|
||||
Snacks.terminal()
|
||||
end,
|
||||
desc = 'which_key_ignore',
|
||||
},
|
||||
{
|
||||
']]',
|
||||
function()
|
||||
Snacks.words.jump(vim.v.count1)
|
||||
end,
|
||||
desc = 'Next Reference',
|
||||
mode = { 'n', 't' },
|
||||
},
|
||||
{
|
||||
'[[',
|
||||
function()
|
||||
Snacks.words.jump(-vim.v.count1)
|
||||
end,
|
||||
desc = 'Prev Reference',
|
||||
mode = { 'n', 't' },
|
||||
},
|
||||
{
|
||||
'<leader>N',
|
||||
desc = 'Neovim News',
|
||||
function()
|
||||
Snacks.win {
|
||||
file = vim.api.nvim_get_runtime_file('doc/news.txt', false)[1],
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
wo = {
|
||||
spell = false,
|
||||
wrap = false,
|
||||
signcolumn = 'yes',
|
||||
statuscolumn = ' ',
|
||||
conceallevel = 3,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
return {
|
||||
'folke/snacks.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 3000,
|
||||
},
|
||||
git = { enabled = true },
|
||||
---@class snacks.lazygit.Config: snacks.terminal.Opts
|
||||
---@field args? string[]
|
||||
---@field theme? snacks.lazygit.Theme
|
||||
lazygit = {
|
||||
-- automatically configure lazygit to use the current colorscheme
|
||||
-- and integrate edit with the current neovim instance
|
||||
configure = true,
|
||||
-- extra configuration for lazygit that will be merged with the default
|
||||
-- snacks does NOT have a full yaml parser, so if you need `"test"` to appear with the quotes
|
||||
-- you need to double quote it: `"\"test\""`
|
||||
config = {
|
||||
os = { editPreset = "nvim-remote" },
|
||||
gui = {
|
||||
-- set to an empty string "" to disable icons
|
||||
nerdFontsVersion = "3",
|
||||
},
|
||||
},
|
||||
theme_path = vim.fs.normalize(vim.fn.stdpath("cache") .. "/lazygit-theme.yml"),
|
||||
-- Theme for lazygit
|
||||
theme = {
|
||||
[241] = { fg = "Special" },
|
||||
activeBorderColor = { fg = "MatchParen", bold = true },
|
||||
cherryPickedCommitBgColor = { fg = "Identifier" },
|
||||
cherryPickedCommitFgColor = { fg = "Function" },
|
||||
defaultFgColor = { fg = "Normal" },
|
||||
inactiveBorderColor = { fg = "FloatBorder" },
|
||||
optionsTextColor = { fg = "Function" },
|
||||
searchingActiveBorderColor = { fg = "MatchParen", bold = true },
|
||||
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
|
||||
unstagedChangesColor = { fg = "DiagnosticError" },
|
||||
},
|
||||
win = {
|
||||
style = "lazygit",
|
||||
},
|
||||
},
|
||||
quickfile = { enabled = true },
|
||||
words = { enabled = true },
|
||||
styles = {
|
||||
notification = {
|
||||
-- wo = { wrap = true } -- Wrap notifications
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
},
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd('User', {
|
||||
pattern = 'VeryLazy',
|
||||
callback = function()
|
||||
-- Setup some globals for debugging (lazy-loaded)
|
||||
_G.dd = function(...)
|
||||
Snacks.debug.inspect(...)
|
||||
end
|
||||
_G.bt = function()
|
||||
Snacks.debug.backtrace()
|
||||
end
|
||||
|
||||
-- Override print to use snacks for `:=` command
|
||||
if vim.fn.has 'nvim-0.11' == 1 then
|
||||
vim._print = function(_, ...)
|
||||
dd(...)
|
||||
end
|
||||
else
|
||||
vim.print = _G.dd
|
||||
end
|
||||
|
||||
-- Create some toggle mappings
|
||||
Snacks.toggle.option('spell', { name = 'Spelling' }):map '<leader>us'
|
||||
Snacks.toggle.option('wrap', { name = 'Wrap' }):map '<leader>uw'
|
||||
Snacks.toggle.option('relativenumber', { name = 'Relative Number' }):map '<leader>uL'
|
||||
Snacks.toggle.diagnostics():map '<leader>ud'
|
||||
Snacks.toggle.line_number():map '<leader>ul'
|
||||
Snacks.toggle.option('conceallevel', { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map '<leader>uc'
|
||||
Snacks.toggle.treesitter():map '<leader>uT'
|
||||
Snacks.toggle.option('background', { off = 'light', on = 'dark', name = 'Dark Background' }):map '<leader>ub'
|
||||
Snacks.toggle.inlay_hints():map '<leader>uh'
|
||||
Snacks.toggle.indent():map '<leader>ug'
|
||||
Snacks.toggle.dim():map '<leader>uD'
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
63
.config/nvim/lua/plugins/telescope.lua
Normal file
63
.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VimEnter',
|
||||
branch = '0.1.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
|
||||
build = 'make',
|
||||
|
||||
cond = function()
|
||||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
|
||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||
},
|
||||
config = function()
|
||||
require('telescope').setup {
|
||||
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require('telescope').load_extension, 'ui-select')
|
||||
|
||||
local builtin = require 'telescope.builtin'
|
||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||
vim.keymap.set('n', '<leader><leader>', builtin.find_files, { desc = '[S]earch [F]iles' })
|
||||
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
||||
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>/', builtin.live_grep, { desc = '[/] Fuzzy Search the cwd' })
|
||||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||
vim.keymap.set('n', '<leader>b', builtin.buffers, { desc = 'Find existing [B]uffers' })
|
||||
|
||||
vim.keymap.set('n', '<leader>sg', function()
|
||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '[S]earch by [G]rep' })
|
||||
|
||||
vim.keymap.set('n', '<leader>s/', function()
|
||||
builtin.live_grep {
|
||||
grep_open_files = true,
|
||||
prompt_title = 'Live Grep in Open Files',
|
||||
}
|
||||
end, { desc = '[S]earch [/] in Open Files' })
|
||||
|
||||
vim.keymap.set('n', '<leader>sn', function()
|
||||
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
||||
end, { desc = '[S]earch [N]eovim files' })
|
||||
end,
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
return {
|
||||
{
|
||||
'Mofiqul/dracula.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{ 'ellisonleao/gruvbox.nvim', priority = 1000, config = true },
|
||||
{ 'rebelot/kanagawa.nvim', priority = 1000, config = true },
|
||||
{
|
||||
'f4z3r/gruvbox-material.nvim',
|
||||
name = 'gruvbox-material',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
},
|
||||
'Mofiqul/dracula.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local dracula = require 'dracula'
|
||||
|
||||
vim.cmd.colorscheme 'dracula'
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ $line_break\
|
||||
$python\
|
||||
$character"""
|
||||
|
||||
palette = "gruvbox"
|
||||
palette = "dracula"
|
||||
|
||||
[directory]
|
||||
style = "bold purple"
|
||||
style = "bold pink"
|
||||
|
||||
[character]
|
||||
success_symbol = "[>](bold green)"
|
||||
error_symbol = "[>](bold red)"
|
||||
vimcmd_symbol = "[<](bold yellow)"
|
||||
vimcmd_symbol = "[<](bold purple)"
|
||||
|
||||
[git_branch]
|
||||
format = "[$branch]($style) "
|
||||
@@ -52,16 +52,3 @@ pink = "#ff79c6"
|
||||
purple = "#bd93f9"
|
||||
red = "#ff5555"
|
||||
yellow = "#f1fa8c"
|
||||
|
||||
[palettes.gruvbox]
|
||||
background = "#282828"
|
||||
current_line = "#928374"
|
||||
foreground = "#f8f8f2"
|
||||
comment = "#6272a4"
|
||||
cyan = "#83a598"
|
||||
green = "#b8bb26"
|
||||
orange = "#fe8019"
|
||||
pink = "#ff79c6"
|
||||
purple = "#d3869b"
|
||||
red = "#fb4934"
|
||||
yellow = "#fabd2f"
|
||||
|
||||
@@ -3,7 +3,6 @@ set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.tmux/plugins'
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||
set -g mouse on
|
||||
set-option -g set-clipboard external
|
||||
|
||||
unbind C-b
|
||||
set -g prefix C-Space
|
||||
@@ -43,21 +42,6 @@ set -g @tpm_plugins '
|
||||
tmux-plugins/tmux-yank
|
||||
'
|
||||
|
||||
set -g @dracula-colors "
|
||||
# Dracula Color Pallette
|
||||
white='#f8f8f2'
|
||||
gray='#44475a'
|
||||
dark_gray='#282a36'
|
||||
light_purple='#bd93f9'
|
||||
dark_purple='#6272a4'
|
||||
cyan='#8be9fd'
|
||||
green='#50fa7b'
|
||||
orange='#ffb86c'
|
||||
red='#ff5555'
|
||||
pink='#ff79c6'
|
||||
yellow='#f1fa8c'
|
||||
"
|
||||
|
||||
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, playerctl, kubernetes-context, synchronize-panes
|
||||
set -g @dracula-plugins "network-bandwidth ram-usage time battery"
|
||||
set -g @dracula-show-left-icon "#[bold]#S"
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
# vim:fileencoding=utf-8:foldmethod=marker
|
||||
|
||||
# : Manager {{{
|
||||
|
||||
[mgr]
|
||||
cwd = { fg = "#83a598" }
|
||||
|
||||
# Find
|
||||
find_keyword = { fg = "#b8bb26", bold = true, italic = true, underline = true }
|
||||
find_position = { fg = "#fe8019", bg = "reset", bold = true, italic = true }
|
||||
|
||||
# Symlink
|
||||
symlink_target = { italic = true }
|
||||
|
||||
# Marker
|
||||
marker_copied = { fg = "#8ec07c", bg = "#8ec07c" }
|
||||
marker_cut = { fg = "#d3869b", bg = "#d3869b" }
|
||||
marker_marked = { fg = "#83a598", bg = "#83a598" }
|
||||
marker_selected = { fg = "#fbf1c7", bg = "#fbf1c7" }
|
||||
|
||||
# Count
|
||||
count_copied = { fg = "#282828", bg = "#8ec07c" }
|
||||
count_cut = { fg = "#282828", bg = "#d3869b" }
|
||||
count_selected = { fg = "#282828", bg = "#fbf1c7" }
|
||||
|
||||
# Border
|
||||
border_symbol = "│"
|
||||
border_style = { fg = "#665c54" }
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Tabs {{{
|
||||
|
||||
[tabs]
|
||||
active = { fg = "#282828", bg = "#a89984" }
|
||||
inactive = { fg = "#a89984", bg = "#504945" }
|
||||
|
||||
# Separator
|
||||
sep_inner = { open = "", close = "" }
|
||||
sep_outer = { open = "", close = "" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Mode {{{
|
||||
|
||||
[mode]
|
||||
normal_main = { fg = "#282828", bg = "#a89984", bold = true }
|
||||
normal_alt = { fg = "#a89984", bg = "#504945" }
|
||||
|
||||
# Select mode
|
||||
select_main = { fg = "#282828", bg = "#fe8019", bold = true }
|
||||
select_alt = { fg = "#a89984", bg = "#504945" }
|
||||
|
||||
# Unset mode
|
||||
unset_main = { fg = "#282828", bg = "#b8bb26", bold = true }
|
||||
unset_alt = { fg = "#a89984", bg = "#504945" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Indicator of hovered file {{{
|
||||
|
||||
[indicator]
|
||||
parent = { reversed = true }
|
||||
current = { reversed = true }
|
||||
preview = { underline = true }
|
||||
padding = { open = "█", close = "█" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Status {{{
|
||||
|
||||
[status]
|
||||
overall = { }
|
||||
sep_left = { open = "\ue0be", close = "\ue0b8" }
|
||||
sep_right = { open = "\ue0be", close = "\ue0b8" }
|
||||
# Permissions
|
||||
perm_sep = { fg = "#665c54" }
|
||||
perm_type = { fg = "#504945" }
|
||||
perm_read = { fg = "#b8bb26" }
|
||||
perm_write = { fg = "#fb4934" }
|
||||
perm_exec = { fg = "#b8bb26" }
|
||||
|
||||
# Progress
|
||||
progress_label = { fg = "#ebdbb2", bold = true }
|
||||
progress_normal = { fg = "#504945", bg = "#3c3836" }
|
||||
progress_error = { fg = "#fb4934", bg = "#3c3836" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Which {{{
|
||||
|
||||
[which]
|
||||
cols = 3
|
||||
mask = { bg = "#3c3836" }
|
||||
cand = { fg = "#83a598" }
|
||||
rest = { fg = "#928374" }
|
||||
desc = { fg = "#fe8019" }
|
||||
separator = " "
|
||||
separator_style = { fg = "#504945" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Confirmation {{{
|
||||
|
||||
[confirm]
|
||||
border = { fg = "#a89984" }
|
||||
title = { fg = "#83a598" }
|
||||
body = { fg = "#fbf1c7" }
|
||||
list = { fg = "#ebdbb2" }
|
||||
btn_yes = { reversed = true, fg = "#ebdbb2" }
|
||||
btn_no = {}
|
||||
btn_labels = [ " [Y]es ", " (N)o " ]
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Spotter {{{
|
||||
|
||||
[spot]
|
||||
border = { fg = "#83a598" }
|
||||
title = { fg = "#83a598" }
|
||||
|
||||
# Table
|
||||
tbl_col = { fg = "#83a598" }
|
||||
tbl_cell = { fg = "#fabd2f", reversed = true }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Notification {{{
|
||||
|
||||
[notify]
|
||||
title_info = { fg = "#8ec07c" }
|
||||
title_warn = { fg = "#fbf1c7" }
|
||||
title_error = { fg = "#d3869b" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Picker {{{
|
||||
|
||||
[pick]
|
||||
border = { fg = "#458588" }
|
||||
active = { fg = "#d3869b", bold = true }
|
||||
inactive = {}
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Input {{{
|
||||
|
||||
[input]
|
||||
border = { fg = "#ebdbb2" }
|
||||
title = {}
|
||||
value = {}
|
||||
selected = { reversed = true }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Completion {{{
|
||||
|
||||
[cmp]
|
||||
border = { fg = "#a89984" }
|
||||
active = { reversed = true, fg = "#83a598" }
|
||||
inactive = { fg = "#ebdbb2" }
|
||||
|
||||
|
||||
|
||||
# : Task manager {{{
|
||||
|
||||
[tasks]
|
||||
border = { fg = "#504945" }
|
||||
title = {}
|
||||
hovered = { underline = true }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Help {{{
|
||||
|
||||
[help]
|
||||
on = { fg = "#83a598" }
|
||||
run = { fg = "#d3869b" }
|
||||
desc = {}
|
||||
hovered = { reversed = true, bold = true }
|
||||
footer = { fg = "#3c3836", bg = "#a89984" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : File-specific styles {{{
|
||||
|
||||
[filetype]
|
||||
rules = [
|
||||
# Images
|
||||
{ mime = "image/*", fg = "#d3869b" },
|
||||
|
||||
# Media
|
||||
{ mime = "{audio,video}/*", fg = "#fabd2f" },
|
||||
|
||||
# Archives
|
||||
{ mime = "application/*zip", fg = "#fb4934" },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg =
|
||||
"#fb4934" },
|
||||
|
||||
# Documents
|
||||
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#689d6a" },
|
||||
|
||||
# Fallback
|
||||
{ url = "*", fg = "#ebdbb2" },
|
||||
{ url = "*/", fg = "#83a598" },
|
||||
]
|
||||
|
||||
# : }}}
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
## Color palette
|
||||
## Check https://github.com/rebelot/kanagawa.nvim for more details
|
||||
# sumiInk0 "#16161d" dark bg
|
||||
# sumiInk3 "#181616" bg
|
||||
# sumiInk4 "#0d0c0c"
|
||||
# sumiInk6 "#54546d"
|
||||
# fujiWhite "#c5c9c5" fg
|
||||
# oldWhite "#7fb4ca" dark fg
|
||||
# fujiGray "#a6a69c"
|
||||
# peachRed "#ff5d62"
|
||||
# autumnRed "#c4746e"
|
||||
# crystalBlue "#8ba4b0"
|
||||
# waveRed "#e46876"
|
||||
# carpYellow "#e6c384"
|
||||
# springGreen "#8a9a7b"
|
||||
# autumnGreen "#76946a"
|
||||
# oniViolet "#a292a3"
|
||||
# waveAqua1 "#6a9589"
|
||||
# surimiOrange "#e46876"
|
||||
# waveAqua2 "#7aa89f"
|
||||
|
||||
[manager]
|
||||
marker_copied = { fg = "#8a9a7b", bg = "#8a9a7b" }
|
||||
marker_cut = { fg = "#e46876", bg = "#e46876" }
|
||||
marker_marked = { fg = "#a292a3", bg = "#a292a3" }
|
||||
marker_selected = { fg = "#e46876", bg = "#e46876" }
|
||||
|
||||
cwd = { fg = "#e6c384" }
|
||||
hovered = { reversed = true }
|
||||
preview_hovered = { reversed = true }
|
||||
|
||||
find_keyword = { fg = "#e46876", bg = "#181616" }
|
||||
find_position = {}
|
||||
|
||||
tab_active = { reversed = true }
|
||||
tab_inactive = {}
|
||||
tab_width = 1
|
||||
|
||||
count_copied = { fg = "#181616", bg = "#8a9a7b" }
|
||||
count_cut = { fg = "#181616", bg = "#e46876" }
|
||||
count_selected = { fg = "#181616", bg = "#e6c384" }
|
||||
|
||||
border_symbol = "│"
|
||||
border_style = { fg = "#c5c9c5" }
|
||||
|
||||
|
||||
[mode]
|
||||
normal_main = { fg = "#181616", bg = "#8ba4b0" }
|
||||
normal_alt = { fg = "#8ba4b0", bg = "#0d0c0c" }
|
||||
select_main = { fg = "#181616", bg = "#a292a3" }
|
||||
select_alt = { fg = "#a292a3", bg = "#0d0c0c" }
|
||||
unset_main = { fg = "#181616", bg = "#e6c384" }
|
||||
unset_alt = { fg = "#e6c384", bg = "#0d0c0c" }
|
||||
|
||||
|
||||
[status]
|
||||
sep_left = { open = "", close = "" }
|
||||
sep_right = { open = "", close = "" }
|
||||
overall = { fg = "#7fb4ca", bg = "#16161d" }
|
||||
|
||||
progress_label = { fg = "#8ba4b0", bg = "#0d0c0c", bold = true }
|
||||
progress_normal = { fg = "#0d0c0c", bg = "#181616" }
|
||||
progress_error = { fg = "#0d0c0c", bg = "#181616" }
|
||||
|
||||
perm_type = { fg = "#8a9a7b" }
|
||||
perm_read = { fg = "#e6c384" }
|
||||
perm_write = { fg = "#ff5d62" }
|
||||
perm_exec = { fg = "#7aa89f" }
|
||||
perm_sep = { fg = "#a292a3" }
|
||||
|
||||
|
||||
[pick]
|
||||
border = { fg = "#8ea4a2" }
|
||||
active = { fg = "#a292a3", bold = true }
|
||||
inactive = {}
|
||||
|
||||
[input]
|
||||
border = { fg = "#8ea4a2" }
|
||||
title = {}
|
||||
value = {}
|
||||
selected = { reversed = true }
|
||||
|
||||
[completion]
|
||||
border = { fg = "#8ea4a2" }
|
||||
active = { reversed = true }
|
||||
inactive = {}
|
||||
|
||||
[tasks]
|
||||
border = { fg = "#8ea4a2" }
|
||||
title = {}
|
||||
hovered = { fg = "#a292a3" }
|
||||
|
||||
[which]
|
||||
cols = 2
|
||||
separator = " - "
|
||||
separator_style = { fg = "#a6a69c" }
|
||||
mask = { bg = "#16161d" }
|
||||
rest = { fg = "#a6a69c" }
|
||||
cand = { fg = "#8ba4b0" }
|
||||
desc = { fg = "#54546d" }
|
||||
|
||||
[help]
|
||||
on = { fg = "#7aa89f" }
|
||||
run = { fg = "#a292a3" }
|
||||
desc = {}
|
||||
hovered = { reversed = true, bold = true }
|
||||
footer = { fg = "#181616", bg = "#c5c9c5" }
|
||||
|
||||
[notify]
|
||||
title_info = { fg = "#8a9a7b" }
|
||||
title_warn = { fg = "#e6c384" }
|
||||
title_error = { fg = "#ff5d62" }
|
||||
|
||||
[filetype]
|
||||
rules = [
|
||||
# images
|
||||
{ mime = "image/*", fg = "#e6c384" },
|
||||
|
||||
# media
|
||||
{ mime = "{audio,video}/*", fg = "#a292a3" },
|
||||
|
||||
# archives
|
||||
{ mime =
|
||||
"application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}",
|
||||
fg = "#e46876" },
|
||||
|
||||
# documents
|
||||
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg =
|
||||
"#6a9589" },
|
||||
|
||||
# broken links
|
||||
{ name = "*", is = "orphan", fg =
|
||||
"#c4746e" },
|
||||
|
||||
# executables
|
||||
{ name = "*", is = "exec", fg =
|
||||
"#76946a" },
|
||||
|
||||
# fallback
|
||||
{ name = "*", fg =
|
||||
"#c5c9c5" },
|
||||
{ name = "*/", fg =
|
||||
"#8ba4b0" },
|
||||
]
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
[flavor]
|
||||
dark = "gruvbox_material"
|
||||
use = "gruvbox_material"
|
||||
dark = "dracula"
|
||||
use = "dracula"
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[mgr]
|
||||
[manager]
|
||||
ratio = [2,3,3]
|
||||
sort_by = "natural"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"buffer_font_size": 14,
|
||||
"theme": {
|
||||
"mode": "system",
|
||||
"light": "Dracula Solid",
|
||||
"light": "Dracula",
|
||||
"dark": "One Dark"
|
||||
}
|
||||
}
|
||||
|
||||
409
.config/zellij/config.kdl
Normal file
409
.config/zellij/config.kdl
Normal file
@@ -0,0 +1,409 @@
|
||||
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
|
||||
keybinds {
|
||||
normal {
|
||||
// uncomment this and adjust key if using copy_on_select=false
|
||||
// bind "Alt c" { Copy; }
|
||||
}
|
||||
locked {
|
||||
bind "Ctrl g" { SwitchToMode "Normal"; }
|
||||
}
|
||||
resize {
|
||||
bind "Ctrl n" { SwitchToMode "Normal"; }
|
||||
bind "h" "Left" { Resize "Increase Left"; }
|
||||
bind "j" "Down" { Resize "Increase Down"; }
|
||||
bind "k" "Up" { Resize "Increase Up"; }
|
||||
bind "l" "Right" { Resize "Increase Right"; }
|
||||
bind "H" { Resize "Decrease Left"; }
|
||||
bind "J" { Resize "Decrease Down"; }
|
||||
bind "K" { Resize "Decrease Up"; }
|
||||
bind "L" { Resize "Decrease Right"; }
|
||||
bind "=" "+" { Resize "Increase"; }
|
||||
bind "-" { Resize "Decrease"; }
|
||||
}
|
||||
pane {
|
||||
bind "Ctrl p" { SwitchToMode "Normal"; }
|
||||
bind "h" "Left" { MoveFocus "Left"; }
|
||||
bind "l" "Right" { MoveFocus "Right"; }
|
||||
bind "j" "Down" { MoveFocus "Down"; }
|
||||
bind "k" "Up" { MoveFocus "Up"; }
|
||||
bind "p" { SwitchFocus; }
|
||||
bind "n" { NewPane; SwitchToMode "Normal"; }
|
||||
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
|
||||
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
|
||||
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
|
||||
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
|
||||
}
|
||||
move {
|
||||
bind "Ctrl h" { SwitchToMode "Normal"; }
|
||||
bind "n" "Tab" { MovePane; }
|
||||
bind "p" { MovePaneBackwards; }
|
||||
bind "h" "Left" { MovePane "Left"; }
|
||||
bind "j" "Down" { MovePane "Down"; }
|
||||
bind "k" "Up" { MovePane "Up"; }
|
||||
bind "l" "Right" { MovePane "Right"; }
|
||||
}
|
||||
tab {
|
||||
bind "Ctrl t" { SwitchToMode "Normal"; }
|
||||
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
|
||||
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
|
||||
bind "l" "Right" "Down" "j" { GoToNextTab; }
|
||||
bind "n" { NewTab; SwitchToMode "Normal"; }
|
||||
bind "x" { CloseTab; SwitchToMode "Normal"; }
|
||||
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
|
||||
bind "b" { BreakPane; SwitchToMode "Normal"; }
|
||||
bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
|
||||
bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
|
||||
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
|
||||
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
|
||||
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
|
||||
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
|
||||
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
|
||||
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
|
||||
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
|
||||
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
|
||||
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
|
||||
bind "Tab" { ToggleTab; }
|
||||
}
|
||||
scroll {
|
||||
bind "Ctrl s" { SwitchToMode "Normal"; }
|
||||
bind "e" { EditScrollback; SwitchToMode "Normal"; }
|
||||
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
||||
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
|
||||
bind "j" "Down" { ScrollDown; }
|
||||
bind "k" "Up" { ScrollUp; }
|
||||
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
|
||||
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
|
||||
bind "d" { HalfPageScrollDown; }
|
||||
bind "u" { HalfPageScrollUp; }
|
||||
// uncomment this and adjust key if using copy_on_select=false
|
||||
// bind "Alt c" { Copy; }
|
||||
}
|
||||
search {
|
||||
bind "Ctrl s" { SwitchToMode "Normal"; }
|
||||
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
|
||||
bind "j" "Down" { ScrollDown; }
|
||||
bind "k" "Up" { ScrollUp; }
|
||||
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
|
||||
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
|
||||
bind "d" { HalfPageScrollDown; }
|
||||
bind "u" { HalfPageScrollUp; }
|
||||
bind "n" { Search "down"; }
|
||||
bind "p" { Search "up"; }
|
||||
bind "c" { SearchToggleOption "CaseSensitivity"; }
|
||||
bind "w" { SearchToggleOption "Wrap"; }
|
||||
bind "o" { SearchToggleOption "WholeWord"; }
|
||||
}
|
||||
entersearch {
|
||||
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
|
||||
bind "Enter" { SwitchToMode "Search"; }
|
||||
}
|
||||
renametab {
|
||||
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||
bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
|
||||
}
|
||||
renamepane {
|
||||
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
|
||||
}
|
||||
session {
|
||||
bind "Ctrl o" { SwitchToMode "Normal"; }
|
||||
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
||||
bind "d" { Detach; }
|
||||
bind "w" {
|
||||
LaunchOrFocusPlugin "session-manager" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
};
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "c" {
|
||||
LaunchOrFocusPlugin "configuration" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
};
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "p" {
|
||||
LaunchOrFocusPlugin "plugin-manager" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
};
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
}
|
||||
tmux {
|
||||
bind "[" { SwitchToMode "Scroll"; }
|
||||
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
|
||||
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||
bind "c" { NewTab; SwitchToMode "Normal"; }
|
||||
bind "," { SwitchToMode "RenameTab"; }
|
||||
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
|
||||
bind "n" { GoToNextTab; SwitchToMode "Normal"; }
|
||||
bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||
bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||
bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||
bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||
bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||
bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||
bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||
bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||
bind "o" { FocusNextPane; }
|
||||
bind "d" { Detach; }
|
||||
bind "Space" { NextSwapLayout; }
|
||||
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||
}
|
||||
shared_except "locked" {
|
||||
bind "Ctrl g" { SwitchToMode "Locked"; }
|
||||
bind "Ctrl q" { Quit; }
|
||||
bind "Alt f" { ToggleFloatingPanes; }
|
||||
bind "Alt n" { NewPane; }
|
||||
bind "Alt i" { MoveTab "Left"; }
|
||||
bind "Alt o" { MoveTab "Right"; }
|
||||
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
|
||||
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
|
||||
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
|
||||
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
|
||||
bind "Alt =" "Alt +" { Resize "Increase"; }
|
||||
bind "Alt -" { Resize "Decrease"; }
|
||||
bind "Alt [" { PreviousSwapLayout; }
|
||||
bind "Alt ]" { NextSwapLayout; }
|
||||
}
|
||||
shared_except "normal" "locked" {
|
||||
bind "Enter" "Esc" { SwitchToMode "Normal"; }
|
||||
}
|
||||
shared_except "pane" "locked" {
|
||||
bind "Ctrl p" { SwitchToMode "Pane"; }
|
||||
}
|
||||
shared_except "resize" "locked" {
|
||||
bind "Ctrl n" { SwitchToMode "Resize"; }
|
||||
}
|
||||
shared_except "scroll" "locked" {
|
||||
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
||||
}
|
||||
shared_except "session" "locked" {
|
||||
bind "Ctrl o" { SwitchToMode "Session"; }
|
||||
}
|
||||
shared_except "tab" "locked" {
|
||||
bind "Ctrl t" { SwitchToMode "Tab"; }
|
||||
}
|
||||
shared_except "move" "locked" {
|
||||
bind "Ctrl h" { SwitchToMode "Move"; }
|
||||
}
|
||||
shared_except "tmux" "locked" {
|
||||
bind "Ctrl b" { SwitchToMode "Tmux"; }
|
||||
}
|
||||
}
|
||||
|
||||
// Plugin aliases - can be used to change the implementation of Zellij
|
||||
// changing these requires a restart to take effect
|
||||
plugins {
|
||||
tab-bar location="zellij:tab-bar"
|
||||
status-bar location="zellij:status-bar"
|
||||
strider location="zellij:strider"
|
||||
compact-bar location="zellij:compact-bar"
|
||||
session-manager location="zellij:session-manager"
|
||||
welcome-screen location="zellij:session-manager" {
|
||||
welcome_screen true
|
||||
}
|
||||
filepicker location="zellij:strider" {
|
||||
cwd "/"
|
||||
}
|
||||
configuration location="zellij:configuration"
|
||||
plugin-manager location="zellij:plugin-manager"
|
||||
}
|
||||
|
||||
// Plugins to load in the background when a new session starts
|
||||
load_plugins {
|
||||
// "file:/path/to/my-plugin.wasm"
|
||||
// "https://example.com/my-plugin.wasm"
|
||||
}
|
||||
|
||||
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
|
||||
// eg. when terminal window with an active zellij session is closed
|
||||
// (Requires restart)
|
||||
// Options:
|
||||
// - detach (Default)
|
||||
// - quit
|
||||
//
|
||||
// on_force_close "quit"
|
||||
|
||||
// Send a request for a simplified ui (without arrow fonts) to plugins
|
||||
// Options:
|
||||
// - true
|
||||
// - false (Default)
|
||||
//
|
||||
// simplified_ui true
|
||||
|
||||
// Choose the path to the default shell that zellij will use for opening new panes
|
||||
// Default: $SHELL
|
||||
//
|
||||
// default_shell "fish"
|
||||
|
||||
// Choose the path to override cwd that zellij will use for opening new panes
|
||||
//
|
||||
// default_cwd ""
|
||||
|
||||
// Toggle between having pane frames around the panes
|
||||
// Options:
|
||||
// - true (default)
|
||||
// - false
|
||||
//
|
||||
// pane_frames true
|
||||
|
||||
// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
|
||||
// Options:
|
||||
// - true (default)
|
||||
// - false
|
||||
//
|
||||
// auto_layout true
|
||||
|
||||
// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected
|
||||
// (Requires restart)
|
||||
// Options:
|
||||
// - true (default)
|
||||
// - false
|
||||
//
|
||||
// session_serialization false
|
||||
|
||||
// Whether pane viewports are serialized along with the session, default is false
|
||||
// (Requires restart)
|
||||
// Options:
|
||||
// - true
|
||||
// - false (default)
|
||||
//
|
||||
// serialize_pane_viewport true
|
||||
|
||||
// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0
|
||||
// defaults to the scrollback size. If this number is higher than the scrollback size, it will
|
||||
// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true.
|
||||
// (Requires restart)
|
||||
//
|
||||
// scrollback_lines_to_serialize 10000
|
||||
|
||||
// Define color themes for Zellij
|
||||
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
|
||||
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
|
||||
//
|
||||
// themes {
|
||||
// dracula {
|
||||
// fg 248 248 242
|
||||
// bg 40 42 54
|
||||
// red 255 85 85
|
||||
// green 80 250 123
|
||||
// yellow 241 250 140
|
||||
// blue 98 114 164
|
||||
// magenta 255 121 198
|
||||
// orange 255 184 108
|
||||
// cyan 139 233 253
|
||||
// black 0 0 0
|
||||
// white 255 255 255
|
||||
// }
|
||||
// }
|
||||
|
||||
// Choose the theme that is specified in the themes section.
|
||||
// Default: default
|
||||
//
|
||||
// theme "default"
|
||||
|
||||
// The name of the default layout to load on startup
|
||||
// Default: "default"
|
||||
// (Requires restart)
|
||||
//
|
||||
// default_layout "compact"
|
||||
|
||||
// Choose the mode that zellij uses when starting up.
|
||||
// Default: normal
|
||||
//
|
||||
// default_mode "locked"
|
||||
|
||||
// Toggle enabling the mouse mode.
|
||||
// On certain configurations, or terminals this could
|
||||
// potentially interfere with copying text.
|
||||
// (Requires restart)
|
||||
// Options:
|
||||
// - true (default)
|
||||
// - false
|
||||
//
|
||||
// mouse_mode false
|
||||
|
||||
// Configure the scroll back buffer size
|
||||
// This is the number of lines zellij stores for each pane in the scroll back
|
||||
// buffer. Excess number of lines are discarded in a FIFO fashion.
|
||||
// (Requires restart)
|
||||
// Valid values: positive integers
|
||||
// Default value: 10000
|
||||
//
|
||||
// scroll_buffer_size 10000
|
||||
|
||||
// Provide a command to execute when copying text. The text will be piped to
|
||||
// the stdin of the program to perform the copy. This can be used with
|
||||
// terminal emulators which do not support the OSC 52 ANSI control sequence
|
||||
// that will be used by default if this option is not set.
|
||||
// Examples:
|
||||
//
|
||||
// copy_command "xclip -selection clipboard" // x11
|
||||
// copy_command "wl-copy" // wayland
|
||||
// copy_command "pbcopy" // osx
|
||||
|
||||
// Choose the destination for copied text
|
||||
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
|
||||
// Does not apply when using copy_command.
|
||||
// Options:
|
||||
// - system (default)
|
||||
// - primary
|
||||
//
|
||||
// copy_clipboard "primary"
|
||||
|
||||
// Enable or disable automatic copy (and clear) of selection when releasing mouse
|
||||
// Default: true
|
||||
//
|
||||
// copy_on_select false
|
||||
|
||||
// Path to the default editor to use to edit pane scrollbuffer
|
||||
// Default: $EDITOR or $VISUAL
|
||||
//
|
||||
// scrollback_editor "/usr/bin/vim"
|
||||
|
||||
// When attaching to an existing session with other users,
|
||||
// should the session be mirrored (true)
|
||||
// or should each user have their own cursor (false)
|
||||
// (Requires restart)
|
||||
// Default: false
|
||||
//
|
||||
// mirror_session true
|
||||
|
||||
// The folder in which Zellij will look for layouts
|
||||
// (Requires restart)
|
||||
//
|
||||
// layout_dir "/path/to/my/layout_dir"
|
||||
|
||||
// The folder in which Zellij will look for themes
|
||||
// (Requires restart)
|
||||
//
|
||||
// theme_dir "/path/to/my/theme_dir"
|
||||
|
||||
// Enable or disable the rendering of styled and colored underlines (undercurl).
|
||||
// May need to be disabled for certain unsupported terminals
|
||||
// (Requires restart)
|
||||
// Default: true
|
||||
//
|
||||
// styled_underlines false
|
||||
|
||||
// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know
|
||||
// metadata info on this session)
|
||||
// (Requires restart)
|
||||
// Default: false
|
||||
//
|
||||
// disable_session_metadata true
|
||||
|
||||
// Enable or disable support for the enhanced Kitty Keyboard Protocol (the host terminal must also support it)
|
||||
// (Requires restart)
|
||||
// Default: true (if the host terminal supports it)
|
||||
//
|
||||
// support_kitty_keyboard_protocol false
|
||||
15
.config/zellij/themes/dracula.kdl
Normal file
15
.config/zellij/themes/dracula.kdl
Normal file
@@ -0,0 +1,15 @@
|
||||
themes {
|
||||
dracula {
|
||||
fg 248 248 242
|
||||
bg 40 42 54
|
||||
black 0 0 0
|
||||
red 255 85 85
|
||||
green 80 250 123
|
||||
yellow 241 250 140
|
||||
blue 98 114 164
|
||||
magenta 255 121 198
|
||||
cyan 139 233 253
|
||||
white 255 255 255
|
||||
orange 255 184 108
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
max_line_length = 80
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
*.log
|
||||
@@ -1,8 +0,0 @@
|
||||
# Define environment variables
|
||||
export EDITOR="nvim"
|
||||
export LANG="en_US.UTF-8"
|
||||
|
||||
# Set Zinit home directory early
|
||||
|
||||
# Path helper or custom PATH additions should go here
|
||||
# export PATH="$PATH:/your/custom/bin"
|
||||
8
.zshrc
8
.zshrc
@@ -1,7 +1,7 @@
|
||||
export ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||
# Set the directory we want to store zinit and plugins
|
||||
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
|
||||
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
||||
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
|
||||
|
||||
# Source/Load zinit
|
||||
source "${ZINIT_HOME}/zinit.zsh"
|
||||
|
||||
# Add in zsh plugins
|
||||
@@ -55,3 +55,5 @@ alias c='clear'
|
||||
# Shell integrations
|
||||
eval "$(fzf --zsh)"
|
||||
eval "$(zoxide init --cmd cd zsh)"
|
||||
|
||||
export EDITOR=nvim
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
# Define the base output directory
|
||||
BASE_OUTPUT_DIR="converted_h265"
|
||||
|
||||
# Create the base output directory
|
||||
mkdir -p "$BASE_OUTPUT_DIR"
|
||||
|
||||
# Define the conversion function
|
||||
convert_video() {
|
||||
local input_file="$1"
|
||||
|
||||
# Calculate relative path to maintain directory structure
|
||||
local relative_path=$(realpath --relative-to=. "$input_file")
|
||||
|
||||
# Construct the output directory path
|
||||
local output_dir="$BASE_OUTPUT_DIR/$(dirname "$relative_path")"
|
||||
|
||||
# Extract filename and remove extension
|
||||
local filename=$(basename -- "$input_file")
|
||||
local filename_no_ext="${filename%.*}"
|
||||
|
||||
# Construct the full output file path
|
||||
local output_file="${output_dir}/${filename_no_ext}.mp4"
|
||||
|
||||
# Create the output directory if it doesn't exist
|
||||
mkdir -p "$output_dir"
|
||||
|
||||
echo "Converting: '$input_file' -> '$output_file'"
|
||||
|
||||
# Run the ffmpeg command
|
||||
ffmpeg -y -i "$input_file" \
|
||||
-vf "scale=1920:1080" \
|
||||
-c:v hevc_nvenc \
|
||||
-preset medium \
|
||||
-b:v 5M \
|
||||
-maxrate 7.5M \
|
||||
-bufsize 10M \
|
||||
-c:a copy \
|
||||
"$output_file"
|
||||
|
||||
# Check if ffmpeg command was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully converted: '$input_file'"
|
||||
else
|
||||
echo "Error converting: '$input_file'. Check ffmpeg output above."
|
||||
fi
|
||||
}
|
||||
|
||||
# Export the function so xargs can use it
|
||||
export -f convert_video
|
||||
export BASE_OUTPUT_DIR # Export the variable too if it's used inside the function
|
||||
|
||||
# Find MP4 files and pass them to the function using xargs
|
||||
# -print0 and -0 are crucial for handling filenames with spaces or special characters
|
||||
# -P 4 specifies parallel processing with 4 jobs (adjust as needed based on your CPU/GPU)
|
||||
find . -type f -name "*.mp4" -print0 | xargs -0 -P 4 -n 1 bash -c 'convert_video "$@"' _
|
||||
@@ -1,183 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# --- Script Configuration for Robustness ---
|
||||
set -euo pipefail # Exit on error, unset variables, and pipe failures
|
||||
# set -x # Uncomment this line for debugging output (prints commands as they are executed)
|
||||
|
||||
# --- FLAC to MP3 Converter (Bash Script) ---
|
||||
#
|
||||
# This script converts all FLAC files found in a specified input directory
|
||||
# and its subdirectories into MP3 files, saving them to a specified output directory
|
||||
# while preserving the original directory structure.
|
||||
#
|
||||
# Usage: ./convert_flac_to_mp3.sh [OPTIONS] <input_directory> <output_directory>
|
||||
#
|
||||
# Options:
|
||||
# --dry-run : Simulate the conversion process without actually creating
|
||||
# files or directories, or running ffmpeg.
|
||||
#
|
||||
# Arguments:
|
||||
# <input_directory> : The path to the directory containing FLAC files.
|
||||
# <output_directory> : The path where the converted MP3 files will be saved.
|
||||
#
|
||||
# Requirements:
|
||||
# - ffmpeg: Must be installed and accessible in your system's PATH.
|
||||
# - realpath: Must be installed and accessible in your system's PATH.
|
||||
# (Typically part of GNU coreutils on Linux. macOS users might need `brew install coreutils`)
|
||||
# - xargs: Standard utility, usually present.
|
||||
#
|
||||
# Example:
|
||||
# ./convert_flac_to_mp3.sh "/home/user/music/flac albums" "/home/user/music/mp3 converted"
|
||||
# ./convert_flac_to_mp3.sh --dry-run "/home/user/music/flac albums" "/home/user/music/mp3 converted"
|
||||
|
||||
# --- Global Variables ---
|
||||
DRY_RUN=false # Default to false, set to true if --dry-run is present
|
||||
|
||||
# --- Function to display usage information ---
|
||||
usage() {
|
||||
echo "Usage: $0 [OPTIONS] <input_directory> <output_directory>"
|
||||
echo "Convert FLAC files to MP3 format, preserving directory structure."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --dry-run : Simulate the conversion process without actually creating"
|
||||
echo " files or directories, or running ffmpeg."
|
||||
echo ""
|
||||
echo "Arguments:"
|
||||
echo " <input_directory> : The path to the directory containing FLAC files."
|
||||
echo " <output_directory> : The path where the converted MP3 files will be saved."
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " $0 /path/to/flac_files /path/to/mp3_output"
|
||||
echo " $0 --dry-run /path/to/flac_files /path/to/mp3_output"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# --- Parse Command Line Arguments ---
|
||||
# Check for --dry-run flag
|
||||
if [[ "$#" -ge 1 && "$1" == "--dry-run" ]]; then
|
||||
DRY_RUN=true
|
||||
shift # Remove --dry-run from the arguments list
|
||||
fi
|
||||
|
||||
# Check for correct number of remaining arguments
|
||||
if [ "$#" -ne 2 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
# Check if ffmpeg is installed
|
||||
if ! command -v ffmpeg &> /dev/null; then
|
||||
echo "Error: ffmpeg is not installed. Please install it to use this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if realpath is installed
|
||||
if ! command -v realpath &> /dev/null; then
|
||||
echo "Error: realpath command not found. This script requires 'realpath' for robust path handling."
|
||||
echo "Please install it (e.g., 'sudo apt-get install realpath' on Debian/Ubuntu, or 'brew install coreutils' on macOS)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if xargs is installed (should be standard, but good practice)
|
||||
if ! command -v xargs &> /dev/null; then
|
||||
echo "Error: xargs command not found. This script requires 'xargs'."
|
||||
echo "Please ensure xargs is installed on your system."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Resolve input and output directories to their absolute, canonical paths.
|
||||
# This makes path handling consistent and robust against symbolic links or relative paths.
|
||||
# Export them so they are available in the subshell created by 'xargs'.
|
||||
export INPUT_DIR=$(realpath "$1")
|
||||
export OUTPUT_DIR=$(realpath "$2")
|
||||
|
||||
# Check if resolved input directory exists
|
||||
if [ ! -d "$INPUT_DIR" ]; then
|
||||
echo "Error: Input directory '$INPUT_DIR' does not exist or is not a directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the output directory if it doesn't exist.
|
||||
# mkdir -p handles creation of parent directories and doesn't error if it already exists.
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "Dry run: Would create output directory if it didn't exist: '$OUTPUT_DIR'"
|
||||
else
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
fi
|
||||
|
||||
|
||||
echo "Starting FLAC to MP3 conversion..."
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "*** DRY RUN MODE ENABLED *** No actual files will be created or modified."
|
||||
fi
|
||||
echo "Input Directory (resolved): $INPUT_DIR"
|
||||
echo "Output Directory (resolved): $OUTPUT_DIR"
|
||||
echo "--------------------------------------------------"
|
||||
|
||||
# Define a function to process a single FLAC file.
|
||||
# This function will be called by 'xargs' for each file found.
|
||||
convert_single_file() {
|
||||
local FLAC_FILEPATH="$1" # The input FLAC file path passed by xargs
|
||||
|
||||
# Ensure FLAC_FILEPATH is an absolute and canonical path.
|
||||
FLAC_FILEPATH_CANONICAL=$(realpath "$FLAC_FILEPATH")
|
||||
|
||||
# Calculate the relative path of the FLAC file from the input directory.
|
||||
# realpath --relative-to is the most robust way to get this.
|
||||
RELATIVE_PATH=$(realpath --relative-to="$INPUT_DIR" "$FLAC_FILEPATH_CANONICAL")
|
||||
|
||||
# Construct the output filename by replacing the .flac extension with .mp3.
|
||||
MP3_FILENAME="${RELATIVE_PATH%.flac}.mp3"
|
||||
|
||||
# Construct the full output path by combining the resolved output directory
|
||||
# with the newly calculated relative MP3 filename.
|
||||
# The original script had an extra "$INPUT_BASENAME/" in the path,
|
||||
# which would create a redundant directory under OUTPUT_DIR.
|
||||
# Changed from: OUTPUT_FILEPATH="${OUTPUT_DIR}/${INPUT_BASENAME}/${MP3_FILENAME}"
|
||||
# To:
|
||||
OUTPUT_FILEPATH="${OUTPUT_DIR}/${MP3_FILENAME}"
|
||||
|
||||
echo "Processing: '$FLAC_FILEPATH_CANONICAL'"
|
||||
echo "Would save to: '$OUTPUT_FILEPATH'"
|
||||
|
||||
# Create the necessary subdirectory structure in the output directory.
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "Dry run: Would create directory: '$(dirname "$OUTPUT_FILEPATH")'"
|
||||
else
|
||||
mkdir -p "$(dirname "$OUTPUT_FILEPATH")"
|
||||
fi
|
||||
|
||||
# Execute the ffmpeg command for conversion.
|
||||
# We suppress output to keep the main script clean, but errors will still be reported by 'set -euo pipefail'.
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "Dry run: Would execute ffmpeg command:"
|
||||
echo "ffmpeg -i \"$FLAC_FILEPATH_CANONICAL\" -map 0:a:0 -codec:a libmp3lame -b:a 320k -y \"$OUTPUT_FILEPATH\""
|
||||
else
|
||||
ffmpeg -i "$FLAC_FILEPATH_CANONICAL" -map 0:a:0 -codec:a libmp3lame -b:a 320k -y "$OUTPUT_FILEPATH" >/dev/null 2>&1
|
||||
|
||||
# Check the exit status of the ffmpeg command.
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully converted: '$MP3_FILENAME'"
|
||||
else
|
||||
# If ffmpeg fails, print a more specific error message.
|
||||
# Note: 'set -e' will cause the script to exit on the first ffmpeg failure.
|
||||
echo "Error converting: '$FLAC_FILEPATH_CANONICAL'. Check ffmpeg output for details (remove >/dev/null 2>&1 to see)."
|
||||
fi
|
||||
fi
|
||||
echo "--------------------------------------------------"
|
||||
}
|
||||
|
||||
# Export the function so xargs can find it.
|
||||
export -f convert_single_file
|
||||
export INPUT_DIR
|
||||
export OUTPUT_DIR
|
||||
export DRY_RUN # Export DRY_RUN so the function can access it
|
||||
|
||||
# Find all .flac files recursively starting from the resolved input directory.
|
||||
# Pipe the null-delimited list of files to 'xargs -0', which then executes
|
||||
# the 'bash -c' command (which calls our defined function) for each file.
|
||||
find "$INPUT_DIR" -type f -name "*.flac" -print0 | sort -zV | xargs -0 -I {} bash -c 'convert_single_file "$@"' _ {}
|
||||
|
||||
echo "Conversion process completed."
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "This was a DRY RUN. No files were actually converted or created."
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
rm -rf .minecraft/webcache2
|
||||
@@ -1,37 +0,0 @@
|
||||
# get date YYYY-MM-DD from first arg
|
||||
date=$1
|
||||
verbose=$2
|
||||
# check date not exists or is not valid
|
||||
if [[ ! $date =~ ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$ ]]; then
|
||||
echo "Usage: $0 YYYY-MM-DD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$verbose" ]; then
|
||||
verbose=false
|
||||
fi
|
||||
|
||||
grep -a upgraded /var/log/pacman.log| grep "$date" > /tmp/lastupdates.txt
|
||||
if [ "$verbose" = true ]; then
|
||||
echo "Last updates:"
|
||||
cat /tmp/lastupdates.txt
|
||||
fi
|
||||
awk '{print $4}' /tmp/lastupdates.txt > /tmp/lines1;awk '{print $5}' /tmp/lastupdates.txt | sed 's/(/-/g' > /tmp/lines2
|
||||
if [ "$verbose" = true ]; then
|
||||
echo "Lines 1:"
|
||||
cat /tmp/lines1
|
||||
echo "Lines 2:"
|
||||
cat /tmp/lines2
|
||||
fi
|
||||
paste /tmp/lines1 /tmp/lines2 > /tmp/lines
|
||||
if [ "$verbose" = true ]; then
|
||||
echo "Lines:"
|
||||
cat /tmp/lines
|
||||
fi
|
||||
tr -d "[:blank:]" < /tmp/lines > /tmp/packages
|
||||
if [ "$verbose" = true ]; then
|
||||
echo "Packages:"
|
||||
cat /tmp/packages
|
||||
fi
|
||||
cd /var/cache/pacman/pkg/
|
||||
for i in $(cat /tmp/packages); do sudo pacman --noconfirm -U "$i"*; done
|
||||
Reference in New Issue
Block a user