Merge branch 'main' of codeberg.org:aleidk/dots

This commit is contained in:
Alexander Navarro 2024-02-18 11:09:24 -03:00
commit 59004c4ac4
22 changed files with 5840 additions and 10 deletions

1
.gitignore vendored
View file

@ -13,3 +13,4 @@ config/spicetify/Backup
# nixos/hardware-configuration.nix # nixos/hardware-configuration.nix
result result
config/ncspot/userstate.cbor config/ncspot/userstate.cbor
config/zsh/zprofile.local

View file

@ -0,0 +1,80 @@
# vim:ft=kitty
## name: Catppuccin-Macchiato
## author: Pocco81 (https://github.com/Pocco81)
## license: MIT
## upstream: https://github.com/catppuccin/kitty/blob/main/macchiato.conf
## blurb: Soothing pastel theme for the high-spirited!
# The basic colors
foreground #CAD3F5
background #24273A
selection_foreground #24273A
selection_background #F4DBD6
# Cursor colors
cursor #F4DBD6
cursor_text_color #24273A
# URL underline color when hovering with mouse
url_color #F4DBD6
# Kitty window border colors
active_border_color #B7BDF8
inactive_border_color #6E738D
bell_border_color #EED49F
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #181926
active_tab_background #C6A0F6
inactive_tab_foreground #CAD3F5
inactive_tab_background #1E2030
tab_bar_background #181926
# Colors for marks (marked text in the terminal)
mark1_foreground #24273A
mark1_background #B7BDF8
mark2_foreground #24273A
mark2_background #C6A0F6
mark3_foreground #24273A
mark3_background #7DC4E4
# The 16 terminal colors
# black
color0 #494D64
color8 #5B6078
# red
color1 #ED8796
color9 #ED8796
# green
color2 #A6DA95
color10 #A6DA95
# yellow
color3 #EED49F
color11 #EED49F
# blue
color4 #8AADF4
color12 #8AADF4
# magenta
color5 #F5BDE6
color13 #F5BDE6
# cyan
color6 #8BD5CA
color14 #8BD5CA
# white
color7 #B8C0E0
color15 #A5ADCB

2458
config/kitty/kitty.conf Normal file

File diff suppressed because it is too large Load diff

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

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
node = 'lts' node = 'lts'
# python = {version='3', virtualenv='.venv'} # python = {version='3', virtualenv='.venv'}
python = {version='3'} # setting virtualenv adds a virtualenv in every directory python = {version='3'} # setting virtualenv adds a virtualenv in every directory
tea = "latest" php = "8.2"
[settings] [settings]
[alias.node] [alias.node]

View file

@ -1,4 +1,5 @@
{ {
"ChatGPT.nvim": { "branch": "main", "commit": "aadb607038d53d97be4da368b07355f65ad3f047" },
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" }, "LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"auto-session": { "branch": "main", "commit": "3eb26b949e1b90798e84926848551046e2eb0721" }, "auto-session": { "branch": "main", "commit": "3eb26b949e1b90798e84926848551046e2eb0721" },
@ -40,7 +41,6 @@
"nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
"nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" }, "nvim-lint": { "branch": "master", "commit": "962a76877a4479a535b935bd7ef35ad41ba308b2" },
"nvim-lspconfig": { "branch": "master", "commit": "6c797ff9324094e333e2ace9526ca4a62ad9d1ca" }, "nvim-lspconfig": { "branch": "master", "commit": "6c797ff9324094e333e2ace9526ca4a62ad9d1ca" },
"nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" },
"nvim-treesitter": { "branch": "master", "commit": "107e61afb7129d637ea6c3c68b97a22194b0bf16" }, "nvim-treesitter": { "branch": "master", "commit": "107e61afb7129d637ea6c3c68b97a22194b0bf16" },
"nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" }, "nvim-treesitter-context": { "branch": "master", "commit": "8aa32aa6b84dda357849dbc0f775e69f2e04c041" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" },
@ -54,6 +54,7 @@
"telescope-file-browser.nvim": { "branch": "master", "commit": "6e51d0cd6447cf2525412220ff0a2885eef9039c" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "6e51d0cd6447cf2525412220ff0a2885eef9039c" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"tfm.nvim": { "branch": "main", "commit": "0fd23be8d4adebcc65a30b3870c2090b97dc1bc2" },
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
"treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" }, "treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },

View file

@ -55,9 +55,6 @@ vim.keymap.set("n", "<leader>rr", ":%s/", default("Search and replace globally")
vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection")) vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
vim.keymap.set("v", "p", [["_dP]], default("Paste whitout lossing yanked text")) vim.keymap.set("v", "p", [["_dP]], default("Paste whitout lossing yanked text"))
vim.keymap.set({ "n", "v" }, "<Leader>y", [["+y]], default("Yank to system clipboard"))
vim.keymap.set({ "n", "v" }, "<Leader>Y", [["+Y]], default("Yank line to system clipboard"))
vim.keymap.set({ "n", "v" }, "<Leader>p", [["+p]], default("Paste from system clipboard"))
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down")) vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down"))
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up")) vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))

View file

@ -0,0 +1,207 @@
return {
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
opts = {
api_key_cmd = nil,
yank_register = "+",
edit_with_instructions = {
diff = false,
keymaps = {
close = "<C-c>",
accept = "<C-y>",
toggle_diff = "<C-d>",
toggle_settings = "<C-o>",
toggle_help = "<C-h>",
cycle_windows = "<Tab>",
use_output_as_input = "<C-i>",
},
},
chat = {
-- welcome_message = WELCOME_MESSAGE,
loading_text = "Loading, please wait ...",
question_sign = "", -- 🙂
answer_sign = "", -- 🤖
border_left_sign = "",
border_right_sign = "",
max_line_length = 120,
sessions_window = {
active_sign = "",
inactive_sign = "",
current_line_sign = "",
border = {
style = "rounded",
text = {
top = " Sessions ",
},
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
},
keymaps = {
close = "<C-c>",
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-n>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-j>",
prev_message = "<C-k>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-r>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_sessions = "<C-p>",
toggle_help = "<C-h>",
toggle_message_role = "<C-r>",
toggle_system_role_open = "<C-s>",
stop_generating = "<C-x>",
},
},
popup_layout = {
default = "center",
center = {
width = "80%",
height = "80%",
},
right = {
width = "30%",
width_settings_open = "50%",
},
},
popup_window = {
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top = " ChatGPT ",
},
},
win_options = {
wrap = true,
linebreak = true,
foldcolumn = "1",
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
buf_options = {
filetype = "markdown",
},
},
system_window = {
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top = " SYSTEM ",
},
},
win_options = {
wrap = true,
linebreak = true,
foldcolumn = "2",
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
},
popup_input = {
prompt = "",
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top_align = "center",
top = " Prompt ",
},
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
submit = "<C-Enter>",
submit_n = "<Enter>",
max_visible_lines = 20,
},
settings_window = {
setting_sign = "",
border = {
style = "rounded",
text = {
top = " Settings ",
},
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
},
help_window = {
setting_sign = "",
border = {
style = "rounded",
text = {
top = " Help ",
},
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
},
openai_params = {
model = "gpt-3.5-turbo",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 300,
temperature = 0,
top_p = 1,
n = 1,
},
openai_edit_params = {
model = "gpt-3.5-turbo",
frequency_penalty = 0,
presence_penalty = 0,
temperature = 0,
top_p = 1,
n = 1,
},
use_openai_functions_for_edits = false,
actions_paths = {},
show_quickfixes_cmd = "Trouble quickfix",
predefined_chat_gpt_prompts = "https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv",
highlights = {
help_key = "@symbol",
help_description = "@comment",
},
},
config = function()
require("chatgpt").setup()
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"folke/trouble.nvim",
"nvim-telescope/telescope.nvim",
},
keys = {
{ "<leader>pp", "<cmd>ChatGPT<CR>", desc = "ChatGPT" },
{ "<leader>pe", "<cmd>ChatGPTEditWithInstruction<CR>", desc = "Edit with instruction", mode = { "n", "v" } },
{ "<leader>pa", "<cmd>ChatGPTActAs<CR>", desc = "Act as", mode = { "n", "v" } },
{ "<leader>pg", "<cmd>ChatGPTRun grammar_correction<CR>", desc = "Grammar Correction", mode = { "n", "v" } },
{ "<leader>pT", "<cmd>ChatGPTRun translate<CR>", desc = "Translate", mode = { "n", "v" } },
{ "<leader>pk", "<cmd>ChatGPTRun keywords<CR>", desc = "Keywords", mode = { "n", "v" } },
{ "<leader>pd", "<cmd>ChatGPTRun docstring<CR>", desc = "Docstring", mode = { "n", "v" } },
{ "<leader>pt", "<cmd>ChatGPTRun add_tests<CR>", desc = "Add Tests", mode = { "n", "v" } },
{ "<leader>po", "<cmd>ChatGPTRun optimize_code<CR>", desc = "Optimize Code", mode = { "n", "v" } },
{ "<leader>ps", "<cmd>ChatGPTRun summarize<CR>", desc = "Summarize", mode = { "n", "v" } },
{ "<leader>pf", "<cmd>ChatGPTRun fix_bugs<CR>", desc = "Fix Bugs", mode = { "n", "v" } },
{ "<leader>px", "<cmd>ChatGPTRun explain_code<CR>", desc = "Explain Code", mode = { "n", "v" } },
{ "<leader>pr", "<cmd>ChatGPTRun roxygen_edit<CR>", desc = "Roxygen Edit", mode = { "n", "v" } },
{
"<leader>pl",
"<cmd>ChatGPTRun code_readability_analysis<CR>",
desc = "Code Readability Analysis",
mode = { "n", "v" },
},
},
}

View file

@ -1,7 +1,7 @@
return { return {
{ {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
-- enabled = false, enabled = false,
version = "*", version = "*",
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",

View file

@ -0,0 +1,66 @@
return {
"rolv-apneseth/tfm.nvim",
lazy = false,
opts = {
-- TFM to use
-- Possible choices: "ranger" | "nnn" | "lf" | "vifm" | "yazi" (default)
file_manager = "yazi",
-- Replace netrw entirely
-- Default: false
replace_netrw = true,
-- Enable creation of commands
-- Default: false
-- Commands:
-- Tfm: selected file(s) will be opened in the current window
-- TfmSplit: selected file(s) will be opened in a horizontal split
-- TfmVsplit: selected file(s) will be opened in a vertical split
-- TfmTabedit: selected file(s) will be opened in a new tab page
enable_cmds = true,
-- Custom keybindings only applied within the TFM buffer
-- Default: {}
keybindings = {
["<ESC>"] = "q",
},
-- Customise UI. The below options are the default
ui = {
border = "rounded",
height = 1,
width = 1,
x = 0.5,
y = 0.5,
},
},
keys = {
{
"<leader>e",
function()
require("tfm").open()
end,
desc = "TFM",
},
{
"<leader>mh",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.split)
end,
desc = "TFM - horizontal split",
},
{
"<leader>mv",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.vsplit)
end,
desc = "TFM - vertical split",
},
{
"<leader>mt",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.tabedit)
end,
desc = "TFM - new tab",
},
},
}

View file

@ -57,6 +57,9 @@ return {
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" }, { mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
{ mode = "n", keys = "<Leader>un", desc = "+Noice" }, { mode = "n", keys = "<Leader>un", desc = "+Noice" },
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" }, { mode = "n", keys = "<Leader>w", desc = "+Workspace" },
{ mode = "n", keys = "<Leader>p", desc = "+ChatGPT" },
{ mode = "v", keys = "<Leader>p", desc = "+ChatGPT" },
{ mode = "n", keys = "<Leader>p", desc = "+ChatGPT" },
}, },
-- Clue window settings -- Clue window settings

Binary file not shown.

Binary file not shown.

View file

@ -4,11 +4,13 @@ prefs_path = /home/aleidk/.var/app/com.spotify.Client/config/spotif
current_theme = catppuccin-macchiato current_theme = catppuccin-macchiato
color_scheme = teal color_scheme = teal
spotify_launch_flags = spotify_launch_flags =
spotify_path = /var/lib/flatpak/app/com.spotify.Client/x86_64/stable/active/files/extra/share/spotify/ spotify_path = /home/aleidk/.local/share/flatpak/app/com.spotify.Client/x86_64/stable/active/files/extra/share/spotify/
inject_css = 1 inject_css = 1
replace_colors = 1 replace_colors = 1
overwrite_assets = 1 overwrite_assets = 1
inject_theme_js = 1 inject_theme_js = 1
check_spicetify_update = 1
always_enable_devtools = 0
[Preprocesses] [Preprocesses]
disable_sentry = 1 disable_sentry = 1
@ -28,5 +30,5 @@ sidebar_config = 1
; DO NOT CHANGE! ; DO NOT CHANGE!
[Backup] [Backup]
version = 1.2.22.982.g794acc0a version = 1.2.26.1187.g36b715a1
with = 2.25.3 with = 2.28.1

View file

@ -16,6 +16,11 @@ set -sg escape-time 0
set-option -g focus-events on set-option -g focus-events on
set-option -g renumber-windows on set-option -g renumber-windows on
# Yazi need this config to show image preview
set -g allow-passthrough on
set -ga update-environment TERM
set -ga update-environment TERM_PROGRAM
## Keybindings ## Keybindings
unbind C-b unbind C-b
unbind C-Space unbind C-Space

View file

@ -0,0 +1,24 @@
-- Pull in the wezterm API
local wezterm = require("wezterm")
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
config.color_scheme = "Catppuccin Mocha"
config.font = wezterm.font("JetBrainsMono Nerd Font")
config.integrated_title_button_style = "Gnome"
config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
config.window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
}
-- and finally, return the configuration to wezterm
return config

28
config/yazi/init.lua Normal file
View file

@ -0,0 +1,28 @@
function Manager:render(area)
local chunks = self:layout(area)
local bar = function(c, x, y)
x, y = math.max(0, x), math.max(0, y)
return ui.Bar(ui.Rect({ x = x, y = y, w = ya.clamp(0, area.w - x, 1), h = math.min(1, area.h) }), ui.Bar.TOP)
:symbol(c)
end
return ya.flat({
-- Borders
ui.Border(area, ui.Border.ALL):type(ui.Border.ROUNDED),
ui.Bar(chunks[1], ui.Bar.RIGHT),
ui.Bar(chunks[3], ui.Bar.LEFT),
bar("", chunks[1].right - 1, chunks[1].y),
bar("", chunks[1].right - 1, chunks[1].bottom - 1),
bar("", chunks[2].right, chunks[2].y),
bar("", chunks[2].right, chunks[1].bottom - 1),
-- Parent
Parent:render(chunks[1]:padding(ui.Padding.xy(1))),
-- Current
Current:render(chunks[2]:padding(ui.Padding.y(1))),
-- Preview
Preview:render(chunks[3]:padding(ui.Padding.xy(1))),
})
end

300
config/yazi/keymap.toml Normal file
View file

@ -0,0 +1,300 @@
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
[manager]
keymap = [
{ on = [ "<Esc>" ], exec = "escape --all", desc = "Exit visual mode, clear selected, or cancel search" },
{ on = [ "q" ], exec = "quit", desc = "Exit the process" },
{ on = [ "Q" ], exec = "quit --no-cwd-file", desc = "Exit the process without writing cwd-file" },
{ on = [ "<C-q>" ], exec = "close", desc = "Close the current tab, or quit if it is last tab" },
{ on = [ "<C-z>" ], exec = "suspend", desc = "Suspend the process" },
# Navigation
{ on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "<S-Up>" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "<S-Down>" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "<C-u>" ], exec = "arrow -50%", desc = "Move cursor up half page" },
{ on = [ "<C-d>" ], exec = "arrow 50%", desc = "Move cursor down half page" },
{ on = [ "<C-b>" ], exec = "arrow -100%", desc = "Move cursor up one page" },
{ on = [ "<C-f>" ], exec = "arrow 100%", desc = "Move cursor down one page" },
{ on = [ "<C-PageUp>" ], exec = "arrow -50%", desc = "Move cursor up half page" },
{ on = [ "<C-PageDown>" ], exec = "arrow 50%", desc = "Move cursor down half page" },
{ on = [ "<PageUp>" ], exec = "arrow -100%", desc = "Move cursor up one page" },
{ on = [ "<PageDown>" ], exec = "arrow 100%", desc = "Move cursor down one page" },
{ on = [ "h" ], exec = [ "leave", "escape --visual --select" ], desc = "Go back to the parent directory" },
{ on = [ "l" ], exec = [ "enter", "escape --visual --select" ], desc = "Enter the child directory" },
{ on = [ "H" ], exec = "back", desc = "Go back to the previous directory" },
{ on = [ "L" ], exec = "forward", desc = "Go forward to the next directory" },
{ on = [ "<A-k>" ], exec = "seek -5", desc = "Seek up 5 units in the preview" },
{ on = [ "<A-j>" ], exec = "seek 5", desc = "Seek down 5 units in the preview" },
{ on = [ "<A-PageUp>" ], exec = "seek -5", desc = "Seek up 5 units in the preview" },
{ on = [ "<A-PageDown>" ], exec = "seek 5", desc = "Seek down 5 units in the preview" },
{ on = [ "<Up>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Left>" ], exec = "leave", desc = "Go back to the parent directory" },
{ on = [ "<Right>" ], exec = "enter", desc = "Enter the child directory" },
{ on = [ "g", "g" ], exec = "arrow -99999999", desc = "Move cursor to the top" },
{ on = [ "G" ], exec = "arrow 99999999", desc = "Move cursor to the bottom" },
# Selection
{ on = [ "<Space>" ], exec = [ "select --state=none", "arrow 1" ], desc = "Toggle the current selection state" },
{ on = [ "v" ], exec = "visual_mode", desc = "Enter visual mode (selection mode)" },
{ on = [ "V" ], exec = "visual_mode --unset", desc = "Enter visual mode (unset mode)" },
{ on = [ "<C-a>" ], exec = "select_all --state=true", desc = "Select all files" },
{ on = [ "<C-r>" ], exec = "select_all --state=none", desc = "Inverse selection of all files" },
# Operation
{ on = [ "o" ], exec = "open", desc = "Open the selected files" },
{ on = [ "O" ], exec = "open --interactive", desc = "Open the selected files interactively" },
{ on = [ "<Enter>" ], exec = "open", desc = "Open the selected files" },
{ on = [ "<C-Enter>" ], exec = "open --interactive", desc = "Open the selected files interactively" },
{ on = [ "y" ], exec = [ "yank", "escape --visual --select" ], desc = "Copy the selected files" },
{ on = [ "Y" ], exec = [ "unyank", "escape --visual --select" ], desc = "Cancel the yank status of files" },
{ on = [ "x" ], exec = [ "yank --cut", "escape --visual --select" ], desc = "Cut the selected files" },
{ on = [ "p" ], exec = "paste", desc = "Paste the files" },
{ on = [ "P" ], exec = "paste --force", desc = "Paste the files (overwrite if the destination exists)" },
{ on = [ "-" ], exec = "link", desc = "Symlink the absolute path of files" },
{ on = [ "_" ], exec = "link --relative", desc = "Symlink the relative path of files" },
{ on = [ "d" ], exec = [ "remove", "escape --visual --select" ], desc = "Move the files to the trash" },
{ on = [ "D" ], exec = [ "remove --permanently", "escape --visual --select" ], desc = "Permanently delete the files" },
{ on = [ "a" ], exec = "create", desc = "Create a file or directory (ends with / for directories)" },
{ on = [ "r" ], exec = "rename --cursor=before_ext", desc = "Rename a file or directory" },
{ on = [ ";" ], exec = "shell", desc = "Run a shell command" },
{ on = [ ":" ], exec = "shell --block", desc = "Run a shell command (block the UI until the command finishes)" },
{ on = [ "." ], exec = "hidden toggle", desc = "Toggle the visibility of hidden files" },
{ on = [ "s" ], exec = "search fd", desc = "Search files by name using fd" },
{ on = [ "S" ], exec = "search rg", desc = "Search files by content using ripgrep" },
{ on = [ "<C-s>" ], exec = "search none", desc = "Cancel the ongoing search" },
{ on = [ "z" ], exec = "jump zoxide", desc = "Jump to a directory using zoxide" },
{ on = [ "Z" ], exec = "jump fzf", desc = "Jump to a directory, or reveal a file using fzf" },
# Linemode
{ on = [ "m", "s" ], exec = "linemode size", desc = "Set linemode to size" },
{ on = [ "m", "p" ], exec = "linemode permissions", desc = "Set linemode to permissions" },
{ on = [ "m", "m" ], exec = "linemode mtime", desc = "Set linemode to mtime" },
{ on = [ "m", "n" ], exec = "linemode none", desc = "Set linemode to none" },
# Copy
{ on = [ "c", "c" ], exec = "copy path", desc = "Copy the absolute path" },
{ on = [ "c", "d" ], exec = "copy dirname", desc = "Copy the path of the parent directory" },
{ on = [ "c", "f" ], exec = "copy filename", desc = "Copy the name of the file" },
{ on = [ "c", "n" ], exec = "copy name_without_ext", desc = "Copy the name of the file without the extension" },
# Filter
{ on = [ "f" ], exec = "filter --smart", desc = "Filter the files" },
# Find
{ on = [ "/" ], exec = "find --smart", desc = "Find next file" },
{ on = [ "?" ], exec = "find --previous --smart", desc = "Find previous file" },
{ on = [ "n" ], exec = "find_arrow", desc = "Go to next found file" },
{ on = [ "N" ], exec = "find_arrow --previous", desc = "Go to previous found file" },
# Sorting
{ on = [ ",", "m" ], exec = "sort modified --dir-first", desc = "Sort by modified time" },
{ on = [ ",", "M" ], exec = "sort modified --reverse --dir-first", desc = "Sort by modified time (reverse)" },
{ on = [ ",", "c" ], exec = "sort created --dir-first", desc = "Sort by created time" },
{ on = [ ",", "C" ], exec = "sort created --reverse --dir-first", desc = "Sort by created time (reverse)" },
{ on = [ ",", "e" ], exec = "sort extension --dir-first", desc = "Sort by extension" },
{ on = [ ",", "E" ], exec = "sort extension --reverse --dir-first", desc = "Sort by extension (reverse)" },
{ on = [ ",", "a" ], exec = "sort alphabetical --dir-first", desc = "Sort alphabetically" },
{ on = [ ",", "A" ], exec = "sort alphabetical --reverse --dir-first", desc = "Sort alphabetically (reverse)" },
{ on = [ ",", "n" ], exec = "sort natural --dir-first", desc = "Sort naturally" },
{ on = [ ",", "N" ], exec = "sort natural --reverse --dir-first", desc = "Sort naturally (reverse)" },
{ on = [ ",", "s" ], exec = "sort size --dir-first", desc = "Sort by size" },
{ on = [ ",", "S" ], exec = "sort size --reverse --dir-first", desc = "Sort by size (reverse)" },
# Tabs
{ on = [ "t" ], exec = "tab_create --current", desc = "Create a new tab using the current path" },
{ on = [ "1" ], exec = "tab_switch 0", desc = "Switch to the first tab" },
{ on = [ "2" ], exec = "tab_switch 1", desc = "Switch to the second tab" },
{ on = [ "3" ], exec = "tab_switch 2", desc = "Switch to the third tab" },
{ on = [ "4" ], exec = "tab_switch 3", desc = "Switch to the fourth tab" },
{ on = [ "5" ], exec = "tab_switch 4", desc = "Switch to the fifth tab" },
{ on = [ "6" ], exec = "tab_switch 5", desc = "Switch to the sixth tab" },
{ on = [ "7" ], exec = "tab_switch 6", desc = "Switch to the seventh tab" },
{ on = [ "8" ], exec = "tab_switch 7", desc = "Switch to the eighth tab" },
{ on = [ "9" ], exec = "tab_switch 8", desc = "Switch to the ninth tab" },
{ on = [ "[" ], exec = "tab_switch -1 --relative", desc = "Switch to the previous tab" },
{ on = [ "]" ], exec = "tab_switch 1 --relative", desc = "Switch to the next tab" },
{ on = [ "{" ], exec = "tab_swap -1", desc = "Swap the current tab with the previous tab" },
{ on = [ "}" ], exec = "tab_swap 1", desc = "Swap the current tab with the next tab" },
# Tasks
{ on = [ "w" ], exec = "tasks_show", desc = "Show the tasks manager" },
# Goto
{ on = [ "g", "h" ], exec = "cd ~", desc = "Go to the home directory" },
{ on = [ "g", "c" ], exec = "cd ~/.config", desc = "Go to the config directory" },
{ on = [ "g", "d" ], exec = "cd ~/Downloads", desc = "Go to the downloads directory" },
{ on = [ "g", "t" ], exec = "cd /tmp", desc = "Go to the temporary directory" },
{ on = [ "g", "<Space>" ], exec = "cd --interactive", desc = "Go to a directory interactively" },
# Help
{ on = [ "~" ], exec = "help", desc = "Open help" },
]
[tasks]
keymap = [
{ on = [ "<Esc>" ], exec = "close", desc = "Hide the task manager" },
{ on = [ "<C-q>" ], exec = "close", desc = "Hide the task manager" },
{ on = [ "w" ], exec = "close", desc = "Hide the task manager" },
{ on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Up>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Enter>" ], exec = "inspect", desc = "Inspect the task" },
{ on = [ "x" ], exec = "cancel", desc = "Cancel the task" },
{ on = [ "~" ], exec = "help", desc = "Open help" }
]
[select]
keymap = [
{ on = [ "<C-q>" ], exec = "close", desc = "Cancel selection" },
{ on = [ "<Esc>" ], exec = "close", desc = "Cancel selection" },
{ on = [ "<Enter>" ], exec = "close --submit", desc = "Submit the selection" },
{ on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "<Up>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<S-Up>" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "<S-Down>" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "~" ], exec = "help", desc = "Open help" }
]
[input]
keymap = [
{ on = [ "<C-q>" ], exec = "close", desc = "Cancel input" },
{ on = [ "<Enter>" ], exec = "close --submit", desc = "Submit the input" },
{ on = [ "<Esc>" ], exec = "close", desc = "Go back the normal mode, or cancel input" },
# Mode
{ on = [ "i" ], exec = "insert", desc = "Enter insert mode" },
{ on = [ "a" ], exec = "insert --append", desc = "Enter append mode" },
{ on = [ "I" ], exec = [ "move -999", "insert" ], desc = "Move to the BOL, and enter insert mode" },
{ on = [ "A" ], exec = [ "move 999", "insert --append" ], desc = "Move to the EOL, and enter append mode" },
{ on = [ "v" ], exec = "visual", desc = "Enter visual mode" },
{ on = [ "V" ], exec = [ "move -999", "visual", "move 999" ], desc = "Enter visual mode and select all" },
# Character-wise movement
{ on = [ "h" ], exec = "move -1", desc = "Move back a character" },
{ on = [ "l" ], exec = "move 1", desc = "Move forward a character" },
{ on = [ "<Left>" ], exec = "move -1", desc = "Move back a character" },
{ on = [ "<Right>" ], exec = "move 1", desc = "Move forward a character" },
{ on = [ "<C-b>" ], exec = "move -1", desc = "Move back a character" },
{ on = [ "<C-f>" ], exec = "move 1", desc = "Move forward a character" },
# Word-wise movement
{ on = [ "b" ], exec = "backward", desc = "Move back to the start of the current or previous word" },
{ on = [ "w" ], exec = "forward", desc = "Move forward to the start of the next word" },
{ on = [ "e" ], exec = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
{ on = [ "<A-b>" ], exec = "backward", desc = "Move back to the start of the current or previous word" },
{ on = [ "<A-f>" ], exec = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
# Line-wise movement
{ on = [ "0" ], exec = "move -999", desc = "Move to the BOL" },
{ on = [ "$" ], exec = "move 999", desc = "Move to the EOL" },
{ on = [ "<C-a>" ], exec = "move -999", desc = "Move to the BOL" },
{ on = [ "<C-e>" ], exec = "move 999", desc = "Move to the EOL" },
{ on = [ "<Home>" ], exec = "move -999", desc = "Move to the BOL" },
{ on = [ "<End>" ], exec = "move 999", desc = "Move to the EOL" },
# Delete
{ on = [ "<Backspace>" ], exec = "backspace", desc = "Delete the character before the cursor" },
{ on = [ "<Delete>" ], exec = "backspace --under", desc = "Delete the character under the cursor" },
{ on = [ "<C-h>" ], exec = "backspace", desc = "Delete the character before the cursor" },
{ on = [ "<C-d>" ], exec = "backspace --under", desc = "Delete the character under the cursor" },
# Kill
{ on = [ "<C-u>" ], exec = "kill bol", desc = "Kill backwards to the BOL" },
{ on = [ "<C-k>" ], exec = "kill eol", desc = "Kill forwards to the EOL" },
{ on = [ "<C-w>" ], exec = "kill backward", desc = "Kill backwards to the start of the current word" },
{ on = [ "<A-d>" ], exec = "kill forward", desc = "Kill forwards to the end of the current word" },
# Cut/Yank/Paste
{ on = [ "d" ], exec = "delete --cut", desc = "Cut the selected characters" },
{ on = [ "D" ], exec = [ "delete --cut", "move 999" ], desc = "Cut until the EOL" },
{ on = [ "c" ], exec = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" },
{ on = [ "C" ], exec = [ "delete --cut --insert", "move 999" ], desc = "Cut until the EOL, and enter insert mode" },
{ on = [ "x" ], exec = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut the current character" },
{ on = [ "y" ], exec = "yank", desc = "Copy the selected characters" },
{ on = [ "p" ], exec = "paste", desc = "Paste the copied characters after the cursor" },
{ on = [ "P" ], exec = "paste --before", desc = "Paste the copied characters before the cursor" },
# Undo/Redo
{ on = [ "u" ], exec = "undo", desc = "Undo the last operation" },
{ on = [ "<C-r>" ], exec = "redo", desc = "Redo the last operation" },
# Help
{ on = [ "~" ], exec = "help", desc = "Open help" }
]
[completion]
keymap = [
{ on = [ "<C-q>" ], exec = "close", desc = "Cancel completion" },
{ on = [ "<Tab>" ], exec = "close --submit", desc = "Submit the completion" },
{ on = [ "<Enter>" ], exec = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" },
{ on = [ "<A-k>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<A-j>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Up>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "~" ], exec = "help", desc = "Open help" }
]
[help]
keymap = [
{ on = [ "<Esc>" ], exec = "escape", desc = "Clear the filter, or hide the help" },
{ on = [ "q" ], exec = "close", desc = "Exit the process" },
{ on = [ "<C-q>" ], exec = "close", desc = "Hide the help" },
# Navigation
{ on = [ "k" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "j" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "K" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "J" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "<Up>" ], exec = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], exec = "arrow 1", desc = "Move cursor down" },
{ on = [ "<S-Up>" ], exec = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "<S-Down>" ], exec = "arrow 5", desc = "Move cursor down 5 lines" },
# Filtering
{ on = [ "/" ], exec = "filter", desc = "Apply a filter for the help items" },
]

192
config/yazi/yazi.toml Normal file
View file

@ -0,0 +1,192 @@
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
[manager]
ratio = [ 1, 3, 4 ]
sort_by = "alphabetical"
sort_sensitive = false
sort_reverse = false
sort_dir_first = true
linemode = "mtime"
show_hidden = false
show_symlink = true
[preview]
tab_size = 2
max_width = 1920
max_height = 1080
cache_dir = ""
image_filter = "triangle"
image_quality = 75
sixel_fraction = 15
ueberzug_scale = 1
ueberzug_offset = [ 0, 0, 0, 0 ]
[opener]
edit = [
{ exec = '[ -n "$EDITOR" ] && $EDITOR "$@"', desc = "$EDITOR", block = true, for = "unix" },
{ exec = 'code "%*"', orphan = true, for = "windows" },
]
open = [
{ exec = 'xdg-open "$@"', desc = "Open", for = "linux" },
{ exec = 'open "$@"', desc = "Open", for = "macos" },
{ exec = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }
]
reveal = [
{ exec = 'open -R "$1"', desc = "Reveal", for = "macos" },
{ exec = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" },
{ exec = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" },
]
extract = [
{ exec = 'unar "$1"', desc = "Extract here", for = "unix" },
{ exec = 'unar "%1"', desc = "Extract here", for = "windows" },
]
play = [
{ exec = 'mpv "$@"', orphan = true, for = "unix" },
{ exec = 'mpv "%1"', orphan = true, for = "windows" },
{ exec = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" },
]
[open]
rules = [
{ name = "*/", use = [ "edit", "open", "reveal" ] },
{ mime = "text/*", use = [ "edit", "reveal" ] },
{ mime = "image/*", use = [ "open", "reveal" ] },
{ mime = "video/*", use = [ "play", "reveal" ] },
{ mime = "audio/*", use = [ "play", "reveal" ] },
{ mime = "inode/x-empty", use = [ "edit", "reveal" ] },
{ mime = "application/json", use = [ "edit", "reveal" ] },
{ mime = "*/javascript", use = [ "edit", "reveal" ] },
{ mime = "application/zip", use = [ "extract", "reveal" ] },
{ mime = "application/gzip", use = [ "extract", "reveal" ] },
{ mime = "application/x-tar", use = [ "extract", "reveal" ] },
{ mime = "application/x-bzip", use = [ "extract", "reveal" ] },
{ mime = "application/x-bzip2", use = [ "extract", "reveal" ] },
{ mime = "application/x-7z-compressed", use = [ "extract", "reveal" ] },
{ mime = "application/x-rar", use = [ "extract", "reveal" ] },
{ mime = "application/xz", use = [ "extract", "reveal" ] },
{ mime = "*", use = [ "open", "reveal" ] },
]
[tasks]
micro_workers = 10
macro_workers = 25
bizarre_retry = 5
image_alloc = 536870912 # 512MB
image_bound = [ 0, 0 ]
suppress_preload = false
[plugin]
preloaders = [
{ name = "*", cond = "!mime", exec = "mime", multi = true, prio = "high" },
# Image
{ mime = "image/vnd.djvu", exec = "noop" },
{ mime = "image/*", exec = "image" },
# Video
{ mime = "video/*", exec = "video" },
# PDF
{ mime = "application/pdf", exec = "pdf" },
]
previewers = [
{ name = "*/", exec = "folder", sync = true },
# Code
{ mime = "text/*", exec = "code" },
{ mime = "*/xml", exec = "code" },
{ mime = "*/javascript", exec = "code" },
{ mime = "*/x-wine-extension-ini", exec = "code" },
# JSON
{ mime = "application/json", exec = "json" },
# Image
{ mime = "image/vnd.djvu", exec = "noop" },
{ mime = "image/*", exec = "image" },
# Video
{ mime = "video/*", exec = "video" },
# PDF
{ mime = "application/pdf", exec = "pdf" },
# Archive
{ mime = "application/zip", exec = "archive" },
{ mime = "application/gzip", exec = "archive" },
{ mime = "application/x-tar", exec = "archive" },
{ mime = "application/x-bzip", exec = "archive" },
{ mime = "application/x-bzip2", exec = "archive" },
{ mime = "application/x-7z-compressed", exec = "archive" },
{ mime = "application/x-rar", exec = "archive" },
{ mime = "application/xz", exec = "archive" },
# Fallback
{ name = "*", exec = "file" },
]
[input]
# cd
cd_title = "Change directory:"
cd_origin = "top-center"
cd_offset = [ 0, 2, 50, 3 ]
# create
create_title = "Create:"
create_origin = "hovered"
create_offset = [ 0, 1, 50, 3 ]
# rename
rename_title = "Rename:"
rename_origin = "hovered"
rename_offset = [ 0, 1, 50, 3 ]
# trash
trash_title = "Move {n} selected file{s} to trash? (y/N)"
trash_origin = "hovered"
trash_offset = [ 0, 2, 50, 3 ]
# delete
delete_title = "Delete {n} selected file{s} permanently? (y/N)"
delete_origin = "hovered"
delete_offset = [ 0, 2, 50, 3 ]
# filter
filter_title = "Filter:"
filter_origin = "hovered"
filter_offset = [ 0, 2, 50, 3 ]
# find
find_title = [ "Find next:", "Find previous:" ]
find_origin = "hovered"
find_offset = [ 0, 2, 50, 3 ]
# search
search_title = "Search via {n}:"
search_origin = "hovered"
search_offset = [ 0, 2, 50, 3 ]
# shell
shell_title = [ "Shell:", "Shell (block):" ]
shell_origin = "center"
shell_offset = [ 0, 2, 50, 3 ]
# overwrite
overwrite_title = "Overwrite an existing file? (y/N)"
overwrite_origin = "center"
overwrite_offset = [ 0, 2, 50, 3 ]
# quit
quit_title = "{n} task{s} running, sure to quit? (y/N)"
quit_origin = "center"
quit_offset = [ 0, 2, 50, 3 ]
[select]
open_title = "Open with:"
open_origin = "hovered"
open_offset = [ 0, 1, 50, 7 ]
[which]
sort_by = "none"
sort_sensitive = false
sort_reverse = false
[log]
enabled = false

View file

@ -51,3 +51,12 @@ help() {
fzf-jq() { fzf-jq() {
echo '' | fzf --print-query --preview="jq -r {q} <$@" echo '' | fzf --print-query --preview="jq -r {q} <$@"
} }
function ya() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}

View file

@ -34,6 +34,10 @@ update_path "$HOME/.local/share/rtx/shims"
. "$HOME/.cargo/env" . "$HOME/.cargo/env"
if [[ "$DOTS/config/zsh/zprofile.local" -e ]]; then
source "$DOTS/config/zsh/zprofile.local"
fi
if [[ $OSTYPE =~ 'darwin' ]]; then if [[ $OSTYPE =~ 'darwin' ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
fi fi

View file

@ -108,6 +108,6 @@ if [[ "$ZPROF" = true ]]; then
fi fi
eval "$(starship init zsh)" eval "$(starship init zsh)"
eval "$(rtx activate zsh)"
# eval "$(zellij setup --generate-auto-start zsh)" # eval "$(zellij setup --generate-auto-start zsh)"
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
eval "$(mise activate zsh)"