diff options
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua | 10 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua | 11 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/dadbod.lua | 1 | ||||
| -rw-r--r-- | ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua | 6 | ||||
| -rw-r--r-- | ar/.config/mimeapps.list | 1 | ||||
| -rw-r--r-- | ar/.config/qutebrowser/config.py | 65 | ||||
| -rwxr-xr-x | ar/.local/bin/extractkeys | 2 |
7 files changed, 71 insertions, 25 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua index 10c1085..8baae0b 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/autocmds.lua @@ -318,7 +318,7 @@ local suckless_config = vim.api.nvim_create_augroup("suckless_config", { clear = vim.api.nvim_create_autocmd("BufWritePost", { group = suckless_config, - pattern = home .. "/.local/src/suckless/dmenu/config.h", + pattern = home .. "/.local/src/suckless/dmenu/config.def.h", callback = function() vim.cmd("silent !cd " .. home .. "/.local/src/suckless/dmenu/ && sudo make install") end, @@ -326,7 +326,7 @@ vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", { group = suckless_config, - pattern = home .. "/.local/src/suckless/dwmblocks/config.h", + pattern = home .. "/.local/src/suckless/dwmblocks/config.def.h", callback = function() vim.cmd( "silent !cd " @@ -338,7 +338,7 @@ vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", { group = suckless_config, - pattern = home .. "/.local/src/suckless/slock/config.h", + pattern = home .. "/.local/src/suckless/slock/config.def.h", callback = function() vim.cmd("silent !cd " .. home .. "/.local/src/suckless/slock/ && sudo make install") end, @@ -347,7 +347,7 @@ vim.api.nvim_create_autocmd("BufWritePost", { local suckless_keys = augroup("suckless_keys") vim.api.nvim_create_autocmd("BufWritePost", { group = suckless_keys, - pattern = home .. "/.local/src/suckless/dwm/config.h", + pattern = home .. "/.local/src/suckless/dwm/config.def.h", callback = function() vim.cmd("silent !" .. home .. "/.local/bin/extractkeys") end, @@ -355,7 +355,7 @@ vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", { group = suckless_keys, - pattern = home .. "/.local/src/suckless/st/config.h", + pattern = home .. "/.local/src/suckless/st/config.def.h", callback = function() vim.cmd("silent !" .. home .. "/.local/bin/extractkeys") end, diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua index 044b9cf..cc206ab 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua @@ -178,6 +178,17 @@ vim.keymap.set("n", "<leader>oq", "<cmd>copen<cr>", { desc = "Open quickfix list -- Formats vim.keymap.set("n", "<leader>cF", vim.lsp.buf.format, { desc = "Format buffer by default lsp" }) +-- Full path +vim.keymap.set("n", "<leader>zf", function() + local word = vim.fn.expand("<cWORD>") -- Get full text under the cursor (handles paths with slashes) + if word:match("%$") then + local expanded_path = vim.fn.expand(word) + if expanded_path ~= word then + vim.cmd("normal! ciW" .. expanded_path) -- Replace entire word under cursor + end + end +end, { desc = "Expand and replace path under cursor" }) + -- Git -- create repository vim.keymap.set("n", "<leader>gR", function() diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/dadbod.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/dadbod.lua index 41adb5a..730ebfe 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/dadbod.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/dadbod.lua @@ -18,6 +18,7 @@ return { firefox = "sqlite://" .. home .. "/.mozilla/firefox/si.default/places.sqlite", mysql = "mariadb://user:password@localhost/mysql", postsql = "postgresql://postgres:mypassword@localhost:5432/postgresql", + qutebrowser = "sqlite://" .. home .. "/.local/share/qutebrowser/history.sqlite", sqlite = "sqlite://" .. home .. "/.local/share/db/sqlite.db", } local wk = require("which-key") diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua index 3c7a35f..b8630d8 100644 --- a/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua +++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/plugins/mini.lua @@ -1139,19 +1139,19 @@ return { "n", "<leader>zj", ":lua MiniSplitjoin.toggle()<cr>", - { noremap = true, silent = true, desc = "Trim trailing whitespace" } + { noremap = true, silent = true, desc = "Toggle split-join" } ) vim.keymap.set( "n", "<leader>J", ":lua MiniSplitjoin.join()<cr>", - { noremap = true, silent = true, desc = "Trim trailing whitespace" } + { noremap = true, silent = true, desc = "Join" } ) vim.keymap.set( "n", "<leader><cr>", ":lua MiniSplitjoin.split()<cr>", - { noremap = true, silent = true, desc = "Trim trailing whitespace" } + { noremap = true, silent = true, desc = "Split" } ) end, }, diff --git a/ar/.config/mimeapps.list b/ar/.config/mimeapps.list index 5ac44b7..0acd48c 100644 --- a/ar/.config/mimeapps.list +++ b/ar/.config/mimeapps.list @@ -26,3 +26,4 @@ video/x-matroska=video.desktop; x-scheme-handler/lbry=lbry.desktop; x-scheme-handler/mailto=mail.desktop; x-scheme-handler/magnet=torrent.desktop; +image/webp=nsxiv.desktop; diff --git a/ar/.config/qutebrowser/config.py b/ar/.config/qutebrowser/config.py index 7fa01f7..56cf745 100644 --- a/ar/.config/qutebrowser/config.py +++ b/ar/.config/qutebrowser/config.py @@ -931,7 +931,7 @@ c.content.javascript.log_message.excludes = { "userscript:_qute_stylesheet": [ "*Refused to apply inline style because it violates the following Content Security Policy directive: *" ], - "userscript:_qute_js": ["*TrustedHTML*"], + "userscript:_qute_js": ["*TrustedHTML*", "*default-src*"], } ## Javascript message sources/levels to show in the qutebrowser UI. When @@ -1085,7 +1085,7 @@ c.content.prefers_reduced_motion = True ## Valid values: ## - system: Use the system wide proxy. ## - none: Don't use any proxy -# c.content.proxy = 'socks://localhost:9050/' # for tor to access .onion +c.content.proxy = "system" # for tor to access .onion ## Send DNS requests over the configured proxy. ## Type: Bool @@ -1152,7 +1152,7 @@ c.content.tls.certificate_errors = "ask" ## - default-public-and-private-interfaces: WebRTC should only use the default route used by http. This also exposes the associated default private address. Default route is the route chosen by the OS on a multi-homed endpoint. ## - default-public-interface-only: WebRTC should only use the default route used by http. This doesn't expose any local addresses. ## - disable-non-proxied-udp: WebRTC should only use TCP to contact peers or servers unless the proxy server supports UDP. This doesn't expose any local addresses either. -# c.content.webrtc_ip_handling_policy = 'all-interfaces' +c.content.webrtc_ip_handling_policy = "default-public-interface-only" ## Monitor load requests for cross-site scripting attempts. Suspicious ## scripts will be blocked and reported in the devtools JavaScript @@ -1165,7 +1165,7 @@ c.content.tls.certificate_errors = "ask" ## Directory to save downloads to. If unset, a sensible OS-specific ## default is used. ## Type: Directory -# c.downloads.location.directory = None +c.downloads.location.directory = "~/Downloads" ## Prompt the user for the download location. If set to false, ## `downloads.location.directory` will be used. @@ -1182,7 +1182,7 @@ c.content.tls.certificate_errors = "ask" ## - path: Show only the download path. ## - filename: Show only download filename. ## - both: Show download path and filename. -# c.downloads.location.suggestion = 'path' +c.downloads.location.suggestion = "both" ## Default program used to open downloads. If null, the default internal ## handler is used. Any `{}` in the string will be expanded to the @@ -1858,7 +1858,7 @@ c.session.lazy_restore = True ## - tr-TR: Turkish (Turkey) ## - uk-UA: Ukrainian (Ukraine) ## - vi-VN: Vietnamese (Viet Nam) -# c.spellcheck.languages = [] +c.spellcheck.languages = ["en-US", "ko"] ## Padding (in pixels) for the statusbar. ## Type: Padding @@ -2556,19 +2556,15 @@ config.bind("<Ctrl-]>", "command-history-prev", mode="command") # config.bind('y', 'prompt-accept yes', mode='yesno') ## userscripts -config.bind(",b", "spawn --userscript add-nextcloud-bookmarks") -config.bind(",B", "hint links userscript add-nextcloud-bookmarks") -config.bind(",c", "spawn --userscript add-nextcloud-cookbook") -config.bind(",C", "hint links userscript add-nextcloud-cookbook") -config.bind(",d", "spawn qndl -v {url}") -config.bind(",D", "hint links spawn qndl -v {hint-url}") config.bind(",gd", "spawn --userscript translate") config.bind(",gk", "spawn --userscript translate --target_lang ko") config.bind(",gd", "spawn --userscript translate", mode="caret") config.bind(",gk", "spawn --userscript translate --target_lang ko", mode="caret") -config.bind(",help", "open -t qute://help/index.html") config.bind(",msg", "open -t qute://log/?level=info") -config.bind(",oc", "open -t qute://help/commands.html#cmd-repeat") +config.bind(",nb", "spawn --userscript add-nextcloud-bookmarks") +config.bind(",nB", "hint links userscript add-nextcloud-bookmarks") +config.bind(",nc", "spawn --userscript add-nextcloud-cookbook") +config.bind(",nC", "hint links userscript add-nextcloud-cookbook") config.bind( ",pp", "spawn --userscript qute-pass --dmenu-invocation passmenu2 --unfiltered", @@ -2577,6 +2573,43 @@ config.bind( ",pn", 'spawn --userscript qute-pass --dmenu-invocation passmenu2 --unfiltered --username-pattern "name: (.+)"', ) +config.bind(",qh", "open -t qute://help/index.html") +config.bind(",qc", "open -t qute://help/commands.html#cmd-repeat") config.bind(",rs", "restart") -config.bind(",v", "spawn mpv --quiet --loop {url}") -config.bind(",V", "hint links spawn mpv --quiet --loop {hint-url}") +config.bind(",vd", "spawn qndl -v {url}") +config.bind(",vD", "hint links spawn qndl -v {hint-url}") +config.bind(",vv", "spawn mpv --quiet --detach --loop {url}") +config.bind(",vV", "hint links spawn --detach mpv --quiet --loop {hint-url}") +config.bind( + "za", + "config-cycle statusbar.show always never;; config-cycle tabs.show always never", +) +config.bind("zb", "config-cycle statusbar.show always never") +config.bind("zt", "config-cycle tabs.show always never") + +## Theme +# https://github.com/alphapapa/solarized-everything-css +config.bind( + ",tap", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/apprentice/apprentice-all-sites.css ""', +) +config.bind( + ",tdr", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/darculized/darculized-all-sites.css ""', +) +config.bind( + ",tgr", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/gruvbox/gruvbox-all-sites.css ""', +) +config.bind( + ",tsd", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/solarized-dark/solarized-dark-all-sites.css ""', +) +config.bind( + ",tsl", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/solarized-light/solarized-light-all-sites.css ""', +) +config.bind( + ",tcp", + 'config-cycle content.user_stylesheets ~/.config/qutebrowser/css/catppuccin/searxng/catppuccin.user.css ""', +) diff --git a/ar/.local/bin/extractkeys b/ar/.local/bin/extractkeys index 71b7cc9..ec047df 100755 --- a/ar/.local/bin/extractkeys +++ b/ar/.local/bin/extractkeys @@ -76,7 +76,7 @@ for file_path in "${config_files[@]}"; do fi line=$(echo "$line" | sed -e "s/^{ \(.*\) },/\1/g;s/{ \([^,]*\), \([^,]*\), \([^,]*\), \([^}]*\) }/\1 \2 \3 \4/g") - modkey=$(echo "$line" | awk -F',' '{print $1}' | sed "s/\b0//g;s/MODKEY\(\d*\)/MOD\1/g;s/\([Shift|Contrl]\)Mask/\1/g;s/Control/Ctrl/g;s/WINMOD2/MOD2+Ctrl/g;s/WINMOD/MOD+Shift/g;s/TERMMOD2/MOD2+Ctrl/g;s/TERMMOD/MOD+Shift/g;s/ULTRAMOD2/MOD2+Ctrl+Shift/g;s/ULTRAMOD/MOD+Ctrl+Shift/g;s/EXTRAMOD/Ctrl+Shift/g;s/|/+/g;s/ //g;s/XK_ANY_MOD/ANY MOD/g") + modkey=$(echo "$line" | awk -F',' '{print $1}' | sed "s/\b0//g;s/MODKEY\(\d*\)/MOD\1/g;s/\([Shift|Contrl]\)Mask/\1/g;s/Control/Ctrl/g;s/WINMOD2/MOD+Ctrl/g;s/WINMOD/MOD+Shift/g;s/TERMMOD2/MOD+Ctrl/g;s/TERMMOD/MOD+Shift/g;s/ULTRAMOD2/MOD2+Ctrl+Shift/g;s/ULTRAMOD/MOD+Ctrl+Shift/g;s/EXTRAMOD/Ctrl+Shift/g;s/|/+/g;s/ //g;s/XK_ANY_MOD/ANY MOD/g") key=$(echo "$line" | awk -F',' '{print $2}' | sed "s/\b0//g;s/XF86XK_//g;s/XK_//g;s/\s*\(.*\)_R$/Right_\1/g;s/\s*\(.*\)_L$/Left_\1/g;s/MODKEY\(\d*\)/MOD\1/g;s/\([Shift|Contrl]\)Mask/\1/g;s/Control/Ctrl/g;s/|/+/g;s/ //g") func=$(echo "$line" | awk -F',' '{print $3}' | grep -v "spawn" | sed "s/ //g") args=$(echo "$line" | cut -d',' -f4- | sed -E 's/.*\.v\s*=\s*\(const\s*char\s*\*\[\]\)\s*\{\s*([^}]*)\s*\}.*/\1/g; |
