3 Commits
ATRI ... imac

Author SHA1 Message Date
dfc3187980 update: add local-overlay 2024-11-05 09:39:28 -05:00
09c7389823 update: imac config 2024-11-03 20:52:21 -05:00
0316aaead6 update: imac config 2024-11-03 20:46:45 -05:00
144 changed files with 1426 additions and 5093 deletions

View File

@@ -0,0 +1,16 @@
[font]
size = 12
[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"
[window]
opacity = 0.7
[window.padding]
#x = 15
#y = 15
[selection]
save_to_clipboard = true

View File

@@ -1 +0,0 @@
--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --enable-features=VaapiVideoDecoder

View File

@@ -1 +0,0 @@
--ozone-platform=wayland

View File

@@ -3,11 +3,10 @@
# -----------------------------------------------------
# Setup XDG for screen sharing
#exec-once = ../scripts/xdg.sh
exec-once = ../scripts/xdg.sh
# Start Polkit
# exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = systemctl --user start hyprpolkitagent
# Load Dunst Notification Manager
exec-once = dunst
@@ -32,7 +31,6 @@ exec-once = ~/dotfiles/hypr/scripts/init-wallpaper-engine.sh
exec-once = pypr
exec-once = activate-linux -t "激活 Win——" -m "什么Gentoo Linux那没事了" -f "Noto Sans CJK SC" &
# Start autostart cleanup
# exec-once = ~/dotfiles/hypr/scripts/cleanup.sh

View File

@@ -5,7 +5,6 @@
decoration {
rounding = 10
#rounding_power = 4.0
blur {
enabled = true
size = 10
@@ -19,14 +18,8 @@ decoration {
inactive_opacity = 0.8
fullscreen_opacity = 1.0
shadow {
enabled = true
range = 30
render_power = 3
color = 0x66000000
}
#drop_shadow = true
#shadow_range = 30
#shadow_render_power = 3
#col.shadow = 0x66000000
drop_shadow = true
shadow_range = 30
shadow_render_power = 3
col.shadow = 0x66000000
}

View File

@@ -102,4 +102,3 @@ submap = reset
# Pyprland
bind = $mainMod SHIFT, RETURN, exec, pypr toggle term
bind = $mainMod, C, exec, pypr toggle chat

View File

@@ -1,5 +1,5 @@
monitor=DP-1,preferred,0x0,2
monitor=DP-2,preferred,1920x-275,2,transform,1
#workspace=1,monitor:DP-1
workspace=1,monitor:DP-1
#exec-once=hyprctl dispatch workspace 1

View File

@@ -15,11 +15,9 @@ windowrule = float,^(showmethekey-gtk)$
windowrule = pin,^(showmethekey-gtk)$
layerrule = blur, gtk-layer-shell
layerrule = blur, logout_dialog
layerrule = blur, waybar
windowrule = float,title:^(Mathematica)$
windowrule = opacity 0.8, ^(Code)$
windowrule = opacity 0.8, ^(code)$
windowrule = opacity 0.8, ^(code-oss)$
windowrule = opacity 0.8, ^(code-url-handler)$
windowrule = float,^(QQ)$
@@ -29,8 +27,3 @@ windowrule = float,^(fdm)$
windowrule = float,^(Uget-gtk)$
windowrule = float,^(xdg-desktop-portal-gtk)$
windowrule = float,title:^(打开文件)$
windowrule = tile,^(explorer.exe)$
windowrule = float,chrome-chatgpt
windowrule = fullscreen,^(eu4)$

View File

@@ -15,18 +15,18 @@
# }
general {
#lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
#before_sleep_cmd = loginctl lock-session # lock before suspend.
#after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
# Screenlock
#listener {
# # HYPRLOCK TIMEOUT
# timeout = 1200
# # HYPRLOCK ONTIMEOUT
# on-timeout = loginctl lock-session
#}
listener {
# HYPRLOCK TIMEOUT
timeout = 1200
# HYPRLOCK ONTIMEOUT
on-timeout = loginctl lock-session
}
# dpms
listener {

View File

@@ -7,15 +7,6 @@ plugins = [
[scratchpads.term]
animation = "fromTop"
command = "kitty --class kitty-dropterm"
class = "kitty-dropterm"
command = "alacritty --class alacritty-dropterm"
class = "alacritty-dropterm"
size = "75% 60%"
unfocus = "hide"
[scratchpads.chat]
animation = "fromLeft"
command = "google-chrome-stable --ozone-platform=wayland --enable-wayland-ime --user-data-dir=$HOME/.config/chatgpt-webapp --app=https://chatgpt.com"
class = "chatgpt-webapp"
size = "30% 85%"
margin = 12
force_monitor = "DP-1"

View File

@@ -53,7 +53,7 @@ case $1 in
# Select wallpaper with rofi
"select")
sleep 0.2
selected=$( find -L "$wallpaper_folder" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort -R | while read rfile
selected=$( find "$wallpaper_folder" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) -exec basename {} \; | sort -R | while read rfile
do
echo -en "$rfile\x00icon\x1f$wallpaper_folder/${rfile}\n"
done | rofi -dmenu -i -replace -config ~/dotfiles/rofi/config-wallpaper.rasi)

View File

@@ -1,19 +1,9 @@
# Maple
#font_family Maple Mono NF CN
# end Maple
# Fica Code
font_family FiraCode Nerd Font
font_features FiraCodeNF-Reg +cv01 +cv02 +cv06 +cv31 +zero +cv30
font_features FiraCodeNF-SemBd +cv01 +cv02 +cv06 +cv31 +zero +cv30
# end Fira Code
font_family Fira Code Nerd Font
font_size 16.0
bold_font auto
italic_font auto
bold_italic_font auto
cursor_shape block
cursor_trail 10
background_opacity 0.7
confirm_os_window_close 0
@@ -23,6 +13,8 @@ include ~/.cache/wal/colors-kitty.conf
detect_urls yes
copy_on_select clipboard
strip_trailing_spaces smart
rectangle_select_modifiers ctrl+alt
terminal_select_modifiers shift
enable_audio_bell no

View File

@@ -8,4 +8,4 @@ jobs:
- uses: actions/checkout@v4
- uses: lunarmodules/luacheck@v1
with:
args: . --std luajit --max-line-length 150 --no-config --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_inlayhint _toggle_virtualtext _toggle_lazygit
args: . --std luajit --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_lazygit --max-line-length 150 --no-config

View File

@@ -5,11 +5,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1735644329,
"narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=",
"lastModified": 1722113426,
"narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=",
"owner": "numtide",
"repo": "devshell",
"rev": "f7795ede5b02664b57035b3b757876703e2c3eac",
"rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae",
"type": "github"
},
"original": {
@@ -23,11 +23,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"lastModified": 1719994518,
"narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7",
"type": "github"
},
"original": {
@@ -43,11 +43,11 @@
]
},
"locked": {
"lastModified": 1740796616,
"narHash": "sha256-JU97wIfRxeFN6rpTsUVCwWAdix+Wka4Or23907YIrFI=",
"lastModified": 1722462338,
"narHash": "sha256-ss0G8t8RJVDewA3MyqgAlV951cWRK6EtVhVKEZ7J5LU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f0b5e7e8a75abdea32bbff09ddd7b6eeb4b9b445",
"rev": "6e090576c4824b16e8759ebca3958c5b09659ee8",
"type": "github"
},
"original": {
@@ -74,23 +74,23 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1738452942,
"narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
"lastModified": 1719876945,
"narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
"url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1740547748,
"narHash": "sha256-Ly2fBL1LscV+KyCqPRufUBuiw+zmWrlJzpWOWbahplg=",
"lastModified": 1722415718,
"narHash": "sha256-5US0/pgxbMksF92k1+eOa8arJTJiPvsdZj9Dl+vJkM4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3a05eebede89661660945da1f151959900903b6a",
"rev": "c3392ad349a5227f4a3464dce87bcc5046692fce",
"type": "github"
},
"original": {

View File

@@ -2,6 +2,7 @@
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" },
"advanced-git-search.nvim": { "branch": "main", "commit": "36ea105a7b7063a6879ac3b8afffe6fb326e27b1" },
"aerial.nvim": { "branch": "master", "commit": "92f93f4e155b2135fc47ed2daf8b63f40726b545" },
"alpha-nvim": { "branch": "main", "commit": "b6f4129302db197a7249e67a90de3f2b676de13e" },
"autoclose.nvim": { "branch": "main", "commit": "b2077aa2c83df7ebc19b2a20a3a0654b24ae9c8f" },
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
@@ -23,7 +24,6 @@
"csv.vim": { "branch": "master", "commit": "bddfcbadd788ab11eb3dbba4550a38a412fe3705" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dropbar.nvim": { "branch": "master", "commit": "6156e07759fd8c7cbf764414f583aa7e47470368" },
"edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" },
"fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
@@ -32,11 +32,11 @@
"gitsigns.nvim": { "branch": "main", "commit": "899e993850084ea33d001ec229d237bc020c19ae" },
"glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" },
"go.nvim": { "branch": "master", "commit": "8389adb56ab124b75d858df5f87b741eaca7b8b3" },
"grug-far.nvim": { "branch": "main", "commit": "1b7a54633071cbb7a378162b8f04a38913987d64" },
"guihua.lua": { "branch": "master", "commit": "225db770e36aae6a1e9e3a65578095c8eb4038d3" },
"hop.nvim": { "branch": "master", "commit": "8f51ef02700bb3cdcce94e92eff16170a6343c4f" },
"indent-blankline.nvim": { "branch": "master", "commit": "db926997af951da38e5004ec7b9fbdc480b48f5d" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"local-highlight.nvim": { "branch": "master", "commit": "ae3ada3a332128b1036c84c8587b9069891c63da" },
"lsp-format-modifications.nvim": { "branch": "main", "commit": "006d4cd88f4f09fdc4375fcb75dd5b7d981a723b" },
"lsp_signature.nvim": { "branch": "master", "commit": "e6d225e27770db81346c2f2aa6c30d0e249f9e7f" },
"lspsaga.nvim": { "branch": "main", "commit": "4ce44df854f447cf0a8972e5387b3aeb5efc798b" },
@@ -47,8 +47,8 @@
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.align": { "branch": "main", "commit": "b54d88b16bfac62ca6b3d699566135639a3ca4fa" },
"mini.cursorword": { "branch": "main", "commit": "939ffcc8c57694608ac0896418d4b9a7c5273909" },
"neoconf.nvim": { "branch": "main", "commit": "f5befe4772c9d94c43bd3dd318f5546cf955ba3f" },
"neodim": { "branch": "master", "commit": "d87470828690342d0139efc2fd56ea0b29e9ecb3" },
"neoscroll.nvim": { "branch": "master", "commit": "532dcc8cea4287c4cad6bb77532989a8217cfc7b" },
"none-ls.nvim": { "branch": "main", "commit": "203f5ebde4a1af48ba2eb146401b5be2e7866942" },
"nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" },
@@ -61,6 +61,7 @@
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-scrollview": { "branch": "main", "commit": "401c0498689dcaa54b2e7483d823e33cdc051e72" },
"nvim-spectre": { "branch": "master", "commit": "ba7fb777edff6c1fbbeffd343e113af64c04e90a" },
"nvim-tree.lua": { "branch": "master", "commit": "d43ab67d0eb4317961c5e9d15fffe908519debe0" },
"nvim-treehopper": { "branch": "master", "commit": "13559079e33665a310d9ccf0e43f4e9bb9f337e2" },
"nvim-treesitter": { "branch": "master", "commit": "7a64148896289a91cb2a92e9da3f76d5512a3fb8" },

View File

@@ -32,13 +32,7 @@ local leader_map = function()
end
local gui_config = function()
if next(settings.gui_config) then
vim.api.nvim_set_option_value(
"guifont",
settings.gui_config.font_name .. ":h" .. settings.gui_config.font_size,
{}
)
end
vim.api.nvim_set_option_value("guifont", settings.gui_config.font_name .. ":h" .. settings.gui_config.font_size, {})
end
local neovide_config = function()
@@ -110,6 +104,7 @@ local load_core = function()
shell_config()
require("core.options")
require("core.mapping")
require("core.event")
require("core.pack")
require("keymap")

View File

@@ -0,0 +1,65 @@
local bind = require("keymap.bind")
local map_cr = bind.map_cr
local map_cu = bind.map_cu
local map_cmd = bind.map_cmd
local map_callback = bind.map_callback
local core_map = {
-- Suckless
["n|<S-Tab>"] = map_cr("normal za"):with_noremap():with_silent():with_desc("edit: Toggle code fold"),
["n|<C-s>"] = map_cu("write"):with_noremap():with_silent():with_desc("edit: Save file"),
["n|Y"] = map_cmd("y$"):with_desc("edit: Yank text to EOL"),
["n|D"] = map_cmd("d$"):with_desc("edit: Delete text to EOL"),
["n|n"] = map_cmd("nzzzv"):with_noremap():with_desc("edit: Next search result"),
["n|N"] = map_cmd("Nzzzv"):with_noremap():with_desc("edit: Prev search result"),
["n|J"] = map_cmd("mzJ`z"):with_noremap():with_desc("edit: Join next line"),
["n|<Esc>"] = map_callback(function()
_flash_esc_or_noh()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Clear search highlight"),
["n|<C-h>"] = map_cmd("<C-w>h"):with_noremap():with_desc("window: Focus left"),
["n|<C-l>"] = map_cmd("<C-w>l"):with_noremap():with_desc("window: Focus right"),
["n|<C-j>"] = map_cmd("<C-w>j"):with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cmd("<C-w>k"):with_noremap():with_desc("window: Focus up"),
["t|<C-w>h"] = map_cmd("<Cmd>wincmd h<CR>"):with_silent():with_noremap():with_desc("window: Focus left"),
["t|<C-w>l"] = map_cmd("<Cmd>wincmd l<CR>"):with_silent():with_noremap():with_desc("window: Focus right"),
["t|<C-w>j"] = map_cmd("<Cmd>wincmd j<CR>"):with_silent():with_noremap():with_desc("window: Focus down"),
["t|<C-w>k"] = map_cmd("<Cmd>wincmd k<CR>"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<A-h>"] = map_cr("vertical resize -3"):with_silent():with_desc("window: Resize -3 vertically"),
["n|<A-l>"] = map_cr("vertical resize +3"):with_silent():with_desc("window: Resize +3 vertically"),
["n|<A-j>"] = map_cr("resize -3"):with_silent():with_desc("window: Resize -3 horizontally"),
["n|<A-k>"] = map_cr("resize +3"):with_silent():with_desc("window: Resize +3 horizontally"),
["n|<C-q>"] = map_cr("wq"):with_desc("edit: Save file and quit"),
["n|<A-S-q>"] = map_cr("q!"):with_desc("edit: Force quit"),
["n|<leader>o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"),
["n|<leader>bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"),
["n|tn"] = map_cr("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"),
["n|tk"] = map_cr("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"),
["n|tj"] = map_cr("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"),
["n|to"] = map_cr("tabonly"):with_noremap():with_silent():with_desc("tab: Only keep current tab"),
-- Insert mode
["i|<C-u>"] = map_cmd("<C-G>u<C-U>"):with_noremap():with_desc("edit: Delete previous block"),
["i|<C-b>"] = map_cmd("<Left>"):with_noremap():with_desc("edit: Move cursor to left"),
["i|<C-a>"] = map_cmd("<ESC>^i"):with_noremap():with_desc("edit: Move cursor to line start"),
["i|<C-s>"] = map_cmd("<Esc>:w<CR>"):with_desc("edit: Save file"),
["i|<C-q>"] = map_cmd("<Esc>:wq<CR>"):with_desc("edit: Save file and quit"),
-- Command mode
["c|<C-b>"] = map_cmd("<Left>"):with_noremap():with_desc("edit: Left"),
["c|<C-f>"] = map_cmd("<Right>"):with_noremap():with_desc("edit: Right"),
["c|<C-a>"] = map_cmd("<Home>"):with_noremap():with_desc("edit: Home"),
["c|<C-e>"] = map_cmd("<End>"):with_noremap():with_desc("edit: End"),
["c|<C-d>"] = map_cmd("<Del>"):with_noremap():with_desc("edit: Delete"),
["c|<C-h>"] = map_cmd("<BS>"):with_noremap():with_desc("edit: Backspace"),
["c|<C-t>"] = map_cmd([[<C-R>=expand("%:p:h") . "/" <CR>]])
:with_noremap()
:with_desc("edit: Complete path of current file"),
-- Visual mode
["v|J"] = map_cmd(":m '>+1<CR>gv=gv"):with_desc("edit: Move this line down"),
["v|K"] = map_cmd(":m '<-2<CR>gv=gv"):with_desc("edit: Move this line up"),
["v|<"] = map_cmd("<gv"):with_desc("edit: Decrease indent"),
["v|>"] = map_cmd(">gv"):with_desc("edit: Increase indent"),
}
bind.nvim_load_mapping(core_map)

View File

@@ -125,7 +125,7 @@ function Lazy:load_lazy()
---@type string[]
paths = {}, -- add any custom paths here that you want to include in the rtp
disabled_plugins = {
-- Comment out `"editorconfig"` to enable native EditorConfig support
-- Set this to true in order to enable native EditorConfig support
-- WARN: Sleuth.vim already includes all the features provided by this plugin.
-- Do NOT enable both at the same time, or you risk breaking the entire detection system.
"editorconfig",

View File

@@ -46,9 +46,9 @@ settings["formatter_block_list"] = {
-- Servers in this list will skip setting formatting capabilities if rhs is true.
---@type table<string, boolean>
settings["server_formatting_block_list"] = {
clangd = true,
lua_ls = true,
ts_ls = true,
tsserver = true,
clangd = true,
}
-- Set it to false if you want to turn off LSP Inlay Hints

View File

@@ -1,32 +1,27 @@
local bind = require("keymap.bind")
local map_cr = bind.map_cr
local map_cmd = bind.map_cmd
local map_callback = bind.map_callback
local mappings = {
fmt = {
["n|<A-f>"] = map_cr("FormatToggle"):with_noremap():with_silent():with_desc("formatter: Toggle format on save"),
["n|<A-S-f>"] = map_cr("Format"):with_noremap():with_silent():with_desc("formatter: Format buffer manually"),
},
local plug_map = {
["n|<A-f>"] = map_cmd("<Cmd>FormatToggle<CR>"):with_noremap():with_desc("formatter: Toggle format on save"),
}
bind.nvim_load_mapping(mappings.fmt)
bind.nvim_load_mapping(plug_map)
--- The following code allows this file to be exported ---
--- for use with LSP lazy-loaded keymap bindings ---
local mapping = {}
local M = {}
---@param buf integer
function M.lsp(buf)
function mapping.lsp(buf)
local map = {
-- LSP-related keymaps, ONLY effective in buffers with LSP(s) attached
["n|<leader>li"] = map_cr("LspInfo"):with_silent():with_buffer(buf):with_desc("lsp: Info"),
["n|<leader>lr"] = map_cr("LspRestart"):with_silent():with_buffer(buf):with_nowait():with_desc("lsp: Restart"),
["n|go"] = map_callback(function()
require("edgy").toggle("right")
["n|go"] = map_cr("AerialToggle!"):with_silent():with_buffer(buf):with_desc("lsp: Toggle outline"),
["n|gto"] = map_callback(function()
require("telescope").extensions.aerial.aerial()
end)
:with_silent()
:with_buffer(buf)
:with_desc("lsp: Toggle outline"),
:with_desc("lsp: Toggle outline in Telescope"),
["n|g["] = map_cr("Lspsaga diagnostic_jump_prev")
:with_silent()
:with_buffer(buf)
@@ -67,18 +62,6 @@ function M.lsp(buf)
:with_silent()
:with_buffer(buf)
:with_desc("lsp: Show outgoing calls"),
["n|<leader>lv"] = map_callback(function()
_toggle_virtualtext()
end)
:with_noremap()
:with_silent()
:with_desc("lsp: Toggle virtual text display of current buffer"),
["n|<leader>lh"] = map_callback(function()
_toggle_inlayhint()
end)
:with_noremap()
:with_silent()
:with_desc("lsp: Toggle inlay hints dispaly of current buffer"),
}
bind.nvim_load_mapping(map)
@@ -88,4 +71,4 @@ function M.lsp(buf)
end
end
return M
return mapping

View File

@@ -5,136 +5,105 @@ local map_cmd = bind.map_cmd
local map_callback = bind.map_callback
local et = bind.escape_termcode
local mappings = {
builtins = {
-- Builtins: Save & Quit
["n|<C-s>"] = map_cu("write"):with_noremap():with_silent():with_desc("edit: Save file"),
["n|<C-q>"] = map_cr("wq"):with_desc("edit: Save file and quit"),
["n|<A-S-q>"] = map_cr("q!"):with_desc("edit: Force quit"),
local plug_map = {
-- Plugin persisted.nvim
["n|<leader>ss"] = map_cu("SessionSave"):with_noremap():with_silent():with_desc("session: Save"),
["n|<leader>sl"] = map_cu("SessionLoad"):with_noremap():with_silent():with_desc("session: Load current"),
["n|<leader>sd"] = map_cu("SessionDelete"):with_noremap():with_silent():with_desc("session: Delete"),
-- Builtins: Insert mode
["i|<C-u>"] = map_cmd("<C-G>u<C-U>"):with_noremap():with_desc("edit: Delete previous block"),
["i|<C-b>"] = map_cmd("<Left>"):with_noremap():with_desc("edit: Move cursor to left"),
["i|<C-a>"] = map_cmd("<ESC>^i"):with_noremap():with_desc("edit: Move cursor to line start"),
["i|<C-s>"] = map_cmd("<Esc>:w<CR>"):with_desc("edit: Save file"),
["i|<C-q>"] = map_cmd("<Esc>:wq<CR>"):with_desc("edit: Save file and quit"),
-- Plugin: nvim-bufdel
["n|<A-q>"] = map_cr("BufDel"):with_noremap():with_silent():with_desc("buffer: Close current"),
-- Builtins: Command mode
["c|<C-b>"] = map_cmd("<Left>"):with_noremap():with_desc("edit: Left"),
["c|<C-f>"] = map_cmd("<Right>"):with_noremap():with_desc("edit: Right"),
["c|<C-a>"] = map_cmd("<Home>"):with_noremap():with_desc("edit: Home"),
["c|<C-e>"] = map_cmd("<End>"):with_noremap():with_desc("edit: End"),
["c|<C-d>"] = map_cmd("<Del>"):with_noremap():with_desc("edit: Delete"),
["c|<C-h>"] = map_cmd("<BS>"):with_noremap():with_desc("edit: Backspace"),
["c|<C-t>"] = map_cmd([[<C-R>=expand("%:p:h") . "/" <CR>]])
:with_noremap()
:with_desc("edit: Complete path of current file"),
-- Plugin: comment.nvim
["n|gcc"] = map_callback(function()
return vim.v.count == 0 and et("<Plug>(comment_toggle_linewise_current)")
or et("<Plug>(comment_toggle_linewise_count)")
end)
:with_silent()
:with_noremap()
:with_expr()
:with_desc("edit: Toggle comment for line"),
["n|gbc"] = map_callback(function()
return vim.v.count == 0 and et("<Plug>(comment_toggle_blockwise_current)")
or et("<Plug>(comment_toggle_blockwise_count)")
end)
:with_silent()
:with_noremap()
:with_expr()
:with_desc("edit: Toggle comment for block"),
["n|gc"] = map_cmd("<Plug>(comment_toggle_linewise)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for line with operator"),
["n|gb"] = map_cmd("<Plug>(comment_toggle_blockwise)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for block with operator"),
["x|gc"] = map_cmd("<Plug>(comment_toggle_linewise_visual)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for line with selection"),
["x|gb"] = map_cmd("<Plug>(comment_toggle_blockwise_visual)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for block with selection"),
-- Builtins: Visual mode
["v|J"] = map_cmd(":m '>+1<CR>gv=gv"):with_desc("edit: Move this line down"),
["v|K"] = map_cmd(":m '<-2<CR>gv=gv"):with_desc("edit: Move this line up"),
["v|<"] = map_cmd("<gv"):with_desc("edit: Decrease indent"),
["v|>"] = map_cmd(">gv"):with_desc("edit: Increase indent"),
-- Plugin: diffview.nvim
["n|<leader>gd"] = map_cr("DiffviewOpen"):with_silent():with_noremap():with_desc("git: Show diff"),
["n|<leader>gD"] = map_cr("DiffviewClose"):with_silent():with_noremap():with_desc("git: Close diff"),
-- Builtins: "Suckless" - named after r/suckless
["n|Y"] = map_cmd("y$"):with_desc("edit: Yank text to EOL"),
["n|D"] = map_cmd("d$"):with_desc("edit: Delete text to EOL"),
["n|n"] = map_cmd("nzzzv"):with_noremap():with_desc("edit: Next search result"),
["n|N"] = map_cmd("Nzzzv"):with_noremap():with_desc("edit: Prev search result"),
["n|J"] = map_cmd("mzJ`z"):with_noremap():with_desc("edit: Join next line"),
["n|<S-Tab>"] = map_cr("normal za"):with_noremap():with_silent():with_desc("edit: Toggle code fold"),
["n|<Esc>"] = map_callback(function()
_flash_esc_or_noh()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Clear search highlight"),
["n|<leader>o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"),
},
plugins = {
-- Plugin: persisted.nvim
["n|<leader>ss"] = map_cu("SessionSave"):with_noremap():with_silent():with_desc("session: Save"),
["n|<leader>sl"] = map_cu("SessionLoad"):with_noremap():with_silent():with_desc("session: Load current"),
["n|<leader>sd"] = map_cu("SessionDelete"):with_noremap():with_silent():with_desc("session: Delete"),
-- Plugin: hop.nvim
["nv|<leader>w"] = map_cmd("<Cmd>HopWordMW<CR>"):with_noremap():with_desc("jump: Goto word"),
["nv|<leader>j"] = map_cmd("<Cmd>HopLineMW<CR>"):with_noremap():with_desc("jump: Goto line"),
["nv|<leader>k"] = map_cmd("<Cmd>HopLineMW<CR>"):with_noremap():with_desc("jump: Goto line"),
["nv|<leader>c"] = map_cmd("<Cmd>HopChar1MW<CR>"):with_noremap():with_desc("jump: Goto one char"),
["nv|<leader>C"] = map_cmd("<Cmd>HopChar2MW<CR>"):with_noremap():with_desc("jump: Goto two chars"),
-- Plugin: comment.nvim
["n|gcc"] = map_callback(function()
return vim.v.count == 0 and et("<Plug>(comment_toggle_linewise_current)")
or et("<Plug>(comment_toggle_linewise_count)")
end)
:with_silent()
:with_noremap()
:with_expr()
:with_desc("edit: Toggle comment for line"),
["n|gbc"] = map_callback(function()
return vim.v.count == 0 and et("<Plug>(comment_toggle_blockwise_current)")
or et("<Plug>(comment_toggle_blockwise_count)")
end)
:with_silent()
:with_noremap()
:with_expr()
:with_desc("edit: Toggle comment for block"),
["n|gc"] = map_cmd("<Plug>(comment_toggle_linewise)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for line with operator"),
["n|gb"] = map_cmd("<Plug>(comment_toggle_blockwise)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for block with operator"),
["x|gc"] = map_cmd("<Plug>(comment_toggle_linewise_visual)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for line with selection"),
["x|gb"] = map_cmd("<Plug>(comment_toggle_blockwise_visual)")
:with_silent()
:with_noremap()
:with_desc("edit: Toggle comment for block with selection"),
-- Plugin: smart-splits.nvim
["n|<A-h>"] = map_cu("SmartResizeLeft"):with_silent():with_noremap():with_desc("window: Resize -3 horizontally"),
["n|<A-j>"] = map_cu("SmartResizeDown"):with_silent():with_noremap():with_desc("window: Resize -3 vertically"),
["n|<A-k>"] = map_cu("SmartResizeUp"):with_silent():with_noremap():with_desc("window: Resize +3 vertically"),
["n|<A-l>"] = map_cu("SmartResizeRight"):with_silent():with_noremap():with_desc("window: Resize +3 horizontally"),
["n|<C-h>"] = map_cu("SmartCursorMoveLeft"):with_silent():with_noremap():with_desc("window: Focus left"),
["n|<C-j>"] = map_cu("SmartCursorMoveDown"):with_silent():with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cu("SmartCursorMoveUp"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<C-l>"] = map_cu("SmartCursorMoveRight"):with_silent():with_noremap():with_desc("window: Focus right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window leftward"),
["n|<leader>Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window downward"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window upward"),
["n|<leader>Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window rightward"),
-- Plugin: diffview.nvim
["n|<leader>gd"] = map_cr("DiffviewOpen"):with_silent():with_noremap():with_desc("git: Show diff"),
["n|<leader>gD"] = map_cr("DiffviewClose"):with_silent():with_noremap():with_desc("git: Close diff"),
-- Plugin: nvim-spectre
["n|<leader>Ss"] = map_callback(function()
require("spectre").toggle()
end)
:with_silent()
:with_noremap()
:with_desc("editn: Toggle search & replace panel"),
["n|<leader>Sp"] = map_callback(function()
require("spectre").open_visual({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (project)"),
["v|<leader>Sp"] = map_callback(function()
require("spectre").open_visual()
end)
:with_silent()
:with_noremap()
:with_desc("edit: search & replace current word (project)"),
["n|<leader>Sf"] = map_callback(function()
require("spectre").open_file_search({ select_word = true })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search & replace current word (file)"),
-- Plugin: hop.nvim
["nv|<leader>w"] = map_cmd("<Cmd>HopWordMW<CR>"):with_noremap():with_desc("jump: Goto word"),
["nv|<leader>j"] = map_cmd("<Cmd>HopLineMW<CR>"):with_noremap():with_desc("jump: Goto line"),
["nv|<leader>k"] = map_cmd("<Cmd>HopLineMW<CR>"):with_noremap():with_desc("jump: Goto line"),
["nv|<leader>c"] = map_cmd("<Cmd>HopChar1MW<CR>"):with_noremap():with_desc("jump: Goto one char"),
["nv|<leader>C"] = map_cmd("<Cmd>HopChar2MW<CR>"):with_noremap():with_desc("jump: Goto two chars"),
-- Plugin: nvim-treehopper
["o|m"] = map_cu("lua require('tsht').nodes()"):with_silent():with_desc("jump: Operate across syntax tree"),
-- Plugin: grug-far
["n|<leader>Ss"] = map_callback(function()
require("grug-far").open()
end)
:with_silent()
:with_noremap()
:with_desc("editn: Toggle search & replace panel"),
["n|<leader>Sp"] = map_callback(function()
require("grug-far").open({ prefills = { search = vim.fn.expand("<cword>") } })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search&replace current word (project)"),
["v|<leader>Sp"] = map_callback(function()
require("grug-far").with_visual_selection()
end)
:with_silent()
:with_noremap()
:with_desc("edit: search & replace current word (project)"),
["n|<leader>Sf"] = map_callback(function()
require("grug-far").open({ prefills = { paths = vim.fn.expand("%") } })
end)
:with_silent()
:with_noremap()
:with_desc("editn: search & replace current word (file)"),
-- Plugin: nvim-treehopper
["o|m"] = map_cu("lua require('tsht').nodes()"):with_silent():with_desc("jump: Operate across syntax tree"),
-- Plugin: suda.vim
["n|<A-s>"] = map_cu("SudaWrite"):with_silent():with_noremap():with_desc("editn: Save file using sudo"),
},
-- Plugin suda.vim
["n|<A-s>"] = map_cu("SudaWrite"):with_silent():with_noremap():with_desc("editn: Save file using sudo"),
}
bind.nvim_load_mapping(mappings.builtins)
bind.nvim_load_mapping(mappings.plugins)
bind.nvim_load_mapping(plug_map)

View File

@@ -3,20 +3,14 @@ _G._command_panel = function()
lhs_filter = function(lhs)
return not string.find(lhs, "Þ")
end,
layout_config = {
width = 0.6,
height = 0.6,
prompt_position = "top",
},
})
end
_G._flash_esc_or_noh = function()
local flash_active, state = pcall(function()
return require("flash.plugins.char").state
end)
if flash_active and state then
state:hide()
else
pcall(vim.cmd.noh)
end
end
_G._telescope_collections = function(picker_type)
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
@@ -44,27 +38,14 @@ _G._telescope_collections = function(picker_type)
:find()
end
_G._toggle_inlayhint = function()
local is_enabled = vim.lsp.inlay_hint.is_enabled()
vim.lsp.inlay_hint.enable(not is_enabled)
vim.notify(
(is_enabled and "Inlay hint disabled successfully" or "Inlay hint enabled successfully"),
vim.log.levels.INFO,
{ title = "LSP Inlay Hint" }
)
end
local _vt_enabled = require("core.settings").diagnostics_virtual_text
_G._toggle_virtualtext = function()
if vim.diagnostic.is_enabled() then
_vt_enabled = not _vt_enabled
vim.diagnostic[_vt_enabled and "show" or "hide"]()
vim.notify(
(_vt_enabled and "Virtual text is now displayed" or "Virtual text is now hidden"),
vim.log.levels.INFO,
{ title = "LSP Diagnostic" }
)
_G._flash_esc_or_noh = function()
local flash_active, state = pcall(function()
return require("flash.plugins.char").state
end)
if flash_active and state then
state:hide()
else
pcall(vim.cmd.noh)
end
end

View File

@@ -1,42 +1,27 @@
require("keymap.helpers")
local bind = require("keymap.bind")
local map_cr = bind.map_cr
-- local map_cu = bind.map_cu
-- local map_cmd = bind.map_cmd
-- local map_callback = bind.map_callback
local mappings = {
core = {
-- Package manager: lazy.nvim
["n|<leader>ph"] = map_cr("Lazy"):with_silent():with_noremap():with_nowait():with_desc("package: Show"),
["n|<leader>ps"] = map_cr("Lazy sync"):with_silent():with_noremap():with_nowait():with_desc("package: Sync"),
["n|<leader>pu"] = map_cr("Lazy update")
:with_silent()
:with_noremap()
:with_nowait()
:with_desc("package: Update"),
["n|<leader>pi"] = map_cr("Lazy install")
:with_silent()
:with_noremap()
:with_nowait()
:with_desc("package: Install"),
["n|<leader>pl"] = map_cr("Lazy log"):with_silent():with_noremap():with_nowait():with_desc("package: Log"),
["n|<leader>pc"] = map_cr("Lazy check"):with_silent():with_noremap():with_nowait():with_desc("package: Check"),
["n|<leader>pd"] = map_cr("Lazy debug"):with_silent():with_noremap():with_nowait():with_desc("package: Debug"),
["n|<leader>pp"] = map_cr("Lazy profile")
:with_silent()
:with_noremap()
:with_nowait()
:with_desc("package: Profile"),
["n|<leader>pr"] = map_cr("Lazy restore")
:with_silent()
:with_noremap()
:with_nowait()
:with_desc("package: Restore"),
["n|<leader>px"] = map_cr("Lazy clean"):with_silent():with_noremap():with_nowait():with_desc("package: Clean"),
},
local plug_map = {
-- Package manager: lazy.nvim
["n|<leader>ph"] = map_cr("Lazy"):with_silent():with_noremap():with_nowait():with_desc("package: Show"),
["n|<leader>ps"] = map_cr("Lazy sync"):with_silent():with_noremap():with_nowait():with_desc("package: Sync"),
["n|<leader>pu"] = map_cr("Lazy update"):with_silent():with_noremap():with_nowait():with_desc("package: Update"),
["n|<leader>pi"] = map_cr("Lazy install"):with_silent():with_noremap():with_nowait():with_desc("package: Install"),
["n|<leader>pl"] = map_cr("Lazy log"):with_silent():with_noremap():with_nowait():with_desc("package: Log"),
["n|<leader>pc"] = map_cr("Lazy check"):with_silent():with_noremap():with_nowait():with_desc("package: Check"),
["n|<leader>pd"] = map_cr("Lazy debug"):with_silent():with_noremap():with_nowait():with_desc("package: Debug"),
["n|<leader>pp"] = map_cr("Lazy profile"):with_silent():with_noremap():with_nowait():with_desc("package: Profile"),
["n|<leader>pr"] = map_cr("Lazy restore"):with_silent():with_noremap():with_nowait():with_desc("package: Restore"),
["n|<leader>px"] = map_cr("Lazy clean"):with_silent():with_noremap():with_nowait():with_desc("package: Clean"),
}
bind.nvim_load_mapping(mappings.core)
bind.nvim_load_mapping(plug_map)
-- Builtin & Plugin keymaps
-- Plugin keymaps
require("keymap.completion")
require("keymap.editor")
require("keymap.lang")
@@ -44,7 +29,7 @@ require("keymap.tool")
require("keymap.ui")
-- User keymaps
local ok, def = pcall(require, "user.keymap.init")
local ok, mappings = pcall(require, "user.keymap.init")
if ok then
require("modules.utils.keymap").replace(def)
require("modules.utils.keymap").replace(mappings)
end

View File

@@ -1,16 +1,17 @@
local bind = require("keymap.bind")
local map_cr = bind.map_cr
-- local map_cu = bind.map_cu
-- local map_cmd = bind.map_cmd
-- local map_callback = bind.map_callback
local mappings = {
plugins = {
-- Plugin: render-markdown.nvim
["n|<F1>"] = map_cr("RenderMarkdown toggle")
:with_noremap()
:with_silent()
:with_desc("tool: toggle markdown preview within nvim"),
-- Plugin: MarkdownPreview
["n|<F12>"] = map_cr("MarkdownPreviewToggle"):with_noremap():with_silent():with_desc("tool: Preview markdown"),
},
local plug_map = {
-- Plugin render-markdown.nvim
["n|<F1>"] = map_cr("RenderMarkdown toggle")
:with_noremap()
:with_silent()
:with_desc("tool: toggle markdown preview within nvim"),
-- Plugin MarkdownPreview
["n|<F12>"] = map_cr("MarkdownPreviewToggle"):with_noremap():with_silent():with_desc("tool: Preview markdown"),
}
bind.nvim_load_mapping(mappings.plugins)
bind.nvim_load_mapping(plug_map)

View File

@@ -1,4 +1,3 @@
local vim_path = require("core.global").vim_path
local bind = require("keymap.bind")
local map_cr = bind.map_cr
local map_cu = bind.map_cu
@@ -6,211 +5,187 @@ local map_cmd = bind.map_cmd
local map_callback = bind.map_callback
require("keymap.helpers")
local mappings = {
plugins = {
-- Plugin: edgy
["n|<C-n>"] = map_callback(function()
require("edgy").toggle("left")
end)
:with_noremap()
:with_silent()
:with_desc("filetree: Toggle"),
local plug_map = {
-- Plugin: vim-fugitive
["n|gps"] = map_cr("G push"):with_noremap():with_silent():with_desc("git: Push"),
["n|gpl"] = map_cr("G pull"):with_noremap():with_silent():with_desc("git: Pull"),
["n|<leader>gG"] = map_cu("Git"):with_noremap():with_silent():with_desc("git: Open git-fugitive"),
-- Plugin: vim-fugitive
["n|gps"] = map_cr("G push"):with_noremap():with_silent():with_desc("git: Push"),
["n|gpl"] = map_cr("G pull"):with_noremap():with_silent():with_desc("git: Pull"),
["n|<leader>gG"] = map_cu("Git"):with_noremap():with_silent():with_desc("git: Open git-fugitive"),
-- Plugin: nvim-tree
["n|<C-n>"] = map_cr("NvimTreeToggle"):with_noremap():with_silent():with_desc("filetree: Toggle"),
["n|<leader>nf"] = map_cr("NvimTreeFindFile"):with_noremap():with_silent():with_desc("filetree: Find file"),
["n|<leader>nr"] = map_cr("NvimTreeRefresh"):with_noremap():with_silent():with_desc("filetree: Refresh"),
-- Plugin: nvim-tree
["n|<leader>nf"] = map_cr("NvimTreeFindFile"):with_noremap():with_silent():with_desc("filetree: Find file"),
["n|<leader>nr"] = map_cr("NvimTreeRefresh"):with_noremap():with_silent():with_desc("filetree: Refresh"),
-- Plugin: sniprun
["v|<leader>r"] = map_cr("SnipRun"):with_noremap():with_silent():with_desc("tool: Run code by range"),
["n|<leader>r"] = map_cu([[%SnipRun]]):with_noremap():with_silent():with_desc("tool: Run code by file"),
-- Plugin: sniprun
["v|<leader>r"] = map_cr("SnipRun"):with_noremap():with_silent():with_desc("tool: Run code by range"),
["n|<leader>r"] = map_cu([[%SnipRun]]):with_noremap():with_silent():with_desc("tool: Run code by file"),
-- Plugin: toggleterm
["t|<Esc><Esc>"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["n|<C-\\>"] = map_cr("ToggleTerm direction=horizontal")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["i|<C-\\>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=horizontal<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["t|<C-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle horizontal"),
["n|<A-\\>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["i|<A-\\>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=vertical<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<A-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<F5>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["i|<F5>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=vertical<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<F5>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<A-d>"] = map_cr("ToggleTerm direction=float"):with_noremap():with_silent():with_desc("terminal: Toggle float"),
["i|<A-d>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=float<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle float"),
["t|<A-d>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle float"),
["n|<leader>gg"] = map_callback(function()
_toggle_lazygit()
end)
:with_noremap()
:with_silent()
:with_desc("git: Toggle lazygit"),
-- Plugin: toggleterm
["t|<Esc><Esc>"] = map_cmd([[<C-\><C-n>]]):with_noremap():with_silent(), -- switch to normal mode in terminal.
["n|<C-\\>"] = map_cr("ToggleTerm direction=horizontal")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["i|<C-\\>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=horizontal<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["t|<C-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle horizontal"),
["n|<A-\\>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["i|<A-\\>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=vertical<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<A-\\>"] = map_cmd("<Cmd>ToggleTerm<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["n|<F5>"] = map_cr("ToggleTerm direction=vertical")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["i|<F5>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=vertical<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle vertical"),
["t|<F5>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle vertical"),
["n|<A-d>"] = map_cr("ToggleTerm direction=float")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle float"),
["i|<A-d>"] = map_cmd("<Esc><Cmd>ToggleTerm direction=float<CR>")
:with_noremap()
:with_silent()
:with_desc("terminal: Toggle float"),
["t|<A-d>"] = map_cmd("<Cmd>ToggleTerm<CR>"):with_noremap():with_silent():with_desc("terminal: Toggle float"),
["n|<leader>gg"] = map_callback(function()
_toggle_lazygit()
end)
:with_noremap()
:with_silent()
:with_desc("git: Toggle lazygit"),
-- Plugin: trouble
["n|gt"] = map_cr("Trouble diagnostics toggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"),
["n|<leader>lw"] = map_cr("Trouble diagnostics toggle")
:with_noremap()
:with_silent()
:with_desc("lsp: Show workspace diagnostics"),
["n|<leader>lp"] = map_cr("Trouble project_diagnostics toggle")
:with_noremap()
:with_silent()
:with_desc("lsp: Show project diagnostics"),
["n|<leader>ld"] = map_cr("Trouble diagnostics toggle filter.buf=0")
:with_noremap()
:with_silent()
:with_desc("lsp: Show document diagnostics"),
-- Plugin: trouble
["n|gt"] = map_cr("Trouble diagnostics toggle")
:with_noremap()
:with_silent()
:with_desc("lsp: Toggle trouble list"),
["n|<leader>lw"] = map_cr("Trouble diagnostics toggle")
:with_noremap()
:with_silent()
:with_desc("lsp: Show workspace diagnostics"),
["n|<leader>lp"] = map_cr("Trouble project_diagnostics toggle")
:with_noremap()
:with_silent()
:with_desc("lsp: Show project diagnostics"),
["n|<leader>ld"] = map_cr("Trouble diagnostics toggle filter.buf=0")
:with_noremap()
:with_silent()
:with_desc("lsp: Show document diagnostics"),
-- Plugin: telescope
["n|<C-p>"] = map_callback(function()
_command_panel()
end)
:with_noremap()
:with_silent()
:with_desc("tool: Toggle command panel"),
["n|<leader>fc"] = map_callback(function()
_telescope_collections(require("telescope.themes").get_dropdown())
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope collections"),
["n|<leader>ff"] = map_callback(function()
require("search").open({ collection = "file" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Find files"),
["n|<leader>fp"] = map_callback(function()
require("search").open({ collection = "pattern" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Find patterns"),
["v|<leader>fs"] = map_cu("Telescope grep_string")
:with_noremap()
:with_silent()
:with_desc("tool: Find word under cursor"),
["n|<leader>fg"] = map_callback(function()
require("search").open({ collection = "git" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Locate Git objects"),
["n|<leader>fd"] = map_callback(function()
require("search").open({ collection = "dossier" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Retrieve dossiers"),
["n|<leader>fm"] = map_callback(function()
require("search").open({ collection = "misc" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Miscellaneous"),
-- Plugin: telescope
["n|<C-p>"] = map_callback(function()
_command_panel()
end)
:with_noremap()
:with_silent()
:with_desc("tool: Toggle command panel"),
["n|<leader>fc"] = map_callback(function()
_telescope_collections(require("telescope.themes").get_dropdown())
end)
:with_noremap()
:with_silent()
:with_desc("tool: Open Telescope collections"),
["n|<leader>ff"] = map_callback(function()
require("search").open({ collection = "file" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Find files"),
["n|<leader>fp"] = map_callback(function()
require("search").open({ collection = "pattern" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Find patterns"),
["v|<leader>fs"] = map_callback(function()
local opts = vim.fn.getcwd() == vim_path and { additional_args = { "--no-ignore" } } or {}
require("telescope-live-grep-args.shortcuts").grep_visual_selection(opts)
end)
:with_noremap()
:with_silent()
:with_desc("tool: Find word under cursor"),
["n|<leader>fg"] = map_callback(function()
require("search").open({ collection = "git" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Locate Git objects"),
["n|<leader>fd"] = map_callback(function()
require("search").open({ collection = "dossier" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Retrieve dossiers"),
["n|<leader>fm"] = map_callback(function()
require("search").open({ collection = "misc" })
end)
:with_noremap()
:with_silent()
:with_desc("tool: Miscellaneous"),
-- Plugin: dap
["n|<F6>"] = map_callback(function()
require("dap").continue()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run/Continue"),
["n|<F7>"] = map_callback(function()
require("dap").terminate()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Stop"),
["n|<F8>"] = map_callback(function()
require("dap").toggle_breakpoint()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Toggle breakpoint"),
["n|<F9>"] = map_callback(function()
require("dap").step_into()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step into"),
["n|<F10>"] = map_callback(function()
require("dap").step_out()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step out"),
["n|<F11>"] = map_callback(function()
require("dap").step_over()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step over"),
["n|<leader>db"] = map_callback(function()
require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))
end)
:with_noremap()
:with_silent()
:with_desc("debug: Set breakpoint with condition"),
["n|<leader>dc"] = map_callback(function()
require("dap").run_to_cursor()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run to cursor"),
["n|<leader>dl"] = map_callback(function()
require("dap").run_last()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run last"),
["n|<leader>do"] = map_callback(function()
require("dap").repl.open()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Open REPL"),
},
-- Plugin: dap
["n|<F6>"] = map_callback(function()
require("dap").continue()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run/Continue"),
["n|<F7>"] = map_callback(function()
require("dap").terminate()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Stop"),
["n|<F8>"] = map_callback(function()
require("dap").toggle_breakpoint()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Toggle breakpoint"),
["n|<F9>"] = map_callback(function()
require("dap").step_into()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step into"),
["n|<F10>"] = map_callback(function()
require("dap").step_out()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step out"),
["n|<F11>"] = map_callback(function()
require("dap").step_over()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Step over"),
["n|<leader>db"] = map_callback(function()
require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))
end)
:with_noremap()
:with_silent()
:with_desc("debug: Set breakpoint with condition"),
["n|<leader>dc"] = map_callback(function()
require("dap").run_to_cursor()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run to cursor"),
["n|<leader>dl"] = map_callback(function()
require("dap").run_last()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Run last"),
["n|<leader>do"] = map_callback(function()
require("dap").repl.open()
end)
:with_noremap()
:with_silent()
:with_desc("debug: Open REPL"),
}
bind.nvim_load_mapping(mappings.plugins)
bind.nvim_load_mapping(plug_map)

View File

@@ -1,171 +1,105 @@
local bind = require("keymap.bind")
local map_cr = bind.map_cr
local map_cu = bind.map_cu
local map_cmd = bind.map_cmd
local map_callback = bind.map_callback
-- local map_cu = bind.map_cu
-- local map_cmd = bind.map_cmd
-- local map_callback = bind.map_callback
local mappings = {
builtins = {
-- Builtins: Buffer
["n|<leader>bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"),
-- Builtins: Terminal
["t|<C-w>h"] = map_cmd("<Cmd>wincmd h<CR>"):with_silent():with_noremap():with_desc("window: Focus left"),
["t|<C-w>l"] = map_cmd("<Cmd>wincmd l<CR>"):with_silent():with_noremap():with_desc("window: Focus right"),
["t|<C-w>j"] = map_cmd("<Cmd>wincmd j<CR>"):with_silent():with_noremap():with_desc("window: Focus down"),
["t|<C-w>k"] = map_cmd("<Cmd>wincmd k<CR>"):with_silent():with_noremap():with_desc("window: Focus up"),
-- Builtins: Tabpage
["n|tn"] = map_cr("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"),
["n|tk"] = map_cr("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"),
["n|tj"] = map_cr("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"),
["n|to"] = map_cr("tabonly"):with_noremap():with_silent():with_desc("tab: Only keep current tab"),
},
plugins = {
-- Plugin: nvim-bufdel
["n|<A-q>"] = map_cr("BufDel"):with_noremap():with_silent():with_desc("buffer: Close current"),
-- Plugin: bufferline.nvim
["n|<A-i>"] = map_cr("BufferLineCycleNext"):with_noremap():with_silent():with_desc("buffer: Switch to next"),
["n|<A-o>"] = map_cr("BufferLineCyclePrev"):with_noremap():with_silent():with_desc("buffer: Switch to prev"),
["n|<A-S-i>"] = map_cr("BufferLineMoveNext")
:with_noremap()
:with_silent()
:with_desc("buffer: Move current to next"),
["n|<A-S-o>"] = map_cr("BufferLineMovePrev")
:with_noremap()
:with_silent()
:with_desc("buffer: Move current to prev"),
["n|<leader>be"] = map_cr("BufferLineSortByExtension"):with_noremap():with_desc("buffer: Sort by extension"),
["n|<leader>bd"] = map_cr("BufferLineSortByDirectory"):with_noremap():with_desc("buffer: Sort by directory"),
["n|<A-1>"] = map_cr("BufferLineGoToBuffer 1"):with_noremap():with_silent():with_desc("buffer: Goto buffer 1"),
["n|<A-2>"] = map_cr("BufferLineGoToBuffer 2"):with_noremap():with_silent():with_desc("buffer: Goto buffer 2"),
["n|<A-3>"] = map_cr("BufferLineGoToBuffer 3"):with_noremap():with_silent():with_desc("buffer: Goto buffer 3"),
["n|<A-4>"] = map_cr("BufferLineGoToBuffer 4"):with_noremap():with_silent():with_desc("buffer: Goto buffer 4"),
["n|<A-5>"] = map_cr("BufferLineGoToBuffer 5"):with_noremap():with_silent():with_desc("buffer: Goto buffer 5"),
["n|<A-6>"] = map_cr("BufferLineGoToBuffer 6"):with_noremap():with_silent():with_desc("buffer: Goto buffer 6"),
["n|<A-7>"] = map_cr("BufferLineGoToBuffer 7"):with_noremap():with_silent():with_desc("buffer: Goto buffer 7"),
["n|<A-8>"] = map_cr("BufferLineGoToBuffer 8"):with_noremap():with_silent():with_desc("buffer: Goto buffer 8"),
["n|<A-9>"] = map_cr("BufferLineGoToBuffer 9"):with_noremap():with_silent():with_desc("buffer: Goto buffer 9"),
-- Plugin: smart-splits.nvim
["n|<A-h>"] = map_cu("SmartResizeLeft")
:with_silent()
:with_noremap()
:with_desc("window: Resize -3 horizontally"),
["n|<A-j>"] = map_cu("SmartResizeDown"):with_silent():with_noremap():with_desc("window: Resize -3 vertically"),
["n|<A-k>"] = map_cu("SmartResizeUp"):with_silent():with_noremap():with_desc("window: Resize +3 vertically"),
["n|<A-l>"] = map_cu("SmartResizeRight")
:with_silent()
:with_noremap()
:with_desc("window: Resize +3 horizontally"),
["n|<C-h>"] = map_cu("SmartCursorMoveLeft"):with_silent():with_noremap():with_desc("window: Focus left"),
["n|<C-j>"] = map_cu("SmartCursorMoveDown"):with_silent():with_noremap():with_desc("window: Focus down"),
["n|<C-k>"] = map_cu("SmartCursorMoveUp"):with_silent():with_noremap():with_desc("window: Focus up"),
["n|<C-l>"] = map_cu("SmartCursorMoveRight"):with_silent():with_noremap():with_desc("window: Focus right"),
["n|<leader>Wh"] = map_cu("SmartSwapLeft")
:with_silent()
:with_noremap()
:with_desc("window: Move window leftward"),
["n|<leader>Wj"] = map_cu("SmartSwapDown")
:with_silent()
:with_noremap()
:with_desc("window: Move window downward"),
["n|<leader>Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window upward"),
["n|<leader>Wl"] = map_cu("SmartSwapRight")
:with_silent()
:with_noremap()
:with_desc("window: Move window rightward"),
},
local plug_map = {
-- Plugin: bufferline.nvim
["n|<A-i>"] = map_cr("BufferLineCycleNext"):with_noremap():with_silent():with_desc("buffer: Switch to next"),
["n|<A-o>"] = map_cr("BufferLineCyclePrev"):with_noremap():with_silent():with_desc("buffer: Switch to prev"),
["n|<A-S-i>"] = map_cr("BufferLineMoveNext"):with_noremap():with_silent():with_desc("buffer: Move current to next"),
["n|<A-S-o>"] = map_cr("BufferLineMovePrev"):with_noremap():with_silent():with_desc("buffer: Move current to prev"),
["n|<leader>be"] = map_cr("BufferLineSortByExtension"):with_noremap():with_desc("buffer: Sort by extension"),
["n|<leader>bd"] = map_cr("BufferLineSortByDirectory"):with_noremap():with_desc("buffer: Sort by directory"),
["n|<A-1>"] = map_cr("BufferLineGoToBuffer 1"):with_noremap():with_silent():with_desc("buffer: Goto buffer 1"),
["n|<A-2>"] = map_cr("BufferLineGoToBuffer 2"):with_noremap():with_silent():with_desc("buffer: Goto buffer 2"),
["n|<A-3>"] = map_cr("BufferLineGoToBuffer 3"):with_noremap():with_silent():with_desc("buffer: Goto buffer 3"),
["n|<A-4>"] = map_cr("BufferLineGoToBuffer 4"):with_noremap():with_silent():with_desc("buffer: Goto buffer 4"),
["n|<A-5>"] = map_cr("BufferLineGoToBuffer 5"):with_noremap():with_silent():with_desc("buffer: Goto buffer 5"),
["n|<A-6>"] = map_cr("BufferLineGoToBuffer 6"):with_noremap():with_silent():with_desc("buffer: Goto buffer 6"),
["n|<A-7>"] = map_cr("BufferLineGoToBuffer 7"):with_noremap():with_silent():with_desc("buffer: Goto buffer 7"),
["n|<A-8>"] = map_cr("BufferLineGoToBuffer 8"):with_noremap():with_silent():with_desc("buffer: Goto buffer 8"),
["n|<A-9>"] = map_cr("BufferLineGoToBuffer 9"):with_noremap():with_silent():with_desc("buffer: Goto buffer 9"),
}
bind.nvim_load_mapping(mappings.builtins)
bind.nvim_load_mapping(mappings.plugins)
bind.nvim_load_mapping(plug_map)
--- The following code enables this file to be exported ---
--- for use with gitsigns lazy-loaded keymap bindings ---
local mapping = {}
local M = {}
function M.gitsigns(bufnr)
local gitsigns = require("gitsigns")
function mapping.gitsigns(buf)
local actions = require("gitsigns.actions")
local map = {
["n|]g"] = map_callback(function()
if vim.wo.diff then
return "]g"
end
vim.schedule(function()
gitsigns.nav_hunk("next")
end)
return "<Ignore>"
["n|]g"] = bind.map_callback(function()
if vim.wo.diff then
return "]g"
end
vim.schedule(function()
actions.next_hunk()
end)
:with_buffer(bufnr)
:with_noremap()
return "<Ignore>"
end)
:with_buffer(buf)
:with_expr()
:with_desc("git: Goto next hunk"),
["n|[g"] = map_callback(function()
if vim.wo.diff then
return "[g"
end
vim.schedule(function()
gitsigns.nav_hunk("prev")
end)
return "<Ignore>"
["n|[g"] = bind.map_callback(function()
if vim.wo.diff then
return "[g"
end
vim.schedule(function()
actions.prev_hunk()
end)
:with_buffer(bufnr)
:with_noremap()
return "<Ignore>"
end)
:with_buffer(buf)
:with_expr()
:with_desc("git: Goto prev hunk"),
["n|<leader>gs"] = map_callback(function()
gitsigns.stage_hunk()
end)
:with_buffer(bufnr)
:with_noremap()
:with_desc("git: Toggle staging/unstaging of hunk"),
["v|<leader>gs"] = map_callback(function()
gitsigns.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
:with_buffer(bufnr)
:with_noremap()
:with_desc("git: Toggle staging/unstaging of selected hunk"),
["n|<leader>gr"] = map_callback(function()
gitsigns.reset_hunk()
end)
:with_buffer(bufnr)
:with_noremap()
["n|<leader>gs"] = bind.map_callback(function()
actions.stage_hunk()
end)
:with_buffer(buf)
:with_desc("git: Stage hunk"),
["v|<leader>gs"] = bind.map_callback(function()
actions.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
:with_buffer(buf)
:with_desc("git: Stage hunk"),
["n|<leader>gu"] = bind.map_callback(function()
actions.undo_stage_hunk()
end)
:with_buffer(buf)
:with_desc("git: Undo stage hunk"),
["n|<leader>gr"] = bind.map_callback(function()
actions.reset_hunk()
end)
:with_buffer(buf)
:with_desc("git: Reset hunk"),
["v|<leader>gr"] = map_callback(function()
gitsigns.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
:with_buffer(bufnr)
:with_noremap()
["v|<leader>gr"] = bind.map_callback(function()
actions.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
end)
:with_buffer(buf)
:with_desc("git: Reset hunk"),
["n|<leader>gR"] = map_callback(function()
gitsigns.reset_buffer()
end)
:with_buffer(bufnr)
:with_noremap()
["n|<leader>gR"] = bind.map_callback(function()
actions.reset_buffer()
end)
:with_buffer(buf)
:with_desc("git: Reset buffer"),
["n|<leader>gp"] = map_callback(function()
gitsigns.preview_hunk()
end)
:with_buffer(bufnr)
:with_noremap()
["n|<leader>gp"] = bind.map_callback(function()
actions.preview_hunk()
end)
:with_buffer(buf)
:with_desc("git: Preview hunk"),
["n|<leader>gb"] = map_callback(function()
gitsigns.blame_line({ full = true })
end)
:with_buffer(bufnr)
:with_noremap()
["n|<leader>gb"] = bind.map_callback(function()
actions.blame_line({ full = true })
end)
:with_buffer(buf)
:with_desc("git: Blame line"),
-- Text objects
["ox|ih"] = map_callback(function()
gitsigns.select_hunk()
end)
:with_buffer(bufnr)
:with_noremap(),
["ox|ih"] = bind.map_callback(function()
actions.text_object()
end):with_buffer(buf),
}
bind.nvim_load_mapping(map)
end
return M
return mapping

View File

@@ -0,0 +1,80 @@
return function()
require("modules.utils").load_plugin("aerial", {
lazy_load = false,
close_on_select = true,
highlight_on_jump = false,
disable_max_lines = 8500,
disable_max_size = 1000000,
ignore = { filetypes = { "NvimTree", "terminal", "nofile" } },
-- Use symbol tree for folding. Set to true or false to enable/disable
-- Set to "auto" to manage folds if your previous foldmethod was 'manual'
-- This can be a filetype map (see :help aerial-filetype-map)
manage_folds = "auto",
layout = {
-- Determines the default direction to open the aerial window. The 'prefer'
-- options will open the window in the other direction *if* there is a
-- different buffer in the way of the preferred direction
-- Enum: prefer_right, prefer_left, right, left, float
default_direction = "prefer_right",
},
-- Keymaps in aerial window. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("aerial.actions").<name>
-- Set to `false` to remove a keymap
keymaps = {
["?"] = "actions.show_help",
["g?"] = "actions.show_help",
["<CR>"] = "actions.jump",
["<2-LeftMouse>"] = "actions.jump",
["<C-v>"] = "actions.jump_vsplit",
["<C-s>"] = "actions.jump_split",
["<C-d>"] = "actions.down_and_scroll",
["<C-u>"] = "actions.up_and_scroll",
["{"] = "actions.prev",
["}"] = "actions.next",
["[["] = "actions.prev_up",
["]]"] = "actions.next_up",
["q"] = "actions.close",
["o"] = "actions.tree_toggle",
["O"] = "actions.tree_toggle_recursive",
["zr"] = "actions.tree_increase_fold_level",
["zR"] = "actions.tree_open_all",
["zm"] = "actions.tree_decrease_fold_level",
["zM"] = "actions.tree_close_all",
["zx"] = "actions.tree_sync_folds",
["zX"] = "actions.tree_sync_folds",
},
-- A list of all symbols to display. Set to false to display all symbols.
-- This can be a filetype map (see :help aerial-filetype-map)
-- To see all available values, see :help SymbolKind
filter_kind = {
"Array",
"Boolean",
"Class",
"Constant",
"Constructor",
"Enum",
"EnumMember",
"Event",
"Field",
"File",
"Function",
"Interface",
"Key",
"Method",
"Module",
"Namespace",
"Null",
-- "Number",
"Object",
"Operator",
"Package",
-- "Property",
-- "String",
"Struct",
-- "TypeParameter",
-- "Variable",
},
})
end

View File

@@ -8,13 +8,6 @@ local format_modifications_only = settings.format_modifications_only
local server_formatting_block_list = settings.server_formatting_block_list
local format_timeout = settings.format_timeout
vim.api.nvim_create_user_command("Format", function()
M.format({
timeout = format_timeout,
filter = M.format_filter,
})
end, {})
vim.api.nvim_create_user_command("FormatToggle", function()
M.toggle_format_on_save()
end, {})
@@ -125,7 +118,7 @@ function M.format(opts)
end
local bufnr = opts.bufnr or vim.api.nvim_get_current_buf()
local clients = vim.lsp.get_clients({ bufnr = bufnr })
local clients = vim.lsp.get_clients({ buffer = bufnr })
if opts.filter then
clients = opts.filter(clients)

View File

@@ -1,20 +1,14 @@
return function()
local vim_path = require("core.global").vim_path
local snippet_path = vim_path .. "/snips/"
local user_snippet_path = vim_path .. "/lua/user/snips/"
local snippet_path = vim.fn.stdpath("config") .. "/snips/"
if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then
vim.opt.rtp:append(snippet_path)
end
require("modules.utils").load_plugin("luasnip", {
history = true,
update_events = "TextChanged,TextChangedI",
delete_check_events = "TextChanged,InsertLeave",
}, false, require("luasnip").config.set_config)
require("luasnip.loaders.from_vscode").lazy_load({
paths = {
snippet_path,
user_snippet_path,
},
})
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()

View File

@@ -52,12 +52,10 @@ please REMOVE your LSP configuration (rust_analyzer.lua) from the `servers` dire
end
local ok, custom_handler = pcall(require, "user.configs.lsp-servers." .. lsp_name)
local default_ok, default_handler = pcall(require, "completion.servers." .. lsp_name)
-- Use preset if there is no user definition
if not ok then
ok, custom_handler = default_ok, default_handler
ok, custom_handler = pcall(require, "completion.servers." .. lsp_name)
end
if not ok then
-- Default to use factory config for server(s) that doesn't include a spec
nvim_lsp[lsp_name].setup(opts)
@@ -68,14 +66,7 @@ please REMOVE your LSP configuration (rust_analyzer.lua) from the `servers` dire
--- See `clangd.lua` for example.
custom_handler(opts)
elseif type(custom_handler) == "table" then
nvim_lsp[lsp_name].setup(
vim.tbl_deep_extend(
"force",
opts,
type(default_handler) == "table" and default_handler or {},
custom_handler
)
)
nvim_lsp[lsp_name].setup(vim.tbl_deep_extend("force", opts, custom_handler))
else
vim.notify(
string.format(

View File

@@ -83,9 +83,7 @@ M.setup = function()
)
end,
on_stderr = function(_, msg_stream)
if msg_stream then
vim.notify(msg_stream, vim.log.levels.ERROR, { title = "[lsp] Install Failure" })
end
vim.notify(msg_stream, vim.log.levels.ERROR, { title = "[lsp] Install Failure" })
end,
})
:start()

View File

@@ -17,7 +17,7 @@ return function()
-- Don't specify any config here if you are using the default one.
local sources = {
btns.formatting.clang_format.with({
filetypes = { "c", "cpp", "objc", "objcpp", "cs", "cuda", "proto" },
filetypes = { "c", "cpp", "objc", "objcpp", "cs", "java", "cuda", "proto" },
extra_args = formatter_args("clang_format"),
}),
btns.formatting.prettier.with({

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/bashls.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/bashls.lua
return {
cmd = { "bash-language-server", "start" },
filetypes = { "bash", "sh" },

View File

@@ -33,7 +33,7 @@ local function get_binary_path_list(binaries)
return table.concat(path_list, ",")
end
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/clangd.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/clangd.lua
return function(options)
require("lspconfig").clangd.setup({
on_attach = options.on_attach,

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/dartls.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/dartls.lua
return {
cmd = { "dart", "language-server", "--protocol=lsp" },
filetypes = { "dart" },

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/gopls.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/gopls.lua
return {
cmd = { "gopls", "-remote.debug=:0", "-remote=auto" },
filetypes = { "go", "gomod", "gosum", "gotmpl", "gohtmltmpl", "gotexttmpl" },
@@ -31,11 +31,11 @@ return {
gopls = {
staticcheck = true,
semanticTokens = true,
noSemanticString = true,
usePlaceholders = true,
completeUnimported = true,
symbolMatcher = "Fuzzy",
buildFlags = { "-tags", "integration" },
semanticTokenTypes = { string = false },
codelenses = {
generate = true,
gc_details = true,

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/jsonls.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/jsonls.lua
return {
flags = { debounce_text_changes = 500 },
settings = {

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/lua_ls.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/lua_ls.lua
return {
settings = {
Lua = {

View File

@@ -1,4 +1,4 @@
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/configs/pylsp.lua
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua
return {
cmd = { "pylsp" },
filetypes = { "python" },

View File

@@ -1,7 +0,0 @@
return function()
require("mini.cursorword").setup({
-- Delay (in ms) between when cursor moved and when highlighting appeared
delay = 200,
})
require("modules.utils").gen_cursorword_hl()
end

View File

@@ -1,20 +0,0 @@
return function()
vim.g.maplocalleader = ","
require("modules.utils").load_plugin("grug-far", {
engine = "ripgrep",
engines = {
ripgrep = {
path = "rg",
showReplaceDiff = true,
placeholders = {
enabled = true,
},
},
},
windowCreationCommand = "bot split",
disableBufferLineNumbers = false,
icons = {
enabled = true,
},
})
end

View File

@@ -0,0 +1,6 @@
return function()
require("modules.utils").load_plugin("local-highlight", {
hlgroup = "IlluminatedWordText",
insert_mode = false,
})
end

View File

@@ -1,5 +0,0 @@
return function()
vim.g.matchup_transmute_enabled = 1
vim.g.matchup_surround_enabled = 1
vim.g.matchup_matchparen_offscreen = { method = "popup" }
end

View File

@@ -10,6 +10,7 @@ return function()
require("modules.utils").load_plugin("crates", {
smart_insert = true,
insert_closing_quote = true,
avoid_prerelease = true,
autoload = true,
autoupdate = true,
autoupdate_throttle = 250,
@@ -18,6 +19,7 @@ return function()
thousands_separator = ",",
notification_title = "Crates",
curl_args = { "-sL", "--retry", "1" },
disable_invalid_feature_diagnostic = false,
text = {
loading = " " .. icons.misc.Watch .. "Loading",
version = " " .. icons.ui.Check .. "%s",

View File

@@ -5,43 +5,20 @@ return function()
misc = require("modules.utils.icons").get("misc", true),
ui = require("modules.utils.icons").get("ui", true),
}
local utils = require("dropbar.utils")
local sources = require("dropbar.sources")
-- Custom source to display only the leaf filename in the dropbar
sources.symbols = {
get_symbols = function(buf, win, cursor)
local symbols = sources.path.get_symbols(buf, win, cursor)
return { symbols[#symbols] }
end,
}
require("modules.utils").load_plugin("dropbar", {
bar = {
hover = false,
truncate = true,
pick = { pivots = "etovxqpdygfblzhckisuran" },
sources = function(buf)
if vim.bo[buf].ft == "markdown" then
return {
sources.symbols,
sources.markdown,
}
end
if vim.bo[buf].buftype == "terminal" then
return {
sources.terminal,
}
end
return {
sources.symbols,
utils.source.fallback({
sources.lsp,
sources.treesitter,
}),
}
end,
},
sources = {
path = {
relative_to = function()
-- Only show the leaf filename in dropbar
return vim.fn.expand("%:p:h")
end,
},
terminal = {
name = function(buf)
local name = vim.api.nvim_buf_get_name(buf)
@@ -58,6 +35,7 @@ return function()
icons = {
enable = true,
kinds = {
use_devicons = true,
symbols = {
-- Type
Array = icons.type.Array,

View File

@@ -1,7 +1,6 @@
return function()
local builtin = require("telescope.builtin")
local extensions = require("telescope").extensions
local vim_path = require("core.global").vim_path
require("modules.utils").load_plugin("search", {
collections = {
@@ -13,9 +12,7 @@ return function()
name = "Files",
tele_func = function(opts)
opts = opts or {}
if vim.fn.getcwd() == vim_path then
builtin.find_files(vim.tbl_deep_extend("force", opts, { no_ignore = true }))
elseif vim.fn.isdirectory(".git") == 1 then
if vim.fn.isdirectory(".git") == 1 then
builtin.git_files(opts)
else
builtin.find_files(opts)
@@ -49,20 +46,13 @@ return function()
{
name = "Word in project",
tele_func = function()
local opts = {}
if vim.fn.getcwd() == vim_path then
opts["additional_args"] = { "--no-ignore" }
end
extensions.live_grep_args.live_grep_args(opts)
extensions.live_grep_args.live_grep_args()
end,
},
{
name = "Word under cursor",
tele_func = function(opts)
opts = opts or {}
if vim.fn.getcwd() == vim_path then
opts["additional_args"] = { "--no-ignore" }
end
builtin.grep_string(opts)
end,
},

View File

@@ -44,6 +44,13 @@ return function()
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
},
extensions = {
aerial = {
show_lines = false,
show_nesting = {
["_"] = false, -- This key will be the default
lua = true, -- You can set the option for specific filetypes
},
},
fzf = {
fuzzy = false,
override_generic_sorter = true,
@@ -90,5 +97,6 @@ return function()
require("telescope").load_extension("undo")
require("telescope").load_extension("zoxide")
require("telescope").load_extension("persisted")
require("telescope").load_extension("aerial")
require("telescope").load_extension("advanced_git_search")
end

View File

@@ -8,11 +8,21 @@ return function()
return vim.o.columns * 0.40
end
end,
on_open = function()
on_open = function(term)
-- Prevent infinite calls from freezing neovim.
-- Only set these options specific to this terminal buffer.
vim.api.nvim_set_option_value("foldmethod", "manual", { scope = "local" })
vim.api.nvim_set_option_value("foldexpr", "0", { scope = "local" })
-- Prevent horizontal terminal from obscuring `nvim-tree`.
local api = require("nvim-tree.api")
local tree = require("nvim-tree.view")
if tree.is_visible() and term.direction == "horizontal" then
local width = vim.fn.winwidth(tree.get_winnr())
api.tree.toggle()
tree.View.width = width
api.tree.toggle(false, true)
end
end,
highlights = {
Normal = {

View File

@@ -34,8 +34,8 @@ return function()
padding = 0,
},
{
filetype = "trouble",
text = "LSP Outline",
filetype = "aerial",
text = "Symbol Outline",
text_align = "center",
padding = 0,
},

View File

@@ -30,23 +30,7 @@ return function()
properties = {},
},
integrations = {
cmp = true,
dap = true,
dap_ui = true,
diffview = true,
dropbar = { enabled = true, color_mode = true },
fidget = true,
flash = true,
fzf = true,
gitsigns = true,
grug_far = true,
hop = true,
indent_blankline = { enabled = true, colored_indent_levels = true },
lsp_saga = true,
lsp_trouble = true,
markdown = true,
mason = true,
mini = { enabled = true, indentscope_color = "" },
treesitter = true,
native_lsp = {
enabled = true,
virtual_text = {
@@ -62,14 +46,53 @@ return function()
information = { "underline" },
},
},
aerial = true,
alpha = false,
barbar = false,
beacon = false,
cmp = true,
coc_nvim = false,
dap = true,
dap_ui = true,
dashboard = false,
dropbar = { enabled = true, color_mode = true },
fern = false,
fidget = true,
flash = true,
gitgutter = false,
gitsigns = true,
harpoon = false,
headlines = false,
hop = true,
illuminate = true,
indent_blankline = { enabled = true, colored_indent_levels = false },
leap = false,
lightspeed = false,
lsp_saga = true,
lsp_trouble = true,
markdown = true,
mason = true,
mini = false,
navic = { enabled = false },
neogit = false,
neotest = false,
neotree = { enabled = false, show_root = true, transparent_panel = false },
noice = false,
notify = true,
nvimtree = true,
overseer = false,
pounce = false,
rainbow_delimiters = true,
render_markdown = true,
sandwich = false,
semantic_tokens = true,
symbols_outline = false,
telekasten = false,
telescope = { enabled = true, style = "nvchad" },
treesitter = true,
treesitter_context = true,
ts_rainbow = false,
vim_sneak = false,
vimwiki = false,
which_key = true,
},
color_overrides = {},

View File

@@ -1,76 +0,0 @@
return function()
local trouble_filter = function(position)
return function(_, win)
return vim.w[win].trouble
and vim.w[win].trouble.position == position
and vim.w[win].trouble.type == "split"
and vim.w[win].trouble.relative == "editor"
and not vim.w[win].trouble_preview
end
end
require("modules.utils").load_plugin("edgy", {
close_when_all_hidden = true,
exit_when_last = true,
wo = { winbar = false },
keys = {
["q"] = false,
["Q"] = false,
["<C-q>"] = false,
["<A-j>"] = function(win)
win:resize("height", -2)
end,
["<A-k>"] = function(win)
win:resize("height", 2)
end,
["<A-h>"] = function(win)
win:resize("width", -2)
end,
["<A-l>"] = function(win)
win:resize("width", 2)
end,
},
bottom = {
{ ft = "qf", size = { height = 0.3 } },
{
ft = "toggleterm",
size = { height = 0.3 },
filter = function(_, win)
return vim.w[win].relative == ""
end,
},
{
ft = "help",
size = { height = 0.3 },
filter = function(buf)
return vim.bo[buf].buftype == "help"
end,
},
},
left = {
{
ft = "NvimTree",
pinned = true,
open = "NvimTreeOpen",
size = { width = 30 },
},
},
right = {
{
ft = "trouble",
pinned = true,
size = { height = 0.6, width = 0.3 },
open = "Trouble symbols toggle win.position=right",
filter = trouble_filter("right"),
},
{
ft = "trouble",
pinned = true,
collapsed = true,
size = { height = 0.4, width = 0.3 },
open = "Trouble lsp toggle win.position=right",
filter = trouble_filter("right"),
},
},
}, false, nil, true)
end

View File

@@ -164,7 +164,7 @@ return function()
lsp = {
function()
local buf_ft = vim.bo.filetype
local clients = vim.lsp.get_clients({ bufnr = vim.api.nvim_get_current_buf() })
local clients = vim.lsp.get_clients({ buffer = vim.api.nvim_get_current_buf() })
local lsp_lists = {}
local available_servers = {}
if next(clients) == nil then

View File

@@ -0,0 +1,37 @@
return function()
local blend_color = require("modules.utils").gen_neodim_blend_attr()
require("modules.utils").load_plugin("neodim", {
alpha = 0.45,
blend_color = blend_color,
refresh_delay = 75, -- time in ms to wait after typing before refreshing diagnostics
hide = {
virtual_text = true,
signs = false,
underline = false,
},
priority = 80,
disable = {
"alpha",
"bigfile",
"checkhealth",
"dap-repl",
"diff",
"fugitive",
"fugitiveblame",
"git",
"gitcommit",
"help",
"log",
"notify",
"NvimTree",
"Outline",
"qf",
"TelescopePrompt",
"text",
"toggleterm",
"undotree",
"vimwiki",
},
})
end

View File

@@ -21,6 +21,11 @@ completion["nvimdev/lspsaga.nvim"] = {
config = require("completion.lspsaga"),
dependencies = { "nvim-tree/nvim-web-devicons" },
}
completion["stevearc/aerial.nvim"] = {
lazy = true,
event = "LspAttach",
config = require("completion.aerial"),
}
completion["DNLHC/glance.nvim"] = {
lazy = true,
event = "LspAttach",

View File

@@ -55,17 +55,17 @@ editor["echasnovski/mini.align"] = {
event = { "CursorHold", "CursorHoldI" },
config = require("editor.align"),
}
editor["echasnovski/mini.cursorword"] = {
lazy = true,
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("editor.cursorword"),
}
editor["smoka7/hop.nvim"] = {
lazy = true,
version = "*",
event = { "CursorHold", "CursorHoldI" },
config = require("editor.hop"),
}
editor["tzachar/local-highlight.nvim"] = {
lazy = true,
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("editor.local-highlight"),
}
editor["brenoprata10/nvim-highlight-colors"] = {
lazy = true,
event = { "CursorHold", "CursorHoldI" },
@@ -84,30 +84,32 @@ editor["tpope/vim-sleuth"] = {
lazy = true,
event = { "BufNewFile", "BufReadPost", "BufFilePost" },
}
editor["MagicDuck/grug-far.nvim"] = {
editor["nvim-pack/nvim-spectre"] = {
lazy = true,
cmd = "GrugFar",
config = require("editor.grug-far"),
cmd = "Spectre",
}
editor["mrjones2014/smart-splits.nvim"] = {
lazy = true,
event = { "CursorHoldI", "CursorHold" },
config = require("editor.splits"),
}
----------------------------------------------------------------------
--  :treesitter related plugins --
----------------------------------------------------------------------
editor["nvim-treesitter/nvim-treesitter"] = {
lazy = true,
build = function()
if #vim.api.nvim_list_uis() > 0 then
if vim.fn.has("gui_running") == 1 then
vim.api.nvim_command([[TSUpdate]])
end
end,
event = "BufReadPre",
config = require("editor.treesitter"),
dependencies = {
{ "andymass/vim-matchup" },
{ "mfussenegger/nvim-treehopper" },
{ "nvim-treesitter/nvim-treesitter-textobjects" },
{
"andymass/vim-matchup",
init = require("editor.matchup"),
},
{
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),

View File

@@ -7,14 +7,9 @@ ui["goolord/alpha-nvim"] = {
}
ui["akinsho/bufferline.nvim"] = {
lazy = true,
event = { "BufReadPre", "BufAdd", "BufNewFile" },
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("ui.bufferline"),
}
ui["folke/edgy.nvim"] = {
lazy = true,
event = { "BufReadPre", "BufAdd", "BufNewFile" },
config = require("ui.edgy"),
}
ui["Jint-lzxy/nvim"] = {
lazy = false,
branch = "refactor/syntax-highlighting",
@@ -41,6 +36,11 @@ ui["nvim-lualine/lualine.nvim"] = {
event = { "BufReadPost", "BufAdd", "BufNewFile" },
config = require("ui.lualine"),
}
ui["zbirenbaum/neodim"] = {
lazy = true,
event = "LspAttach",
config = require("ui.neodim"),
}
ui["karb94/neoscroll.nvim"] = {
lazy = true,
event = { "CursorHold", "CursorHoldI" },
@@ -56,11 +56,6 @@ ui["folke/paint.nvim"] = {
event = { "CursorHold", "CursorHoldI" },
config = require("ui.paint"),
}
ui["mrjones2014/smart-splits.nvim"] = {
lazy = true,
event = { "CursorHoldI", "CursorHold" },
config = require("ui.splits"),
}
ui["folke/todo-comments.nvim"] = {
lazy = true,
event = { "CursorHold", "CursorHoldI" },

View File

@@ -57,7 +57,7 @@ local function init_palette()
end
if not palette then
palette = (vim.g.colors_name or ""):find("catppuccin") and require("catppuccin.palettes").get_palette()
palette = vim.g.colors_name:find("catppuccin") and require("catppuccin.palettes").get_palette()
or {
rosewater = "#DC8A78",
flamingo = "#DD7878",
@@ -104,7 +104,7 @@ end
-- NOTE: If the active colorscheme isn't `catppuccin`, this function won't overwrite existing definitions
---Sets a global highlight group.
---@param name string @Highlight group name, e.g. "ErrorMsg"
---@param foreground? string @The foreground color
---@param foreground string @The foreground color
---@param background? string @The background color
---@param italic? boolean
local function set_global_hl(name, foreground, background, italic)
@@ -133,24 +133,6 @@ function M.blend(foreground, background, alpha)
return string.format("#%02x%02x%02x", blend_channel(1), blend_channel(2), blend_channel(3))
end
---Darken a color by blending it with the background color.
---@param hex string @The color in hex to darken
---@param amount number @The amount to darken the color
---@param bg string @The background color to blend with
---@return string @The darkened color as a hex string
function M.darken(hex, amount, bg)
return M.blend(hex, bg or "#000000", math.abs(amount))
end
---Lighten a color by blending it with the foreground color.
---@param hex string @The color in hex to lighten
---@param amount number @The amount to lighten the color
---@param fg string @The foreground color to blend with
---@return string @The lightened color as a hex string
function M.lighten(hex, amount, fg)
return M.blend(hex, fg or "#FFFFFF", math.abs(amount))
end
---Get RGB highlight by highlight group
---@param hl_group string @Highlight group name
---@param use_bg boolean @Returns background or not
@@ -161,10 +143,7 @@ function M.hl_to_rgb(hl_group, use_bg, fallback_hl)
local hlexists = pcall(vim.api.nvim_get_hl, 0, { name = hl_group, link = false })
if hlexists then
-- FIXME: Investigate why hl-StatusLine is undefined in toggleterm and remove this workaround
-- (@Jint-lzxy)
local link = vim.bo.filetype == "toggleterm"
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = link })
local result = vim.api.nvim_get_hl(0, { name = hl_group, link = false })
if use_bg then
hex = result.bg and string.format("#%06x", result.bg) or "NONE"
else
@@ -187,7 +166,6 @@ function M.extend_hl(name, def)
local current_def = vim.api.nvim_get_hl(0, { name = name, link = false })
local combined_def = vim.tbl_deep_extend("force", current_def, def)
---@diagnostic disable-next-line: param-type-mismatch
vim.api.nvim_set_hl(0, name, combined_def)
end
@@ -257,13 +235,18 @@ function M.gen_alpha_hl()
set_global_hl("AlphaFooter", colors.yellow)
end
-- Generate highlight groups for cursorword. Existing attributes will NOT be overwritten
function M.gen_cursorword_hl()
local colors = M.get_palette()
-- Generate blend_color for neodim.
function M.gen_neodim_blend_attr()
local trans_bg = require("core.settings").transparent_background
local appearance = require("core.settings").background
-- Do not highlight `MiniCursorwordCurrent`
set_global_hl("MiniCursorword", nil, M.darken(colors.surface1, 0.7, colors.base))
set_global_hl("MiniCursorwordCurrent", nil)
if trans_bg and appearance == "dark" then
return "#000000"
elseif trans_bg and appearance == "light" then
return "#FFFFFF"
else
return M.hl_to_rgb("Normal", true)
end
end
---Convert number (0/1) to boolean
@@ -320,8 +303,7 @@ end
---@param opts nil|table @The default config to be merged with
---@param vim_plugin? boolean @If this plugin is written in vimscript or not
---@param setup_callback? function @Add new callback if the plugin needs unusual setup function
---@param overwrite? boolean @If load user table-type config by overwriting
function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback, overwrite)
function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback)
vim_plugin = vim_plugin or false
-- Get the file name of the default config
@@ -354,11 +336,7 @@ function M.load_plugin(plugin_name, opts, vim_plugin, setup_callback, overwrite)
if ok then
-- Extend base config if the returned user config is a table
if type(user_config) == "table" then
if overwrite == true then
opts = vim.tbl_deep_extend("force", opts, user_config)
else
opts = tbl_recursive_merge(opts, user_config)
end
opts = tbl_recursive_merge(opts, user_config)
setup_callback(opts)
-- Replace base config if the returned user config is a function
elseif type(user_config) == "function" then

View File

@@ -1,598 +0,0 @@
music_dir = ["/home/wyj/Music"]
player_port = 50101
player_interface = "::"
player_loop_mode = "Random"
player_volume = 70
player_speed = 10
player_gapless = false
podcast_simultanious_download = 3
podcast_max_retries = 3
podcast_dir = "/home/wyj/Music/podcast"
player_seek_step = "Auto"
player_remember_last_played_position = "Auto"
enable_exit_confirmation = true
playlist_display_symbol = false
playlist_select_random_track_quantity = 20
playlist_select_random_album_quantity = 5
theme_selected = "Palenight"
kill_daemon_when_quit = false
player_use_mpris = true
player_use_discord = true
[album_photo_xywh]
x_between_1_100 = 100
y_between_1_100 = 77
width_between_1_100 = 20
align = "BottomRight"
[style_color_symbol]
library_foreground = "Foreground"
library_background = "Reset"
library_border = "Blue"
library_highlight = "LightYellow"
library_highlight_symbol = "🦄"
playlist_foreground = "Foreground"
playlist_background = "Reset"
playlist_border = "Blue"
playlist_highlight = "LightYellow"
playlist_highlight_symbol = "🚀"
progress_foreground = "LightBlack"
progress_background = "Reset"
progress_border = "Blue"
lyric_foreground = "Foreground"
lyric_background = "Reset"
lyric_border = "Blue"
currently_playing_track_symbol = "►"
[style_color_symbol.alacritty_theme]
path = "/home/wyj/.config/termusic/themes/Palenight.yml"
name = "empty name"
author = "empty author"
background = "#292d3e"
foreground = "#959dcb"
cursor = "#959dcb"
text = "#292d3e"
black = "#292d3e"
red = "#f07178"
green = "#c3e88d"
yellow = "#ffcb6b"
blue = "#82aaff"
magenta = "#c792ea"
cyan = "#89ddff"
white = "#d0d0d0"
light_black = "#434758"
light_red = "#ff8b92"
light_green = "#ddffa7"
light_yellow = "#ffe585"
light_blue = "#9cc4ff"
light_magenta = "#e1acff"
light_cyan = "#a3f7ff"
light_white = "#ffffff"
[keys.global_esc.code]
type = "Esc"
[keys.global_esc.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_quit.code]
type = "Char"
args = "q"
[keys.global_quit.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_left.code]
type = "Char"
args = "h"
[keys.global_left.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_down.code]
type = "Char"
args = "j"
[keys.global_down.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_up.code]
type = "Char"
args = "k"
[keys.global_up.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_right.code]
type = "Char"
args = "l"
[keys.global_right.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_goto_top.code]
type = "Char"
args = "g"
[keys.global_goto_top.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_goto_bottom.code]
type = "Char"
args = "G"
[keys.global_goto_bottom.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_player_toggle_pause.code]
type = "Char"
args = " "
[keys.global_player_toggle_pause.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_player_next.code]
type = "Char"
args = "n"
[keys.global_player_next.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_player_previous.code]
type = "Char"
args = "N"
[keys.global_player_previous.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_player_volume_plus_1.code]
type = "Char"
args = "+"
[keys.global_player_volume_plus_1.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_player_volume_plus_2.code]
type = "Char"
args = "="
[keys.global_player_volume_plus_2.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_player_volume_minus_1.code]
type = "Char"
args = "_"
[keys.global_player_volume_minus_1.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_player_volume_minus_2.code]
type = "Char"
args = "-"
[keys.global_player_volume_minus_2.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_help.code]
type = "Char"
args = "h"
[keys.global_help.modifier]
type = "KeyModifiers"
bits = 2
[keys.global_player_seek_forward.code]
type = "Char"
args = "f"
[keys.global_player_seek_forward.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_player_seek_backward.code]
type = "Char"
args = "b"
[keys.global_player_seek_backward.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_lyric_adjust_forward.code]
type = "Char"
args = "F"
[keys.global_lyric_adjust_forward.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_lyric_adjust_backward.code]
type = "Char"
args = "B"
[keys.global_lyric_adjust_backward.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_player_speed_up.code]
type = "Char"
args = "f"
[keys.global_player_speed_up.modifier]
type = "KeyModifiers"
bits = 2
[keys.global_player_speed_down.code]
type = "Char"
args = "b"
[keys.global_player_speed_down.modifier]
type = "KeyModifiers"
bits = 2
[keys.global_lyric_cycle.code]
type = "Char"
args = "T"
[keys.global_lyric_cycle.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_layout_treeview.code]
type = "Char"
args = "1"
[keys.global_layout_treeview.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_layout_database.code]
type = "Char"
args = "2"
[keys.global_layout_database.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_player_toggle_gapless.code]
type = "Char"
args = "g"
[keys.global_player_toggle_gapless.modifier]
type = "KeyModifiers"
bits = 2
[keys.global_config_open.code]
type = "Char"
args = "C"
[keys.global_config_open.modifier]
type = "KeyModifiers"
bits = 1
[keys.global_save_playlist.code]
type = "Char"
args = "s"
[keys.global_save_playlist.modifier]
type = "KeyModifiers"
bits = 2
[keys.global_layout_podcast.code]
type = "Char"
args = "3"
[keys.global_layout_podcast.modifier]
type = "KeyModifiers"
bits = 0
[keys.global_xywh_move_left.code]
type = "Left"
[keys.global_xywh_move_left.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_move_right.code]
type = "Right"
[keys.global_xywh_move_right.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_move_up.code]
type = "Up"
[keys.global_xywh_move_up.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_move_down.code]
type = "Down"
[keys.global_xywh_move_down.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_zoom_in.code]
type = "PageUp"
[keys.global_xywh_zoom_in.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_zoom_out.code]
type = "PageDown"
[keys.global_xywh_zoom_out.modifier]
type = "KeyModifiers"
bits = 3
[keys.global_xywh_hide.code]
type = "End"
[keys.global_xywh_hide.modifier]
type = "KeyModifiers"
bits = 3
[keys.library_load_dir.code]
type = "Char"
args = "L"
[keys.library_load_dir.modifier]
type = "KeyModifiers"
bits = 1
[keys.library_delete.code]
type = "Char"
args = "d"
[keys.library_delete.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_yank.code]
type = "Char"
args = "y"
[keys.library_yank.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_paste.code]
type = "Char"
args = "p"
[keys.library_paste.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_search.code]
type = "Char"
args = "/"
[keys.library_search.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_search_youtube.code]
type = "Char"
args = "s"
[keys.library_search_youtube.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_tag_editor_open.code]
type = "Char"
args = "t"
[keys.library_tag_editor_open.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_switch_root.code]
type = "Char"
args = "o"
[keys.library_switch_root.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_add_root.code]
type = "Char"
args = "a"
[keys.library_add_root.modifier]
type = "KeyModifiers"
bits = 0
[keys.library_remove_root.code]
type = "Char"
args = "A"
[keys.library_remove_root.modifier]
type = "KeyModifiers"
bits = 1
[keys.playlist_delete.code]
type = "Char"
args = "d"
[keys.playlist_delete.modifier]
type = "KeyModifiers"
bits = 0
[keys.playlist_delete_all.code]
type = "Char"
args = "D"
[keys.playlist_delete_all.modifier]
type = "KeyModifiers"
bits = 1
[keys.playlist_shuffle.code]
type = "Char"
args = "r"
[keys.playlist_shuffle.modifier]
type = "KeyModifiers"
bits = 0
[keys.playlist_mode_cycle.code]
type = "Char"
args = "m"
[keys.playlist_mode_cycle.modifier]
type = "KeyModifiers"
bits = 0
[keys.playlist_play_selected.code]
type = "Char"
args = "l"
[keys.playlist_play_selected.modifier]
type = "KeyModifiers"
bits = 0
[keys.playlist_search.code]
type = "Char"
args = "/"
[keys.playlist_search.modifier]
type = "KeyModifiers"
bits = 0
[keys.playlist_swap_down.code]
type = "Char"
args = "J"
[keys.playlist_swap_down.modifier]
type = "KeyModifiers"
bits = 1
[keys.playlist_swap_up.code]
type = "Char"
args = "K"
[keys.playlist_swap_up.modifier]
type = "KeyModifiers"
bits = 1
[keys.playlist_cmus_lqueue.code]
type = "Char"
args = "S"
[keys.playlist_cmus_lqueue.modifier]
type = "KeyModifiers"
bits = 1
[keys.playlist_cmus_tqueue.code]
type = "Char"
args = "s"
[keys.playlist_cmus_tqueue.modifier]
type = "KeyModifiers"
bits = 0
[keys.database_add_all.code]
type = "Char"
args = "L"
[keys.database_add_all.modifier]
type = "KeyModifiers"
bits = 1
[keys.config_save.code]
type = "Char"
args = "s"
[keys.config_save.modifier]
type = "KeyModifiers"
bits = 2
[keys.podcast_mark_played.code]
type = "Char"
args = "m"
[keys.podcast_mark_played.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_mark_all_played.code]
type = "Char"
args = "M"
[keys.podcast_mark_all_played.modifier]
type = "KeyModifiers"
bits = 1
[keys.podcast_episode_download.code]
type = "Char"
args = "d"
[keys.podcast_episode_download.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_episode_delete_file.code]
type = "Char"
args = "x"
[keys.podcast_episode_delete_file.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_delete_feed.code]
type = "Char"
args = "d"
[keys.podcast_delete_feed.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_delete_all_feeds.code]
type = "Char"
args = "D"
[keys.podcast_delete_all_feeds.modifier]
type = "KeyModifiers"
bits = 1
[keys.podcast_search_add_feed.code]
type = "Char"
args = "s"
[keys.podcast_search_add_feed.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_refresh_feed.code]
type = "Char"
args = "r"
[keys.podcast_refresh_feed.modifier]
type = "KeyModifiers"
bits = 0
[keys.podcast_refresh_all_feeds.code]
type = "Char"
args = "R"
[keys.podcast_refresh_all_feeds.modifier]
type = "KeyModifiers"
bits = 1

View File

@@ -13,8 +13,7 @@
// General Settings
"layer": "top",
"output": [
"DP-1",
"HDMI-A-2"
"DP-1"
],
"margin-top": 0,
"margin-bottom": 0,

View File

@@ -37,8 +37,7 @@
"Alacritty",
"kitty-dropterm",
"kitty",
"alacritty-dropterm",
"chrome-chatgpt.com__-Default"
"alacritty-dropterm"
],
"app_ids-mapping": {
"firefoxdeveloperedition": "firefox-developer-edition"
@@ -58,8 +57,7 @@
"(.*) Microsoft Teams": "$1",
"(.*) - Google Chrome": "$1",
"(.*) - Visual Studio Code": "$1",
"(.*) _哔哩哔哩*": "$1",
"imv - (.*)": "$1"
"(.*) _哔哩哔哩*": "$1"
},
"separate-outputs": true
},

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2023 yazi-rs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 Himanshu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,33 +0,0 @@
<div align="center">
<img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
</div>
<h3 align="center">
Catppuccin Mocha Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
</h3>
## 👀 Preview
<img src="preview.png" width="600" />
## 🎨 Installation
Download and copy this folder as:
- `~/.config/yazi/flavors/catppuccin-mocha.yazi` on Linux/macOS
- `%AppData%\yazi\config\flavors\catppuccin-mocha.yazi` on Windows
## ⚙️ Usage
Add these lines to your `theme.toml` configuration file to use it:
```toml
[flavor]
use = "catppuccin-mocha"
```
## 📜 License
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.

View File

@@ -1,162 +0,0 @@
# vim:fileencoding=utf-8:foldmethod=marker
# : Manager {{{
[manager]
cwd = { fg = "#94e2d5" }
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true }
find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true }
# Marker
marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" }
marker_cut = { fg = "#f38ba8", bg = "#f38ba8" }
marker_marked = { fg = "#94e2d5", bg = "#94e2d5" }
marker_selected = { fg = "#f9e2af", bg = "#f9e2af" }
# Tab
tab_active = { reversed = true }
tab_inactive = {}
tab_width = 1
# Count
count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" }
count_cut = { fg = "#1e1e2e", bg = "#f38ba8" }
count_selected = { fg = "#1e1e2e", bg = "#f9e2af" }
# Border
border_symbol = "│"
border_style = { fg = "#7f849c" }
# : }}}
# : Status {{{
[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#45475a", bg = "#45475a" }
# Mode
mode_normal = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
mode_select = { fg = "#1e1e2e", bg = "#a6e3a1", bold = true }
mode_unset = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
# Progress
progress_label = { fg = "#ffffff", bold = true }
progress_normal = { fg = "#89b4fa", bg = "#45475a" }
progress_error = { fg = "#f38ba8", bg = "#45475a" }
# Permissions
permissions_t = { fg = "#89b4fa" }
permissions_r = { fg = "#f9e2af" }
permissions_w = { fg = "#f38ba8" }
permissions_x = { fg = "#a6e3a1" }
permissions_s = { fg = "#7f849c" }
# : }}}
# : Select {{{
[select]
border = { fg = "#89b4fa" }
active = { fg = "#f5c2e7", bold = true }
inactive = {}
# : }}}
# : Input {{{
[input]
border = { fg = "#89b4fa" }
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Completion {{{
[completion]
border = { fg = "#89b4fa" }
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#89b4fa" }
title = {}
hovered = { fg = "#f5c2e7", underline = true }
# : }}}
# : Which {{{
[which]
mask = { bg = "#313244" }
cand = { fg = "#94e2d5" }
rest = { fg = "#9399b2" }
desc = { fg = "#f5c2e7" }
separator = "  "
separator_style = { fg = "#585b70" }
# : }}}
# : Help {{{
[help]
on = { fg = "#94e2d5" }
run = { fg = "#f5c2e7" }
hovered = { reversed = true, bold = true }
footer = { fg = "#45475a", bg = "#cdd6f4" }
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#a6e3a1" }
title_warn = { fg = "#f9e2af" }
title_error = { fg = "#f38ba8" }
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#94e2d5" },
# Media
{ mime = "{audio,video}/*", fg = "#f9e2af" },
# Archives
{ mime = "application/*zip", fg = "#f5c2e7" },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#f5c2e7" },
# Documents
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#a6e3a1" },
# Fallback
{ name = "*", fg = "#cdd6f4" },
{ name = "*/", fg = "#89b4fa" }
]
# : }}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +0,0 @@
[flavor]
#use = "tokyo-night"
use = "catppuccin-mocha"
[manager]
# Hovered
preview_hovered = { underline = false }
# Border
border_symbol = "┆"
border_style = { fg = "#7f849c" , dim = true }

View File

@@ -1,25 +0,0 @@
[manager]
ratio = [ 1, 3, 3 ]
sort_by = "natural"
[preview]
max_width = 1900
max_height = 900
[open]
rules = [
{ name = "*/", use = [ "edit", "open", "reveal" ] },
{ mime = "text/*", use = [ "edit", "reveal" ] },
{ mime = "image/*", use = [ "open", "reveal" ] },
{ mime = "{audio,video}/*", use = [ "play", "reveal" ] },
{ mime = "inode/x-empty", use = [ "edit", "reveal" ] },
{ mime = "application/{,g}zip", use = [ "extract", "reveal" ] },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "extract", "reveal" ] },
{ mime = "application/{json,x-ndjson}", use = [ "edit", "reveal" ] },
{ mime = "*/javascript", use = [ "edit", "reveal" ] },
{ name = "*", use = [ "open", "reveal" ] },
]

13
issue
View File

@@ -1,13 +0,0 @@
 .
 .vir. d$b
 .d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b.
 $$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b.
 Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$
 "$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$
 d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P
 $$$$$$$P `""""" "" "" Q$$$P "Q$$$P" "Q$$$P"
 `Q$$P" """

This is \n (\s \m \r) \t

View File

@@ -1,162 +0,0 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Autogenerated by pycargoebuild 0.13.5
EAPI=8
CRATES="
aho-corasick@1.1.3
allocator-api2@0.2.21
android-tzdata@0.1.1
android_system_properties@0.1.5
atty@0.2.14
autocfg@1.1.0
bitflags@1.3.2
bitflags@2.8.0
bumpalo@3.11.0
cassowary@0.3.0
cfg-if@1.0.0
chrono-tz-build@0.2.1
chrono-tz@0.8.6
chrono@0.4.39
clap@3.2.12
clap@4.1.11
clap_complete@3.2.4
clap_derive@3.2.7
clap_derive@4.1.9
clap_lex@0.2.4
clap_lex@0.3.3
clap_mangen@0.1.11
core-foundation-sys@0.8.3
crossterm@0.25.0
crossterm@0.27.0
crossterm_winapi@0.9.1
dirs-sys@0.4.1
dirs@5.0.1
either@1.13.0
equivalent@1.0.2
foldhash@0.1.4
getrandom@0.2.15
hashbrown@0.12.3
hashbrown@0.15.2
heck@0.4.1
hermit-abi@0.1.19
hermit-abi@0.4.0
iana-time-zone@0.1.46
indexmap@1.9.1
indexmap@2.7.1
indoc@2.0.5
is-terminal@0.4.15
itertools@0.12.1
js-sys@0.3.59
libc@0.2.169
libredox@0.1.3
lock_api@0.4.7
log@0.4.17
lru@0.12.5
memchr@2.7.4
mio@0.8.4
num-traits@0.2.15
once_cell@1.13.0
option-ext@0.2.0
os_str_bytes@6.2.0
parking_lot@0.12.1
parking_lot_core@0.9.3
parse-zoneinfo@0.3.0
paste@1.0.15
phf@0.11.1
phf_codegen@0.11.1
phf_generator@0.11.1
phf_shared@0.11.1
proc-macro-error-attr@1.0.4
proc-macro-error@1.0.4
proc-macro2@1.0.93
quote@1.0.38
rand@0.8.5
rand_core@0.6.3
ratatui@0.25.0
redox_syscall@0.2.13
redox_users@0.4.6
regex-automata@0.4.9
regex-syntax@0.8.5
regex@1.11.1
roff@0.2.1
rustversion@1.0.19
scopeguard@1.1.0
serde@1.0.147
serde_derive@1.0.147
serde_spanned@0.6.8
signal-hook-mio@0.2.3
signal-hook-registry@1.4.0
signal-hook@0.3.17
siphasher@0.3.10
smallvec@1.9.0
stability@0.1.1
strsim@0.10.0
strum@0.25.0
strum_macros@0.25.3
syn@1.0.98
syn@2.0.98
termcolor@1.1.3
textwrap@0.15.0
thiserror-impl@1.0.39
thiserror@1.0.39
toml@0.7.8
toml_datetime@0.6.8
toml_edit@0.19.15
unicode-ident@1.0.2
unicode-segmentation@1.12.0
unicode-width@0.1.9
version_check@0.9.4
wasi@0.11.0+wasi-snapshot-preview1
wasm-bindgen-backend@0.2.82
wasm-bindgen-macro-support@0.2.82
wasm-bindgen-macro@0.2.82
wasm-bindgen-shared@0.2.82
wasm-bindgen@0.2.82
winapi-i686-pc-windows-gnu@0.4.0
winapi-util@0.1.5
winapi-x86_64-pc-windows-gnu@0.4.0
winapi@0.3.9
windows-sys@0.36.1
windows-sys@0.48.0
windows-sys@0.59.0
windows-targets@0.48.5
windows-targets@0.52.6
windows_aarch64_gnullvm@0.48.5
windows_aarch64_gnullvm@0.52.6
windows_aarch64_msvc@0.36.1
windows_aarch64_msvc@0.48.5
windows_aarch64_msvc@0.52.6
windows_i686_gnu@0.36.1
windows_i686_gnu@0.48.5
windows_i686_gnu@0.52.6
windows_i686_gnullvm@0.52.6
windows_i686_msvc@0.36.1
windows_i686_msvc@0.48.5
windows_i686_msvc@0.52.6
windows_x86_64_gnu@0.36.1
windows_x86_64_gnu@0.48.5
windows_x86_64_gnu@0.52.6
windows_x86_64_gnullvm@0.48.5
windows_x86_64_gnullvm@0.52.6
windows_x86_64_msvc@0.36.1
windows_x86_64_msvc@0.48.5
windows_x86_64_msvc@0.52.6
winnow@0.5.40
"
inherit cargo
DESCRIPTION="A clock app in terminal"
HOMEPAGE="https://github.com/race604/clock-tui"
SRC_URI="
${CARGO_CRATE_URIS}
"
LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" MIT MPL-2.0 Unicode-DFS-2016 ZLIB"
SLOT="0"
KEYWORDS="~amd64"

View File

@@ -0,0 +1,3 @@
AUX hypridle-0.1.4-fix-CFLAGS-CXXFLAGS.patch 901 BLAKE2B 8dd15b2a06beb5e10760f0ab84f8becf22722e8b8990c19e58d51a6865e10d68592e1d9041146a746d6deeb9d03dc2567056017f18c9623046c25153a9e13299 SHA512 8e7d1db099b4872e52bcf676db8b92a1f4d27ff79a7d340ef77f691c6c5305d2f98c28fe71f7b0f3c82bb63ef13115f76b43dc3eba769791e845e631cf9a27f8
DIST hypridle-0.1.4.gh.tar.gz 13948 BLAKE2B 450e2505fe8c245fd120fb22662e96648c8267a2878a9e9421ae06a8f2831b7f03f3e1ec23416c37e392e3b295cfb7d0cf8a61f7f611f62dea7affa6c3aadd06 SHA512 203dd5ff6c588fb1858d660baba71ede9d2c353abd63a5273fbc4befff8b77d416d802138881bce11605b248b05145e66847b5aa5395e9c150aaf07e67c8bcd8
EBUILD hypridle-0.1.4.ebuild 717 BLAKE2B 0be274204f4cd8da6cc787baa42f12b9867b9dd114dbf7d19c0ef56b9c70fc22bd6826ac96fd7abf8eacebb282124f046cc9a8d7e1276f385095062e054668fc SHA512 ce4e07b92c7b480ccc9da005fc5b9004856997ad39be27bee4a117e8cd565a1230adbc893b9387a04ddfdee338756fe9688972212520165cb47f26f64f62f2d2

View File

@@ -0,0 +1,29 @@
From e2b3acf133c104574724f705f9f07007ec8bbe3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gon=C3=A7alo=20Negrier=20Duarte?=
<gonegrier.duarte@gmail.com>
Date: Wed, 21 Feb 2024 15:29:01 +0000
Subject: [PATCH] Removed added CFLAGS/CXXFLAGS by CMakeLists.txt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Gonçalo Negrier Duarte <gonegrier.duarte@gmail.com>
---
CMakeLists.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3d60b42..bb37060 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
message(STATUS "Configuring hypridle in Debug with CMake")
add_compile_definitions(HYPRLAND_DEBUG)
else()
- add_compile_options(-O3)
message(STATUS "Configuring hypridle in Release with CMake")
endif()
--
2.43.2

View File

@@ -0,0 +1,39 @@
# Copyright 2023-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Hyprland's idle daemon"
HOMEPAGE="https://github.com/hyprwm/hypridle"
if [[ "${PV}" = *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/hyprwm/${PN^}.git"
else
SRC_URI="https://github.com/hyprwm/${PN^}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
KEYWORDS="~amd64"
fi
LICENSE="BSD"
SLOT="0"
RDEPEND="
dev-cpp/sdbus-c++:0/2
>=dev-libs/hyprlang-0.4.0
dev-libs/wayland
"
DEPEND="
${RDEPEND}
dev-libs/wayland-protocols
"
BDEPEND="
dev-util/wayland-scanner
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/hypridle-0.1.4-fix-CFLAGS-CXXFLAGS.patch"
)

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
<email>gonegrier.duarte@gmail.com</email>
<name>Gonçalo Negrier Duarte</name>
</maintainer>
<upstream>
<changelog>https://github.com/hyprwm/hypridle/releases</changelog>
<doc>https://wiki.hyprland.org/Hypr-Ecosystem/hypridle/</doc>
<bugs-to>https://github.com/hyprwm/hypridle/issues</bugs-to>
<remote-id type="github">hyprwm/hypridle</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,11 @@
AUX config.json 197 BLAKE2B 7857d382a02a15fbc86018cd61e759927be2c009b0eefa10d282772f236680f54bd90169e0b404e98857657b7f16ef537be78d5e7ec18a498c48d3d490bffead SHA512 9b2b6663bddadc249221aa81669d26a44102926caa8ce6c683c0f1bb65466f1b5449f821b73468e6da57515d5367e9bea829cfb08ddb4c3b48e1f178c4c88677
AUX qq.sh 340 BLAKE2B f06daf0857721e55b2c3ed2a5538b5582acf4cff41b336a89b972abe4ceb1626b7c9cf51889ea731e00219fcee7da9a9d8c68375eaf7a84c71b5a13a8c11bd4f SHA512 4553c2cc6c6d0f7921237476ad3376c992571eb90f692dd339fb628bd1352746f6e46df61bf5d00f24099bafbfbee4074702be6e77577c44b448d38e3ee82c8b
AUX start.sh 5065 BLAKE2B de4dd4684820dfb35069408659612cc009c5fe6b6a397ddc2cf59f350341c286828f727d10edf3115e4ba7d5c1da7890e08c62c8a5da93b750fe8de5d0beb3b8 SHA512 bc66e6592b10cc805b747cead85b26650fc47e10cb3e08f38272631b22c29b817c468cbbcd31a52139b75427fb48b171b4ad14969da939e1d6703943c6555397
AUX vercmp.sh 1492 BLAKE2B ac4ae2aeef54225cfbf31e50345b1bfd9b71310fe24ff9025956801589db258c215a5120115d19044d941c5f63814d7f7a5ddfb638d8af98cdbfbd3aa83569e7 SHA512 e2843a84c6f66918a8de60ef83d07a14881b072e7eed2e374e16542d8079e088974a65cea336cba3e5a41d72c5824de381bdce26d54ca21509196ab5f2befd76
AUX xdg-open.sh 206 BLAKE2B 1ed3d1f9c659fffc3476fa0cd28030f8646be0ff2d1d97968433f6eb0fe88dd7717c2fb137c8fd6c93686e4c652cc74434d8aceb69ccba594a205e241d7ea93e SHA512 b12a65aa3cbd5da758e47bbc9a98930c009a9aeeffc12a6329aabd9dc0a9b206dfec9af8950122e912be311985fe7d2daa6dae815ccabdd00ecdbfbc2760a143
DIST LiteLoaderQQNT-1.2.1.zip 32390 BLAKE2B ab626bba9fdff7566657b22bcbc1ac32e9ea3878eea461aeb58c0ba27e92e3111479c2a72c9d08d2067e43497f854a1a30090da18f5941eb6a0b705bce0d6639 SHA512 a0a179942f3b6ee8ed1c8388f6a5234e2f84b3340c94ddc91b497dd7f12cc9cac80ae250c62e21bdaab9e52cfecaa6c78b13b6849ddc5ff7db65efe852d753d0
DIST QQ_3.2.12_240808_amd64_01.deb 152276798 BLAKE2B fa70a6e198203df87546115de7ae07b2479f3992848c5b361797330f7c3d5757ff8a1ff2bdb16b72e74a60cb8db5e41ab20cf56ec653a86ea58fb43604256544 SHA512 ad4657fd72ba13f804db24336cc07636454afd9fc97dac1a9d575a8500227f996879386e2257e290139bc7ba9e2f56e305b4969ca9c9ee5dbd7efd0302ed7ca9
DIST QQ_3.2.12_240808_arm64_01.deb 152230448 BLAKE2B 0a4ad45efd111aac457723124a934fe6b80701bb8a4c9363f959abf4d5e2b7fcc4dfcc8c82ddfa324992bc1bc4561168d6597cc5217d998257561d6f9a0386e8 SHA512 22fb0f590f8a4be148750fde203fd42647557998caa8516b165094020ee3f670f967d9d313d47fdbbf449f497cbe23f612355b6afae9cfde7df02c52e64ef0ca
DIST QQ_3.2.12_240808_loongarch64_01.deb 144876648 BLAKE2B 2813becfcd657f093925d53e94137c16a8e0037e02e354cb11c98e2c978a89643dcc9a7794961f7edcdf15a4509880564dbe85463f7bfbe3e3c45e9362b87af9 SHA512 19192fb5d4b1de95fe677195db92fcf70fea0daa286697faf558305f44ecb980a3f44f29cc7b9d846ef76a4dd4b06a2e5ecc2c1c2e21c1603188d3a7e79292ce
EBUILD tencent-qq-3.2.12_p240808.ebuild 4928 BLAKE2B 4167fa15062f201a109c67d07aaab6074631564f15e6ff1e42094fb14e3875cd272f9b31e19cfbf42a0d5b5cef70807e8d06d29ad1dddbb7eacea6d37dc3d955 SHA512 17b14aa95d165e8a05920eb363a0da831567bcffb178f04df9d9a22f135b3b9fe7aad309b1c7d2ef56286d63e40ab96b2c7a0c6357034a4315875cc46ea0922e
MISC metadata.xml 877 BLAKE2B ccb294dfc292e53c35bfc5c8669c0edcf41d24050ce9fb097a73d874687717de009048e0bf6d6bc1c5194afc05d274b9d70e8f4d5a3787fceb45fceab1bbf4d0 SHA512 520778cfee8e5977f4a766a1dfff82ed9fed287567ad96de11a9dbb49d4fae571001cb46bc714669172ebca8441cf51a6ec0b778215bb4709a57ace72c6a70f8

View File

@@ -0,0 +1,9 @@
{
"baseVersion": "__BASE_VER__",
"currentVersion": "__CURRENT_VER__",
"previousVersion": "",
"buildVersion": "__BUILD_VER__",
"skippedVersions": [],
"inUsePkg": "",
"hasRan": false
}

View File

@@ -0,0 +1,12 @@
#!/bin/bash
if [ -d ~/.config/QQ/versions ]; then
find ~/.config/QQ/versions -name sharp-lib -type d -exec rm -r {} \; 2>/dev/null
fi
# Allow users to override command-line options
if [[ -f $XDG_CONFIG_HOME/qq-flags.conf ]]; then
QQ_USER_FLAGS="$(grep -v '^#' $XDG_CONFIG_HOME/qq-flags.conf)"
fi
exec /opt/QQ/qq $QQ_USER_FLAGS "$@"

View File

@@ -0,0 +1,149 @@
#!/bin/bash
QQ_HOTUPDATE_VERSION="__CURRENT_VER__"
function command_exists() {
local command="$1"
command -v "${command}" >/dev/null 2>&1
}
function show_error_dialog() {
title="linuxqq-nt-bwrap"
if command_exists kdialog; then
kdialog --error "$1" --title "$title" --icon qq
elif command_exists zenity; then
zenity --error --title "$title" --icon-name qq --text "$1"
else
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"
printf "${blue}==>${yellow} ${bold} $1${all_off}\n"
fi
}
# 进行必要文件的检查
if [ ! -e "/etc/localtime" ]; then
show_error_dialog "/etc/localtime 未找到。\n请先设置系统时区。"
exit 1
fi
USER_RUN_DIR="/run/user/$(id -u)"
XAUTHORITY="${XAUTHORITY:-$HOME/.Xauthority}"
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
FONTCONFIG_HOME="${XDG_CONFIG_HOME}/fontconfig"
QQ_APP_DIR="${XDG_CONFIG_HOME}/QQ"
if [ -z "${QQ_DOWNLOAD_DIR}" ]; then
if [ -z "${XDG_DOWNLOAD_DIR}" ]; then
XDG_DOWNLOAD_DIR="$(xdg-user-dir DOWNLOAD)"
fi
QQ_DOWNLOAD_DIR="${XDG_DOWNLOAD_DIR:-$HOME/Downloads}"
fi
# 从 flags 文件中加载参数
set -euo pipefail
flags_file="${XDG_CONFIG_HOME}/qq-electron-flags.conf"
declare -a flags
if [[ -f "${flags_file}" ]]; then
mapfile -t <"${flags_file}"
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done
QQ_HOTUPDATE_DIR="${QQ_APP_DIR}/versions"
# 在「下载」目录不存在的时候,自动使用 ~/Downloads
# 避免挂载整个 home
if [ "${QQ_DOWNLOAD_DIR%*/}" == "${HOME}" ]; then
QQ_DOWNLOAD_DIR="${HOME}/Downloads"
fi
# 安装当前版本
HOTUPDATE_VERSION_DIR="${QQ_HOTUPDATE_DIR}/${QQ_HOTUPDATE_VERSION}"
install -d "${QQ_HOTUPDATE_DIR}"
if [ ! -d "${HOTUPDATE_VERSION_DIR}" ] && [ ! -L "${HOTUPDATE_VERSION_DIR}" ]; then
ln -sfd "/opt/QQ/resources/app" "${HOTUPDATE_VERSION_DIR}"
fi
# 处理旧版本
rm -rf "${QQ_HOTUPDATE_DIR}/"**".zip"
is_hotupdated_version=0 # 正在运行的版本是否经过热更新?
find "${QQ_HOTUPDATE_DIR}/"*[-_]* -maxdepth 1 -type "d,l" | while read path; do
this_version="$(basename "$path")"
if [ "$(/opt/QQ/workarounds/vercmp.sh "${this_version}" lt "${QQ_HOTUPDATE_VERSION//_/-}")" == "true" ]; then
# 这个版本小于当前版本,删除之
echo "rm $this_version"
rm -rf "$path"
else
is_hotupdated_version=1
fi
done
if [ "$is_hotupdated_version" == "0" ]; then
cp "/opt/QQ/workarounds/config.json" "${QQ_HOTUPDATE_DIR}/config.json"
fi
bwrap --new-session --cap-drop ALL --unshare-user-try --unshare-pid --unshare-cgroup-try \
--ro-bind /lib /lib \
--ro-bind /lib64 /lib64 \
--ro-bind /bin /bin \
--ro-bind /usr /usr \
--ro-bind /opt /opt \
--ro-bind /opt/QQ/workarounds/xdg-open.sh /usr/bin/xdg-open \
--ro-bind /usr/lib/snapd-xdg-open/xdg-open /snapd-xdg-open \
--ro-bind /usr/lib/flatpak-xdg-utils/xdg-open /flatpak-xdg-open \
--ro-bind /etc/machine-id /etc/machine-id \
--ro-bind /etc/ld.so.cache /etc/ld.so.cache \
--dev-bind /dev /dev \
--ro-bind /sys /sys \
--ro-bind /etc/passwd /etc/passwd \
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
--ro-bind-try /run/systemd/userdb /run/systemd/userdb \
--ro-bind /etc/resolv.conf /etc/resolv.conf \
--ro-bind /etc/localtime /etc/localtime \
--proc /proc \
--dev-bind /run/dbus /run/dbus \
--bind "${USER_RUN_DIR}" "${USER_RUN_DIR}" \
--ro-bind-try /etc/fonts /etc/fonts \
--dev-bind /tmp /tmp \
--bind-try "${HOME}/.pki" "${HOME}/.pki" \
--ro-bind-try "${XAUTHORITY}" "${XAUTHORITY}" \
--bind-try "${QQ_DOWNLOAD_DIR}" "${QQ_DOWNLOAD_DIR}" \
--setenv QQ_APP_DIR "${QQ_APP_DIR}" \
--bind "${QQ_APP_DIR}" "${QQ_APP_DIR}" \
--ro-bind-try "${FONTCONFIG_HOME}" "${FONTCONFIG_HOME}" \
--ro-bind-try "${HOME}/.icons" "${HOME}/.icons" \
--ro-bind-try "${HOME}/.local/share/.icons" "${HOME}/.local/share/.icons" \
--ro-bind-try "${XDG_CONFIG_HOME}/gtk-3.0" "${XDG_CONFIG_HOME}/gtk-3.0" \
--ro-bind /etc/nsswitch.conf /etc/nsswitch.conf \
--ro-bind-try /run/systemd/userdb/ /run/systemd/userdb/ \
--setenv IBUS_USE_PORTAL 1 \
--setenv QQNTIM_HOME "${QQ_APP_DIR}/QQNTim" \
--setenv LITELOADERQQNT_PROFILE "${QQ_APP_DIR}/LiteLoaderQQNT" \
/opt/QQ/qq "${flags[@]}" "$@"
# 移除无用崩溃报告和日志
# 如果需要向腾讯反馈 bug请注释掉如下几行
rm -rf ${QQ_APP_DIR}/crash_files
touch ${QQ_APP_DIR}/crash_files
if [ -d "${QQ_APP_DIR}/log" ]; then
rm -rf "${QQ_APP_DIR}/log"
fi
for nt_qq_userdata in "${QQ_APP_DIR}/nt_qq_"*; do
if [ -d "${nt_qq_userdata}/log" ]; then
rm -rf "${nt_qq_userdata}/log"
fi
if [ -d "${nt_qq_userdata}/log-cache" ]; then
rm -rf "${nt_qq_userdata}/log-cache"
fi
done
if [ -d "${QQ_APP_DIR}/Crashpad" ]; then
rm -rf "${QQ_APP_DIR}/Crashpad"
fi

View File

@@ -0,0 +1,93 @@
#!/usr/bin/env bash
# Comparison expressions for semantic versions.
# only supports semver standard MAJOR.MINOR.PATCH syntax;
# pre-release or build-metadata extensions have undefined behavior.
set -o errexit
set -o pipefail
function usage() {
echo "Comparison expressions for semantic versions."
echo
echo "usage: vercmp VERSION_A OPERATOR VERSION_B"
echo
echo "OPERATORS"
echo
echo " lt - Less than"
echo " lteq - Less than or equal to"
echo " eq - Equal to"
echo " gteq - Grater than or equal to"
echo " gt - Greater than"
echo
}
if [ "$#" -ne 3 ]; then
usage
exit 1
fi
LEFT="$1"
OPERATOR="$2"
RIGHT="$3"
if [ "$LEFT" = "$RIGHT" ]; then
COMPARISON=0
else
SORTED=($(for VER in "$LEFT" "$RIGHT"; do echo "$VER"; done | sort -V))
if [ "${SORTED[0]}" = "$LEFT" ]; then
COMPARISON=-1
else
COMPARISON=1
fi
fi
OUTCOME=false
case $OPERATOR in
lt)
if [ "$COMPARISON" -eq -1 ]; then
OUTCOME=true
fi
;;
lteq)
if [ "$COMPARISON" -lt 1 ]; then
OUTCOME=true
fi
;;
eq)
if [ "$COMPARISON" -eq 0 ]; then
OUTCOME=true
fi
;;
gteq)
if [ "$COMPARISON" -gt -1 ]; then
OUTCOME=true
fi
;;
gt)
if [ "$COMPARISON" -eq 1 ]; then
OUTCOME=true
fi
;;
*)
usage
exit 1
;;
esac
VERCMP_QUIET="${VERCMP_QUIET:-false}"
if [ ! "$VERCMP_QUIET" = "true" ]; then
echo "$OUTCOME"
fi
if [ "$OUTCOME" = "true" ]; then
exit 0
else
exit 1
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
URI_TO_OPEN="$1"
if ! [ "${URI_TO_OPEN:0:8}" == "jsbridge" ]; then
if [ "${URI_TO_OPEN:0:4}" == "http" ]; then
/snapd-xdg-open "$URI_TO_OPEN"
else
/flatpak-xdg-open "$URI_TO_OPEN"
fi
fi

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE
pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>git@xen0n.name</email>
<name>WANG Xuerui</name>
</maintainer>
<maintainer type="person">
<email>ston.jia@qq.com</email>
<name>ston</name>
</maintainer>
<use>
<flag name="bwrap">Use sys-apps/bubblewrap to prevent
private information leakage</flag>
<flag name="system-vips">Use media-libs/vips instead of
shipped libs.</flag>
<flag name="gnome">Supporting screenshot when using
GNOME</flag>
<flag name="appindicator">Build in support for
notifications using the libindicate or libappindicator
plugin</flag>
<flag name="liteloader">Add liteloader support</flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,156 @@
# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit unpacker xdg
MY_PV=${PV/_p/_}
_I="Linux"
_ArchExt="_01"
_QQDownSite="https://dldir1.qq.com/qqfile/qq/QQNT"
_QQFileName="QQ"
_QQFileSuffix=".deb"
_LiteLoader_PV="1.2.1"
DESCRIPTION="The new version of the official linux-qq"
HOMEPAGE="https://im.qq.com/linuxqq/index.shtml"
SRC_URI="
amd64? ( ${_QQDownSite}/$_I/${_QQFileName}_${MY_PV}_amd64${_ArchExt}${_QQFileSuffix} )
arm64? ( ${_QQDownSite}/$_I/${_QQFileName}_${MY_PV}_arm64${_ArchExt}${_QQFileSuffix} )
loong? ( ${_QQDownSite}/$_I/${_QQFileName}_${MY_PV}_loongarch64${_ArchExt}${_QQFileSuffix} )
liteloader? (
https://github.com/LiteLoaderQQNT/LiteLoaderQQNT/releases/download/${_LiteLoader_PV}/LiteLoaderQQNT.zip \
-> LiteLoaderQQNT-${_LiteLoader_PV}.zip
)
"
S=${WORKDIR}
LICENSE="Tencent"
SLOT="0"
KEYWORDS="-* ~amd64 ~arm64"
IUSE="+bwrap system-vips gnome appindicator liteloader"
RESTRICT="strip mirror"
RDEPEND="
x11-libs/gtk+:3
x11-libs/libnotify
dev-libs/nss
appindicator? ( dev-libs/libayatana-appindicator )
x11-libs/libXScrnSaver
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXtst
x11-misc/xdg-utils
app-accessibility/at-spi2-core:2
app-crypt/libsecret
virtual/krb5
sys-apps/keyutils
system-vips? (
dev-libs/glib
>=media-libs/vips-8.15.2[-pdf]
)
bwrap? (
sys-apps/bubblewrap
x11-misc/snapd-xdg-open
x11-misc/flatpak-xdg-utils
)
gnome? ( dev-libs/gjs )
media-libs/openslide
loong? (
virtual/loong-ow-compat
)
"
BDEPEND="liteloader? ( app-arch/unzip )"
src_unpack() {
:
if use liteloader; then
unpack LiteLoaderQQNT-${_LiteLoader_PV}.zip
fi
}
src_install() {
dodir /
cd "${D}" || die
if [ "${ARCH}" = "loong" ]; then
unpacker "${DISTDIR}/${_QQFileName}_${MY_PV}_loongarch64${_QQFileSuffix}"
else
unpacker "${DISTDIR}/${_QQFileName}_${MY_PV}_${ARCH}${_ArchExt}${_QQFileSuffix}"
fi
if use system-vips; then
rm -r "${D}"/opt/QQ/resources/app/sharp-lib || die
fi
if use bwrap; then
exeinto /opt/QQ
doexe "${FILESDIR}"/start.sh
sed -i 's!/opt/QQ/qq!/opt/QQ/start.sh!' "${D}"/usr/share/applications/qq.desktop || die
insinto /opt/QQ/workarounds
doins "${FILESDIR}"/{config.json,xdg-open.sh,vercmp.sh}
fperms +x /opt/QQ/workarounds/{xdg-open.sh,vercmp.sh}
local _base_pkgver=${PV/_p/-} || die
local _update_pkgver=${_base_pkgver} || die
local cur_ver=${_update_pkgver:-${base_ver}} || die
local build_ver=${cur_ver#*-} || die
sed -i "s|__BASE_VER__|${base_ver}|g;s|__CURRENT_VER__|${cur_ver}|g;s|__BUILD_VER__|${build_ver}|g" \
"${D}"/opt/QQ/workarounds/config.json \
"${D}"/opt/QQ/start.sh || die
else
sed -i 's!/opt/QQ/qq!/usr/bin/qq!' "${D}"/usr/share/applications/qq.desktop || die
fi
if use bwrap; then
dosym -r /opt/QQ/start.sh /usr/bin/qq
elif use system-vips; then
newbin "$FILESDIR/qq.sh" qq
else
dosym -r /opt/QQ/qq /usr/bin/qq
fi
# https://bugs.gentoo.org/898912
if use appindicator; then
dosym ../../usr/lib64/libayatana-appindicator3.so /opt/QQ/libappindicator3.so
fi
sed -i 's!/usr/share/icons/hicolor/512x512/apps/qq.png!qq!' "${D}"/usr/share/applications/qq.desktop || die
gzip -d "${D}"/usr/share/doc/linuxqq/changelog.gz || die
dodoc "${D}"/usr/share/doc/linuxqq/changelog
rm -rf "${D}"/usr/share/doc/linuxqq/ || die
if use liteloader; then
insinto /opt/LiteLoader
doins -r "${WORKDIR}"/*
dosym -r /opt/LiteLoader/src/preload.js /opt/QQ/resources/app/application/preload.js
sed -i "1 i require(\"/opt/LiteLoader\");" "${D}"/opt/QQ/resources/app/app_launcher/index.js || die
fi
}
pkg_postinst() {
xdg_pkg_postinst
if use bwrap; then
elog "-EN-----------------------------------------------------------------"
elog "If you want to download files in QQ"
elog "Please set the QQ download path to ~/Download"
elog "If you have enabled LiteLoaderQQNT support, relevant plugins can be "
elog "downloaded from https://liteloaderqqnt.github.io/, "
elog "For instance, after downloading the 「轻量工具箱」 and unzipping it, "
elog "download it to the directory ~/.config/QQ/LiteLoaderQQNT/plugins/lite_tools_v4/, "
elog "and the changes will take effect after a restart."
elog "--------------------------------------------------------------------"
elog "-ZH-----------------------------------------------------------------"
elog "如果要在 QQ 中下载文件,请先在「设置」->「存储管理」中把下载文件夹"
elog "更改为系统的“下载”/“Downloads”文件夹。"
elog "如果您启用了 LiteLoaderQQNT 支持,"
elog "可以从 https://liteloaderqqnt.github.io/ 下载相关插件,"
elog "例如:「轻量工具箱」下载后"
elog "解压到 ~/.config/QQ/LiteLoaderQQNT/plugins/“lite_tools_v4”/ 目录下,重启后生效。"
elog "--------------------------------------------------------------------"
fi
}

6
portage/env/nolto.conf vendored Normal file
View File

@@ -0,0 +1,6 @@
# Env setup to disable LTO and related warnings for problematic builds
DISABLE_LTO="-Wno-error=odr -Wno-error=lto-type-mismatch -Wno-error=strict-aliasing -fno-lto"
CFLAGS="${CFLAGS} ${DISABLE_LTO}"
CXXFLAGS="${CXXFLAGS} ${DISABLE_LTO}"
FCFLAGS="${FCFLAGS} ${DISABLE_LTO}"
FFLAGS="${FFLAGS} ${DISABLE_LTO}"

View File

@@ -2,35 +2,33 @@
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe"
WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-march=native -O2 -pipe -flto ${WARNING_FLAGS}"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
RUSTFLAGS="${RUSTFLAGS} -C target-cpu=native"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3"
# NOTE: This stage was built with the bindist USE flag enabled
PORTAGE_TMPDIR="/tmp"
ACCEPT_LISENCE="@FREE @BINARY-REDISTRIBUTABLE"
ACCEPT_LISENCE="@FREE"
ACCEPT_KEYWORDS="amd64"
VIDEO_CARDS="amdgpu radeonsi"
VIDEO_CARDS="intel amdgpu radeonsi"
USE="wayland cjk pipewire pulseaudio zstd zsh-completion vulkan dbus lto pgo -kde -gnome -initramfs"
L10N="en zh en-US zh-CN"
LINGUAS="en en_US zh zh_CN"
L10N="zh-CN"
# NOTE: This stage was built with the bindist Use flag enabled
MAKEOPTS="-j12"
MAKEOPTS="-j4"
GRUB_PLATFORMS="efi-64"
PYTHON_TARGETS="python3_12 python3_13"
PYTHON_SINGLE_TARGET="python3_12"
# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C.utf8
GENTOO_MIRRORS="${GENTOO_MIRRORS} https://distfiles.gentoocn.org"
RUBY_SINGLE_TARGET="ruby32"

View File

@@ -0,0 +1 @@
gui-apps/aylurs-gtk-shell ~amd64

View File

@@ -0,0 +1 @@
x11-terms/alacritty ~amd64

View File

@@ -0,0 +1 @@
app-i18n/fcitx-configtool ~amd64

View File

@@ -1,3 +0,0 @@
media-gfx/gimp ~amd64
media-libs/babl ~amd64
media-libs/gegl ~amd64

View File

@@ -1,9 +1,4 @@
gui-libs/hyprutils ~amd64
gui-apps/hyprlock ~amd64
gui-apps/hypridle ~amd64
sys-auth/hyprpolkitagent ~amd64
dev-libs/hyprgraphics ~amd64
dev-libs/hyprlang ~amd64
# xdg-desktop-portal-hyprland
gui-libs/xdg-desktop-portal-hyprland ~amd64
@@ -35,7 +30,6 @@ dev-python/aiohttp-oauthlib ~amd64
# multimedia
media-sound/termusic ~amd64
media-sound/kew ~amd64
# misc
media-video/obs-studio ~amd64

View File

@@ -0,0 +1 @@
app-misc/liquidctl ~amd64

View File

@@ -0,0 +1,4 @@
games-action/minecraft-launcher ~amd64
dev-java/openjdk-jre-bin ~amd64
dev-java/openjdk ~amd64
virtual/jre ~amd64

View File

@@ -1 +1,3 @@
app-misc/activate-linux ~amd64
app-mobilephone/scrcpy ~amd64
net-misc/anydesk ~amd64
x11-libs/gtkglext ~amd64

View File

@@ -1,4 +1,2 @@
app-shells/zoxide ~amd64
dev-vcs/lazygit ~amd64
app-editors/neovide ~amd64

View File

@@ -1,11 +0,0 @@
app-misc/ollama ~amd64
sci-libs/hipBLAS ~amd64
dev-util/hip ~amd64
sci-libs/rocBLAS ~amd64
sci-libs/rocSOLVER ~amd64
sci-libs/rocSPARSE ~amd64
sci-libs/rocPRIM ~amd64
dev-util/Tensile ~amd64
dev-util/rocm-smi ~amd64
dev-util/rocminfo ~amd64

View File

@@ -1,7 +1,8 @@
dev-libs/rocm-opencl-runtime ~amd64
dev-libs/rocr-runtime ~amd64
dev-libs/rocm-comgr ~amd64
dev-libs/rocm-comgr ~amd64
dev-libs/rocm-device-libs ~amd64
dev-build/rocm-cmake ~amd64
dev-util/hipcc ~amd64
dev-libs/roct-thunk-interface ~amd64

View File

@@ -0,0 +1,27 @@
sci-mathematics/sage-conf ~amd64
sci-mathematics/sage-doc ~amd64
sci-mathematics/sage_docbuild ~amd64
sci-mathematics/sage_setup ~amd64
sci-mathematics/sagemath-standard ~amd64
dev-python/jupyter-jsmol ~amd64
media-gfx/threejs-sage-extension ~amd64
dev-python/cvxopt ~amd64
dev-python/rpy ~amd64
media-gfx/tachyon ~amd64
sci-mathematics/cu2 ~amd64
sci-mathematics/cubex ~amd64
sci-mathematics/dikcube ~amd64
sci-mathematics/ExportSageNB ~amd64
sci-mathematics/mcube ~amd64
sci-mathematics/optimal ~amd64
sci-mathematics/sage-data-combinatorial_designs ~amd64
sci-mathematics/sage-data-elliptic_curves ~amd64
sci-mathematics/sage-data-graphs ~amd64
sci-mathematics/sage-data-polytopes_db ~amd64
sci-chemistry/sage-jmol-bin ~amd64
sci-libs/dsdp ~amd64
dev-python/jupyter-sphinx ~amd64
dev-python/sphinx-copybutton ~amd64
dev-python/sphinx-inline-tabs ~amd64
dev-tex/sagetex ~amd64

View File

@@ -1,3 +0,0 @@
*/*::steam-overlay
games-util/game-device-udev-rules
sys-libs/libudev-compat

View File

@@ -1,14 +1,7 @@
sys-process/nvtop ~amd64
app-admin/s-tui ~amd64
app-misc/fastfetch ~amd64
app-misc/onefetch ~amd64
app-misc/cpufetch ~amd64
sys-apps/lsplug ~amd64
app-backup/timeshift ~amd64
app-backup/timeshift-autosnap ~amd64
net-dns/dnslookup ~amd64
app-arch/unrar ~amd64

Some files were not shown because too many files have changed in this diff Show More