This commit is contained in:
DefectingCat
2023-03-20 15:04:06 +08:00
commit a4a4077578
98 changed files with 12443 additions and 0 deletions

11
.config/hypr/hdp.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#!/bin/bash
sleep 1
killall xdg-desktop-portal-hyprland
killall xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

171
.config/hypr/hyprland.conf Normal file
View File

@ -0,0 +1,171 @@
# This is an example Hyprland config file.
#
# Refer to the wiki for more information.
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=DP-1,preferred,auto,auto
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
exec-once = waybar & hyprpaper & ~/.config/hypr/hdp.sh
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Some default env vars.
env = XCURSOR_SIZE,24
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
kb_variant =
kb_model =
kb_options = ctrl:nocaps
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = false
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
general {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5
gaps_out = 20
border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa)
layout = dwindle
}
decoration {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 8
blur = true
blur_size = 3
blur_passes = 1
blur_new_optimizations = true
drop_shadow = true
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
}
animations {
enabled = true
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true # you probably want this
}
master {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = false
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic mouse V1 {
sensitivity = -0.8
}
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# $mainMod = SUPER
$mainMod = ALT
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
#bind = $mainMod, Q, exec, kitty
bind = $mainMod, Q, killactive,
bind = $mainMod, T, exec, kitty
#bind = $mainMod, C, killactive,
bind = $mainMod SHIFT, Q, exit,
bind = $mainMod, E, exec, dolphin
bind = $mainMod, V, togglefloating,
bind = $mainMod, Space, exec, rofi -show drun
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
bind = SUPER, h, movefocus, l
bind = SUPER, j, movefocus, d
bind = SUPER, k, movefocus, u
bind = SUPER, l, movefocus, r
# Switch workspaces with mainMod + [0-9]
bind = CONTROL, 1, workspace, 1
bind = CONTROL, 2, workspace, 2
bind = CONTROL, 3, workspace, 3
bind = CONTROL, 4, workspace, 4
bind = CONTROL, 5, workspace, 5
bind = CONTROL, 6, workspace, 6
bind = CONTROL, 7, workspace, 7
bind = CONTROL, 8, workspace, 8
bind = CONTROL, 9, workspace, 9
bind = CONTROL, 0, workspace, 10
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = CONTROL SHIFT, 1, movetoworkspace, 1
bind = CONTROL SHIFT, 2, movetoworkspace, 2
bind = CONTROL SHIFT, 3, movetoworkspace, 3
bind = CONTROL SHIFT, 4, movetoworkspace, 4
bind = CONTROL SHIFT, 5, movetoworkspace, 5
bind = CONTROL SHIFT, 6, movetoworkspace, 6
bind = CONTROL SHIFT, 7, movetoworkspace, 7
bind = CONTROL SHIFT, 8, movetoworkspace, 8
bind = CONTROL SHIFT, 9, movetoworkspace, 9
bind = CONTROL SHIFT, 0, movetoworkspace, 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 = $mainMod SHIFT, S, exec, grimblast copysave area

View File

@ -0,0 +1,3 @@
preload = /home/xfy/Pictures/backgrounds/eos_wallpapers_community/Endy_vector_satelliet.png
wallpaper = DP-1,/home/xfy/Pictures/backgrounds/eos_wallpapers_community/Endy_vector_satelliet.png

111
.config/ideavim/.ideavimrc Normal file
View File

@ -0,0 +1,111 @@
let mapleader=" "
""" Plugins --------------------------------
Plug 'easymotion/vim-easymotion'
""" Plug 'preservim/nerdtree'
set NERDTree
set surround
set multiple-cursors
set commentary
set argtextobj
set easymotion
set textobj-entire
set ReplaceWithRegister
"""s Plugin settings -------------------------
""" let g:EasyMotion_override_acejump = 0
let g:argtextobj_pairs="[:],(:),<:>"
""" Common settings -------------------------
set scrolloff=5
set clipboard+=unnamed
set clipboard+=idea-put
set scrolloff=5
set number relativenumber
set incsearch
set hls
""" Idea specific settings ------------------
set ideajoin
set ideastatusicon=gray
set idearefactormode=keep
" Don't use Ex mode, use Q for formatting.
map Q gq
let g:EasyMotion_smartcase = 1
""" Mappings --------------------------------
map <leader><leader> <Plug>(easymotion-s)
map <leader>w <Plug>(easymotion-w)
map <leader>b <Plug>(easymotion-b)
""" map <leader><leader>l <Plug>(easymotion-lineforward)
map <leader>j <Plug>(easymotion-j)
map <leader>k <Plug>(easymotion-k)
""" map <leader><leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
nnoremap <leader>nh :nohl<CR>
xnoremap p "_dP
noremap gb viw
nnoremap gh :action QuickJavaDoc<cr>
nnoremap <leader>r :action RenameElement<CR>
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nnoremap <C-j> :action GotoNextError<CR>
nnoremap <C-k> :action GotoPreviousError<CR>
""" Switch windows
nnoremap <leader>h <c-w>h
nnoremap <leader>l <c-w>l
""" nnoremap <leader>j <c-w>j
""" nnoremap <leader>k <c-w>k
""" nnoremap <leader>e :action ActivateProjectToolWindow<CR>
""" nnoremap <leader>e :NERDTreeToggle<CR>
nnoremap ;r :action FindInPath<CR>
nnoremap <C-p> :action GotoFile<CR>
""" Switch tabs
nmap <C-i> :action NextTab<CR>
nmap <C-o> :action PreviousTab<CR>
""" nmap gh :action ShowErrorDescription<CR>
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
" Find more examples here: https://jb.gg/share-ideavimrc
sethandler <C-2> a:vim
sethandler <C-;> a:vim
sethandler <C-S-;> a:vim
sethandler <C-2> a:vim
sethandler <C-;> a:vim
sethandler <C-S-;> a:vim
sethandler <C-A> a:ide
sethandler <C-B> a:vim
sethandler <C-C> a:ide
sethandler <C-D> a:vim
sethandler <C-E> a:ide
sethandler <C-F> a:ide
sethandler <C-G> a:vim
sethandler <C-H> a:vim
sethandler <C-I> a:vim
sethandler <C-J> a:vim
sethandler <C-K> a:vim
sethandler <C-L> a:vim
sethandler <C-N> a:vim
sethandler <C-O> a:vim
sethandler <C-P> a:vim
sethandler <C-R> a:vim
sethandler <C-S> a:ide
sethandler <C-T> a:vim
sethandler <C-U> a:vim
sethandler <C-V> a:vim
sethandler <C-W> a:ide
sethandler <C-Y> a:vim

View File

@ -0,0 +1,21 @@
background #1e1f28
foreground #f8f8f2
cursor #bbbbbb
selection_background #44475a
color0 #000000
color8 #545454
color1 #ff5555
color9 #ff5454
color2 #50fa7b
color10 #50fa7b
color3 #f0fa8b
color11 #f0fa8b
color4 #bd92f8
color12 #bd92f8
color5 #ff78c5
color13 #ff78c5
color6 #8ae9fc
color14 #8ae9fc
color7 #bbbbbb
color15 #ffffff
selection_foreground #1e1f28

View File

@ -0,0 +1,35 @@
# vim:ft=kitty
## name: Dracula
## author: Keegan Carruthers-Smith
## license: MIT
## upstream: https://raw.githubusercontent.com/dracula/kitty/master/dracula.conf
foreground #f8f8f2
background #282a36
selection_foreground #ffffff
selection_background #44475a
url_color #8be9fd
color0 #21222c
color8 #6272a4
color1 #ff5555
color9 #ff6e6e
color2 #50fa7b
color10 #69ff94
color3 #f1fa8c
color11 #ffffa5
color4 #bd93f9
color12 #d6acff
color5 #ff79c6
color13 #ff92df
color6 #8be9fd
color14 #a4ffff
color7 #f8f8f2
color15 #ffffff
cursor #f8f8f2
cursor_text_color background
active_tab_foreground #282a36
active_tab_background #f8f8f2
inactive_tab_foreground #282a36
inactive_tab_background #6272a4
mark1_foreground #282a36
mark1_background #ff5555

2205
.config/kitty/kitty.conf Normal file

File diff suppressed because it is too large Load Diff

2200
.config/kitty/kitty.conf.bak Normal file

File diff suppressed because it is too large Load Diff

334
.config/kitty/tab_bar.py Normal file
View File

@ -0,0 +1,334 @@
# import json
# import subprocess
# from collections import defaultdict
# from datetime import datetime, timezone
#
# from kitty.boss import get_boss
# from kitty.fast_data_types import Screen, add_timer
# from kitty.rgb import Color
# from kitty.tab_bar import (
# DrawData,
# ExtraData,
# Formatter,
# TabBarData,
# as_rgb,
# draw_attributed_string,
# draw_title,
# )
# from kitty.utils import color_as_int
#
# timer_id = None
#
# ICON = "  "
# RIGHT_MARGIN = 1
# REFRESH_TIME = 15
#
# icon_fg = as_rgb(color_as_int(Color(255, 250, 205)))
# icon_bg = as_rgb(color_as_int(Color(47, 61, 68)))
# # OR icon_bg = as_rgb(0x2f3d44)
# bat_text_color = as_rgb(0x999F93)
# clock_color = as_rgb(0x7FBBB3)
# dnd_color = as_rgb(0x465258)
# sep_color = as_rgb(0x999F93)
# utc_color = as_rgb(color_as_int(Color(113, 115, 116)))
#
#
# # cells = [
# # (Color(113, 115, 116), dnd),
# # (Color(135, 192, 149), clock),
# # (Color(113, 115, 116), utc),
# # ]
#
#
# def calc_draw_spaces(*args) -> int:
# length = 0
# for i in args:
# if not isinstance(i, str):
# i = str(i)
# length += len(i)
# return length
#
#
# def _draw_icon(screen: Screen, index: int) -> int:
# if index != 1:
# return 0
#
# fg, bg = screen.cursor.fg, screen.cursor.bg
# screen.cursor.fg = icon_fg
# screen.cursor.bg = icon_bg
# screen.draw(ICON)
# screen.cursor.fg, screen.cursor.bg = fg, bg
# screen.cursor.x = len(ICON)
# return screen.cursor.x
#
#
# def _draw_left_status(
# draw_data: DrawData,
# screen: Screen,
# tab: TabBarData,
# before: int,
# max_title_length: int,
# index: int,
# is_last: bool,
# extra_data: ExtraData,
# ) -> int:
# # print(extra_data)
# if draw_data.leading_spaces:
# screen.draw(" " * draw_data.leading_spaces)
#
# # TODO: https://github.com/kovidgoyal/kitty/discussions/4447#discussioncomment-2463083
# # tm = get_boss().active_tab_manager
# # if tm is not None:
# # w = tm.active_window
# # if w is not None:
# # cwd = w.cwd_of_child or ''
# # log_error(cwd)
#
# draw_title(draw_data, screen, tab, index)
# trailing_spaces = min(max_title_length - 1, draw_data.trailing_spaces)
# max_title_length -= trailing_spaces
# extra = screen.cursor.x - before - max_title_length
# if extra > 0:
# screen.cursor.x -= extra + 1
# screen.draw("…")
# if trailing_spaces:
# screen.draw(" " * trailing_spaces)
# end = screen.cursor.x
# screen.cursor.bold = screen.cursor.italic = False
# screen.cursor.fg = 0
# if not is_last:
# screen.cursor.bg = as_rgb(color_as_int(draw_data.inactive_bg))
# screen.draw(draw_data.sep)
# screen.cursor.bg = 0
# return end
#
#
# def _get_dnd_status():
# result = subprocess.run("~/.dotfiles/bin/dnd -k",
# shell=True, capture_output=True)
# status = ""
#
# if result.stderr:
# raise subprocess.CalledProcessError(
# returncode=result.returncode, cmd=result.args, stderr=result.stderr
# )
#
# if result.stdout:
# status = result.stdout.decode("utf-8").strip()
#
# return status
#
#
# # more handy kitty tab_bar things:
# # REF: https://github.com/kovidgoyal/kitty/discussions/4447#discussioncomment-2183440
# def _draw_right_status(screen: Screen, is_last: bool) -> int:
# if not is_last:
# return 0
# # global timer_id
# # if timer_id is None:
# # timer_id = add_timer(_redraw_tab_bar, REFRESH_TIME, True)
#
# draw_attributed_string(Formatter.reset, screen)
#
# clock = datetime.now().strftime("%H:%M")
# utc = datetime.now(timezone.utc).strftime(" (UTC %H:%M)")
# dnd = _get_dnd_status()
#
# cells = []
# if dnd != "":
# cells.append((dnd_color, dnd))
# cells.append((sep_color, " ⋮ "))
#
# cells.append((clock_color, clock))
# cells.append((utc_color, utc))
#
# # right_status_length = calc_draw_spaces(dnd + " " + clock + " " + utc)
#
# right_status_length = RIGHT_MARGIN
# for cell in cells:
# right_status_length += len(str(cell[1]))
#
# draw_spaces = screen.columns - screen.cursor.x - right_status_length
#
# if draw_spaces > 0:
# screen.draw(" " * draw_spaces)
#
# screen.cursor.fg = 0
# for color, status in cells:
# screen.cursor.fg = color # as_rgb(color_as_int(color))
# screen.draw(status)
# screen.cursor.bg = 0
#
# if screen.columns - screen.cursor.x > right_status_length:
# screen.cursor.x = screen.columns - right_status_length
#
# return screen.cursor.x
#
#
# # REF: https://github.com/kovidgoyal/kitty/discussions/4447#discussioncomment-1940795
# # def _redraw_tab_bar():
# # tm = get_boss().active_tab_manager
# # if tm is not None:
# # tm.mark_tab_bar_dirty()
#
#
# def draw_tab(
# draw_data: DrawData,
# screen: Screen,
# tab: TabBarData,
# before: int,
# max_title_length: int,
# index: int,
# is_last: bool,
# extra_data: ExtraData,
# ) -> int:
#
# _draw_icon(screen, index)
# _draw_left_status(
# draw_data,
# screen,
# tab,
# before,
# max_title_length,
# index,
# is_last,
# extra_data,
# )
# _draw_right_status(
# screen,
# is_last,
# )
#
# return screen.cursor.x
#
import datetime
import json
import subprocess
from collections import defaultdict
from kitty.rgb import Color
from kitty.boss import get_boss
from kitty.fast_data_types import Screen
from kitty.tab_bar import (
DrawData,
ExtraData,
Formatter,
TabBarData,
as_rgb,
draw_attributed_string,
draw_tab_with_powerline,
draw_title
)
from kitty.utils import color_as_int
timer_id = None
def draw_tab(
draw_data: DrawData,
screen: Screen,
tab: TabBarData,
before: int,
max_title_length: int,
index: int,
is_last: bool,
extra_data: ExtraData,
) -> int:
global timer_id
# if timer_id is None:
# timer_id = add_timer(_redraw_tab_bar, 2.0, True)
draw_tab_with_powerline(
draw_data, screen, tab, before, max_title_length, index, is_last, extra_data
)
if is_last:
draw_right_status(draw_data, screen)
return screen.cursor.x
def draw_right_status(draw_data: DrawData, screen: Screen) -> None:
# The tabs may have left some formats enabled. Disable them now.
draw_attributed_string(Formatter.reset, screen)
cells = create_cells()
# Drop cells that wont fit
while True:
if not cells:
return
padding = screen.columns - screen.cursor.x - \
sum(len(c) + 3 for c in cells)
if padding >= 0:
break
cells = cells[1:]
if padding:
screen.draw(" " * padding)
tab_bg = as_rgb(int(draw_data.inactive_bg))
tab_fg = as_rgb(int(draw_data.inactive_fg))
default_bg = as_rgb(int(draw_data.default_bg))
for cell in cells:
# Draw the separator
if cell == cells[0]:
screen.cursor.fg = tab_bg
screen.draw("")
else:
screen.cursor.fg = default_bg
screen.cursor.bg = tab_bg
screen.draw("")
screen.cursor.fg = tab_fg
screen.cursor.bg = tab_bg
screen.draw(f" {cell} ")
def create_cells() -> list[str]:
now = datetime.datetime.now()
return [
# currently_playing(),
# get_headphone_battery_status(),
now.strftime("%d %b"),
now.strftime("%H:%M"),
]
def get_headphone_battery_status():
try:
battery_pct = int(subprocess.getoutput("headsetcontrol -b -c"))
except Exception:
status = ""
else:
if battery_pct < 0:
status = ""
else:
status = f"{battery_pct}% {''[battery_pct // 10]}"
return f"{status}"
STATE = defaultdict(lambda: "", {"Paused": "", "Playing": ""})
def currently_playing():
# TODO: Work out how to add python libraries so that I can query dbus directly
# For now, implemented in a separate python project: dbus-player-status
status = ""
data = {}
try:
data = json.loads(subprocess.getoutput("dbus-player-status"))
except ValueError:
pass
if data:
if "state" in data:
status = f"{status} {STATE[data['state']]}"
if "title" in data:
status = f"{status} {data['title']}"
if "artist" in data:
status = f"{status} - {data['artist']}"
else:
status = ""
return status
def _redraw_tab_bar(timer_id):
for tm in get_boss().all_tab_managers:
tm.mark_tab_bar_dirty()

View File

@ -0,0 +1,804 @@
# Source: https://github.com/chick2d/neofetch-themes
# Configuration made by Chick
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
# I used custom seperators as the older one looked not very properly proportioned
# Quote the prin's and unqote the underlines if you want.
print_info() {
# prin "Eat  , Sleep  , Linux  ."
# info underline
prin ""
prin "Hardware Information"
info " " model
info " " cpu
info "﬙ " gpu
# info " " disk
info "ﳔ " memory
info " " resolution
# info "󱈑 " battery
# info underline
prin ""
prin "Software Information"
info " " distro
# Just get your distro's logo off nerdfonts.com
info " " kernel
# info "" de
info " " wm
info " " shell
info " " term
# info " " term_font
# info " " theme
# info " " icons
info " " packages
# info "󰅐 " uptime
# Backup
# info "GPU Driver" gpu_driver # Linux/macOS only
# info "CPU Usage" cpu_usage
# info "Font" font
# info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
# info "Local IP" local_ip
# info "Public IP" public_ip
#info "Users" users
# info "Locale" locale # This only works on glibc systems.
prin ""
# info cols
# prin " " # Padding
prin "${cl3}󰮯 \n \n ${cl5}󰊠 \n \n ${cl2}󰊠 \n \n ${cl6}󰊠 \n \n ${cl4}󰊠 \n \n ${cl1}󰊠 \n \n ${cl7}󰊠 \n \n ${cl0}󰊠 \n \n "
}
# Kernel
# Shorten the output of the kernel function.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --kernel_shorthand
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
#
# Example:
# on: '4.8.9-1-ARCH'
# off: 'Linux 4.8.9-1-ARCH'
kernel_shorthand="on"
# Distro
# Shorten the output of the distro function
#
# Default: 'off'
# Values: 'on', 'tiny', 'off'
# Flag: --distro_shorthand
# Supports: Everything except Windows and Haiku
distro_shorthand="off"
# Show/Hide OS Architecture.
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --os_arch
#
# Example:
# on: 'Arch Linux x86_64'
# off: 'Arch Linux'
os_arch="on"
# Uptime
# Shorten the output of the uptime function
#
# Default: 'on'
# Values: 'on', 'tiny', 'off'
# Flag: --uptime_shorthand
#
# Example:
# on: '2 days, 10 hours, 3 mins'
# tiny: '2d 10h 3m'
# off: '2 days, 10 hours, 3 minutes'
uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="on"
# Packages
# Show/Hide Package Manager names.
#
# Default: 'tiny'
# Values: 'on', 'tiny' 'off'
# Flag: --package_managers
#
# Example:
# on: '998 (pacman), 8 (flatpak), 4 (snap)'
# tiny: '908 (pacman, flatpak, snap)'
# off: '908'
package_managers="on"
# Shell
# Show the path to $SHELL
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --shell_path
#
# Example:
# on: '/bin/bash'
# off: 'bash'
shell_path="on"
# Show $SHELL version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --shell_version
#
# Example:
# on: 'bash 4.4.5'
# off: 'bash'
shell_version="on"
# CPU
# CPU speed type
#
# Default: 'bios_limit'
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
# Flag: --speed_type
# Supports: Linux with 'cpufreq'
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type="bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthad="on"
# Enable/Disable CPU brand in output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_brand
#
# Example:
# on: 'Intel i7-6500U'
# off: 'i7-6500U (4)'
cpu_brand="on"
# CPU Speed
# Hide/Show CPU speed.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cp_speed
#
# Example:
# on: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'Intel i7-6500U (4)'
cpu_speed="on"
# CPU Cores
# Display CPU cores in output
#
# Default: 'logical'
# Values: 'logical', 'physical', 'off'
# Flag: --cpu_cores
# Support: 'physical' doesn't work on BSD.
#
# Example:
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
# off: 'Intel i7-6500U @ 3.1GHz'
cpu_cores="logical"
# CPU Temperature
# Hide/Show CPU temperature.
# Note the temperature is added to the regular CPU function.
#
# Default: 'off'
# Values: 'C', 'F', 'off'
# Flag: --cpu_temp
# Supports: Linux, BSD
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
# coretemp kernel module. This only supports newer Intel processors.
#
# Example:
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
cpu_temp="on"
# GPU
# Enable/Disable GPU Brand
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gpu_brand
#
# Example:
# on: 'AMD HD 7950'
# off: 'HD 7950'
gpu_brand="on"
# Which GPU to display
#
# Default: 'all'
# Values: 'all', 'dedicated', 'integrated'
# Flag: --gpu_type
# Supports: Linux
#
# Example:
# all:
# GPU1: AMD HD 7950
# GPU2: Intel Integrated Graphics
#
# dedicated:
# GPU1: AMD HD 7950
#
# integrated:
# GPU1: Intel Integrated Graphics
gpu_type="all"
# Resolution
# Display refresh rate next to each monitor
# Default: 'off'
# Values: 'on', 'off'
# Flag: --refresh_rate
# Supports: Doesn't work on Windows.
#
# Example:
# on: '1920x1080 @ 60Hz'
# off: '1920x1080'
refresh_rate="on"
# Gtk Theme / Icons / Font
# Shorten output of GTK Theme / Icons / Font
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --gtk_shorthand
#
# Example:
# on: 'Numix, Adwaita'
# off: 'Numix [GTK2], Adwaita [GTK3]'
gtk_shorthand="on"
# Enable/Disable gtk2 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk2
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Adwaita [GTK3]'
gtk2="on"
# Enable/Disable gtk3 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk3
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Numix [GTK2]'
gtk3="on"
# IP Address
# Website to ping for the public IP
#
# Default: 'http://ident.me'
# Values: 'url'
# Flag: --ip_host
public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Disk
# Which disks to display.
# The values can be any /dev/sdXX, mount point or directory.
# NOTE: By default we only show the disk info for '/'.
#
# Default: '/'
# Values: '/', '/dev/sdXX', '/path/to/drive'.
# Flag: --disk_show
#
# Example:
# disk_show=('/' '/dev/sdb1'):
# 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
#
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name', 'dir'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
#disk_subtitle="mount"
# Song
# Manually specify a music player.
#
# Default: 'auto'
# Values: 'auto', 'player-name'
# Flag: --music_player
#
# Available values for 'player-name':
#
# amarok
# audacious
# banshee
# bluemindo
# clementine
# cmus
# deadbeef
# deepin-music
# dragon
# elisa
# exaile
# gnome-music
# gmusicbrowser
# gogglesmm
# guayadeque
# iTunes
# juk
# lollypop
# mocp
# mopidy
# mpd
# netease-cloud-music
# pogo
# pragha
# qmmp
# quodlibet
# rhythmbox
# sayonara
# smplayer
# spotify
# strawberry
# tomahawk
# vlc
# xmms2d
# xnoise
# yarock
music_player="auto"
# Format to display song information.
#
# Default: '%artist% - %album% - %title%'
# Values: '%artist%', '%album%', '%title%'
# Flag: --song_format
#
# Example:
# default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %title%"
# Print the Artist, Album and Title on separate lines
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --song_shorthand
#
# Example:
# on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger'
#
# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off"
# 'mpc' arguments (specify a host, password etc).
#
# Default: ''
# Example: mpc_args=(-h HOST -P PASSWORD)
mpc_args=()
# Text Colors
# Text Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --colors
#
# Each number represents a different part of the text in
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
#
# Example:
# colors=(distro) - Text is colored based on Distro colors.
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
colors=(distro)
# Text Options
# Toggle bold text
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bold
bold="on"
# Enable/Disable Underline
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --underline
underline_enabled="on"
# Underline character
#
# Default: '-'
# Values: 'string'
# Flag: --underline_char
underline_char="-"
# Info Separator
# Replace the default separator with the specified string.
#
# Default: ':'
# Flag: --separator
#
# Example:
# separator="->": 'Shell-> bash'
# separator=" =": 'WM = dwm'
separator="  "
# Color Blocks
# Color block range
# The range of colors to print.
#
# Default: '0', '15'
# Values: 'num'
# Flag: --block_range
#
# Example:
#
# Display colors 0-7 in the blocks. (8 colors)
# neofetch --block_range 0 7
#
# Display colors 0-15 in the blocks. (16 colors)
# neofetch --block_range 0 15
#block_range=(8 15)
block_range=(1 7)
# Toggle color blocks
# Colors for custom colorblocks
#colors
#bold="(tput bold)"
magenta="\033[1;35m"
green="\033[1;32m"
white="\033[1;37m"
blue="\033[1;34m"
red="\033[1;31m"
black="\033[1;40;30m"
yellow="\033[1;33m"
cyan="\033[1;36m"
reset="\033[0m"
bgyellow="\033[1;43;33m"
bgwhite="\033[1;47;37m"
cl0="${reset}"
cl1="${magenta}"
cl2="${green}"
cl3="${white}"
cl4="${blue}"
cl5="${red}"
cl6="${yellow}"
cl7="${cyan}"
cl8="${black}"
cl9="${bgyellow}"
cl10="${bgwhite}"
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --color_blocks
color_blocks="on"
# Color block width in spaces
#
# Default: '3'
# Values: 'num'
# Flag: --block_width
block_width=4
# Color block height in lines
#
# Default: '1'
# Values: 'num'
# Flag: --block_height
block_height=1
# Progress Bars
# Bar characters
#
# Default: '-', '='
# Values: 'string', 'string'
# Flag: --bar_char
#
# Example:
# neofetch --bar_char 'elapsed' 'total'
# neofetch --bar_char '-' '='
bar_char_elapsed="-"
bar_char_total="="
# Toggle Bar border
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bar_border
bar_border="on"
# Progress bar length in spaces
# Number of chars long to make the progress bars.
#
# Default: '15'
# Values: 'num'
# Flag: --bar_length
bar_length=15
# Progress bar colors
# When set to distro, uses your distro's logo colors.
#
# Default: 'distro', 'distro'
# Values: 'distro', 'num'
# Flag: --bar_colors
#
# Example:
# neofetch --bar_colors 3 4
# neofetch --bar_colors distro 5
bar_color_elapsed="distro"
bar_color_total="distro"
# Info display
# Display a bar with the info.
#
# Default: 'off'
# Values: 'bar', 'infobar', 'barinfo', 'off'
# Flags: --cpu_display
# --memory_display
# --battery_display
# --disk_display
#
# Example:
# bar: '[---=======]'
# infobar: 'info [---=======]'
# barinfo: '[---=======] info'
# off: 'info'
cpu_display="on"
memory_display="on"
battery_display="on"
disk_display="on"
# Backend Settings
# Image backend.
#
# Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend
image_backend="kitty"
# Image Source
#
# Which image or ascii file to display.
#
# Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source
#
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
# In ascii mode, distro ascii art will be used and in an image mode, your
# wallpaper will be used.
#image_source="$HOME/.config/neofetch/archlogo.txt"
#image_source="$HOME/.config/neofetch/logo"
image_source="$HOME/.config/neofetch/goth-asuka.jpeg"
# Ascii Options
# Ascii distro
# Which distro's ascii art to display.
#
# Default: 'auto'
# Values: 'auto', 'distro_name'
# Flag: --ascii_distro
#
# NOTE: Arch and Ubuntu have 'old' logo variants.
# Change this to 'arch_old' or 'ubuntu_old' to use the old logos.
# NOTE: Ubuntu has flavor variants.
# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors.
# NOTE: Arch, Crux and Gentoo have a smaller logo variant.
# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos.
ascii_distro="auto"
# Ascii Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --ascii_colors
#
# Example:
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
ascii_colors=(distro)
# Bold ascii logo
# Whether or not to bold the ascii logo.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --ascii_bold
ascii_bold="on"
# Image Options
# Image loop
# Setting this to on will make neofetch redraw the image constantly until
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --loop
image_loop="off"
# Thumbnail directory
#
# Default: '~/.cache/thumbnails/neofetch'
# Values: 'dir'
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
# Crop mode
#
# Default: 'normal'
# Values: 'normal', 'fit', 'fill'
# Flag: --crop_mode
#
# See this wiki page to learn about the fit and fill options.
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
crop_mode="normal"
# Crop offset
# Note: Only affects 'normal' crop mode.
#
# Default: 'center'
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
# 'east', 'southwest', 'south', 'southeast'
# Flag: --crop_offset
crop_offset="center"
# Image size
# The image is half the terminal width by default.
#
# Default: 'auto'
# Values: 'auto', '00px', '00%', 'none'
# Flags: --image_size
# --size
image_size="30%"
# Gap between image and text
#
# Default: '3'
# Values: 'num', '-num'
# Flag: --gap
gap=2
# Image offsets
# Only works with the w3m backend.
#
# Default: '0'
# Values: 'px'
# Flags: --xoffset
# --yoffset
yoffset=0
xoffset=0
# Image background color
# Only works with the w3m backend.
#
# Default: ''
# Values: 'color', 'blue'
# Flag: --bg_color
background_color=
# Misc Options
# Stdout mode
# Turn off all colors and disables image backend (ASCII/Image).
# Useful for piping into another command.
# Default: 'off'
# Values: 'on', 'off'
stdout="off"

View File

@ -0,0 +1,864 @@
# See this wiki page for more info:
# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Resolution" resolution
info "DE" de
info "WM" wm
info "WM Theme" wm_theme
info "Theme" theme
info "Icons" icons
info "Terminal" term
info "Terminal Font" term_font
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
# info "GPU Driver" gpu_driver # Linux/macOS only
# info "CPU Usage" cpu_usage
# info "Disk" disk
# info "Battery" battery
# info "Font" font
# info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
# info "Local IP" local_ip
# info "Public IP" public_ip
# info "Users" users
# info "Locale" locale # This only works on glibc systems.
info cols
}
# Title
# Hide/Show Fully qualified domain name.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --title_fqdn
title_fqdn="off"
# Kernel
# Shorten the output of the kernel function.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --kernel_shorthand
# Supports: Everything except *BSDs (except PacBSD and PC-BSD)
#
# Example:
# on: '4.8.9-1-ARCH'
# off: 'Linux 4.8.9-1-ARCH'
kernel_shorthand="on"
# Distro
# Shorten the output of the distro function
#
# Default: 'off'
# Values: 'on', 'tiny', 'off'
# Flag: --distro_shorthand
# Supports: Everything except Windows and Haiku
distro_shorthand="off"
# Show/Hide OS Architecture.
# Show 'x86_64', 'x86' and etc in 'Distro:' output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --os_arch
#
# Example:
# on: 'Arch Linux x86_64'
# off: 'Arch Linux'
os_arch="on"
# Uptime
# Shorten the output of the uptime function
#
# Default: 'on'
# Values: 'on', 'tiny', 'off'
# Flag: --uptime_shorthand
#
# Example:
# on: '2 days, 10 hours, 3 mins'
# tiny: '2d 10h 3m'
# off: '2 days, 10 hours, 3 minutes'
uptime_shorthand="on"
# Memory
# Show memory pecentage in output.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --memory_percent
#
# Example:
# on: '1801MiB / 7881MiB (22%)'
# off: '1801MiB / 7881MiB'
memory_percent="off"
# Change memory output unit.
#
# Default: 'mib'
# Values: 'kib', 'mib', 'gib'
# Flag: --memory_unit
#
# Example:
# kib '1020928KiB / 7117824KiB'
# mib '1042MiB / 6951MiB'
# gib: ' 0.98GiB / 6.79GiB'
memory_unit="mib"
# Packages
# Show/Hide Package Manager names.
#
# Default: 'tiny'
# Values: 'on', 'tiny' 'off'
# Flag: --package_managers
#
# Example:
# on: '998 (pacman), 8 (flatpak), 4 (snap)'
# tiny: '908 (pacman, flatpak, snap)'
# off: '908'
package_managers="on"
# Shell
# Show the path to $SHELL
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --shell_path
#
# Example:
# on: '/bin/bash'
# off: 'bash'
shell_path="off"
# Show $SHELL version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --shell_version
#
# Example:
# on: 'bash 4.4.5'
# off: 'bash'
shell_version="on"
# CPU
# CPU speed type
#
# Default: 'bios_limit'
# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'.
# Flag: --speed_type
# Supports: Linux with 'cpufreq'
# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value.
speed_type="bios_limit"
# CPU speed shorthand
#
# Default: 'off'
# Values: 'on', 'off'.
# Flag: --speed_shorthand
# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz
#
# Example:
# on: 'i7-6500U (4) @ 3.1GHz'
# off: 'i7-6500U (4) @ 3.100GHz'
speed_shorthand="off"
# Enable/Disable CPU brand in output.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_brand
#
# Example:
# on: 'Intel i7-6500U'
# off: 'i7-6500U (4)'
cpu_brand="on"
# CPU Speed
# Hide/Show CPU speed.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --cpu_speed
#
# Example:
# on: 'Intel i7-6500U (4) @ 3.1GHz'
# off: 'Intel i7-6500U (4)'
cpu_speed="on"
# CPU Cores
# Display CPU cores in output
#
# Default: 'logical'
# Values: 'logical', 'physical', 'off'
# Flag: --cpu_cores
# Support: 'physical' doesn't work on BSD.
#
# Example:
# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores)
# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores)
# off: 'Intel i7-6500U @ 3.1GHz'
cpu_cores="logical"
# CPU Temperature
# Hide/Show CPU temperature.
# Note the temperature is added to the regular CPU function.
#
# Default: 'off'
# Values: 'C', 'F', 'off'
# Flag: --cpu_temp
# Supports: Linux, BSD
# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable
# coretemp kernel module. This only supports newer Intel processors.
#
# Example:
# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]'
# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]'
# off: 'Intel i7-6500U (4) @ 3.1GHz'
cpu_temp="off"
# GPU
# Enable/Disable GPU Brand
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gpu_brand
#
# Example:
# on: 'AMD HD 7950'
# off: 'HD 7950'
gpu_brand="on"
# Which GPU to display
#
# Default: 'all'
# Values: 'all', 'dedicated', 'integrated'
# Flag: --gpu_type
# Supports: Linux
#
# Example:
# all:
# GPU1: AMD HD 7950
# GPU2: Intel Integrated Graphics
#
# dedicated:
# GPU1: AMD HD 7950
#
# integrated:
# GPU1: Intel Integrated Graphics
gpu_type="all"
# Resolution
# Display refresh rate next to each monitor
# Default: 'off'
# Values: 'on', 'off'
# Flag: --refresh_rate
# Supports: Doesn't work on Windows.
#
# Example:
# on: '1920x1080 @ 60Hz'
# off: '1920x1080'
refresh_rate="off"
# Gtk Theme / Icons / Font
# Shorten output of GTK Theme / Icons / Font
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --gtk_shorthand
#
# Example:
# on: 'Numix, Adwaita'
# off: 'Numix [GTK2], Adwaita [GTK3]'
gtk_shorthand="off"
# Enable/Disable gtk2 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk2
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Adwaita [GTK3]'
gtk2="on"
# Enable/Disable gtk3 Theme / Icons / Font
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --gtk3
#
# Example:
# on: 'Numix [GTK2], Adwaita [GTK3]'
# off: 'Numix [GTK2]'
gtk3="on"
# IP Address
# Website to ping for the public IP
#
# Default: 'http://ident.me'
# Values: 'url'
# Flag: --ip_host
public_ip_host="http://ident.me"
# Public IP timeout.
#
# Default: '2'
# Values: 'int'
# Flag: --ip_timeout
public_ip_timeout=2
# Desktop Environment
# Show Desktop Environment version
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --de_version
de_version="on"
# Disk
# Which disks to display.
# The values can be any /dev/sdXX, mount point or directory.
# NOTE: By default we only show the disk info for '/'.
#
# Default: '/'
# Values: '/', '/dev/sdXX', '/path/to/drive'.
# Flag: --disk_show
#
# Example:
# disk_show=('/' '/dev/sdb1'):
# 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 823G / 893G (93%)'
#
# disk_show=('/'):
# 'Disk (/): 74G / 118G (66%)'
#
disk_show=('/')
# Disk subtitle.
# What to append to the Disk subtitle.
#
# Default: 'mount'
# Values: 'mount', 'name', 'dir', 'none'
# Flag: --disk_subtitle
#
# Example:
# name: 'Disk (/dev/sda1): 74G / 118G (66%)'
# 'Disk (/dev/sdb2): 74G / 118G (66%)'
#
# mount: 'Disk (/): 74G / 118G (66%)'
# 'Disk (/mnt/Local Disk): 74G / 118G (66%)'
# 'Disk (/mnt/Videos): 74G / 118G (66%)'
#
# dir: 'Disk (/): 74G / 118G (66%)'
# 'Disk (Local Disk): 74G / 118G (66%)'
# 'Disk (Videos): 74G / 118G (66%)'
#
# none: 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
# 'Disk: 74G / 118G (66%)'
disk_subtitle="mount"
# Disk percent.
# Show/Hide disk percent.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --disk_percent
#
# Example:
# on: 'Disk (/): 74G / 118G (66%)'
# off: 'Disk (/): 74G / 118G'
disk_percent="on"
# Song
# Manually specify a music player.
#
# Default: 'auto'
# Values: 'auto', 'player-name'
# Flag: --music_player
#
# Available values for 'player-name':
#
# amarok
# audacious
# banshee
# bluemindo
# clementine
# cmus
# deadbeef
# deepin-music
# dragon
# elisa
# exaile
# gnome-music
# gmusicbrowser
# gogglesmm
# guayadeque
# io.elementary.music
# iTunes
# juk
# lollypop
# mocp
# mopidy
# mpd
# muine
# netease-cloud-music
# olivia
# playerctl
# pogo
# pragha
# qmmp
# quodlibet
# rhythmbox
# sayonara
# smplayer
# spotify
# strawberry
# tauonmb
# tomahawk
# vlc
# xmms2d
# xnoise
# yarock
music_player="auto"
# Format to display song information.
#
# Default: '%artist% - %album% - %title%'
# Values: '%artist%', '%album%', '%title%'
# Flag: --song_format
#
# Example:
# default: 'Song: Jet - Get Born - Sgt Major'
song_format="%artist% - %album% - %title%"
# Print the Artist, Album and Title on separate lines
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --song_shorthand
#
# Example:
# on: 'Artist: The Fratellis'
# 'Album: Costello Music'
# 'Song: Chelsea Dagger'
#
# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger'
song_shorthand="off"
# 'mpc' arguments (specify a host, password etc).
#
# Default: ''
# Example: mpc_args=(-h HOST -P PASSWORD)
mpc_args=()
# Text Colors
# Text Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --colors
#
# Each number represents a different part of the text in
# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info'
#
# Example:
# colors=(distro) - Text is colored based on Distro colors.
# colors=(4 6 1 8 8 6) - Text is colored in the order above.
colors=(distro)
# Text Options
# Toggle bold text
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bold
bold="on"
# Enable/Disable Underline
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --underline
underline_enabled="on"
# Underline character
#
# Default: '-'
# Values: 'string'
# Flag: --underline_char
underline_char="-"
# Info Separator
# Replace the default separator with the specified string.
#
# Default: ':'
# Flag: --separator
#
# Example:
# separator="->": 'Shell-> bash'
# separator=" =": 'WM = dwm'
separator=":"
# Color Blocks
# Color block range
# The range of colors to print.
#
# Default: '0', '15'
# Values: 'num'
# Flag: --block_range
#
# Example:
#
# Display colors 0-7 in the blocks. (8 colors)
# neofetch --block_range 0 7
#
# Display colors 0-15 in the blocks. (16 colors)
# neofetch --block_range 0 15
block_range=(0 15)
# Toggle color blocks
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --color_blocks
color_blocks="on"
# Color block width in spaces
#
# Default: '3'
# Values: 'num'
# Flag: --block_width
block_width=3
# Color block height in lines
#
# Default: '1'
# Values: 'num'
# Flag: --block_height
block_height=1
# Color Alignment
#
# Default: 'auto'
# Values: 'auto', 'num'
# Flag: --col_offset
#
# Number specifies how far from the left side of the terminal (in spaces) to
# begin printing the columns, in case you want to e.g. center them under your
# text.
# Example:
# col_offset="auto" - Default behavior of neofetch
# col_offset=7 - Leave 7 spaces then print the colors
col_offset="auto"
# Progress Bars
# Bar characters
#
# Default: '-', '='
# Values: 'string', 'string'
# Flag: --bar_char
#
# Example:
# neofetch --bar_char 'elapsed' 'total'
# neofetch --bar_char '-' '='
bar_char_elapsed="-"
bar_char_total="="
# Toggle Bar border
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --bar_border
bar_border="on"
# Progress bar length in spaces
# Number of chars long to make the progress bars.
#
# Default: '15'
# Values: 'num'
# Flag: --bar_length
bar_length=15
# Progress bar colors
# When set to distro, uses your distro's logo colors.
#
# Default: 'distro', 'distro'
# Values: 'distro', 'num'
# Flag: --bar_colors
#
# Example:
# neofetch --bar_colors 3 4
# neofetch --bar_colors distro 5
bar_color_elapsed="distro"
bar_color_total="distro"
# Info display
# Display a bar with the info.
#
# Default: 'off'
# Values: 'bar', 'infobar', 'barinfo', 'off'
# Flags: --cpu_display
# --memory_display
# --battery_display
# --disk_display
#
# Example:
# bar: '[---=======]'
# infobar: 'info [---=======]'
# barinfo: '[---=======] info'
# off: 'info'
cpu_display="off"
memory_display="off"
battery_display="off"
disk_display="off"
# Backend Settings
# Image backend.
#
# Default: 'ascii'
# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off',
# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty'
# Flag: --backend
image_backend="ascii"
# Image Source
#
# Which image or ascii file to display.
#
# Default: 'auto'
# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/'
# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")'
# Flag: --source
#
# NOTE: 'auto' will pick the best image source for whatever image backend is used.
# In ascii mode, distro ascii art will be used and in an image mode, your
# wallpaper will be used.
image_source="auto"
# Ascii Options
# Ascii distro
# Which distro's ascii art to display.
#
# Default: 'auto'
# Values: 'auto', 'distro_name'
# Flag: --ascii_distro
# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS",
# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs,
# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock,
# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD,
# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS,
# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover,
# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin,
# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary,
# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD,
# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo,
# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra,
# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion,
# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite,
# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva,
# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib,
# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner,
# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba,
# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD,
# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint,
# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix,
# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan,
# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific,
# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz,
# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS,
# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails,
# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio,
# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin,
# and IRIX have ascii logos
# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants.
# Use '{distro name}_old' to use the old logos.
# NOTE: Ubuntu has flavor variants.
# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME,
# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors.
# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu,
# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android,
# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola,
# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS,
# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian,
# postmarketOS, and Void have a smaller logo variant.
# Use '{distro name}_small' to use the small variants.
ascii_distro="auto"
# Ascii Colors
#
# Default: 'distro'
# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num'
# Flag: --ascii_colors
#
# Example:
# ascii_colors=(distro) - Ascii is colored based on Distro colors.
# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors.
ascii_colors=(distro)
# Bold ascii logo
# Whether or not to bold the ascii logo.
#
# Default: 'on'
# Values: 'on', 'off'
# Flag: --ascii_bold
ascii_bold="on"
# Image Options
# Image loop
# Setting this to on will make neofetch redraw the image constantly until
# Ctrl+C is pressed. This fixes display issues in some terminal emulators.
#
# Default: 'off'
# Values: 'on', 'off'
# Flag: --loop
image_loop="off"
# Thumbnail directory
#
# Default: '~/.cache/thumbnails/neofetch'
# Values: 'dir'
thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch"
# Crop mode
#
# Default: 'normal'
# Values: 'normal', 'fit', 'fill'
# Flag: --crop_mode
#
# See this wiki page to learn about the fit and fill options.
# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F
crop_mode="normal"
# Crop offset
# Note: Only affects 'normal' crop mode.
#
# Default: 'center'
# Values: 'northwest', 'north', 'northeast', 'west', 'center'
# 'east', 'southwest', 'south', 'southeast'
# Flag: --crop_offset
crop_offset="center"
# Image size
# The image is half the terminal width by default.
#
# Default: 'auto'
# Values: 'auto', '00px', '00%', 'none'
# Flags: --image_size
# --size
image_size="auto"
# Gap between image and text
#
# Default: '3'
# Values: 'num', '-num'
# Flag: --gap
gap=3
# Image offsets
# Only works with the w3m backend.
#
# Default: '0'
# Values: 'px'
# Flags: --xoffset
# --yoffset
yoffset=0
xoffset=0
# Image background color
# Only works with the w3m backend.
#
# Default: ''
# Values: 'color', 'blue'
# Flag: --bg_color
background_color=
# Misc Options
# Stdout mode
# Turn off all colors and disables image backend (ASCII/Image).
# Useful for piping into another command.
# Default: 'off'
# Values: 'on', 'off'
stdout="off"

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

14
.config/neofetch/logo Normal file
View File

@ -0,0 +1,14 @@
⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷
⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇
⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽
⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕
⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕
⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕
⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄
⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕
⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿
⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟
⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠
⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙
⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣

BIN
.config/neofetch/rempng.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -0,0 +1,30 @@
local status, autopairs = pcall(require, "nvim-autopairs")
if not status then
return
end
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
disable_filetype = { "TelescopePrompt", "vim" },
})
-- import nvim-autopairs completion functionality safely
local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp")
if not cmp_autopairs_setup then
return
end
-- import nvim-cmp plugin safely (completions plugin)
local cmp_setup, cmp = pcall(require, "cmp")
if not cmp_setup then
return
end
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())

View File

@ -0,0 +1,36 @@
local status, bufferline = pcall(require, "bufferline")
if not status then
return
end
bufferline.setup({
options = {
-- 关闭 Tab 的命令
close_command = "Bdelete! %d",
right_mouse_command = "Bdelete! %d",
-- 侧边栏配置
-- 左侧让出 nvim-tree 的位置,显示文字 File Explorer
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
text_align = "left",
},
},
diagnostics = "nvim_lsp",
-- 可选,显示 LSP 报错图标
---@diagnostic disable-next-line: unused-local
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
-- local s = " "
-- for e, n in pairs(diagnostics_dict) do
-- local sym = e == "error" and " " or (e == "warning" and " " or "")
-- s = s .. n .. sym
-- end
-- return s
-- end,
},
})
vim.keymap.set("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>", {})
vim.keymap.set("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>", {})

View File

@ -0,0 +1,93 @@
-- import nvim-cmp plugin safely
local cmp_status, cmp = pcall(require, "cmp")
if not cmp_status then
return
end
-- import luasnip plugin safely
local luasnip_status, luasnip = pcall(require, "luasnip")
if not luasnip_status then
return
end
-- import lspkind plugin safely
local lspkind_status, lspkind = pcall(require, "lspkind")
if not lspkind_status then
return
end
-- load vs-code like snippets from plugins
require("luasnip/loaders/from_vscode").lazy_load()
vim.opt.completeopt = "menu,menuone,noselect"
-- helper function for super tab functionality
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
-- super tab functionality
["<Tab>"] = cmp.mapping(function(fallback) -- use tab for next suggestion
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback) -- use shift-tab for prev suggestion
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- lsp
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = "nvim_lsp_signature_help" },
}),
-- configure lspkind for vs-code like icons
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})
vim.cmd([[
set completeopt=menuone,noinsert,noselect
highlight! default link CmpItemKind CmpItemMenuDefault
]])
-- " Use <Tab> and <S-Tab> to navigate through popup menu
-- inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
-- inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

View File

@ -0,0 +1,8 @@
local status, colorizer = pcall(require, "colorizer")
if not status then
return
end
colorizer.setup({
"*",
})

View File

@ -0,0 +1,19 @@
local status, comment = pcall(require, "nvim_comment")
if not status then
return
end
comment.setup({
-- comment_empty = false
hook = function()
if vim.api.nvim_buf_get_option(0, "filetype") == "vue" then
require("ts_context_commentstring.internal").update_commentstring()
end
if vim.api.nvim_buf_get_option(0, "filetype") == "typescriptreact" then
require("ts_context_commentstring.internal").update_commentstring()
end
if vim.api.nvim_buf_get_option(0, "filetype") == "javascriptreact" then
require("ts_context_commentstring.internal").update_commentstring()
end
end,
})

View File

@ -0,0 +1,8 @@
local status, db = pcall(require, "dashboard")
if not status then
return
end
db.dashboard_custom_header = {
[[ ` ]],
}

View File

@ -0,0 +1,50 @@
-- import gitsigns plugin safely
local setup, gitsigns = pcall(require, "gitsigns")
if not setup then
return
end
-- configure/enable gitsigns
gitsigns.setup({
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
topdelete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
untracked = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = {
enable = false,
},
on_attach = require("xfy.maps").gitsigns_on_attach,
})

View File

@ -0,0 +1,8 @@
local status, hologram = pcall(require, "edluffy/hologram.nvim")
if not status then
return
end
hologram.setup({
auto_display = true, -- WIP automatic markdown image display, may be prone to breaking
})

View File

@ -0,0 +1,11 @@
local status, colors = pcall(require, "lsp-colors")
if not status then
return
end
colors.setup({
Error = "#db4b4b",
Warning = "#e0af68",
Information = "#0db9d7",
Hint = "#10B981",
})

View File

@ -0,0 +1,49 @@
local status, lspkind = pcall(require, "lspkind")
if not status then
return
end
lspkind.init({
-- enables text annotations
--
-- default: true
mode = "symbol",
-- default symbol map
-- can be either 'default' (requires nerd-fonts font) or
-- 'codicons' for codicon preset (requires vscode-codicons font)
--
-- default: 'default'
preset = "codicons",
-- override preset symbols
--
-- default: {}
symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
})

View File

@ -0,0 +1,52 @@
local status, lualine = pcall(require, "lualine")
if not status then
return
end
lualine.setup({
options = {
icons_enabled = true,
theme = "dracula-nvim",
section_separators = { left = "", right = "" },
component_separators = { left = "", right = "" },
disabled_filetypes = {},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
{
"filename",
file_status = true, -- displays file status (readonly status, modified status)
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
},
},
lualine_x = {
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "", warn = "", info = "", hint = "" },
},
"encoding",
"filetype",
},
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {
{
"filename",
file_status = true, -- displays file status (readonly status, modified status)
path = 1, -- 0 = just filename, 1 = relative path, 2 = absolute path
},
},
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { "fugitive" },
})

View File

@ -0,0 +1,47 @@
-- import mason plugin safely
local mason_status, mason = pcall(require, "mason")
if not mason_status then
return
end
-- import mason-lspconfig plugin safely
local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig")
if not mason_lspconfig_status then
return
end
-- import mason-null-ls plugin safely
local mason_null_ls_status, mason_null_ls = pcall(require, "mason-null-ls")
if not mason_null_ls_status then
return
end
-- enable mason
mason.setup()
mason_lspconfig.setup({
-- list of servers for mason to install
ensure_installed = {
"lua_ls",
"tsserver",
"html",
"cssls",
"tailwindcss",
"rust_analyzer",
"pylsp",
},
-- auto-install configured servers (with lspconfig)
automatic_installation = true, -- not the same as ensure_installed
})
mason_null_ls.setup({
-- list of formatters & linters for mason to install
ensure_installed = {
"prettier", -- ts/js formatter
"stylua", -- lua formatter
"eslint_d", -- ts/js linter
"black", -- pythone formatter
},
-- auto-install configured formatters & linters (with null-ls)
automatic_installation = true,
})

View File

@ -0,0 +1,23 @@
local status, map = pcall(require, "mini.map")
if not status then
return
end
map.setup({
integrations = {
map.gen_integration.builtin_search(),
map.gen_integration.gitsigns(),
map.gen_integration.diagnostic(),
},
window = {
width = 1,
},
})
vim.keymap.set("n", "<Leader>mc", MiniMap.close)
vim.keymap.set("n", "<Leader>mf", MiniMap.toggle_focus)
vim.keymap.set("n", "<Leader>mo", MiniMap.open)
vim.keymap.set("n", "<Leader>mr", MiniMap.refresh)
vim.keymap.set("n", "<Leader>ms", MiniMap.toggle_side)
vim.keymap.set("n", "<Leader>mt", MiniMap.toggle)
-- Auto open
MiniMap.open()

View File

@ -0,0 +1,29 @@
local status, tree = pcall(require, "nvim-tree")
if not status then
return
end
local list_keys = require("xfy.maps").nvimTreeList
tree.setup({
update_focused_file = {
enable = true,
update_cwd = true,
},
view = {
side = "left",
mappings = {
-- 只用内置快捷键
custom_only = true,
list = list_keys,
},
},
actions = {
open_file = {
-- 首次打开大小适配
resize_window = true,
-- 打开文件时关闭 tree
quit_on_open = false,
},
},
})

View File

@ -0,0 +1,20 @@
local status, prettier = pcall(require, "prettier")
if (not status) then return end
prettier.setup {
bin = 'prettier',
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
}
}

View File

@ -0,0 +1,12 @@
local status, scrollbar = pcall(require, "scrollbar")
if not status then
return
end
-- local colors = require("dracula").colors()
scrollbar.setup({
handlers = {
diagnostic = true,
search = true, -- Requires hlslens to be loaded
},
})

View File

@ -0,0 +1,57 @@
local status, telescope = pcall(require, "telescope")
if not status then
return
end
local actions = require("telescope.actions")
local builtin = require("telescope.builtin")
-- local action_state = require("telescope.actions.state")
local lga_actions = require("telescope-live-grep-args.actions")
telescope.setup({
defaults = {
initial_mode = "normal",
mappings = {
n = {
["q"] = actions.close,
},
},
},
extensions = {
live_grep_args = {
auto_quoting = true, -- enable/disable auto-quoting
-- override default mappings
-- default_mappings = {},
mappings = { -- extend mappings
i = {
["<C-k>"] = lga_actions.quote_prompt(),
},
},
},
},
})
vim.keymap.set("n", "<C-p>", function()
builtin.find_files({
no_ignore = false,
hidden = true,
})
end)
vim.keymap.set("n", ";r", function()
builtin.live_grep()
end)
vim.keymap.set("n", ";;", function()
builtin.buffers()
end)
vim.keymap.set("n", ";t", function()
builtin.help_tags()
end)
vim.keymap.set("n", ";d", function()
builtin.oldfiles()
end)
-- vim.keymap.set('n', ';;', function()
-- builtin.resume()
-- end)
vim.keymap.set("n", ";e", function()
builtin.diagnostics()
end)

View File

@ -0,0 +1,98 @@
---@diagnostic disable: missing-parameter
local status, toggleterm = pcall(require, "toggleterm")
if not status then
vim.notify("没有找到 toggleterm")
return
end
toggleterm.setup({
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.3
end
end,
start_in_insert = true,
})
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({
cmd = "lazygit",
dir = "git_dir",
direction = "float",
float_opts = {
border = "double",
},
on_open = function(term)
vim.cmd("startinsert!")
-- q / <leader>tg 关闭 terminal
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "<leader>tg", "<cmd>close<CR>", { noremap = true, silent = true })
-- ESC 键取消留给lazygit
if vim.fn.mapcheck("<Esc>", "t") ~= "" then
vim.api.nvim_del_keymap("t", "<Esc>")
end
end,
on_close = function(_)
-- 添加回来
vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", {
noremap = true,
silent = true,
})
end,
})
local ta = Terminal:new({
direction = "float",
close_on_exit = true,
})
local tb = Terminal:new({
direction = "vertical",
close_on_exit = true,
})
local tc = Terminal:new({
direction = "horizontal",
close_on_exit = true,
})
local M = {}
M.toggleA = function()
if ta:is_open() then
ta:close()
return
end
tb:close()
tc:close()
ta:open()
end
M.toggleB = function()
if tb:is_open() then
tb:close()
return
end
ta:close()
tc:close()
tb:open()
end
M.toggleC = function()
if tc:is_open() then
tc:close()
return
end
ta:close()
tb:close()
tc:open()
end
M.toggleG = function()
lazygit:toggle()
end
require("xfy.maps").mapToggleTerm(M)

View File

@ -0,0 +1,60 @@
local status, ts = pcall(require, "nvim-treesitter.configs")
if not status then
return
end
ts.setup({
highlight = {
enable = true,
disable = {},
},
indent = {
enable = true,
disable = {},
},
ensure_installed = {
"tsx",
"toml",
"json",
"yaml",
"css",
"html",
"lua",
"go",
"rust",
"javascript",
"typescript",
"markdown",
"svelte",
"graphql",
"bash",
"vim",
"dockerfile",
"gitignore",
},
autotag = {
enable = true,
},
context_commentstring = {
enable = true,
},
-- p00f/nvim-ts-rainbow
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
colors = {
"#95ca60",
"#ee6985",
"#D6A760",
"#7794f4",
"#b38bf5",
"#7cc7fe",
}, -- table of hex strings
-- termcolors = { } -- table of colour name strings
},
})
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" }

View File

@ -0,0 +1,6 @@
local status, autotag = pcall(require, "nvim-ts-autotag")
if not status then
return
end
autotag.setup({})

View File

@ -0,0 +1,13 @@
local status, icons = pcall(require, "nvim-web-devicons")
if not status then
return
end
icons.setup({
-- your personnal icons can go here (to override)
-- DevIcon will be appended to `name`
override = {},
-- globally enable default icons (default to false)
-- will get overriden by `get_icons` option
default = true,
})

View File

@ -0,0 +1,4 @@
require("xfy.base")
require("xfy.plugins")
require("xfy.maps")
require("xfy.autocmds")

View File

@ -0,0 +1,37 @@
local myAutoGroup = vim.api.nvim_create_augroup("myAutoGroup", {
clear = true,
})
local autocmd = vim.api.nvim_create_autocmd
-- 修改lua/plugins.lua 自动更新插件
autocmd("BufWritePost", {
group = myAutoGroup,
-- autocmd BufWritePost plugins.lua source <afile> | PackerSync
callback = function()
if vim.fn.expand("<afile>") == "lua/plugins.lua" then
vim.api.nvim_command("source lua/plugins.lua")
vim.api.nvim_command("PackerSync")
end
end,
})
-- Highlight on yank
autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
group = myAutoGroup,
pattern = "*",
})
-- 用o换行不要延续注释
autocmd("BufEnter", {
group = myAutoGroup,
pattern = "*",
callback = function()
vim.opt.formatoptions = vim.opt.formatoptions
- "o" -- O and o, don't continue comments
+ "r" -- But do continue when pressing enter.
end,
})

View File

@ -0,0 +1,52 @@
vim.cmd("autocmd!")
local opt = vim.opt
vim.scriptencoding = "utf-8"
vim.opt.encoding = "utf-8"
vim.opt.fileencoding = "utf-8"
-- vim.wo.number = true
vim.wo.relativenumber = true
vim.wo.nu = true
vim.wo.rnu = true
opt.title = true
opt.autoindent = true
opt.expandtab = true
opt.smartindent = true
opt.hlsearch = true
opt.backup = false
opt.showcmd = true
opt.laststatus = 2
opt.backupskip = { "/tmp/*", "/private/tmp/*" }
opt.ignorecase = true -- Case insensitive searching UNLESS /C or capital in search
opt.smarttab = true
opt.breakindent = true
opt.shiftwidth = 2
opt.tabstop = 2
opt.wrap = false -- No Wrap lines
opt.backspace = { "start", "eol", "indent" }
opt.path:append({ "**" }) -- Finding files - Search down into subfolders
opt.wildignore:append({ "*/node_modules/*" })
opt.clipboard:append({ "unnamedplus" })
opt.cursorline = true
opt.termguicolors = true
opt.backspace = "indent,eol,start"
opt.iskeyword:append("-")
-- Undercurl
vim.cmd([[let &t_Cs = "\e[4:3m"]])
vim.cmd([[let &t_Ce = "\e[4:0m"]])
-- Turn off paste mode when leaving insert
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
command = "set nopaste",
})
-- Add asterisks in block comments
vim.opt.formatoptions:append({ "r" })
-- Use color theme
vim.cmd([[colorscheme dracula]])

View File

@ -0,0 +1,206 @@
vim.g.mapleader = " "
local keymap = vim.keymap
keymap.set("n", "x", '"_x')
-- $跳到行尾不带空格 (交换$ 和 g_)
keymap.set("v", "$", "g_")
keymap.set("v", "g_", "$")
keymap.set("n", "$", "g_")
keymap.set("n", "g_", "$")
-- Increment/decrement
keymap.set("n", "+", "<C-a>")
keymap.set("n", "-", "<C-x>")
-- Delete a word backwards
-- keymap.set('n', 'dw', 'vb"_d')
-- clear search highlights
keymap.set("n", "<leader>nh", ":nohl<CR>")
-- Select all
keymap.set("n", "<C-a>", "gg<S-v>G")
-- Save single file
keymap.set("n", "<C-s>", ":w<CR>")
keymap.set("n", "<leader>w", ":w<CR>")
keymap.set("n", "<leader>wq", ":wqa!<CR>")
-- Terminal相关
keymap.set("n", "st", ":sp | terminal<CR>")
keymap.set("n", "stv", ":vsp | terminal<CR>")
-- Esc 回 Normal 模式
keymap.set("t", "<Esc>", "<C-\\><C-n>")
keymap.set("t", "<A-h>", [[ <C-\><C-N><C-w>h ]])
keymap.set("t", "<A-j>", [[ <C-\><C-N><C-w>j ]])
keymap.set("t", "<A-k>", [[ <C-\><C-N><C-w>k ]])
keymap.set("t", "<A-l>", [[ <C-\><C-N><C-w>l ]])
keymap.set("t", "<leader>h", [[ <C-\><C-N><C-w>h ]])
keymap.set("t", "<leader>j", [[ <C-\><C-N><C-w>j ]])
keymap.set("t", "<leader>k", [[ <C-\><C-N><C-w>k ]])
keymap.set("t", "<leader>l", [[ <C-\><C-N><C-w>l ]])
-- Save with root permission (not working for now)
-- vim.api.nvim_create_user_command('W', 'w !sudo tee > /dev/null %', {})
-- New tab
keymap.set("n", "te", ":tabedit<Return>")
-- Split window
keymap.set("n", "ss", ":split<Return><C-w>w")
keymap.set("n", "sv", ":vsplit<Return><C-w>w")
keymap.set("n", "sw", ":bd<Return>")
keymap.set("n", "<C-w>", ":bd<Return>")
keymap.set("n", "sx", ":close<CR>") -- close current split window
-- Move window
-- keymap.set("n", "<Space>", "<C-w>w")
keymap.set("", "<leader>h", "<C-w>h")
keymap.set("", "<leader>k", "<C-w>k")
keymap.set("", "<leader>j", "<C-w>j")
keymap.set("", "<leader>l", "<C-w>l")
-- Resize window
keymap.set("n", "<C-w><left>", "<C-w><")
keymap.set("n", "<C-w><right>", "<C-w>>")
keymap.set("n", "<C-w><up>", "<C-w>+")
keymap.set("n", "<C-w><down>", "<C-w>-")
-- Virtual mode setting
keymap.set("v", "p", '"_dP')
keymap.set("v", "<", "<gv")
keymap.set("v", ">", ">gv")
-- plugin keymaps
-- vim-miximzer
keymap.set("n", "<leader>sm", ":MaximizerToggle<CR>")
-- File manager
keymap.set("n", "<leader>e", ":NvimTreeToggle<Return>")
-- Comment
-- keymap.set('n', '<C-/>', ':gcc<CR>')
-- Motion
keymap.set(
"",
"f",
"<cmd>lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })<cr>",
{}
)
keymap.set(
"",
"F",
"<cmd>lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })<cr>",
{}
)
keymap.set("", "<leader><leader>", ":HopWord<Return>")
-- telescope git commands
keymap.set("n", "<leader>gc", "<cmd>Telescope git_commits<cr>") -- list all git commits (use <cr> to checkout) ["gc" for git commits]
keymap.set("n", "<leader>gfc", "<cmd>Telescope git_bcommits<cr>") -- list git commits for current file/buffer (use <cr> to checkout) ["gfc" for git file commits]
keymap.set("n", "<leader>gb", "<cmd>Telescope git_branches<cr>") -- list git branches (use <cr> to checkout) ["gb" for git branch]
keymap.set("n", "<leader>gs", "<cmd>Telescope git_status<cr>") -- list current changes per file with diff preview ["gs" for git status]
-- Select current world
keymap.set("n", "gb", "viw")
-- Comment
keymap.set("", "<C-/>", ":Comment<Return>")
local pluginKeys = {}
-- 列表快捷键
pluginKeys.nvimTreeList = { -- 打开文件或文件夹
{ key = { "o", "<2-LeftMouse>" }, action = "system_open" },
{ key = "<CR>", action = "edit" },
-- v分屏打开文件
{ key = "v", action = "vsplit" },
-- h分屏打开文件
{ key = "h", action = "split" },
-- Ignore (node_modules)
{ key = "i", action = "toggle_ignored" },
-- Hide (dotfiles)
{ key = ".", action = "toggle_dotfiles" },
{ key = "R", action = "refresh" },
-- 文件操作
{ key = "a", action = "create" },
{ key = "d", action = "remove" },
{ key = "r", action = "rename" },
{ key = "x", action = "cut" },
{ key = "c", action = "copy" },
{ key = "p", action = "paste" },
{ key = "y", action = "copy_name" },
{ key = "Y", action = "copy_path" },
{ key = "gy", action = "copy_absolute_path" },
{ key = "I", action = "toggle_file_info" },
{ key = "n", action = "tabnew" },
-- 进入下一级
{ key = { "]" }, action = "cd" },
-- 进入上一级
{ key = { "[" }, action = "dir_up" },
}
-- 自定义 toggleterm 3个不同类型的命令行窗口
-- <leader>ta 浮动
-- <leader>tb 右侧
-- <leader>tc 下方
-- 特殊lazygit 窗口需要安装lazygit
-- <leader>tg lazygit
pluginKeys.mapToggleTerm = function(toggleterm)
vim.keymap.set({ "n", "t" }, "<leader>ta", toggleterm.toggleA)
vim.keymap.set({ "n", "t" }, "<leader>tb", toggleterm.toggleB)
vim.keymap.set({ "n", "t" }, "<leader>tc", toggleterm.toggleC)
vim.keymap.set({ "n", "t" }, "<leader>tg", toggleterm.toggleG)
end
-- gitsigns
pluginKeys.gitsigns_on_attach = function(bufnr)
local gs = package.loaded.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", "<leader>gj", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
map("n", "<leader>gk", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
-- map({ "n", "v" }, "<leader>gs", ":Gitsigns stage_hunk<CR>")
-- map("n", "<leader>gS", gs.stage_buffer)
-- map("n", "<leader>gu", gs.undo_stage_hunk)
-- map({ "n", "v" }, "<leader>gr", ":Gitsigns reset_hunk<CR>")
map("n", "<leader>gR", gs.reset_buffer)
map("n", "<leader>gp", gs.preview_hunk)
map("n", "<leader>gb", function()
gs.blame_line({ full = true })
end)
map("n", "<leader>gd", gs.diffthis)
map("n", "<leader>gD", function()
gs.diffthis("~")
end)
-- toggle
map("n", "<leader>gtd", gs.toggle_deleted)
map("n", "<leader>gtb", gs.toggle_current_line_blame)
-- Text object
map({ "o", "x" }, "ig", ":<C-U>Gitsigns select_hunk<CR>")
end
return pluginKeys

View File

@ -0,0 +1,167 @@
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
vim.cmd([[packadd packer.nvim]])
return true
end
return false
end
local packer_bootstrap = ensure_packer()
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
augroup end
]])
local status, packer = pcall(require, "packer")
if not status then
return
end
return packer.startup({
function(use)
use("wbthomason/packer.nvim")
-- UIs
use("Mofiqul/dracula.nvim") -- Color scheme
use("nvim-lualine/lualine.nvim") -- Statusline
use("nvim-lua/plenary.nvim") -- Common utilities
use("akinsho/nvim-bufferline.lua")
use("petertriho/nvim-scrollbar")
use({
"kevinhwang91/nvim-hlslens",
config = function()
-- require('hlslens').setup() is not required
require("scrollbar.handlers.search").setup({
-- hlslens config overrides
})
end,
})
-- terminal & window
use("szw/vim-maximizer") -- maximizs and restore current window
use({ "akinsho/toggleterm.nvim" })
-- surround
use({
"ur4ltz/surround.nvim",
config = function()
require("surround").setup({ mappings_style = "surround" })
end,
})
-- autocompletion
use("hrsh7th/nvim-cmp") -- Completion
use("hrsh7th/cmp-vsnip")
use("hrsh7th/cmp-path") -- { name = 'path' }
use("hrsh7th/cmp-cmdline") -- { name = 'cmdline' }
use("hrsh7th/cmp-nvim-lsp-signature-help") -- { name = 'nvim_lsp_signature_help' }
use("hrsh7th/cmp-buffer") -- nvim-cmp source for buffer words
use("hrsh7th/cmp-nvim-lsp") -- nvim-cmp source for neovim's built-in LSP
-- snippets
use("L3MON4D3/LuaSnip") -- snippet engine
use("saadparwaiz1/cmp_luasnip") -- for autocompletion
use("rafamadriz/friendly-snippets")
-- LSPs
use("neovim/nvim-lspconfig") -- LSP
use("onsails/lspkind-nvim") -- vscode-like pictograms
use({ "glepnir/lspsaga.nvim", branch = "main" }) -- enhanced lsp uis
use("jose-elias-alvarez/typescript.nvim") -- additional functionality for typescript server (e.g. rename file & update imports)
use("simrat39/rust-tools.nvim") -- rust
-- formatting & linting
use("jose-elias-alvarez/null-ls.nvim") -- Use Neovim as a language server to inject LSP diagnos
use("jayp0521/mason-null-ls.nvim") -- bridges gap b/w mason & null-ls
use("gpanders/editorconfig.nvim") -- editor config
-- managing & installing lsp servers, linters & formatters
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
-- treesitter configuration
use({
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
-- run = function()
-- require("nvim-treesitter.install").update({ with_sync = true })
-- end,
})
use("kyazdani42/nvim-web-devicons") -- File icons
use({
"nvim-telescope/telescope.nvim",
requires = {
{ "nvim-telescope/telescope-live-grep-args.nvim" },
},
})
use("windwp/nvim-autopairs")
use("windwp/nvim-ts-autotag")
use("norcalli/nvim-colorizer.lua")
-- git intergation
use("lewis6991/gitsigns.nvim")
-- File explorer
use({
"kyazdani42/nvim-tree.lua",
requires = {
"kyzadani42/nvim-web-devicons",
},
tag = "nightly",
})
-- Motion
use({
"phaazon/hop.nvim",
branch = "v2", -- optional but strongly recommended
config = function()
-- you can configure Hop the way you like here; see :h hop-config
require("hop").setup({ keys = "etovxqpdygfblzhckisuran" })
end,
})
use({ "glepnir/dashboard-nvim" })
-- multi cursor
use("mg979/vim-visual-multi")
-- Comment
use("terrortylor/nvim-comment")
use("JoosepAlviste/nvim-ts-context-commentstring")
-- MDX
use("jxnblk/vim-mdx-js")
if packer_bootstrap then
require("packer").sync()
end
end,
config = {
-- 锁定插件版本在snapshots目录
-- snapshot_path = require("packer.util").join_paths(vim.fn.stdpath("config"), "snapshots"),
-- 这里锁定插件版本在v1不会继续更新插件
-- snapshot = "v1",
-- 最大并发数
max_jobs = 16,
-- 自定义源
git = {
-- default_url_format = "https://hub.fastgit.xyz/%s",
-- default_url_format = "https://mirror.ghproxy.com/https://github.com/%s",
-- default_url_format = "https://gitcode.net/mirrors/%s",
-- default_url_format = "https://gitclone.com/github.com/%s",
},
-- display = {
-- 使用浮动窗口显示
-- open_fn = function()
-- return require("packer.util").float({ border = "single" })
-- end,
-- },
},
})

View File

@ -0,0 +1,223 @@
-- vim.lsp.set_log_level("debug")
local status, nvim_lsp = pcall(require, "lspconfig")
if not status then
return
end
-- import cmp-nvim-lsp plugin safely
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not cmp_nvim_lsp_status then
return
end
-- import typescript plugin safely
local typescript_setup, typescript = pcall(require, "typescript")
if not typescript_setup then
return
end
local rust_status, rust = pcall(require, "rust-tools")
if not rust_status then
return
end
local protocol = require("vim.lsp.protocol")
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...)
vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
--Enable completion triggered by <c-x><c-o>
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings.
local opts = { noremap = true, silent = true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
--buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
--buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
end
protocol.CompletionItemKind = {
"", -- Text
"", -- Method
"", -- Function
"", -- Constructor
"", -- Field
"", -- Variable
"", -- Class
"", -- Interface
"", -- Module
"", -- Property
"", -- Unit
"", -- Value
"", -- Enum
"", -- Keyword
"", -- Snippet
"", -- Color
"", -- File
"", -- Reference
"", -- Folder
"", -- EnumMember
"", -- Constant
"", -- Struct
"", -- Event
"", -- Operator
"", -- TypeParameter
}
-- used to enable autocompletion (assign to every lsp server config)
local capabilities = cmp_nvim_lsp.default_capabilities()
nvim_lsp.flow.setup({
on_attach = on_attach,
capabilities = capabilities,
})
-- organize imports
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
title = "",
}
vim.lsp.buf.execute_command(params)
end
vim.keymap.set("n", "<S-A-o>", organize_imports)
-- nvim_lsp.tsserver.setup({
-- on_attach = on_attach,
-- capabilities = capabilities,
-- commands = {
-- OrganizeImports = {
-- organize_imports,
-- description = "Organize Imports",
-- },
-- },
-- })
nvim_lsp.sourcekit.setup({
on_attach = on_attach,
})
nvim_lsp.lua_ls.setup({
on_attach = on_attach,
settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
},
},
})
-- configure html server
nvim_lsp["html"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- configure typescript server with plugin
typescript.setup({
server = {
capabilities = capabilities,
on_attach = on_attach,
root_dir = nvim_lsp.util.root_pattern("package.json"),
},
})
-- Deno
nvim_lsp.denols.setup({
capabilities = capabilities,
on_attach = on_attach,
root_dir = nvim_lsp.util.root_pattern("deno.json", "deno.jsonc"),
})
-- configure css server
nvim_lsp["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- tailwindcss
nvim_lsp.tailwindcss.setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- python
nvim_lsp.pylsp.setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- nvim_lsp.rust_analyzer.setup({
-- capabilities = capabilities,
-- on_attach = on_attach,
-- })
-- rust
rust.setup({
server = {
capabilities = capabilities,
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
checkOnSave = {
allFeatures = true,
command = "clippy",
},
procMacro = {
ignored = {
-- ["async-trait"] = { "async_trait" },
-- ["napi-derive"] = { "napi" },
-- ["async-recursion"] = { "async_recursion" },
},
},
},
},
},
})
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
})
-- Diagnostic symbols in the sign column (gutter)
-- local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
-- for type, icon in pairs(signs) do
-- local hl = "DiagnosticSign" .. type
-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
-- end
vim.diagnostic.config({
virtual_text = {
prefix = "",
},
update_in_insert = true,
float = {
source = "always", -- Or "if_many"
},
})

View File

@ -0,0 +1,19 @@
local status, saga = pcall(require, "lspsaga")
if not status then
return
end
-- saga.init_lsp_saga({
-- server_filetype_map = {
-- typescript = "typescript",
-- },
-- })
local opts = { noremap = true, silent = true }
vim.keymap.set("n", "<C-j>", "<Cmd>Lspsaga diagnostic_jump_next<CR>", opts)
vim.keymap.set("n", "<C-k>", "<Cmd>Lspsaga diagnostic_jump_prev<CR>", opts)
vim.keymap.set("n", "gh", "<Cmd>Lspsaga hover_doc<CR>", opts)
vim.keymap.set("n", "gd", "<Cmd>Lspsaga lsp_finder<CR>", opts)
vim.keymap.set("n", "gp", "<Cmd>Lspsaga peek_definition<CR>", opts)
vim.keymap.set("n", "<leader>r", "<Cmd>Lspsaga rename<CR>", opts)
vim.keymap.set("n", "<C-.>", "<cmd>Lspsaga code_action<CR>", opts)

View File

@ -0,0 +1,81 @@
-- import null-ls plugin safely
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end
-- for conciseness
local formatting = null_ls.builtins.formatting -- to setup formatters
local diagnostics = null_ls.builtins.diagnostics -- to setup linters
local code_actions = null_ls.builtins.code_actions
-- to setup format on save
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
-- configure null_ls
null_ls.setup({
log = {
level = "info",
},
-- setup formatters & linters
sources = {
-- to disable file types use
-- "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
formatting.prettierd.with({
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"css",
"scss",
"less",
"html",
"json",
"jsonc",
"yaml",
"markdown",
"markdown.mdx",
"graphql",
},
}), -- js/ts formatter
formatting.stylua, -- lua formatter
formatting.rustfmt, -- rust formatter
diagnostics.eslint_d.with({ -- js/ts linter
-- only enable eslint if root has .eslintrc.js
condition = function(utils)
return utils.root_has_file(".eslintrc.js") -- change file extension if you use something else
end,
}),
-- diagnostics.eslint.with({
-- prefer_local = "node_modules/.bin",
-- }),
formatting.black.with({ extra_args = { "--fast" } }), -- python pip install black
-- Diagnostics ---------------------
-- code actions ---------------------
-- code_actions.gitsigns,
code_actions.eslint_d.with({
prefer_local = "node_modules/.bin",
}),
},
-- configure format on save
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
-- only use null-ls for formatting instead of lsp server
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})

View File

@ -0,0 +1,54 @@
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log($1)",
],
"description": "Log output to console"
},
"IIFE": {
"prefix": "iife",
"body": [
"(() => {",
" $1",
"})();"
],
"description": "Immediately Invoked Function Expression"
},
"CAF": {
"prefix": "caf",
"body": [
"const ${1:name} = () => {",
" ",
"}"
],
"description": "const arrow function"
},
"CAFA": {
"prefix": "cafa",
"body": [
"const ${1:name} = async () => {",
" ",
"}"
],
"description": "const arrow async function"
},
"CAFT": {
"prefix": "caft",
"body": [
"type ${1:name} = {",
" ",
"};",
"",
"const ${1:name} = (state: State): ${1:name} => {",
" ",
"}"
],
"description": "const arrow function with type"
},
}

View File

@ -0,0 +1,68 @@
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"console.log($1)",
],
"description": "Log output to console"
},
"IIFE": {
"prefix": "iife",
"body": [
"(() => {",
" $1",
"})();"
],
"description": "Immediately Invoked Function Expression"
},
"CAF": {
"prefix": "caf",
"body": [
"const ${1:name} = () => {",
" ",
"}"
],
"description": "const arrow function"
},
"CAFA": {
"prefix": "cafa",
"body": [
"const ${1:name} = async () => {",
" ",
"}"
],
"description": "const arrow async function"
},
"CAFT": {
"prefix": "caft",
"body": [
"type ${1:name} = {",
" ",
"};",
"",
"const ${1:name} = (state: State): ${1:name} => {",
" ",
"}"
],
"description": "const arrow function with type"
},
"RAFCE":{
"prefix": "rafce",
"body":[
"import React from 'react';",
"",
"const $TM_FILENAME_BASE: React.FC = () => {",
" return <></>;",
"};",
"",
"export default $TM_FILENAME_BASE;",
""
],
"description": "React function component"
}
}

View File

@ -0,0 +1,12 @@
{
"example1": {
"prefix": "options",
"body": [
"whoa! :O"
],
"luasnip": {
"priority": 2000,
"autotrigger": true
}
}
}

View File

@ -0,0 +1,45 @@
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": ["console.log($1)"],
"description": "Log output to console"
},
"IIFE": {
"prefix": "iife",
"body": ["(() => {", " $1", "})();"],
"description": "Immediately Invoked Function Expression"
},
"CAF": {
"prefix": "caf",
"body": ["const ${1:name} = () => {", " ", "}"],
"description": "const arrow function"
},
"CAFA": {
"prefix": "cafa",
"body": ["const ${1:name} = async () => {", " ", "}"],
"description": "const arrow async function"
},
"CAFT": {
"prefix": "caft",
"body": [
"type ${1:name} = {",
" ",
"};",
"",
"const ${1:name} = (state: State): ${1:name} => {",
" ",
"}"
],
"description": "const arrow function with type"
},
"SDD": {
"prefix": "sdd",
"body": ["export const ${1:name} = styled.div``"],
"description": "Import styled-components from current folder."
}
}

View File

@ -0,0 +1,67 @@
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": ["console.log($1)"],
"description": "Log output to console"
},
"IIFE": {
"prefix": "iife",
"body": ["(() => {", " $1", "})();"],
"description": "Immediately Invoked Function Expression"
},
"CAF": {
"prefix": "caf",
"body": ["const ${1:name} = () => {", " ", "}"],
"description": "const arrow function"
},
"CAFA": {
"prefix": "cafa",
"body": ["const ${1:name} = async () => {", " ", "}"],
"description": "const arrow async function"
},
"CAFT": {
"prefix": "caft",
"body": [
"type ${1:name} = {",
" ",
"};",
"",
"const ${1:name} = (state: State): ${1:name} => {",
" ",
"}"
],
"description": "const arrow function with type"
},
"RAFCE": {
"prefix": "rafce",
"body": [
"const $TM_FILENAME_BASE = () => {",
" return <></>;",
"};",
"",
"export default $TM_FILENAME_BASE;",
""
],
"description": "React function component"
},
"IMS": {
"prefix": "ims",
"body": ["import styles from './$TM_FILENAME_BASE.module.less'"],
"description": "Import less module css from current folder."
},
"RLZ": {
"prefix": "rlz",
"body": ["const ${1:name} = lazy(() => import('./${1:name}'));"],
"description": "React lazy import component."
},
"ISD": {
"prefix": "isd",
"body": ["import * as S from './$TM_FILENAME_BASE.styles'"],
"description": "Import styled-components from current folder."
}
}

View File

@ -0,0 +1,74 @@
{
// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Vue3 Template": {
"prefix": "v3",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script>",
"export default {",
" name: '$TM_FILENAME_BASE',",
" setup() {",
"",
" }",
"}",
"</script>",
"",
"<style scoped lang=\"scss\">",
"",
"</style>",
],
"description": "Vue3 Template"
},
"Vue3 TypeScript Template": {
"prefix": "v3t",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script lang=\"ts\">",
"import { defineComponent } from 'vue';",
"",
"export default defineComponent({",
" name: '$TM_FILENAME_BASE',",
" setup() {",
"",
" }",
"})",
"</script>",
"",
"<style scoped lang=\"scss\">",
"",
"</style>",
],
"description": "Vue3 Template"
},
"Vue3 TypeScript Setup Template": {
"prefix": "v3s",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script lang=\"ts\" setup></script>",
"",
"<style scoped lang=\"scss\"></style>",
],
"description": "Vue3 Template"
}
}

8
.config/nvim/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

View File

@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

201
.config/nvim/LICENSE Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4
.config/nvim/README.md Normal file
View File

@ -0,0 +1,4 @@
# 💤 LazyVim
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.

2
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,2 @@
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View File

@ -0,0 +1,63 @@
{
"LazyVim": { "branch": "main", "commit": "7a8ca6222a554bdb78fb8de35404672fc4042302" },
"LuaSnip": { "branch": "master", "commit": "a835e3d680c5940b61780c6af07885db95382478" },
"SchemaStore.nvim": { "branch": "main", "commit": "ac100fa691b10dd990ca0cdc31ebd054a5959b58" },
"alpha-nvim": { "branch": "main", "commit": "3847d6baf74da61e57a13e071d8ca185f104dc96" },
"bufferline.nvim": { "branch": "main", "commit": "3677aceb9a72630b0613e56516c8f7151b86f95c" },
"catppuccin": { "branch": "main", "commit": "128af65c3a23c94b324dc8d7f02a34feee8722d4" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" },
"friendly-snippets": { "branch": "main", "commit": "25ddcd96540a2ce41d714bd7fea2e7f75fea8ead" },
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
"hop.nvim": { "branch": "v2", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" },
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
"lazy.nvim": { "branch": "main", "commit": "fdb41229ca39cf2795cbf4e6d04a52b73e6225f5" },
"leap.nvim": { "branch": "main", "commit": "f74473d23ebf60957e0db3ff8172349a82e5a442" },
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "2b811031febe5f743e07305738181ff367e1e452" },
"mason.nvim": { "branch": "main", "commit": "9992c66c2a832a17302ca3179a82516544565f9b" },
"mini.ai": { "branch": "main", "commit": "d5a9f6b50fc6285fb876667e67394bbee2d5c70c" },
"mini.animate": { "branch": "main", "commit": "3ef586e8c6a4034e3d7e803bf29e296025ecdd38" },
"mini.bufremove": { "branch": "main", "commit": "68f9111aa81545022bb5afe7d576311a0fc29969" },
"mini.comment": { "branch": "main", "commit": "f045998636c6fd746297220b8c692bf1e91568cb" },
"mini.indentscope": { "branch": "main", "commit": "43f6761c9a3e397b7c12b3c72f678bcf61efcfcf" },
"mini.pairs": { "branch": "main", "commit": "771c08bd313614c7e9a1904d277ac76eb226f674" },
"mini.surround": { "branch": "main", "commit": "b450a3aff91b4108c0e9ba9e82633d65deb5802b" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "20c2f2f5ba083bbb1e37b8bc3d590621434f31e9" },
"neoconf.nvim": { "branch": "main", "commit": "8348a85bb577f1b4aec2fc9137659558ca4a8284" },
"neodev.nvim": { "branch": "main", "commit": "522cb5750ad0c67e023a6801b2c9f717374aa9e8" },
"noice.nvim": { "branch": "main", "commit": "92b058ad183fccd3b970f03ae49094596a6c735b" },
"nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" },
"null-ls.nvim": { "branch": "main", "commit": "456a983ce9843123e51b955f50925077ca7207d5" },
"nvim-autopairs": { "branch": "master", "commit": "e755f366721bc9e189ddecd39554559045ac0a18" },
"nvim-cmp": { "branch": "main", "commit": "777450fd0ae289463a14481673e26246b5e38bf2" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-hlslens": { "branch": "main", "commit": "5e3e9088fba7508cee3612ee50b14dfdd3ab19af" },
"nvim-lspconfig": { "branch": "master", "commit": "5a871409199d585b52b69952532e3fb435e64566" },
"nvim-navic": { "branch": "master", "commit": "cdd24539bcf114a499827e9b32869fe74836efe7" },
"nvim-notify": { "branch": "master", "commit": "02047199e2752223c77c624160f720ca227944a9" },
"nvim-scrollbar": { "branch": "main", "commit": "f85b29805cf917f9b1d5ff0c9a52c5b1bdca5943" },
"nvim-spectre": { "branch": "master", "commit": "201ccd1f6ce98a4e509359c8994e111a52a02515" },
"nvim-treesitter": { "branch": "master", "commit": "4536156f32b8ab0aab264e3cd7819fc8e3daede4" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "582cbb5a4cb50f6161cac8cc01f55aeaff6d836a" },
"nvim-ts-autotag": { "branch": "main", "commit": "25698e4033cd6cd3745454bfc837dd670eba0480" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "729d83ecb990dc2b30272833c213cc6d49ed5214" },
"nvim-web-devicons": { "branch": "master", "commit": "585dbc29315ca60be67d18ae6175771c3fb6791e" },
"persistence.nvim": { "branch": "main", "commit": "c814fae5c37aa0aba9cd9da05df6e52b88d612c3" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },
"telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" },
"todo-comments.nvim": { "branch": "main", "commit": "14e2cd9a6e5e67483a03660f08471ca9a981c4a5" },
"tokyonight.nvim": { "branch": "main", "commit": "edffa82026914be54c8220973b0385f61d3392f0" },
"trouble.nvim": { "branch": "main", "commit": "7915277a259fdff5d46c6f1d2e100df2ec384d3b" },
"typescript.nvim": { "branch": "main", "commit": "f66d4472606cb24615dfb7dbc6557e779d177624" },
"vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" },
"vim-mdx-js": { "branch": "master", "commit": "17179d7f2a73172af5f9a8d65b01a3acf12ddd50" },
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
"vim-startuptime": { "branch": "master", "commit": "6580cf539c33a212f4f5542068a3b4dd2b3ad834" },
"vim-visual-multi": { "branch": "master", "commit": "724bd53adfbaf32e129b001658b45d4c5c29ca1a" },
"which-key.nvim": { "branch": "main", "commit": "d1afcd48f309af58fdb43adc4581bf4b5684768b" }
}

View File

@ -0,0 +1,20 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
local myAutoGroup = vim.api.nvim_create_augroup("myAutoGroup", {
clear = true,
})
local autocmd = vim.api.nvim_create_autocmd
---- 用o换行不要延续注释
autocmd("BufEnter", {
group = myAutoGroup,
pattern = "*",
callback = function()
vim.opt.formatoptions = vim.opt.formatoptions
- "o" -- O and o, don't continue comments
+ "r" -- But do continue when pressing enter.
end,
})

View File

@ -0,0 +1,37 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local keymap = vim.keymap
local opts = { noremap = true, silent = true }
keymap.set("n", "x", '"_x')
-- $跳到行尾不带空格 (交换$ 和 g_)
keymap.set("v", "$", "g_")
-- keymap.set("v", "g_", "$")
keymap.set("n", "$", "g_")
-- keymap.set("n", "g_", "$")
-- clear search highlights
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "clear highlights" })
-- Select all
keymap.set("n", "<C-a>", "gg<S-v>G")
-- Move window
-- keymap.set("", "<leader>h", "<C-w>h")
-- keymap.set("", "<leader>k", "<C-w>k")
-- keymap.set("", "<leader>j", "<C-w>j")
-- keymap.set("", "<leader>l", "<C-w>l")
-- Select current world
keymap.set("n", "gb", "viw")
-- LSP
-- keymap.set("n", "<C-j>", "<Cmd>Lspsaga diagnostic_jump_next<CR>", opts)
-- keymap.set("n", "<C-k>", "<Cmd>Lspsaga diagnostic_jump_prev<CR>", opts)
-- keymap.set("n", "gp", "<Cmd>Lspsaga peek_definition<CR>", opts)
-- keymap.set("n", "<C-.>", "<cmd>Lspsaga code_action<CR>", opts)
-- Comment
-- keymap.set("", "<C-/>", "gcc")

View File

@ -0,0 +1,46 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@ -0,0 +1,7 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local opt = vim.opt
opt.iskeyword:append("-")

View File

@ -0,0 +1,24 @@
return {
"goolord/alpha-nvim",
opts = function(_, opts)
local dashboard = require("alpha.themes.dashboard")
local logo = [[
⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷
⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇
⡆⣿⣿⣦⠹⣳⣳⣕⢅⠈⢗⢕⢕⢕⢕⢕⢈⢆⠟⠋⠉⠁⠉⠉⠁⠈⠼⢐⢕⢽
⡗⢰⣶⣶⣦⣝⢝⢕⢕⠅⡆⢕⢕⢕⢕⢕⣴⠏⣠⡶⠛⡉⡉⡛⢶⣦⡀⠐⣕⢕
⡝⡄⢻⢟⣿⣿⣷⣕⣕⣅⣿⣔⣕⣵⣵⣿⣿⢠⣿⢠⣮⡈⣌⠨⠅⠹⣷⡀⢱⢕
⡝⡵⠟⠈⢀⣀⣀⡀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣼⣿⢈⡋⠴⢿⡟⣡⡇⣿⡇⡀⢕
⡝⠁⣠⣾⠟⡉⡉⡉⠻⣦⣻⣿⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣦⣥⣿⡇⡿⣰⢗⢄
⠁⢰⣿⡏⣴⣌⠈⣌⠡⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣬⣉⣉⣁⣄⢖⢕⢕⢕
⡀⢻⣿⡇⢙⠁⠴⢿⡟⣡⡆⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣵⣵⣿
⡻⣄⣻⣿⣌⠘⢿⣷⣥⣿⠇⣿⣿⣿⣿⣿⣿⠛⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣷⢄⠻⣿⣟⠿⠦⠍⠉⣡⣾⣿⣿⣿⣿⣿⣿⢸⣿⣦⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟
⡕⡑⣑⣈⣻⢗⢟⢞⢝⣻⣿⣿⣿⣿⣿⣿⣿⠸⣿⠿⠃⣿⣿⣿⣿⣿⣿⡿⠁⣠
⡝⡵⡈⢟⢕⢕⢕⢕⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⠿⠋⣀⣈⠙
⡝⡵⡕⡀⠑⠳⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⡠⡲⡫⡪⡪⡣
]]
dashboard.section.header.val = vim.split(logo, "\n")
end,
}

View File

@ -0,0 +1,15 @@
return {
{
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup({})
end,
},
{
"windwp/nvim-ts-autotag",
config = function()
require("nvim-ts-autotag").setup({})
end,
},
}

View File

@ -0,0 +1,6 @@
return {
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup({})
end,
}

View File

@ -0,0 +1,9 @@
return {
-- {
-- "terrortylor/nvim-comment",
-- config = function()
-- local comment = require("nvim_comment")
-- comment.setup({})
-- end,
-- },
}

View File

@ -0,0 +1,10 @@
return {
{
"ggandor/flit.nvim",
enabled = false,
},
-- {
-- "folke/tokyonight.nvim",
-- enabled = false,
-- },
}

View File

@ -0,0 +1,12 @@
return {
-- add dracula
-- { "Mofiqul/dracula.nvim" },
-- Configure LazyVim to load dracula
-- {
-- "LazyVim/LazyVim",
-- opts = {
-- colorscheme = "dracula",
-- },
-- },
}

View File

@ -0,0 +1,267 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under config.plugins will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- add symbols-outline
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add telescope-fzf-native
{
"telescope.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
config = function()
require("telescope").load_extension("fzf")
end,
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"help",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, "😄")
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
-- Use <tab> for completion and snippets (supertab)
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
-- then: setup supertab in cmp
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@ -0,0 +1,25 @@
return {
"phaazon/hop.nvim",
branch = "v2", -- optional but strongly recommended
config = function()
-- you can configure Hop the way you like here; see :h hop-config
local hop = require("hop")
hop.setup({ keys = "etovxqpdygfblzhckisuran" })
local directions = require("hop.hint").HintDirection
vim.keymap.set("", "f", function()
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
end, { remap = true })
vim.keymap.set("", "F", function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
end, { remap = true })
vim.keymap.set("", "t", function()
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
end, { remap = true })
vim.keymap.set("", "T", function()
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
end, { remap = true })
vim.keymap.set("", "<leader><leader>", function()
hop.hint_words()
end, { remap = true, desc = "Hop" })
end,
}

View File

@ -0,0 +1,117 @@
return {
-- {
-- "glepnir/lspsaga.nvim",
-- branch = "main",
-- config = function()
-- require("lspsaga").setup({})
-- end,
-- requires = {
-- { "nvim-tree/nvim-web-devicons" },
-- --Please make sure you install markdown and markdown_inline parser
-- { "nvim-treesitter/nvim-treesitter" },
-- },
-- },
-- LSP keymaps
{
"neovim/nvim-lspconfig",
init = function()
local diagnostic_goto = require("lazyvim.plugins.lsp.keymaps").diagnostic_goto
local keys = require("lazyvim.plugins.lsp.keymaps").get()
-- change a keymap
keys[#keys + 1] = { "<C-j>", diagnostic_goto(true), desc = "Next Diagnostic" }
keys[#keys + 1] = { "<C-k>", diagnostic_goto(false), desc = "Prev Diagnostic" }
keys[#keys + 1] =
{ "<C-.>", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }
keys[#keys + 1] = { "gh", vim.lsp.buf.hover, desc = "Hover" }
-- disable a keymap
keys[#keys + 1] = { "]d", false }
keys[#keys + 1] = { "[d", false }
keys[#keys + 1] = { "K", false }
-- add a keymap
-- keys[#keys + 1] = { "H", "<cmd>echo 'hello'<cr>" }
end,
opts = {
servers = { eslint = {} },
setup = {
eslint = function()
require("lazyvim.util").on_attach(function(client)
if client.name == "eslint" then
client.server_capabilities.documentFormattingProvider = true
elseif client.name == "tsserver" then
client.server_capabilities.documentFormattingProvider = false
end
end)
end,
},
},
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua", -- lua lsp
"shellcheck",
"shfmt", -- shell formatter
"flake8", -- python lsp
"rustfmt",
"rust-analyzer",
"tailwindcss-language-server",
"python-lsp-server",
"css-lsp",
"vue-language-server",
},
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"css",
"html",
"javascript",
"json",
"lua",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
"jsdoc",
"toml",
},
},
config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
-- Use the local version of a parser if available, otherwise download the
-- remote version.
local function local_parser(parser, base_url)
local dir = vim.fn.expand("~/dev/" .. parser)
if vim.fn.isdirectory(dir) == 1 then
return dir
end
return base_url .. parser
end
parser_config.styled = {
install_info = {
url = local_parser("tree-sitter-styled", "https://github.com/mskelton/"),
branch = "main",
files = { "src/parser.c", "src/scanner.c" },
generate_requires_npm = true,
},
maintainers = { "@mskelton" },
}
require("nvim-treesitter.configs").setup(opts)
end,
},
}

View File

@ -0,0 +1,14 @@
return {
{
"glepnir/lspsaga.nvim",
branch = "main",
config = function()
require("lspsaga").setup({})
end,
requires = {
{ "nvim-tree/nvim-web-devicons" },
--Please make sure you install markdown and markdown_inline parser
{ "nvim-treesitter/nvim-treesitter" },
},
},
}

View File

@ -0,0 +1,16 @@
return {
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
"rustfmt",
"rust-analyzer",
"tailwindcss-language-server",
"python-lsp-server",
"css-lsp",
},
},
}

View File

@ -0,0 +1,3 @@
return {
"mg979/vim-visual-multi",
}

View File

@ -0,0 +1,59 @@
return {
{
"jose-elias-alvarez/null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "mason.nvim" },
opts = function()
local nls = require("null-ls")
-- for conciseness
local formatting = nls.builtins.formatting -- to setup formatters
local diagnostics = nls.builtins.diagnostics -- to setup linters
local code_actions = nls.builtins.code_actions
return {
sources = {
-- formator
-- formatting.prettierd,
formatting.stylua,
formatting.rustfmt, -- rust formatter
formatting.black,
formatting.prettier.with({
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"css",
"scss",
"less",
"html",
"json",
"jsonc",
"yaml",
"markdown",
"markdown.mdx",
"graphql",
},
-- npm i -g @prettier/plugin-xml prettier-plugin-toml typescript-styled-plugin
extra_filetypes = {
"toml",
"svg",
},
}), -- js/ts formatter
-- diagnostics
diagnostics.flake8,
-- diagnostics.eslint_d.with({ -- js/ts linter
-- -- only enable eslint if root has .eslintrc.js
-- condition = function(utils)
-- return utils.root_has_file(".eslintrc.js") -- change file extension if you use something else
-- end,
-- }),
code_actions.eslint_d.with({
prefer_local = "node_modules/.bin",
}),
},
}
end,
},
}

View File

@ -0,0 +1,4 @@
return {
"mg979/vim-visual-multi",
"jxnblk/vim-mdx-js",
}

View File

@ -0,0 +1,7 @@
return {
"simrat39/rust-tools.nvim",
config = function()
local rt = require("rust-tools")
rt.setup({})
end,
}

View File

@ -0,0 +1,23 @@
return {
{
"petertriho/nvim-scrollbar",
config = function()
require("scrollbar").setup({
handlers = {
diagnostic = true,
search = true, -- Requires hlslens to be loaded
},
})
end,
},
{
"kevinhwang91/nvim-hlslens",
config = function()
-- require('hlslens').setup() is not required
require("scrollbar.handlers.search").setup({
-- hlslens config overrides
})
end,
},
}

View File

@ -0,0 +1,17 @@
return {
"nvim-telescope/telescope.nvim",
keys = {
-- disable the keymap to grep files
{ "<leader><space>", false },
-- change a keymap
-- { "<leader>ff", "Telescope find_files", desc = "Find Files" },
-- add a keymap to browse plugin files
{
"<leader>fp",
function()
require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root })
end,
desc = "Find Plugin File",
},
},
}

View File

@ -0,0 +1,140 @@
return {
{
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup({})
end,
},
-- {
-- add dracula
-- { "Mofiqul/dracula.nvim" },
-- Configure LazyVim to load dracula
-- {
-- "LazyVim/LazyVim",
-- opts = {
-- colorscheme = "dracula",
-- },
-- },
-- },
{
"petertriho/nvim-scrollbar",
config = function()
require("scrollbar").setup({
handlers = {
diagnostic = true,
search = true, -- Requires hlslens to be loaded
},
})
end,
},
{
"kevinhwang91/nvim-hlslens",
config = function()
-- require('hlslens').setup() is not required
require("scrollbar.handlers.search").setup({
-- hlslens config overrides
})
end,
},
{
"nvim-lualine/lualine.nvim",
opts = function()
local icons = require("lazyvim.config").icons
local function fg(name)
return function()
---@type {foreground?:number}?
local hl = vim.api.nvim_get_hl_by_name(name, true)
return hl and hl.foreground and { fg = string.format("#%06x", hl.foreground) }
end
end
return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
component_separators = "|",
section_separators = { left = "", right = "" },
},
sections = {
lualine_a = { "mode" },
lualine_b = {
{ "filename" },
{ "branch" },
},
lualine_c = {
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
-- { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
-- { "filename", path = 1, symbols = { modified = "  ", readonly = "", unnamed = "" } },
-- {
-- function()
-- return require("nvim-navic").get_location()
-- end,
-- cond = function()
-- return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
-- end,
-- },
},
lualine_x = {
{
function()
return require("noice").api.status.command.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.command.has()
end,
color = fg("Statement"),
},
{
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
color = fg("Constant"),
},
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = fg("Special") },
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
},
},
lualine_y = {
-- { "encoding" },
{ "fileformat" },
{ "filetype", icon_only = true },
{ "progress", separator = " ", padding = { left = 1, right = 1 } },
},
lualine_z = {
{ "location", padding = { left = 0, right = 1 } },
},
-- lualine_z = {
-- function()
-- return " " .. os.date("%R")
-- end,
-- },
},
extensions = { "neo-tree" },
}
end,
},
}

3
.config/nvim/stylua.toml Normal file
View File

@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120

View File

@ -0,0 +1 @@
. $env:USERPROFILE\.config\powershell\user_profile.ps1

View File

@ -0,0 +1,25 @@
# oh-my-posh theme
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/velvet.omp.json" | Invoke-Expression
# PSReadLine
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineOption -BellStyle None
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
Set-PSReadLineOption -PredictionSource History
# import module
# Install-Module -Name Terminal-Icons
Import-Module -Name Terminal-Icons
# Alias
Set-Alias -Name vim -Value nvim
Set-Alias ll ls
Set-Alias g git
Set-Alias grep findstr
Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe'
Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
# Environmental variables
# nvim xdg path. :h xdg
Set-Content -Path env:XDG_CONFIG_HOME -Value "$env:USERPROFILE\.config"
Set-Content -Path env:XDG_DATA_HOME -Value "$env:USERPROFILE\.local\share"

398
.config/tmux/.tmux.conf Normal file
View File

@ -0,0 +1,398 @@
# ==========================
# === General settings ===
# ==========================
set -g default-terminal "screen-256color"
set -g history-limit 20000
set -g buffer-limit 20
set -sg escape-time 0
set -g display-time 1500
set -g remain-on-exit off
set -g repeat-time 300
setw -g allow-rename off
setw -g automatic-rename off
setw -g aggressive-resize on
# Change prefix key to C-a, easier to type, same to "screen"
# unbind C-b
# set -g prefix C-a
# Set parent terminal title to reflect current window in tmux session
set -g set-titles on
set -g set-titles-string "#I:#W"
# Start index of window/pane with 1, because we're humans, not computers
set -g base-index 1
setw -g pane-base-index 1
# Enable mouse support
set -g mouse on
# ==========================
# === Key bindings ===
# ==========================
# Unbind default key bindings, we're going to override
unbind "\$" # rename-session
unbind , # rename-window
unbind % # split-window -h
unbind '"' # split-window
unbind \} # swap-pane -D
unbind \{ # swap-pane -U
unbind [ # paste-buffer
unbind ]
unbind "'" # select-window
unbind n # next-window
unbind p # previous-window
unbind l # last-window
unbind M-n # next window with alert
unbind M-p # next window with alert
unbind o # focus thru panes
unbind & # kill-window
unbind "#" # list-buffer
unbind = # choose-buffer
unbind z # zoom-pane
unbind M-Up # resize 5 rows up
unbind M-Down # resize 5 rows down
unbind M-Right # resize 5 rows right
unbind M-Left # resize 5 rows left
# Edit configuration and reload
bind C-e new-window -n 'tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"Config reloaded\"'"
# Reload tmux configuration
bind C-r source-file ~/.tmux.conf \; display "Config reloaded"
# new window and retain cwd
bind c new-window -c "#{pane_current_path}"
# Prompt to rename window right after it's created
set-hook -g after-new-window 'command-prompt -I "#{window_name}" "rename-window '%%'"'
# Rename session and window
bind r command-prompt -I "#{window_name}" "rename-window '%%'"
bind R command-prompt -I "#{session_name}" "rename-session '%%'"
# Split panes
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# Select pane and windows
bind -r C-[ previous-window
bind -r C-] next-window
bind -r h select-pane -t :.-
bind -r l select-pane -t :.+
bind -r Tab last-window # cycle thru MRU tabs
bind -r C-o swap-pane -D
# Zoom pane
bind + resize-pane -Z
# Link window
bind L command-prompt -p "Link window from (session:window): " "link-window -s %% -a"
# Swap panes back and forth with 1st pane
# When in main-(horizontal|vertical) layouts, the biggest/widest panel is always @1
bind \\ if '[ #{pane_index} -eq 1 ]' \
'swap-pane -s "!"' \
'select-pane -t:.1 ; swap-pane -d -t 1 -s "!"'
# Kill pane/window/session shortcuts
bind x kill-pane
bind X kill-window
bind C-x confirm-before -p "kill other windows? (y/n)" "kill-window -a"
bind Q confirm-before -p "kill-session #S? (y/n)" kill-session
# Merge session with another one (e.g. move all windows)
# If you use adhoc 1-window sessions, and you want to preserve session upon exit
# but don't want to create a lot of small unnamed 1-window sessions around
# move all windows from current session to main named one (dev, work, etc)
bind C-u command-prompt -p "Session to merge with: " \
"run-shell 'yes | head -n #{session_windows} | xargs -I {} -n 1 tmux movew -t %%'"
# Detach from session
bind d detach
bind D if -F '#{session_many_attached}' \
'confirm-before -p "Detach other clients? (y/n)" "detach -a"' \
'display "Session has only 1 client attached"'
# Hide status bar on demand
bind C-s if -F '#{s/off//:status}' 'set status off' 'set status on'
# ==================================================
# === Window monitoring for activity and silence ===
# ==================================================
bind m setw monitor-activity \; display-message 'Monitor window activity [#{?monitor-activity,ON,OFF}]'
bind M if -F '#{monitor-silence}' \
'setw monitor-silence 0 ; display-message "Monitor window silence [OFF]"' \
'command-prompt -p "Monitor silence: interval (s)" "setw monitor-silence %%"'
# Activity bell and whistles
set -g visual-activity on
# TODO: Does not work as well, check on newer versions
# set -g visual-silence on
# BUG: bell-action other ignored · Issue #1027 · tmux/tmux · GitHub - https://github.com/tmux/tmux/issues/1027
# set -g visual-bell on
# setw -g bell-action other
# ================================================
# === Copy mode, scroll and clipboard ===
# ================================================
set -g @copy_use_osc52_fallback on
# Prefer vi style key table
setw -g mode-keys vi
bind p paste-buffer
bind C-p choose-buffer
bind -T copy-mode-vi v send -X begin-selection
# trigger copy mode by
bind -n C-y copy-mode
# Scroll up/down by 1 line, half screen, whole screen
# bind -T copy-mode-vi C-k send-keys -X scroll-up
# bind -T copy-mode-vi C-j send-keys -X scroll-down
bind -T copy-mode-vi M-PageUp send-keys -X halfpage-up
bind -T copy-mode-vi M-PageDown send-keys -X halfpage-down
bind -T copy-mode-vi PageDown send-keys -X page-down
bind -T copy-mode-vi PageUp send-keys -X page-up
# When scrolling with mouse wheel, reduce number of scrolled rows per tick to "2" (default is 5)
bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 2 scroll-up
bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down
# wrap default shell in reattach-to-user-namespace if available
# there is some hack with `exec & reattach`, credits to "https://github.com/gpakosz/.tmux"
# don't really understand how it works, but at least window are not renamed to "reattach-to-user-namespace"
if -b "command -v reattach-to-user-namespace > /dev/null 2>&1" \
"run 'tmux set -g default-command \"exec $(tmux show -gv default-shell) 2>/dev/null & reattach-to-user-namespace -l $(tmux show -gv default-shell)\"'"
yank="~/.tmux/yank.sh"
# Copy selected text
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "$yank"
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$yank"
bind -T copy-mode-vi Y send-keys -X copy-line \;\
run "tmux save-buffer - | $yank"
bind-key -T copy-mode-vi D send-keys -X copy-end-of-line \;\
run "tmux save-buffer - | $yank"
# bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "$yank"
bind-key -T copy-mode-vi A send-keys -X append-selection-and-cancel \;\
run "tmux save-buffer - | $yank"
# Copy selection on drag end event, but do not cancel copy mode and do not clear selection
# clear select on subsequence mouse click
bind -T copy-mode-vi MouseDragEnd1Pane \
send-keys -X copy-pipe "$yank"
bind -T copy-mode-vi MouseDown1Pane select-pane \;\
send-keys -X clear-selection
# iTerm2 works with clipboard out of the box, set-clipboard already set to "external"
# tmux show-options -g -s set-clipboard
# set-clipboard on|external
# =====================================
# === Theme ===
# =====================================
# Feel free to NOT use this variables at all (remove, rename)
# this are named colors, just for convenience
color_orange="colour166" # 208, 166
color_purple="colour134" # 135, 134
color_green="colour076" # 070
color_blue="colour39"
color_yellow="colour220"
color_red="colour160"
color_black="colour232"
color_white="white" # 015
# This is a theme CONTRACT, you are required to define variables below
# Change values, but not remove/rename variables itself
color_dark="$color_black"
color_light="$color_white"
color_session_text="$color_blue"
color_status_text="colour245"
color_main="$color_orange"
color_secondary="$color_purple"
color_level_ok="$color_green"
color_level_warn="$color_yellow"
color_level_stress="$color_red"
color_window_off_indicator="colour088"
color_window_off_status_bg="colour238"
color_window_off_status_current_bg="colour254"
# =====================================
# === Appearence and status bar ===
# ======================================
set -g mode-style "fg=default,bg=$color_main"
# command line style
set -g message-style "fg=$color_main,bg=$color_dark"
# status line style
set -g status-style "fg=$color_status_text,bg=$color_dark"
# window segments in status line
set -g window-status-separator ""
#separator_powerline_left=""
separator_powerline_left=" "
#separator_powerline_right=""
separator_powerline_right=""
# setw -g window-status-style "fg=$color_status_text,bg=$color_dark"
setw -g window-status-format " #I:#W "
setw -g window-status-current-style "fg=$color_light,bold,bg=$color_main"
setw -g window-status-current-format "#[fg=$color_dark,bg=$color_main]$separator_powerline_right#[default] #I:#W# #[fg=$color_main,bg=$color_dark]$separator_powerline_right#[default]"
# when window has monitoring notification
setw -g window-status-activity-style "fg=$color_main"
# outline for active pane
setw -g pane-active-border-style "fg=$color_main"
# general status bar settings
set -g status on
set -g status-interval 5
set -g status-position top
set -g status-justify left
set -g status-right-length 100
# define widgets we're going to use in status bar
# note, that this is not the complete list, some of them are loaded from plugins
wg_session="#[fg=$color_session_text] #S #[default]"
wg_battery="#{battery_status_fg} #{battery_icon} #{battery_percentage}"
wg_date="#[fg=$color_secondary]%h %d %H:%M#[default]"
wg_user_host="#[fg=$color_secondary]#(whoami)#[default]@#H"
wg_is_zoomed="#[fg=$color_dark,bg=$color_secondary]#{?window_zoomed_flag,[Z],}#[default]"
# TODO: highlighted for nested local session as well
wg_is_keys_off="#[fg=$color_light,bg=$color_window_off_indicator]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'OFF')#[default]"
# set -g status-left "$wg_session"
# set -g status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_user_host | $wg_date $wg_battery #{online_status}"
# set -g status-right "#{prefix_highlight} $wg_is_keys_off $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_date"
# online and offline icon for tmux-online-status
set -g @online_icon "#[fg=$color_level_ok]●#[default]"
set -g @offline_icon "#[fg=$color_level_stress]●#[default]"
# Configure view templates for tmux-plugin-sysstat "MEM" and "CPU" widget
# set -g @sysstat_mem_view_tmpl 'MEM:#[fg=#{mem.color}]#{mem.pused}#[default] #{mem.used}'
# Configure colors for tmux-plugin-sysstat "MEM" and "CPU" widget
set -g @sysstat_cpu_color_low "$color_level_ok"
set -g @sysstat_cpu_color_medium "$color_level_warn"
set -g @sysstat_cpu_color_stress "$color_level_stress"
set -g @sysstat_mem_color_low "$color_level_ok"
set -g @sysstat_mem_color_medium "$color_level_warn"
set -g @sysstat_mem_color_stress "$color_level_stress"
set -g @sysstat_swap_color_low "$color_level_ok"
set -g @sysstat_swap_color_medium "$color_level_warn"
set -g @sysstat_swap_color_stress "$color_level_stress"
# Configure tmux-battery widget colors
set -g @batt_color_full_charge "#[fg=$color_level_ok]"
set -g @batt_color_high_charge "#[fg=$color_level_ok]"
set -g @batt_color_medium_charge "#[fg=$color_level_warn]"
set -g @batt_color_low_charge "#[fg=$color_level_stress]"
# Configure tmux-prefix-highlight colors
set -g @prefix_highlight_output_prefix '['
set -g @prefix_highlight_output_suffix ']'
set -g @prefix_highlight_fg "$color_dark"
set -g @prefix_highlight_bg "$color_secondary"
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr "fg=$color_dark,bg=$color_secondary"
# Configure dracula
set -g @dracula-plugins "cpu-usage ram-usage battery time"
set -g @dracula-day-month false
set -g @dracula-show-timezone false
set -g @dracula-show-left-icon session
set -g @dracula-show-powerline true
set -g @dracula-show-left-sep 
set -g @dracula-show-right-sep 
set -g @dracula-left-icon-padding 0
# =====================================
# === Renew environment ===
# =====================================
set -g update-environment \
"DISPLAY\
SSH_ASKPASS\
SSH_AUTH_SOCK\
SSH_AGENT_PID\
SSH_CONNECTION\
SSH_TTY\
WINDOWID\
XAUTHORITY"
bind '$' run "~/.tmux/renew_env.sh"
# ============================
# === Plugins ===
# ============================
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# set -g @plugin 'tmux-plugins/tmux-online-status'
# set -g @plugin 'tmux-plugins/tmux-sidebar'
# set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
# set -g @plugin 'samoshkin/tmux-plugin-sysstat'
set -g @plugin 'dracula/tmux'
# Plugin properties
set -g @sidebar-tree 't'
set -g @sidebar-tree-focus 'T'
set -g @sidebar-tree-command 'tree -C'
set -g @open-S 'https://www.google.com/search?q='
# ==============================================
# === Nesting local and remote sessions ===
# ==============================================
# Session is considered to be remote when we ssh into host
if-shell 'test -n "$SSH_CLIENT"' \
'source-file ~/.tmux/tmux.remote.conf'
# We want to have single prefix key "C-a", usable both for local and remote session
# we don't want to "C-a" + "a" approach either
# Idea is to turn off all key bindings and prefix handling on local session,
# so that all keystrokes are passed to inner/remote session
# see: toggle on/off all keybindings · Issue #237 · tmux/tmux - https://github.com/tmux/tmux/issues/237
# Also, change some visual styles when window keys are off
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "fg=$color_status_text,bg=$color_window_off_status_bg" \;\
set window-status-current-format "#[fg=$color_window_off_status_bg,bg=$color_window_off_status_current_bg]$separator_powerline_right#[default] #I:#W# #[fg=$color_window_off_status_current_bg,bg=$color_window_off_status_bg]$separator_powerline_right#[default]" \;\
set window-status-current-style "fg=$color_dark,bold,bg=$color_window_off_status_current_bg" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
set -u window-status-current-style \;\
set -u window-status-current-format \;\
refresh-client -S
# Run all plugins' scripts
run '~/.tmux/plugins/tpm/tpm'

10
.config/v2raya/v2raya.sh Normal file
View File

@ -0,0 +1,10 @@
docker run -d \
--restart=always \
--privileged \
--network=host \
--name v2raya \
-e V2RAYA_ADDRESS=0.0.0.0:2017 \
-v /lib/modules:/lib/modules:ro \
-v /etc/resolv.conf:/etc/resolv.conf \
-v /etc/v2raya:/etc/v2raya \
mzz2017/v2raya

117
.config/waybar/config Normal file
View File

@ -0,0 +1,117 @@
{
"layer": "top",
"modules-left": ["custom/launcher","cpu","memory","custom/media","tray"],
"modules-center": ["river/tags"],
"modules-right": ["custom/updates","custom/wallpaper","backlight","pulseaudio","clock", "battery","custom/power"],
"pulseaudio": {
"tooltip": false,
"scroll-step": 5,
"format": "{icon} {volume}%",
"format-muted": "{icon} {volume}%",
"on-click":"pactl set-sink-mute @DEFAULT_SINK@ toggle",
"format-icons": {
"default": ["", "", ""]
}
},
"river/tags": {
"num-tags": 6
},
"network": {
"tooltip": false,
"format-wifi": " {essid}",
"format-ethernet": ""
},
"backlight": {
"tooltip": false,
"format": " {}%",
"interval":1,
"on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 20
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{time} {icon}",
"format-icons": ["", "", "", "", ""]
},
"tray":{
"icon-size":18,
"spacing": 10
},
"clock": {
"format": "{:%H:%M}  ",
"format-alt": "{:%A, %B %d, %Y (%R)}  ",
"tooltip-format": "<tt><small>{calendar}</small></tt>",
"calendar": {
"mode" : "year",
"mode-mon-col" : 3,
"weeks-pos" : "right",
"on-scroll" : 1,
"on-click-right": "mode",
"format": {
"months": "<span color='#ffead3'><b>{}</b></span>",
"days": "<span color='#ecc6d9'><b>{}</b></span>",
"weeks": "<span color='#99ffdd'><b>W{}</b></span>",
"weekdays": "<span color='#ffcc66'><b>{}</b></span>",
"today": "<span color='#ff6699'><b><u>{}</u></b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
},
"cpu": {
"interval": 15,
"format": " {}%",
"max-length": 10
},
"memory": {
"interval": 30,
"format": " {}%",
"max-length": 10
},
"custom/media": {
"interval": 30,
"format": "{icon} {}",
"return-type": "json",
"max-length": 20,
"format-icons": {
"spotify": " ",
"default": " "
},
"escape": true,
"exec": "$HOME/.config/system_scripts/mediaplayer.py 2> /dev/null",
"on-click": "playerctl play-pause"
},
"custom/launcher":{
"format": " ",
"on-click": "rofi -show drun",
"on-click-right": "killall rofi"
},
"custom/power":{
"format": " ",
"on-click": "bash ~/.config/rofi/leave/leave.sh",
},
"custom/updates":{
"format": "{} Update(s)",
"exec": "checkupdates | wc -l",
"exec-if": "[[ $(checkupdates | wc -l) != 0 ]]",
"interval": 15,
"on-click": "alacritty -e paru -Syu && notify-send 'The system has been updated' "
},
"custom/wallpaper":{
"format":" ",
"on-click": "bash ~/.config/system_scripts/pkill_bc"
}
}

247
.config/waybar/style.css Normal file
View File

@ -0,0 +1,247 @@
* {
border: none;
border-radius: 8px;
font-family: "JetbrainsMono Nerd Font" ;
font-size: 15px;
min-height: 10px;
}
window#waybar {
/* background: transparent; */
background: rgba(24, 24, 36, 0.5);
}
window#waybar.hidden {
opacity: 0.2;
}
#window {
margin-top: 6px;
padding: 8px;
border-radius: 8px;
transition: none;
color: transparent;
background: transparent;
}
#tags {
margin-top: 6px;
margin-left: 12px;
font-size: 4px;
margin-bottom: 0px;
border-radius: 10px;
background: #161320;
transition: none;
}
#tags button {
transition: none;
color: #B5E8E0;
background: transparent;
font-size: 16px;
border-radius: 2px;
}
#tags button.occupied {
transition: none;
color: #F28FAD;
background: transparent;
font-size: 4px;
}
#tags button.focused {
color: #ABE9B3;
border-top: 2px solid #ABE9B3;
border-bottom: 2px solid #ABE9B3;
}
#tags button:hover {
transition: none;
box-shadow: inherit;
text-shadow: inherit;
color: #FAE3B0;
border-color: #E8A2AF;
color: #E8A2AF;
}
#tags button.focused:hover {
color: #E8A2AF;
}
#network {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #bd93f9;
}
#pulseaudio {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #1A1826;
background: #FAE3B0;
}
#battery {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #B5E8E0;
}
#battery.charging, #battery.plugged {
color: #161320;
background-color: #B5E8E0;
}
#battery.critical:not(.charging) {
background-color: #B5E8E0;
color: #161320;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes blink {
to {
background-color: #BF616A;
color: #B5E8E0;
}
}
#backlight {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #F8BD96;
}
#clock {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #ABE9B3;
/*background: #1A1826;*/
}
#memory {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #161320;
background: #DDB6F2;
}
#cpu {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #161320;
background: #96CDFB;
}
#tray {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
margin-bottom: 0px;
padding-right: 10px;
border-radius: 10px;
transition: none;
color: #B5E8E0;
background: #161320;
}
#custom-launcher {
font-size: 24px;
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 5px;
border-radius: 10px;
transition: none;
color: #89DCEB;
background: #161320;
}
#custom-power {
font-size: 20px;
margin-top: 6px;
margin-left: 8px;
margin-right: 8px;
padding-left: 10px;
padding-right: 5px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #F28FAD;
}
#custom-wallpaper {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #C9CBFF;
}
#custom-updates {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #E8A2AF;
}
#custom-media {
margin-top: 6px;
margin-left: 8px;
padding-left: 10px;
padding-right: 10px;
margin-bottom: 0px;
border-radius: 10px;
transition: none;
color: #161320;
background: #F2CDCD;
}

1671
.config/zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

135
.config/zsh/.zshrc Normal file
View File

@ -0,0 +1,135 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled # disable automatic updates
# zstyle ':omz:update' mode auto # update automatically without asking
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# alias vim="nvim"
alias icat="kitty +kitten icat"
alias kssh="kitty +kitten ssh"
alias ll="ls -lhtr"
# Environmental variables
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
# source /home/xfy/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# source /usr/share/nvm/init-nvm.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# Node.js openssl
export NODE_OPTIONS=--openssl-legacy-provider
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

6
.config/zsh/install.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo "Done."

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
**/*/packer_compiled.lua
.DS_Store

36
README.md Normal file
View File

@ -0,0 +1,36 @@
# xfy's dotfiles
- neovim
- tmux
- ideavim
- kitty
- powershell
- zsh
![](./screenshots/macos.png)
## Screenshots
<details>
<summary>Screenshots</summary>
![](./screenshots/on-macos-1.png)
![](./screenshots/macos-2.png)
![](./screenshots/macos-3.png)
</details>
## Key maps
### vim
Base on lazyvim.
### tmux
| Key | Description | |
| ----- | ----------- | --- |
| `C-b` | Prefix | |
| `c` | New window | |
| `h` | Next Panel | |
| `l` | Prev Panel | |

4
backup-linux.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cp -aR ~/.config/hypr .config/
cp -aR ~/.config/waybar .config/

6
backup.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
cp -aR ~/.config/nvim .config/
cp -aR ~/.config/kitty .config/
cp -aR ~/.config/neofetch .config/
cp -a ~/.zshrc .config/zsh/

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
screenshots/macos-1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

BIN
screenshots/macos-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

BIN
screenshots/macos-3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 KiB

BIN
screenshots/macos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
screenshots/on-macos-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB