Compare commits

..

49 Commits

Author SHA1 Message Date
1449ff5d5c vis: change light background (also for st) and embedded background 2025-09-26 10:47:16 +02:00
35046d1269 vis: fzf.sh allow multi select (puts to messages), skip register value if default register 2025-09-26 10:47:16 +02:00
26cbc9b667 vis: format go files on write 2025-09-26 10:47:16 +02:00
967e9750d9 vis: improve opening make-like file with pos, improve close prev/next window 2025-09-26 10:47:16 +02:00
0949fcfb49 vis: add go_ext grammar with embedded sql with go templating 2025-09-26 10:15:07 +02:00
28595bbd31 vis: fix shell escape and update lazyjj key 2025-09-24 23:55:50 +02:00
b1f3a79744 tmux/nvim: remove switch pane/window integration 2025-09-24 23:54:58 +02:00
1e7c5902ea vis: templ: add (implement) templ lexer 2025-09-24 23:46:47 +02:00
fddce86eca vis: implement fast jump 2025-09-22 21:38:26 +02:00
f5a0ee0dc9 lupan-set-theme: toggle st theme (note: needs st patched to handle USR1) 2025-09-21 19:35:11 +02:00
8fded47ae8 shell: improve tmux and edit aliases 2025-09-20 12:23:46 +02:00
b11ccf5b82 lazygit: new, vis as editor and use nerd fonts 2025-09-20 12:23:46 +02:00
b72f3935d5 xsession: move awesome to top 2025-09-20 12:23:46 +02:00
d0bc15f7a7 vis: change status bar in dark theme and background in light one 2025-09-20 12:23:46 +02:00
e213b465b3 tmux: change terminal for vis compat, pane name on title, more vi like keys in copy mode 2025-09-20 10:59:38 +02:00
c613624f39 awesome: better toggle maximize, add keys to focus nth window on active tag 2025-09-20 10:59:38 +02:00
d4f4c1ad1a awesome: new themes, use st and clock without date 2025-09-20 10:59:38 +02:00
94fc8c036c vis: fzf.sh: add key to select alternative directory, fix switching between search and find 2025-09-19 00:14:10 +02:00
84d26c68a5 vis: add script fzf.sh and use it with just two keys
fzf.sh is a wrapper around fzf with mode for fd, rg, git and jj which
allow to switch between them with keys
2025-09-18 09:14:44 +02:00
d03dda4979 vis: set dark or light theme and start and also add key for this action 2025-09-15 23:04:19 +02:00
5464d111d0 vis: add keys for shell and themes, change current dir keys 2025-09-14 10:13:43 +02:00
bd15a7b443 vis: add lupan-dark and lupan-light themes, based on default with my selection of colors 2025-09-14 10:13:43 +02:00
2024651e33 xsession: add st-abduco-tabbed; dk: change term to st and add key for st-abduco-tabbed 2025-09-12 21:32:36 +02:00
ff66a92104 dk: add key for theme toggle 2025-09-10 10:38:08 +02:00
7fef9a8760 vis: global marks, do not reopen already opened file, fzf search current file 2025-09-10 10:36:54 +02:00
6757fc6aec vis: keys for yazi and fzf with hidden files; vis as default editor (also in yazi) 2025-09-10 10:36:54 +02:00
28fbb75b47 alacritty: use nordic and night owlish light themes; vis use default theme 2025-09-10 00:17:43 +02:00
829804f2ed vis: add key for fzf change directory 2025-09-09 22:11:33 +02:00
ebec63e48c add vis config 2025-09-08 23:30:43 +02:00
b600226065 nvim: add arrow go to keys (without displaying menu), change blame toggle key 2025-09-08 23:30:43 +02:00
4398125c7b add dk and polybar 2025-09-08 23:30:43 +02:00
9064a389e9 dwm: reformat config.h 2025-08-01 00:10:33 +02:00
e507e258e3 nvim: add lazyjj 2025-07-22 23:09:32 +02:00
d138f4c1da nvim, alacritty: switch to kanagawa-paper 2025-07-21 23:59:21 +02:00
fa085ae00c nvim: add snipe 2025-06-25 23:59:37 +02:00
d8a21e78c4 nvim: switch to sweetie colorscheme, also update alacritty themes 2025-06-25 22:05:48 +02:00
213a93acd9 nvim: remove telescope persisted key and grep_string 2025-06-24 22:51:01 +02:00
bdde8238c9 nvim: use snacks, remove lisp related and replaced packages 2025-06-12 09:38:21 +02:00
d21fdc925c nvim: add key for session change and change keys for namu 2025-06-07 21:51:54 +02:00
dba234077e nvim: add commands FormatDisable and FormatEnable 2025-06-07 11:08:57 +02:00
867e3d6991 nvim: move arrow, add namu and odin 2025-06-04 22:55:37 +02:00
ecb466f230 nvim: lazy update 2025-06-03 23:36:38 +02:00
f5302fc646 nvim/zsh: remove jj key mapping, add two aliases, nvim: back to arrow 2025-06-03 23:16:50 +02:00
3eaba86825 nvim: remove hardtime 2025-05-14 00:02:42 +02:00
1b0d0597b0 zsh: change escape bind key 2025-05-13 23:35:24 +02:00
63860cd661 nvim: color scheme nightfox 2025-05-13 23:35:24 +02:00
d122f56ab6 nvim: handle lisp file type, change local leader 2025-05-13 23:35:11 +02:00
a5c491d1ce awesome: use dmenu 2025-05-13 23:00:18 +02:00
d6ba2a78b9 tmux: bind tmux-session-menu 2025-05-13 23:00:18 +02:00
48 changed files with 2276 additions and 416 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ lupan-wm/target
__pycache__ __pycache__
/dwm /dwm
/st /st
/vis/.config/vis/plugins/

View File

@@ -1,71 +1,31 @@
# Nightfox Alacritty Colors # https://github.com/alacritty/alacritty-theme/blob/master/themes/nordic.toml
## name: nightfox
## upstream: https://github.com/edeneast/nightfox.nvim/raw/main/extra/nightfox/alacritty.toml # Colors (Nordic)
[colors.primary] [colors.primary]
background = "#2e3440" # changed background = '#242933'
foreground = "#eceff4" # changed foreground = '#BBBDAF'
dim_foreground = "#aeafb0"
bright_foreground = "#d6d6d7"
[colors.cursor]
text = "#cdcecf"
cursor = "#aeafb0"
[colors.vi_mode_cursor]
text = "#cdcecf"
cursor = "#63cdcf"
[colors.search.matches]
foreground = "#cdcecf"
background = "#3c5372"
[colors.search.focused_match]
foreground = "#cdcecf"
background = "#81b29a"
[colors.footer_bar]
foreground = "#cdcecf"
background = "#29394f"
[colors.hints.start]
foreground = "#cdcecf"
background = "#f4a261"
[colors.hints.end]
foreground = "#cdcecf"
background = "#29394f"
[colors.selection]
text = "#cdcecf"
background = "#2b3b51"
[colors.normal] [colors.normal]
black = "#393b44" black = '#191C1D'
red = "#c94f6d" red = '#BD6062'
green = "#81b29a" green = '#A3D6A9'
yellow = "#dbc074" yellow = '#F0DFAF'
blue = "#719cd6" blue = '#8FB4D8'
magenta = "#9d79d6" magenta = '#C7A9D9'
cyan = "#63cdcf" cyan = '#B6D7A8'
white = "#dfdfe0" white = '#BDC5BD'
[colors.bright] [colors.bright]
black = "#575860" black = '#727C7C'
red = "#d16983" red = '#D18FAF'
green = "#8ebaa4" green = '#B7CEB0'
yellow = "#e0c989" yellow = '#BCBCBC'
blue = "#86abdc" blue = '#E0CF9F'
magenta = "#baa1e2" magenta = '#C7A9D9'
cyan = "#7ad5d6" cyan = '#BBDA97'
white = "#e4e4e5" white = '#BDC5BD'
[colors.dim] [colors.selection]
black = "#30323a" text = '#000000'
red = "#ab435d" background = '#F0DFAF'
green = "#6e9783"
yellow = "#baa363"
blue = "#6085b6"
magenta = "#8567b6"
cyan = "#54aeb0"
white = "#bebebe"

View File

@@ -1,30 +1,35 @@
# Colors (Alabaster) # https://github.com/alacritty/alacritty-theme/blob/master/themes/night_owlish_light.toml
# author tonsky
# Colors (Night Owlish Light)
[colors.primary] [colors.primary]
background = '#FFFFFF' # changed background = '#ffffff'
foreground = '#434343' foreground = '#403f53'
[colors.cursor]
text = '#F7F7F7'
cursor = '#434343'
[colors.normal] [colors.normal]
black = '#000000' black = '#011627'
red = '#AA3731' red = '#d3423e'
green = '#448C27' green = '#2aa298'
yellow = '#CB9000' yellow = '#daaa01'
blue = '#325CC0' blue = '#4876d6'
magenta = '#7A3E9D' magenta = '#403f53'
cyan = '#0083B2' cyan = '#08916a'
white = '#BBBBBB' white = '#7a8181'
[colors.bright] [colors.bright]
black = '#777777' black = '#7a8181'
red = '#F05050' red = '#f76e6e'
green = '#60CB00' green = '#49d0c5'
yellow = '#FFBC5D' yellow = '#dac26b'
blue = '#007ACC' blue = '#5ca7e4'
magenta = '#E64CE6' magenta = '#697098'
cyan = '#00AACB' cyan = '#00c990'
white = '#FFFFFF' white = '#989fb1'
[colors.cursor]
cursor = '#403f53'
text = '#fbfbfb'
[colors.selection]
background = '#f2f2f2'
text = '#403f53'

View File

@@ -88,7 +88,7 @@ local function switch_theme()
end end
-- This is used later as the default terminal and editor to run. -- This is used later as the default terminal and editor to run.
local terminal = "alacritty" local terminal = "st"
-- Default modkey. -- Default modkey.
local modkey = "Mod4" local modkey = "Mod4"
@@ -123,7 +123,7 @@ local mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar -- {{{ Wibar
-- Create a textclock widget -- Create a textclock widget
local mytextclock = wibox.widget.textclock() local mytextclock = wibox.widget.textclock('%H:%M ')
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
local taglist_buttons = gears.table.join( local taglist_buttons = gears.table.join(
@@ -236,6 +236,15 @@ local function layout_menu()
awful.menu(layouts):show() awful.menu(layouts):show()
end end
local function focus_nth_window (n)
local cc = {}
for _, c in ipairs(client.get()) do
if awful.widget.tasklist.filter.currenttags(c, mouse.screen) then cc[#cc + 1] = c end
end
local new_focused = cc[n]
if new_focused then client.focus = new_focused; new_focused:raise() end
end
-- {{{ Key bindings -- {{{ Key bindings
local globalkeys = gears.table.join( local globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help, awful.key({ modkey, }, "s", hotkeys_popup.show_help,
@@ -338,8 +347,8 @@ local globalkeys = gears.table.join(
end, end,
{ description = "lua execute prompt", group = "awesome" }), { description = "lua execute prompt", group = "awesome" }),
-- Menubar -- Menubar
awful.key({ modkey, }, "p", function() menubar.show() end, awful.key({ modkey }, "p", function() awful.spawn("dmenu_run -fn 'FiraCode Nerd Font Ret:size=10'") end,
{ description = "show the menubar", group = "launcher" }) { description = "run command", group = "launcher" })
) )
local clientkeys = gears.table.join( local clientkeys = gears.table.join(
@@ -368,8 +377,11 @@ local clientkeys = gears.table.join(
{ description = "minimize", group = "client" }), { description = "minimize", group = "client" }),
awful.key({ modkey, }, "m", awful.key({ modkey, }, "m",
function(c) function(c)
c.maximized = not c.maximized if awful.layout.getname() == "max" then
c:raise() awful.layout.set(awful.layout.suit.tile)
else
awful.layout.set(awful.layout.suit.max)
end
end, end,
{ description = "(un)maximize", group = "client" }), { description = "(un)maximize", group = "client" }),
awful.key({ modkey, }, "v", awful.key({ modkey, }, "v",
@@ -432,7 +444,11 @@ for i = 1, 9 do
end end
end end
end, end,
{ description = "toggle focused client on tag #" .. i, group = "tag" }) { description = "toggle focused client on tag #" .. i, group = "tag" }),
--- Focus nth window
awful.key({ "Control" }, "#" .. i + 9,
function() focus_nth_window(i) end,
{ description = "focus window index #" .. i, group = "client" })
) )
end end

View File

@@ -7,28 +7,28 @@ local theme = {}
theme.font = "Fira Code Nerd Font 10" theme.font = "Fira Code Nerd Font 10"
theme.tasklist_disable_icon = true theme.tasklist_disable_icon = true
theme.wibar_height = 40 theme.wibar_height = 30
theme.bg_normal = "#293d38" -- hsl(165deg 20% 20%) theme.bg_normal = "#111c22" -- hsl(200 35% 10%)
theme.bg_focus = "#478575" -- hsl(165deg 30% 40%) theme.bg_focus = "#316781" -- hsl(200 45% 35%)
theme.bg_urgent = "#5c3d45" -- hsl(345deg 20% 30%) theme.bg_urgent = "#814c31" -- hsl(20 45% 35%)
theme.bg_minimize = "#363e49" -- hsl(215deg 15% 25%) theme.bg_minimize = "#454f54" -- hsl(200 10% 30%)
theme.bg_systray = theme.bg_normal theme.bg_systray = theme.bg_normal
theme.tasklist_bg_focus = "#3d5c54" -- hsl(165deg 20% 30%) theme.tasklist_bg_focus = "#1c3b4a" -- hsl(200 45% 20%)
theme.fg_normal = "#a9d6ca" -- hsl(165deg 35% 75%)" theme.fg_normal = "#73848c" -- hsl(200 10% 50%)
theme.fg_focus = "#b1babd" theme.fg_focus = "#abb5ba" -- hsl(200 10% 70%)
theme.fg_urgent = theme.bg_focus theme.fg_urgent = theme.bg_focus
theme.fg_minimize = "#8a9294" theme.fg_minimize = theme.fg_normal
theme.taglist_fg_empty = "#62847b" -- hsl(165deg 15% 45%)" theme.taglist_fg_empty = "#454f54" -- hsl(200 10% 30%)
theme.useless_gap = dpi(1) theme.useless_gap = dpi(1)
theme.border_width = dpi(2) theme.border_width = dpi(2)
theme.border_normal = "#708090" theme.border_normal = "#73848c" -- hsl(200 10% 50%)
theme.border_focus = "#a0522d" theme.border_focus = "#b25e34" -- hsl(20 55% 45%)
theme.border_marked = "#91231c" theme.border_marked = "#3488b2" -- hsl(200 55% 45%)
theme.bg_wallpaper = "#424a4c" theme.bg_wallpaper = "#454f54" -- hsl(200 10% 30%)
theme.hotkeys_font = theme.font theme.hotkeys_font = theme.font
theme.hotkeys_description_font = theme.font theme.hotkeys_description_font = theme.font

View File

@@ -7,28 +7,28 @@ local theme = {}
theme.font = "Fira Code Nerd Font 10" theme.font = "Fira Code Nerd Font 10"
theme.tasklist_disable_icon = true theme.tasklist_disable_icon = true
theme.wibar_height = 40 theme.wibar_height = 30
theme.bg_normal = "#293d38" -- hsl(165deg 20% 20%) theme.bg_normal = "#111c22" -- hsl(200 35% 10%)
theme.bg_focus = "#a9d6ca" -- hsl(165deg 35% 75%) theme.bg_focus = "#d0e3fb" -- hsl(214 85% 90%)
theme.bg_urgent = "#bc8f9b" -- hsl(345deg 25% 65%) theme.bg_urgent = "#f2d1a6" -- hsl(34 75% 80%)
theme.bg_minimize = "#62847b" -- hsl(165deg 15% 45%) theme.bg_minimize = "#8596ad" -- hsl(214 20% 60%)
theme.bg_systray = theme.bg_normal theme.bg_systray = theme.bg_normal
theme.tasklist_bg_focus = "#8fbcb1" -- hsl(165deg 25% 65%) theme.tasklist_bg_focus = "#a6c7f2" -- hsl(214 75% 80%)
theme.fg_normal = "#a9d6ca" -- hsl(165deg 35% 75%)" theme.fg_normal = "#a9bcd6" -- hsl(214 35% 75%)
theme.fg_focus = "#363d3e" theme.fg_focus = "#454b54" -- hsl(214 10% 30%)
theme.fg_urgent = "#e9f2f5" theme.fg_urgent = "#70675c" -- hsl(34 10% 40%)
theme.fg_minimize = "#4b5456" theme.fg_minimize = "#70675c" -- hsl(34 10% 40%)
theme.taglist_fg_empty = "#62847b" -- hsl(165deg 15% 45%)" theme.taglist_fg_empty = theme.fg_minimize
theme.useless_gap = dpi(1) theme.useless_gap = dpi(1)
theme.border_width = dpi(2) theme.border_width = dpi(2)
theme.border_normal = "#bebebe" theme.border_normal = theme.bg_minimize
theme.border_focus = "#ff7f50" theme.border_focus = "#df8c20" -- hsl(34 75% 50%)
theme.border_marked = "#91231c" theme.border_marked = "#2073df" -- hsl(214 75% 50%)
theme.bg_wallpaper = "#b0bec2" theme.bg_wallpaper = theme.fg_normal
theme.hotkeys_font = theme.font theme.hotkeys_font = theme.font
theme.hotkeys_description_font = theme.font theme.hotkeys_description_font = theme.font

175
dk/.config/dk/dkrc Executable file
View File

@@ -0,0 +1,175 @@
#!/bin/sh
# determine where to place the log file
logfile="$HOME/.dkrc.log"
[ -d "$HOME/.local/share/xorg" ] && logfile="$HOME/.local/share/xorg/dkrc.log"
: > "$logfile"
# load sxhkd for keybinds
pgrep sxhkd || sxhkd -c "$HOME/.config/dk/sxhkdrc" &
# spawn a scratchpad terminal if not already (see sxhkdrc and rules for binds/setup)
# pgrep -f "st -c scratchpad" || st -c scratchpad &
# adjust border widths based on the DPI of the monitor
px=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+x[0-9]\+' | cut -d'x' -f2)
mm=$(xrandr | grep ' connected' | tail -n1 | grep -o '[0-9]\+mm' | tail -n1 | sed 's/mm//')
dpi=$(( (px / mm) * 25 ))
if [ $dpi -ge 140 ]; then
border_width=5
border_outer_width=3
elif [ $dpi -ge 120 ]; then
border_width=4
border_outer_width=2
else
border_width=2
border_outer_width=1
fi
{ # compound command to redirect all output
# workspace settings
# ------------------------
# initialize 6 workspaces (1-6) (default: 1/monitor)
dkcmd set numws=10
# default workspace '_' values used when allocating new workspaces
# can be applied to all existing workspaces when passed 'apply' after ws=_
dkcmd set ws=_ apply layout=tile master=1 stack=3 gap=0 msplit=0.5 ssplit=0.5
# use grid layout, padding, and gaps on last workspace
#dkcmd set ws=6 layout=grid pad left=200 right=200 top=100 bottom=100 gap=50
# change workspace names (default: number == name -> 1:1, 2:2, 3:3....)
# dkcmd set \
# ws=1 name="edit" \
# ws=2 name="web" \
# ws=3 name="😀" \
# ws=4 name="😠" \
# ws=5 name="5" \
# ws=6 name="6" \
# enable static workspaces assigned to monitors (relevant for multiple monitors)
monitors=$(polybar -m | sed 's/+/:/g' | awk -F: '{print $3, $1}' | sort -n | cut -d' ' -f2 | xargs)
mon1=$(echo $monitors | cut -d' ' -f1)
mon2=$(echo $monitors | cut -d' ' -f2)
mon3=$(echo $monitors | cut -d' ' -f3)
if [ -z "$mon2" ]; then
mon2="$mon1"
mon3="$mon1"
elif [ -z "$mon3" ]; then
mon3="$mon1"
fi
dkcmd set static_ws=true \
ws=1 mon=$mon2 \
ws=2 mon=$mon2 \
ws=3 mon=$mon2 \
ws=4 mon=$mon2 \
ws=5 mon=$mon2 \
ws=6 mon=$mon2 \
ws=7 mon=$mon2 \
ws=8 mon=$mon2 \
ws=9 mon=$mon1 \
ws=10 mon=$mon3
# global settings
# ---------------------
# focus windows when receiving activation and enable focus-follows-mouse
dkcmd set focus_open=true focus_urgent=true focus_mouse=true
# place clients at the tail and ignore size hints on tiled windows
dkcmd set tile_tohead=0 tile_hints=false
# minimum width/height for resizing, and minimum allowed on-screen when moving
dkcmd set win_minwh=50 win_minxy=10
# disable gaps and borders in single window layouts
dkcmd set smart_gap=true smart_border=true
# define mouse mod and move/resize buttons
dkcmd set mouse mod=mod4 move=button1 resize=button3
# obey motif border hints on windows that draw their own (steam, easyeffects, etc.)
dkcmd set obey_motif=true
# borders
# ---------
# traditional
# set border width and colour for each window state
# dkcmd set border width=$border_width colour focus='#6699cc' unfocus='#000000' urgent='#ee5555'
# alternative
# enable split borders and colours, width is overall width, outer_width consumes some of width.
# outer_width must be less than width, outer_width of 0 will be single borders
dkcmd set border width=$border_width outer_width=$border_outer_width \
colour \
focus='#6699cc' \
unfocus='#444444' \
urgent='#ee5555' \
outer_focus='#222222' \
outer_unfocus='#222222' \
outer_urgent='#222222'
# window rules
# --------------
# rule class, instance, and title regex are *always* case INSENSITIVE
# open window(s) on a specific workspace (assigned monitor)
# dkcmd rule class="^gimp$" ws=2
# open window(s) on a monitor by number or name (active workspace on monitor)
# dkcmd rule class="^chromium$" mon="HDMI-A-0"
# open window(s) and use a callback function (user defined in config.h)
# we also ignore_cfg=true to stop the window from being resized on it's own from events
# eg. mpv --x11-name=albumart /path/to/media
# dkcmd rule class="^mpv$" instance="^albumart$" float=true ignore_cfg=true callback=albumart bw=0
# open window(s) in a floating state
dkcmd rule class="^(pavucontrol|transmission-gtk|steam|lxappearance)$" float=true
# open window(s) with a specific geometry and coordinates (floating only!)
# dkcmd rule class="^google-chrome$" title="^open files$" float=true w=1280 h=720
# open window(s) with ignore_msg=true to avoid focus being grabbed and changing workspace
# dkcmd rule class="^TelegramDesktop$" ignore_msg=true
# define some terminals and allow them to be absorbed by spawned windows
dkcmd rule class="^(st|st-256color|urxvt|kitty|alacritty|xterm|xterm-256color)$" terminal=true
# set a window to never absorb other windows, like the xev event tester
dkcmd rule title="^Event Tester$" no_absorb=true
# send a window to the scratchpad
dkcmd rule class="^scratchpad$" scratch=true
# focus window and workspace on opening
# dkcmd rule class="^firefox$" ws=1 focus=true
# update or remove an existing rule with the same match patterns
# dkcmd rule class="^firefox$" mon="HDMI-A-0"
# dkcmd rule remove class="^firefox$"
# apply current rule set to all existing windows (used mainly for WM restart)
dkcmd rule apply '*'
# delete all rules
# dkcmd rule remove '*'
} >> "$logfile" 2>&1 # append responses
# inform of any errors in a notification
if grep -q 'error:' "$logfile"; then
hash notify-send && notify-send -t 0 -u critical "dkrc has errors" \
"$(awk '/error:/ {sub(/^error: /, ""); gsub(/</, "\<"); print}' "$logfile")"
exit 1
fi
exit 0

117
dk/.config/dk/sxhkdrc Normal file
View File

@@ -0,0 +1,117 @@
# sxhkdrc for use with dk
#########################################################
# launcher
mod4 + p
dmenu_run -fn 'Fira Code Nerd Font Ret:size=13'
# terminal
mod4 + shift + Return
st
mod4 + ctrl + shift + Return
st-abduco-tabbed
# screenshot and selection capture
{_,mod4 + }@Print
scrot {_,-s}
# dedicated volume keys
{XF86AudioRaiseVolume,XF86AudioLowerVolume}
pamixer {-i,-d} 2
# dedicated backlight keys
{XF86MonBrightnessUp,XF86MonBrightnessDown}
xbacklight {+10,-10}
# alt volume keys
mod4 + {Insert,Delete}
pamixer {-i,-d} 2
# reload sxhkd
mod4 + shift + x
pkill -USR1 -x sxhkd
# quit dk
mod4 + shift + q
dkcmd exit
# reload dkrc
mod4 + shift + r
$HOME/.config/dk/dkrc
# restart dk
mod4 + ctrl + shift + r
dkcmd restart
# focus next or previous window
mod4 + {j,k}
dkcmd win focus {next,prev}
# close window, swap tiled window in/out of master, cycle tiled windows in place
mod4 + {q,space,Tab}
dkcmd win {kill,swap,cycle}
# toggle fullscreen and fake fullscreen (enable manipulating fullscreen window)
{_,mod4 + }F11
dkcmd win {full,fakefull}
# toggle floating, sticky, or scratchpad
mod4 + shift + {space,s,u}
dkcmd win {float,stick,scratch}
# alternatively to scratch a window by class "scratchpad"
#dkcmd win {float,stick,scratchpad scratch}
# move window, signed (+/-) for relative changes, for tiled windows
# y coord changes will move the window up/down the stack
mod4 + shift + {h,j,k,l}
dkcmd win resize {x=-20,y=+20,y=-20,x=+20}
# resize window, signed (+/-) for relative changes
mod4 + ctrl + {h,j,k,l}
dkcmd win resize {w=-20,h=+20,h=-20,w=+20}
# view, send, or follow to a workspace (by number)
mod4 + {_,shift + ,ctrl + }{1-9,0}
dkcmd ws {view,send,follow} {1-9,10}
# view, send, or follow to the next, previous, last active,
# next non-empty, or prev non-empty workspace
mod4 + {_,shift + ,ctrl + }{bracketleft,bracketright,BackSpace,Left,Right}
dkcmd ws {view,send,follow} {prev,next,last,prevne,nextne}
# view, send, or follow to the next, previous, or last active monitor
mod4 + {_,shift + ,ctrl + }{comma,period,backslash}
dkcmd mon {view,send,follow} {prev,next,last}
# change active workspace layout or cycle between them
mod4 + {t,r,m,g,s,w,f,u,c}
dkcmd set layout {tile,rtile,mono,grid,spiral,dwindle,none,tstack,cycle}
# change number of windows in master or first stack
mod4 + {_,shift + }{i,d}
dkcmd set {master,stack} {+1,-1}
# change gap width
mod4 + {equal,minus}
dkcmd set gap {+5,-5}
# change border widths
mod4 + ctrl + {_,shift + }{equal,minus}
dkcmd set border {width,outer_width} {+1,-1}
# lock screen
mod4 + ctrl + shift + l
slock
# suspend
mod4 + ctrl + shift + s
systemctl suspend
# toggle light/dark theme
mod4 + F6
lupan-set-theme toggle
# vim:ft=sxhkdrc

View File

@@ -0,0 +1,9 @@
os:
edit: 'vis {{filename}}'
editAtLine: 'vis +:{{line}} {{filename}}'
editAtLineAndWait: 'vis +:{{line}} {{filename}}'
editInTerminal: true
openDirInEditor: 'vis {{dir}}'
gui:
nerdFontsVersion: "3"

View File

@@ -1,80 +1,75 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, "arrow.nvim": { "branch": "master", "commit": "6e0f726f55f99332dd726a53effd6813786b6d49" },
"blame.nvim": { "branch": "main", "commit": "39bb4cda9e658d053a43919b10ca52c0a4d738e1" }, "blame.nvim": { "branch": "main", "commit": "b87b8c820e4cec06fbbd2f946b7b35c45906ee0c" },
"ccc.nvim": { "branch": "main", "commit": "b57cbaf8db3ac43c56c9e2c7f3812944638260ed" }, "ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "f643d1b51d1d3d14c8641a46ce44f6bce73c2697" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" },
"global-note.nvim": { "branch": "main", "commit": "1e0d4bba425d971ed3ce40d182c574a25507115c" }, "global-note.nvim": { "branch": "main", "commit": "1e0d4bba425d971ed3ce40d182c574a25507115c" },
"go.nvim": { "branch": "master", "commit": "0d426e87227dd14584881ecc595c173121456111" }, "go.nvim": { "branch": "master", "commit": "a3455f48cff718a86275115523dcc735535a13aa" },
"godoc.nvim": { "branch": "main", "commit": "356f79853dbb3b3e200064367603751895153c29" }, "godoc.nvim": { "branch": "main", "commit": "356f79853dbb3b3e200064367603751895153c29" },
"guihua.lua": { "branch": "master", "commit": "d783191eaa75215beae0c80319fcce5e6b3beeda" }, "guihua.lua": { "branch": "master", "commit": "87bea7b98429405caf2a0ce4d029b027bb017c70" },
"hardtime.nvim": { "branch": "main", "commit": "f87c86d1aa1e05dcf3c6ecd97fbfd237e2de0bf5" }, "hererocks": { "branch": "master", "commit": "344c46ed54df9a4dbc2d2bf510dcd9a9d90497bf" },
"hererocks": { "branch": "master", "commit": "c9c5444dea1e07e005484014a8231aa667be30b6" },
"hlsearch.nvim": { "branch": "main", "commit": "fdeb60b890d15d9194e8600042e5232ef8c29b0e" }, "hlsearch.nvim": { "branch": "main", "commit": "fdeb60b890d15d9194e8600042e5232ef8c29b0e" },
"incline.nvim": { "branch": "main", "commit": "27040695b3bbfcd3257669037bd008d1a892831d" }, "incline.nvim": { "branch": "main", "commit": "27040695b3bbfcd3257669037bd008d1a892831d" },
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
"iswap.nvim": { "branch": "master", "commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec" }, "iswap.nvim": { "branch": "master", "commit": "e02cc91f2a8feb5c5a595767d208c54b6e3258ec" },
"kanagawa-paper.nvim": { "branch": "master", "commit": "b0df20cca3b7087c06f241983b488190cc8e23af" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"leap.nvim": { "branch": "main", "commit": "346a16ef942635a8ca5ff92e603d07e7e8be6cbe" }, "lazyjj.nvim": { "branch": "main", "commit": "bba66a1351ff1f1bd078c8a1b00b8d12b3ed0017" },
"lsp_signature.nvim": { "branch": "master", "commit": "b58cca003d1d3311213d6db0352f58d8e57bfff0" }, "leap.nvim": { "branch": "main", "commit": "08ca7ec9e859856251d56c22ea107f82f563ff3c" },
"lspsaga.nvim": { "branch": "main", "commit": "778d56ff9b387dacd14ae648ed5604394b486f51" }, "lsp_signature.nvim": { "branch": "master", "commit": "d50e40b3bf9324128e71b0b7e589765ce89466d2" },
"marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, "lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "marks.nvim": { "branch": "master", "commit": "f353e8c08c50f39e99a9ed474172df7eddd89b72" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "98767d37f8e5255a5111fc1e3163232d4dc07bda" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c2682b0d9732bf52cbc34862056f143e71dc4a6d" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" },
"melange-nvim": { "branch": "master", "commit": "2db5407f2f6d6d6286f50f2f7365728d66f6f3ae" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"mellifluous.nvim": { "branch": "v1", "commit": "1637e46585435ebda7963248e0e65422effad8d9" }, "namu.nvim": { "branch": "main", "commit": "a3a3d81d12b61a38f131253bcd3ce5e2c6599850" },
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
"nano-theme.nvim": { "branch": "main", "commit": "0b1158c4911f4bd9d5a1e2e7669ebff893435b64" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"neogit": { "branch": "master", "commit": "6d1bd94f7fca92a50a892f494920696b5defa8c8" }, "neogit": { "branch": "master", "commit": "7fe60f9aa6eacf2eb730c4e9b83d06a36d028161" },
"nordic.nvim": { "branch": "main", "commit": "8627750ece357e9670f9e69853091f7fbb8d6523" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nvim-lspconfig": { "branch": "master", "commit": "3ea99227e316c5028f57a4d86a1a7fd01dd876d0" },
"nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, "nvim-surround": { "branch": "main", "commit": "8dd9150ca7eae5683660ea20cec86edcd5ca4046" },
"nvim-lspconfig": { "branch": "master", "commit": "0a1ac55d7d4ec2b2ed9616dfc5406791234d1d2b" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-surround": { "branch": "main", "commit": "caf6f633d4d77a29b6e265b560c5a035d171a913" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "0f051e9813a36481f48ca1f833897210dbcfffde" },
"nvim-treesitter": { "branch": "master", "commit": "aece1062335a9e856636f5da12d8a06c7615ce8a" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, "oil.nvim": { "branch": "master", "commit": "5b6068aad7d2057dd399fac73b7fb2cdf23ccd6e" },
"nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, "orgmode": { "branch": "master", "commit": "32ef9e95f43a6e951fb931b438372546a4f0c524" },
"oil.nvim": { "branch": "master", "commit": "ab887d926c2665a708fbe9e6c4654042cc5f4c60" }, "persisted.nvim": { "branch": "main", "commit": "d35a3ed973e17defd8800acd46a0c893498a2671" },
"onenord.nvim": { "branch": "main", "commit": "babdcc3da92f0c90703bb612a13a58e5f7669287" },
"orgmode": { "branch": "master", "commit": "145dce4d2f1bbaed5ff9e353822981b783627b32" },
"persisted.nvim": { "branch": "main", "commit": "b4b7a281307f8b52d47b0fd5b6798a453681d44e" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"quicker.nvim": { "branch": "master", "commit": "1798be71cdcb15fb84fa8054148a56e17fd391dc" }, "quicker.nvim": { "branch": "master", "commit": "51d3926f183c2d98fbc237cc237ae0926839af3a" },
"rabbit.nvim": { "branch": "master", "commit": "3a4ce048b8ecc48811d061220d0e86111adda20d" },
"rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" }, "rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" },
"slimline.nvim": { "branch": "main", "commit": "326514876f6e5c051a7a2bf1e926659a74500016" }, "slimline.nvim": { "branch": "main", "commit": "10dd807685997d1b72b950dfb4ec1a01cb259101" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"snipe.nvim": { "branch": "main", "commit": "2a1b738dfae8502e6162eddfc774da65ed404142" },
"sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" }, "sqlite.lua": { "branch": "master", "commit": "50092d60feb242602d7578398c6eb53b4a8ffe7b" },
"tardis.nvim": { "branch": "main", "commit": "a6ee00a217529490e79d349b1f1a9cf5831180d3" }, "tardis.nvim": { "branch": "main", "commit": "a6ee00a217529490e79d349b1f1a9cf5831180d3" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-git-grep.nvim": { "branch": "main", "commit": "cdd8215f15843a420b5c8e792395c403136626b6" }, "telescope-git-grep.nvim": { "branch": "main", "commit": "d2e1322934e334ee9eb8e838c30f3afb3e7a730e" },
"telescope-tabs": { "branch": "master", "commit": "0a678eefcb71ebe5cb0876aa71dd2e2583d27fd3" }, "telescope-tabs": { "branch": "master", "commit": "9ca0800d4e9c2610d5cac4d121cde0d9fbd89a64" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"tmux.nvim": { "branch": "main", "commit": "2c1c3be0ef287073cef963f2aefa31a15c8b9cd8" }, "tmux.nvim": { "branch": "main", "commit": "2c1c3be0ef287073cef963f2aefa31a15c8b9cd8" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"tree-sitter-nu": { "branch": "main", "commit": "d5c71a10b4d1b02e38967b05f8de70e847448dd1" }, "tree-sitter-nu": { "branch": "main", "commit": "100d06e29d13a8ebfc3f29173c07a5c4f2050586" },
"tree-sitter-templ": { "branch": "master", "commit": "7f7f06b3931ca00e8ddfbeab3fc08ad00d297fad" }, "tree-sitter-templ": { "branch": "master", "commit": "de35706f89beed5087670a9c4421b7794ef02411" },
"treesj": { "branch": "main", "commit": "6c616638e3aa0087f2c267bb5990115b67105976" }, "treesj": { "branch": "main", "commit": "3b4a2bc42738a63de17e7485d4cc5e49970ddbcc" },
"treewalker.nvim": { "branch": "main", "commit": "43d3250007d2c5a2ed693c1edebf66d66af33407" }, "treewalker.nvim": { "branch": "main", "commit": "86ae3cf9896b43f3cfa35b962428f32fed8b5ee8" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
"vim-ReplaceWithRegister": { "branch": "master", "commit": "b82bf59e5387b57d0125afb94fd7984061031136" }, "vim-ReplaceWithRegister": { "branch": "master", "commit": "a487af6efd1be3fc6fac8da47d00efc9d1f6f724" },
"vim-dadbod": { "branch": "master", "commit": "9f0ca8bcef704659820a95c3bbd2c262583a66a1" }, "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
"vim-dadbod-ui": { "branch": "master", "commit": "685e75b34ee0e12f92ec4507ea8bb7f1aaa936e5" }, "vim-dadbod-ui": { "branch": "master", "commit": "2900a1617b3df1a48683d872eadbe1101146a49a" },
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"whaler": { "branch": "main", "commit": "9e0b67e36250cb80e679563adcd4b7451eae26b2" }, "whaler": { "branch": "main", "commit": "b3a4257f6225a9a6c42f33b56ca316325e395f22" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"yankbank-nvim": { "branch": "main", "commit": "ded8f01bd6a7887310e14d463c8aa55eb79ec281" }, "yankbank-nvim": { "branch": "main", "commit": "ded8f01bd6a7887310e14d463c8aa55eb79ec281" }
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
} }

View File

@@ -1,5 +1,5 @@
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' \\'
local key = vim.keymap.set local key = vim.keymap.set
local opts = { silent = true, noremap = true } local opts = { silent = true, noremap = true }
@@ -51,7 +51,7 @@ key('n', '<leader>P', '<cmd>bp<CR>', { desc = '[P]revious buffer' })
key('n', '<leader>tc', '<cmd>tabnew<CR>', { desc = '[T]ab [c]reate' }) key('n', '<leader>tc', '<cmd>tabnew<CR>', { desc = '[T]ab [c]reate' })
key('n', '<leader>tx', '<cmd>tabclose<CR>', { desc = '[T]ab close' }) key('n', '<leader>tx', '<cmd>tabclose<CR>', { desc = '[T]ab close' })
key('n', '<leader>ts', '<cmd>tab split<CR>', { desc = '[T]ab [s]plit' }) key('n', '<leader>tS', '<cmd>tab split<CR>', { desc = '[T]ab [s]plit' })
key('n', '<leader>tn', '<cmd>tabnext<CR>', { desc = '[T]ab [n]ext' }) key('n', '<leader>tn', '<cmd>tabnext<CR>', { desc = '[T]ab [n]ext' })
key('n', '<leader>tp', '<cmd>tabprevious<CR>', { desc = '[T]ab [p]revious' }) key('n', '<leader>tp', '<cmd>tabprevious<CR>', { desc = '[T]ab [p]revious' })
key('n', '<leader>tf', '<cmd>tabfirst<CR>', { desc = '[T]ab [f]irst' }) key('n', '<leader>tf', '<cmd>tabfirst<CR>', { desc = '[T]ab [f]irst' })
@@ -83,7 +83,8 @@ key('n', '<leader>j', '<cmd>cn<CR>', { desc = "Quickfix next" })
key('n', '<leader>k', '<cmd>cp<CR>', { desc = "Quickfix previous" }) key('n', '<leader>k', '<cmd>cp<CR>', { desc = "Quickfix previous" })
key('n', '<leader>co', '<cmd>copen<CR>', { desc = "Quickfix [O]pen" }) key('n', '<leader>co', '<cmd>copen<CR>', { desc = "Quickfix [O]pen" })
key('n', '<leader>cc', '<cmd>cclose<CR>', { desc = "Quickfix [C]lose" }) key('n', '<leader>cc', '<cmd>cclose<CR>', { desc = "Quickfix [C]lose" })
key('n', '<leader>ct', '<cmd>TroubleToggle<CR>', { desc = "Toggle [T]rouble" })
key('n', '<leader>s;', '<cmd>SessionSelect<CR>', { desc = '[S]ession Select' })
-- luasnip -- luasnip

View File

@@ -1,42 +1,10 @@
return { return {
{ {
"ramojus/mellifluous.nvim", 'thesimonho/kanagawa-paper.nvim',
branch = "v1",
},
{
'rmehri01/onenord.nvim',
},
{
'AlexvZyl/nordic.nvim',
},
{
"savq/melange-nvim",
},
{
'ronisbr/nano-theme.nvim',
config = function() config = function()
local nano = require('nano-theme.colors') vim.cmd.colorscheme('kanagawa-paper')
local nano_get = nano.get
function nano.get()
local t = nano_get()
local light = vim.o.background == 'light'
if not light then
t.nano_strong.fg = '#ECEFF4'
end
return t
end
require('lupan.utils').set_color_schemes('nano-theme', 'nano-theme')
require('lupan.utils').update_color_scheme()
end end
}, },
{
-- Indentation guides (see `:help indent_blankline.txt`)
'lukas-reineke/indent-blankline.nvim',
main = "ibl",
opts = {},
},
{ {
--- Create Color Code --- Create Color Code
'uga-rosa/ccc.nvim', 'uga-rosa/ccc.nvim',

View File

@@ -74,5 +74,8 @@ return {
{ name = 'buffer' }, { name = 'buffer' },
}, },
}) })
cmp.setup.filetype('lisp', {
sources = cmp.config.sources({ { name = 'nvlime' } })
})
end, end,
} }

View File

@@ -1,4 +1,35 @@
return { return {
{
"otavioschwanck/arrow.nvim",
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
},
opts = {
show_icons = true,
leader_key = '-', -- Recommended to be a single key
buffer_leader_key = '+', -- Per Buffer Mappings
},
keys = {
{ "<leader>1", function() require("arrow.persist").go_to(1) end, desc = "Arrow go to 1" },
{ "<leader>2", function() require("arrow.persist").go_to(2) end, desc = "Arrow go to 2" },
{ "<leader>3", function() require("arrow.persist").go_to(3) end, desc = "Arrow go to 3" },
{ "<leader>4", function() require("arrow.persist").go_to(4) end, desc = "Arrow go to 4" },
{ "<leader>5", function() require("arrow.persist").go_to(5) end, desc = "Arrow go to 5" },
{ "<leader>6", function() require("arrow.persist").go_to(6) end, desc = "Arrow go to 6" },
{ "<leader>7", function() require("arrow.persist").go_to(7) end, desc = "Arrow go to 7" },
{ "<leader>8", function() require("arrow.persist").go_to(8) end, desc = "Arrow go to 8" },
{ "<leader>9", function() require("arrow.persist").go_to(9) end, desc = "Arrow go to 9" },
},
},
{
"leath-dub/snipe.nvim",
keys = {
{ "_", function() require("snipe").open_buffer_menu() end, desc = "Open Snipe buffer menu" }
},
opts = {}
},
{ {
"chentoast/marks.nvim", "chentoast/marks.nvim",
event = "VeryLazy", event = "VeryLazy",
@@ -9,4 +40,28 @@ return {
{ '<leader>mg', '<cmd>MarksListGlobal<CR>' }, { '<leader>mg', '<cmd>MarksListGlobal<CR>' },
}, },
}, },
{
"bassamsdata/namu.nvim",
config = function()
require("namu").setup({
-- Enable the modules you want
namu_symbols = {
enable = true,
options = {}, -- here you can configure namu
},
-- Optional: Enable other modules if needed
ui_select = { enable = false }, -- vim.ui.select() wrapper
})
-- === Suggested Keymaps: ===
vim.keymap.set("n", "<leader>;", ":Namu symbols<cr>", {
desc = "Jump to LSP symbol",
silent = true,
})
vim.keymap.set("n", "<leader>.", ":Namu workspace<cr>", {
desc = "LSP Symbols - Workspace",
silent = true,
})
end,
}
} }

View File

@@ -20,32 +20,4 @@ return {
} }
end, end,
}, },
{
"max397574/better-escape.nvim",
config = function(_, opts)
require("better_escape").setup(opts)
end,
},
{
"folke/zen-mode.nvim",
opts = {
window = { width = 180 },
plugins = {
tmux = { enabled = true },
},
on_open = function()
vim.opt.laststatus = 1
require('incline').disable()
vim.system({ 'hyprctl', 'dispatch', 'fullscreen' })
vim.system({ 'awesome-client', 'client.focus.fullscreen = true' })
end,
on_close = function()
vim.opt.laststatus = 3
require('incline').enable()
vim.system({ 'hyprctl', 'dispatch', 'fullscreen' })
vim.system({ 'awesome-client', 'client.focus.fullscreen = false' })
end
},
keys = { { "<leader>z", "<cmd>ZenMode<CR>" } },
},
} }

View File

@@ -21,9 +21,9 @@ return {
{ {
'inkarkat/vim-ReplaceWithRegister', 'inkarkat/vim-ReplaceWithRegister',
keys = { keys = {
{ 'gp', '<Plug>ReplaceWithRegisterOperator' }, { '<leader>rp', '<Plug>ReplaceWithRegisterOperator' },
{ 'gpp', '<Plug>ReplaceWithRegisterLine' }, { '<leader>rpp', '<Plug>ReplaceWithRegisterLine' },
{ 'gp', '<Plug>ReplaceWithRegisterVisual', mode = 'x' }, { '<leader>rp', '<Plug>ReplaceWithRegisterVisual', mode = 'x' },
}, },
}, },
@@ -84,11 +84,4 @@ return {
}, },
}, },
{
'echasnovski/mini.nvim',
version = '*',
config = function()
require('mini.ai').setup()
end
},
} }

View File

@@ -40,7 +40,7 @@ return {
config = true, config = true,
cmd = 'BlameToggle', cmd = 'BlameToggle',
keys = { keys = {
{ '<leader>gb', '<cmd>BlameToggle<cr>', desc = '[G]it [B]lame toggle' }, { '<leader>bt', '<cmd>BlameToggle<cr>', desc = 'Git [B]lame [T]oggle' },
}, },
}, },
@@ -64,8 +64,8 @@ return {
{ buffer = bufnr, desc = '[G]o to [N]ext Hunk' }) { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>ph', gs.preview_hunk, vim.keymap.set('n', '<leader>ph', gs.preview_hunk,
{ buffer = bufnr, desc = '[P]review [H]unk' }) { buffer = bufnr, desc = '[P]review [H]unk' })
vim.keymap.set('n', '<leader>sh', gs.stage_hunk, vim.keymap.set('n', '<leader>sA', gs.stage_hunk,
{ buffer = bufnr, desc = '[S]tage [H]unk' }) { buffer = bufnr, desc = '[S]tage Hunk' })
vim.keymap.set('n', '<leader>HD', function() gs.diffthis('~') end, vim.keymap.set('n', '<leader>HD', function() gs.diffthis('~') end,
{ buffer = bufnr, desc = '[H]unk [D]iff' }) { buffer = bufnr, desc = '[H]unk [D]iff' })
end, end,

View File

@@ -2,11 +2,11 @@ return {
'backdround/global-note.nvim', 'backdround/global-note.nvim',
keys = { keys = {
{ {
"<leader>n", "<leader>tn",
function() function()
require('global-note').toggle_note() require('global-note').toggle_note()
end, end,
desc = 'Toggle global [N]ote', desc = '[T]oggle global [N]ote',
}, },
}, },
} }

View File

@@ -1,7 +0,0 @@
return {
{
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {}
},
}

View File

@@ -0,0 +1,9 @@
return {
{
'swaits/lazyjj.nvim',
dependencies = 'nvim-lua/plenary.nvim',
opts = {
mapping = '<leader>gj'
}
},
}

View File

@@ -1,6 +1,7 @@
return { return {
{ {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
version = '*',
dependencies = { dependencies = {
-- Automatically install LSPs and related tools to stdpath for neovim -- Automatically install LSPs and related tools to stdpath for neovim
'williamboman/mason.nvim', 'williamboman/mason.nvim',
@@ -19,17 +20,10 @@ return {
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
end end
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
map('<leader>rn', '<cmd>Lspsaga rename<CR>', '[R]e[n]ame') map('<leader>rn', '<cmd>Lspsaga rename<CR>', '[R]e[n]ame')
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
map('K', '<cmd>Lspsaga hover_doc<CR>', 'Hover Documentation') map('K', '<cmd>Lspsaga hover_doc<CR>', 'Hover Documentation')
map('<leader>K', vim.lsp.buf.signature_help, 'Signature Documentation') map('<leader>K', vim.lsp.buf.signature_help, 'Signature Documentation')
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
-- Highlight references under cursor (clear highlight when cursor moves). -- Highlight references under cursor (clear highlight when cursor moves).
local client = vim.lsp.get_client_by_id(event.data.client_id) local client = vim.lsp.get_client_by_id(event.data.client_id)

View File

@@ -0,0 +1,49 @@
require 'lspconfig'.ols.setup {}
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
return {
{
"stevearc/conform.nvim",
opts = {
-- notify_on_error = false,
-- Odinfmt gets its configuration from odinfmt.json. It defaults
-- writing to stdout but needs to be told to read from stdin.
formatters = {
odinfmt = {
-- Change where to find the command if it isn't in your path.
command = "odinfmt",
args = { "-stdin" },
stdin = true,
},
},
-- and instruct conform to use odinfmt.
formatters_by_ft = {
odin = { "odinfmt" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 500, lsp_format = "fallback" }
end,
},
}
}

View File

@@ -11,7 +11,4 @@ return {
{ "/", exact = true }, { "/", exact = true },
}, },
}, },
keys = {
{ "<leader>sp", "<cmd>:Telescope persisted<cr>", desc = "Search [P]ersisted" },
},
} }

View File

@@ -1,36 +0,0 @@
local function rabbit_select(n)
require('rabbit').Switch('harpoon').func.select(n)
end
return {
'VoxelPrismatic/rabbit.nvim',
event = 'VeryLazy',
opts = {
window = {
float = 'center',
plugin_name_position = 'title',
},
default_keys = {
open = { '-', '<leader>;' },
},
plugin_opts = {
history = { switch = ';' },
harpoon = { switch = 'f' },
},
colors = {
file = '#EBCB8B',
},
},
keys = {
{ '<leader>1', function() rabbit_select(1) end },
{ '<leader>2', function() rabbit_select(2) end },
{ '<leader>3', function() rabbit_select(3) end },
{ '<leader>4', function() rabbit_select(4) end },
{ '<leader>5', function() rabbit_select(5) end },
{ '<leader>6', function() rabbit_select(6) end },
{ '<leader>7', function() rabbit_select(7) end },
{ '<leader>8', function() rabbit_select(8) end },
{ '<leader>9', function() rabbit_select(9) end },
{ '<leader>0', function() rabbit_select(10) end },
},
}

View File

@@ -0,0 +1,171 @@
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = false },
explorer = { enabled = true },
indent = { enabled = true },
input = { enabled = true },
notifier = {
enabled = true,
timeout = 3000,
},
picker = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = true },
words = { enabled = true },
styles = {
notification = {
-- wo = { wrap = true } -- Wrap notifications
}
},
zen = {
win = { width = 180, backdrop = { transparent = false } },
on_open = function()
vim.opt.laststatus = 1
require('incline').disable()
vim.system({ 'hyprctl', 'dispatch', 'fullscreen' })
vim.system({ 'awesome-client', 'client.focus.fullscreen = true' })
end,
on_close = function()
vim.opt.laststatus = 3
require('incline').enable()
vim.system({ 'hyprctl', 'dispatch', 'fullscreen' })
vim.system({ 'awesome-client', 'client.focus.fullscreen = false' })
end
}
},
keys = {
-- Top Pickr & Explorer
{ "<leader><space>", function() Snacks.picker.smart() end, desc = "Smart Find Files" },
{ "<leader>,", function() Snacks.picker.buffers() end, desc = "Buffers" },
{ "<leader>/", function() Snacks.picker.grep() end, desc = "Grep" },
{ "<leader>:", function() Snacks.picker.command_history() end, desc = "Command History" },
{ "<leader>n", function() Snacks.picker.notifications() end, desc = "Notification History" },
{ "<leader>e", function() Snacks.explorer() end, desc = "File Explorer" },
-- find
{ "<leader>fb", function() Snacks.picker.buffers() end, desc = "Buffers" },
{ "<leader>fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" },
{ "<leader>ff", function() Snacks.picker.files() end, desc = "Find Files" },
{ "<leader>fg", function() Snacks.picker.git_files() end, desc = "Find Git Files" },
{ "<leader>fp", function() Snacks.picker.projects() end, desc = "Projects" },
{ "<leader>fr", function() Snacks.picker.recent() end, desc = "Recent" },
-- git
{ "<leader>gb", function() Snacks.picker.git_branches() end, desc = "Git Branches" },
{ "<leader>gl", function() Snacks.picker.git_log() end, desc = "Git Log" },
{ "<leader>gL", function() Snacks.picker.git_log_line() end, desc = "Git Log Line" },
{ "<leader>gs", function() Snacks.picker.git_status() end, desc = "Git Status" },
{ "<leader>gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" },
{ "<leader>gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (Hunks)" },
{ "<leader>gf", function() Snacks.picker.git_log_file() end, desc = "Git Log File" },
{ "<leader>gg", function() Snacks.picker.git_grep() end, desc = "Git Grep" },
-- Grep
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
{ "<leader>sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" },
{ "<leader>sg", function() Snacks.picker.grep() end, desc = "Grep" },
{ "<leader>sw", function() Snacks.picker.grep_word() end, desc = "Visual selection or word", mode = { "n", "x" } },
{ "<leader>so", function() Snacks.picker.grep({ cwd = "/usr/lib/odin" }) end, desc = "Grep" },
{ "<leader>sO", function() Snacks.picker.files({ cwd = "/usr/lib/odin" }) end, desc = "Grep" },
{ "<leader>sX", function() Snacks.picker.grep({ cwd = "/usr/include/xcb" }) end, desc = "Grep" },
-- search
{ '<leader>s"', function() Snacks.picker.registers() end, desc = "Registers" },
{ '<leader>s/', function() Snacks.picker.search_history() end, desc = "Search History" },
{ "<leader>sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" },
{ "<leader>sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" },
{ "<leader>sc", function() Snacks.picker.command_history() end, desc = "Command History" },
{ "<leader>sC", function() Snacks.picker.commands() end, desc = "Commands" },
{ "<leader>sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" },
{ "<leader>sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Buffer Diagnostics" },
{ "<leader>sh", function() Snacks.picker.help() end, desc = "Help Pages" },
{ "<leader>sH", function() Snacks.picker.highlights() end, desc = "Highlights" },
{ "<leader>si", function() Snacks.picker.icons() end, desc = "Icons" },
{ "<leader>sj", function() Snacks.picker.jumps() end, desc = "Jumps" },
{ "<leader>sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" },
{ "<leader>sl", function() Snacks.picker.loclist() end, desc = "Location List" },
{ "<leader>sm", function() Snacks.picker.marks() end, desc = "Marks" },
{ "<leader>sM", function() Snacks.picker.man() end, desc = "Man Pages" },
{ "<leader>sp", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec" },
{ "<leader>sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" },
{ "<leader>sR", function() Snacks.picker.resume() end, desc = "Resume" },
{ "<leader>su", function() Snacks.picker.undo() end, desc = "Undo History" },
{ "<leader>uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" },
-- LSP
{ "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" },
{ "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" },
{ "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" },
{ "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" },
{ "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" },
{ "<leader>ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" },
{ "<leader>sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" },
-- Other
{ "<leader>z", function() Snacks.zen() end, desc = "Toggle Zen Mode" },
{ "<leader>Z", function() Snacks.zen.zoom() end, desc = "Toggle Zoom" },
{ "<leader>'", function() Snacks.scratch() end, desc = "Toggle Scratch Buffer" },
{ "<leader>S", function() Snacks.scratch.select() end, desc = "Select Scratch Buffer" },
{ "<leader>n", function() Snacks.notifier.show_history() end, desc = "Notification History" },
{ "<leader>bd", function() Snacks.bufdelete() end, desc = "Delete Buffer" },
{ "<leader>cR", function() Snacks.rename.rename_file() end, desc = "Rename File" },
{ "<leader>gB", function() Snacks.gitbrowse() end, desc = "Git Browse", mode = { "n", "v" } },
{ "<leader>gG", function() Snacks.lazygit() end, desc = "Lazygit" },
{ "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
{ "<leader>bl", function() Snacks.git.blame_line() end, desc = "Git Blame Line" },
{ "<c-/>", function() Snacks.terminal() end, desc = "Toggle Terminal" },
{ "<c-_>", function() Snacks.terminal() end, desc = "which_key_ignore" },
{ "]]", function() Snacks.words.jump(vim.v.count1) end, desc = "Next Reference", mode = { "n", "t" } },
{ "[[", function() Snacks.words.jump(-vim.v.count1) end, desc = "Prev Reference", mode = { "n", "t" } },
{
"<leader>N",
desc = "Neovim News",
function()
Snacks.win({
file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1],
width = 0.6,
height = 0.6,
wo = {
spell = false,
wrap = false,
signcolumn = "yes",
statuscolumn = " ",
conceallevel = 3,
},
})
end,
}
},
init = function()
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
-- Setup some globals for debugging (lazy-loaded)
_G.dd = function(...)
Snacks.debug.inspect(...)
end
_G.bt = function()
Snacks.debug.backtrace()
end
vim.print = _G.dd -- Override print to use snacks for `:=` command
-- Create some toggle mappings
Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>us")
Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>uw")
Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("<leader>uL")
Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.line_number():map("<leader>ul")
Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map(
"<leader>uc")
Snacks.toggle.treesitter():map("<leader>uT")
Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
Snacks.toggle.inlay_hints():map("<leader>uh")
Snacks.toggle.indent():map("<leader>ug")
Snacks.toggle.dim():map("<leader>uD")
end,
})
end,
}
}

View File

@@ -54,48 +54,17 @@ return {
pcall(telescope.load_extension, 'ui-select') pcall(telescope.load_extension, 'ui-select')
pcall(telescope.load_extension, 'whaler') pcall(telescope.load_extension, 'whaler')
pcall(telescope.load_extension, 'git_grep') pcall(telescope.load_extension, 'git_grep')
pcall(telescope.load_extension, 'persisted')
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
local builtin = require 'telescope.builtin' local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', '<leader>sT', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '<leader>sL', function() telescope.extensions.whaler.whaler() end,
vim.keymap.set('n', '<leader>sF', function() builtin.find_files { hidden = true } end,
{ desc = '[S]earch [F]iles (with hidden)' })
vim.keymap.set('n', '<leader>sl', function() telescope.extensions.whaler.whaler() end,
{ desc = '[S]earch with wha[L]er' }) { desc = '[S]earch with wha[L]er' })
vim.keymap.set('n', '<leader>gf', builtin.git_files, { desc = '[G]it [F]iles' })
vim.keymap.set('n', '<leader>gs', builtin.git_status, { desc = '[G]it [S]tatus' })
vim.keymap.set('n', '<leader>gg', function() telescope.extensions.git_grep.live_grep() end,
{ desc = '[G]it [g]rep' })
vim.keymap.set('n', '<leader>gw', function() telescope.extensions.git_grep.grep() end, vim.keymap.set('n', '<leader>gw', function() telescope.extensions.git_grep.grep() end,
{ desc = '[G]it grep current [W]ord' }) { desc = '[G]it grep current [W]ord' })
vim.keymap.set('n', '<leader>/', function()
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
end, end,
} }

View File

@@ -15,7 +15,7 @@ return {
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
ensure_installed = { 'c', 'cpp', 'go', 'haskell', 'lua', 'python', 'rust', 'tsx', 'templ', 'typescript', 'vimdoc', 'vim' }, ensure_installed = { 'c', 'commonlisp', 'cpp', 'go', 'haskell', 'lua', 'python', 'rust', 'tsx', 'templ', 'typescript', 'vimdoc', 'vim' },
auto_install = false, auto_install = false,
highlight = { highlight = {
enable = true, enable = true,

View File

@@ -7,6 +7,6 @@ return {
}) })
end, end,
keys = { keys = {
{ "<leader>b", "<cmd>YankBank<CR>", desc = "Yank[B]ank" }, { "<leader>yb", "<cmd>YankBank<CR>", desc = "Yank[B]ank" },
}, },
} }

View File

@@ -16,7 +16,7 @@ static const char col_cyan[] = "#7dcfff";
static const char *colors[][3] = { static const char *colors[][3] = {
/* fg bg border */ /* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_blue, col_cyan }, [SchemeSel] = { col_gray4, col_blue, col_cyan },
}; };
/* tagging */ /* tagging */
@@ -46,7 +46,7 @@ static const Layout layouts[] = {
}; };
/* key definitions */ /* key definitions */
#define MODKEY Mod1Mask #define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \ #define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
@@ -58,32 +58,32 @@ static const Layout layouts[] = {
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_blue, "-sf", col_gray4, NULL }; static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_blue, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL }; static const char *termcmd[] = { "st", NULL };
static const char *lockcmd[] = { "slock", NULL }; static const char *lockcmd[] = { "slock", NULL };
static const char *suspendcmd[] = { "systemctl", "suspend", NULL }; static const char *suspendcmd[] = { "systemctl", "suspend", NULL };
static const char *toggletheme[] = { "lupan-set-theme", "toggle", NULL }; static const char *toggletheme[] = { "lupan-set-theme", "toggle", NULL };
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY|ControlMask, XK_p, spawn, {.v = dmenucmd } }, { MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = lockcmd } }, { MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = suspendcmd } }, { MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = suspendcmd } },
{ MODKEY|ShiftMask, XK_F6, spawn, {.v = toggletheme } }, { MODKEY|ShiftMask, XK_F6, spawn, {.v = toggletheme } },
{ MODKEY|ControlMask, XK_b, togglebar, {0} }, { MODKEY, XK_b, togglebar, {0} },
{ MODKEY|ControlMask, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY|ControlMask, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY|ControlMask, XK_i, incnmaster, {.i = +1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY|ControlMask, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY|ControlMask, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY|ControlMask, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} }, { MODKEY, XK_Tab, view, {0} },
{ MODKEY|ControlMask|ShiftMask, XK_c, killclient, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY|ControlMask, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY|ControlMask, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY|ControlMask, XK_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} }, { MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY, XK_0, view, {.ui = ~0 } },
@@ -101,7 +101,7 @@ static const Key keys[] = {
TAGKEYS( XK_7, 6) TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7) TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {0} }, { MODKEY|ShiftMask, XK_q, quit, {0} },
}; };
/* button definitions */ /* button definitions */

View File

@@ -0,0 +1,197 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[common]
priv = false
[colors]
background = #282A2E
background-alt = #373B41
foreground = #C5C8C6
primary = #F0C674
secondary = #8ABEB7
alert = #A54242
disabled = #707880
[bar/bar]
monitor = ${env:MONITOR:}
width = 100%
height = 24pt
radius = 6
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3pt
border-size = 4pt
border-color = #00000000
padding-left = 0
padding-right = 1
module-margin = 1
separator = |
separator-foreground = ${colors.disabled}
font-0 = Fira Code Nerd Font:size=18;4
modules-left = xworkspaces xwindow
modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date
cursor-click = pointer
cursor-scroll = ns-resize
enable-ipc = true
; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3
; override-redirect = true
; This module is not active by default (to enable it, add it to one of the
; modules-* list above).
; Please note that only a single tray can exist at any time. If you launch
; multiple bars with this module, only a single one will show it, the others
; will produce a warning. Which bar gets the module is timing dependent and can
; be quite random.
; For more information, see the documentation page for this module:
; https://polybar.readthedocs.io/en/stable/user/modules/tray.html
[module/systray]
type = internal/tray
format-margin = 8pt
tray-spacing = 16pt
[module/xworkspaces]
type = internal/xworkspaces
group-by-monitor = false
label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1
label-occupied = %name%
label-occupied-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>
label-volume = %percentage%%
label-muted = muted
label-muted-foreground = ${colors.disabled}
click-middle = "polybar-msg action eth module_toggle; polybar-msg action wlan module_toggle"
click-right = pavucontrol
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
label-layout = %layout%
label-layout-foreground = ${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}
[module/memory]
type = internal/memory
interval = 2
format-prefix = "RAM "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%
[module/temperature]
type = internal/temperature
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
hidden = ${common.priv}
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
[module/date]
type = internal/date
interval = 1
date = %H:%M
date-alt = %Y-%m-%d %H:%M:%S
label = %date%
label-foreground = ${colors.primary}
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini

View File

@@ -1,9 +1,8 @@
alias v=nvim alias v=vis
alias ll='ls -l' alias ll='ls -l'
alias ta='tmux attach -t'
alias tl='tmux list-sessions' alias tl='tmux list-sessions'
alias tn='tmux new -s' alias rgh='rg -.'
alias fv='fzf --preview="bat --color=always --theme=Nord {}" --bind="enter:become(nvim {})"' alias fdh='fd -H'
if which exa > /dev/null; then if which exa > /dev/null; then
alias ls='exa --icons' alias ls='exa --icons'
@@ -12,3 +11,23 @@ fi
alias nocaps='setxkbmap pl -option ctrl:nocaps' alias nocaps='setxkbmap pl -option ctrl:nocaps'
alias fixdp='xrandr --output DP-0 --right-of DP-2' alias fixdp='xrandr --output DP-0 --right-of DP-2'
tn() {
if [ $# -eq 0 ]; then
tmux new
else
tmux new -s "$@"
fi
}
ta() {
if [ $# -eq 0 ]; then
tmux attach
else
tmux attach -t "$@"
fi
}
vf() {
fzf --bind 'enter:become:vis {}' -q "$1"
}

View File

@@ -8,8 +8,8 @@
# for ssh logins, install and configure the libpam-umask package. # for ssh logins, install and configure the libpam-umask package.
#umask 022 #umask 022
export EDITOR=nvim export EDITOR=vis
export VISUAL=nvim export VISUAL=vis
# if running bash # if running bash
if [ -n "$BASH_VERSION" ]; then if [ -n "$BASH_VERSION" ]; then

View File

@@ -28,7 +28,6 @@ else
setopt autocd setopt autocd
fi fi
ZVM_VI_INSERT_ESCAPE_BINDKEY=jj
ZSH_HIGHLIGHT_STYLES[comment]=fg=blue ZSH_HIGHLIGHT_STYLES[comment]=fg=blue
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND=bg=magenta,fg=black,bold HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND=bg=magenta,fg=black,bold
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND=bg=red,fg=black,bold HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND=bg=red,fg=black,bold

View File

@@ -12,7 +12,7 @@ bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7 bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8 bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9 bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10 #bind-key -n M-0 select-window -t 10
bind-key -n M-! swap-window -t 1 bind-key -n M-! swap-window -t 1
bind-key -n M-@ swap-window -t 2 bind-key -n M-@ swap-window -t 2
@@ -33,53 +33,23 @@ bind-key Left resize-pane -L 8
bind-key Up resize-pane -U 4 bind-key Up resize-pane -U 4
bind-key Down resize-pane -D 4 bind-key Down resize-pane -D 4
set -g default-terminal "screen-256color" set -g default-terminal "xterm-256color"
set -as terminal-features ",*:RGB" set -as terminal-features ",*:RGB"
set -g base-index 1 set -g base-index 1
setw -g base-index 1 setw -g base-index 1
set -g set-titles on set -g set-titles on
set -g set-titles-string "#H [#S]" set -g set-titles-string "#H [#S] #W"
set -g status-justify centre set -g status-justify centre
set -g status-left " #[fg=green]#[bg=green]#[fg=black] #H #[bg=default]#[fg=green]#[fg=default] #S" set -g status-left " #[fg=#316781]#[bg=#316781]#[fg=#abb5ba] #H #[bg=default]#[fg=#316781]#[fg=default] #S"
set -g status-left-length 50 set -g status-left-length 50
set -g status-right "#[fg=green]#[bg=green]#[fg=black] %H:%M #[bg=default]#[fg=green] " set -g status-right "#[fg=#316781]#[bg=#316781]#[fg=#abb5ba] %H:%M #[bg=default]#[fg=#316781] "
set-window-option -g window-status-current-format '#[fg=green]#[bg=green]#[fg=black] #I:#W#F #[fg=green]#[bg=black]' set-window-option -g window-status-current-format '#[fg=#316781]#[bg=#316781]#[fg=#abb5ba] #I:#W#F #[fg=#316781]#[bg=black]'
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'" bind-key -n M-0 run-shell tmux-session-menu
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L' bind -T copy-mode-vi v send -X begin-selection
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D' bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U' bind P paste-buffer
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
bind-key -n 'M-n' if-shell "$is_vim" 'send-keys M-n' 'select-window -n'
bind-key -n 'M-p' if-shell "$is_vim" 'send-keys M-p' 'select-window -p'
bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
bind-key -T copy-mode-vi 'M-n' select-window -n
bind-key -T copy-mode-vi 'M-p' select-window -p
bind -n 'M-H' if-shell "$is_vim" 'send-keys M-H' 'resize-pane -L 1'
bind -n 'M-J' if-shell "$is_vim" 'send-keys M-J' 'resize-pane -D 1'
bind -n 'M-K' if-shell "$is_vim" 'send-keys M-K' 'resize-pane -U 1'
bind -n 'M-L' if-shell "$is_vim" 'send-keys M-L' 'resize-pane -R 1'
bind-key -T copy-mode-vi M-H resize-pane -L 1
bind-key -T copy-mode-vi M-J resize-pane -D 1
bind-key -T copy-mode-vi M-K resize-pane -U 1
bind-key -T copy-mode-vi M-L resize-pane -R 1
bind -n 'C-M-h' if-shell "$is_vim" 'send-keys C-M-h' 'swap-pane -s "{left-of}"'
bind -n 'C-M-j' if-shell "$is_vim" 'send-keys C-M-j' 'swap-pane -s "{down-of}"'
bind -n 'C-M-k' if-shell "$is_vim" 'send-keys C-M-k' 'swap-pane -s "{up-of}"'
bind -n 'C-M-l' if-shell "$is_vim" 'send-keys C-M-l' 'swap-pane -s "{right-of}"'
bind-key -T copy-mode-vi C-M-h swap-pane -s "{left-of}"
bind-key -T copy-mode-vi C-M-j swap-pane -s "{down-of}"
bind-key -T copy-mode-vi C-M-k swap-pane -s "{up-of}"
bind-key -T copy-mode-vi C-M-l swap-pane -s "{right-of}"

5
tmux/bin/tmux-session-menu Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
tmux list-sessions -F '#S' \
| awk 'BEGIN {ORS=" "; print "toggle t \"switch-client -l\""} {print $1, NR, "\"switch-client -t", $1 "\""}' \
| xargs tmux display-menu -T "Switch session"

View File

@@ -0,0 +1,110 @@
local lpeg = vis.lpeg
P = lpeg.P
R = lpeg.R
S = lpeg.S
Cp = lpeg.Cp
Ct = lpeg.Ct
space = S(' \t\n\r')
alnum = R('az', 'AZ', '09')
local function search(p)
return Ct(((1 - p)^0 * Cp() * p * Cp())^0)
end
vis:map(vis.modes.NORMAL, '\\', function(keys)
if #keys > 1 then
vis.win:draw()
end
local _, esc = keys:find('<Escape>')
if esc then
return esc
end
local _, enter = keys:find('<Enter>')
if enter then
keys = keys:gsub('<Enter>', '')
end
keys = keys:gsub('<Tab>', 'J')
keys = keys:gsub('<S[-]Tab>', 'K')
vis:info(keys)
local n = 0
keys = keys:gsub('[KJ]', function(s)
if s == 'K' then
n = n - 1
elseif s == 'J' then
n = n + 1
end
return ''
end)
keys = keys:gsub('.<Backspace>', '')
if #keys < 1 then
return -1
end
local up = n < 0
local v = vis.win.viewport.bytes
local data = vis.win.file:content(v)
local p = P(false)
local prefix = nil
for i = 1, #keys do
local x = keys:sub(i, i)
if x == 'A' then
prefix = alnum
elseif x == 'F' then
prefix = P(1) - space
else
local y = S(x:lower() .. x:upper())
if i == 1 then
p = y
elseif prefix then
p = p * (prefix - y)^0 * y
elseif x == ' ' then
p = p * space^1
else
p = p * y
end
prefix = false
end
end
p = search(p)
local lst = p:match(data)
if not lst then
vis:info('not found')
return
end
local pos = vis.win.selection.pos
local prev = 0
local next = 0
for i = 2, #lst, 2 do
local a = lst[i-1] + v.start - 1
if a < pos then
prev = i
end
if a > pos then
next = i
break
end
end
local j = 0
if up then
j = prev + 1 + 2 * n
else
j = next - 1 + 2 * n
end
if j > 0 and j < #lst then
pos = lst[j] + v.start - 1
end
if enter then
vis.win.selection.pos = pos
return enter
end
for i = 2, #lst, 2 do
local a = lst[i-1] + v.start - 1
local b = lst[i] + v.start - 2
if a == pos then
vis.win:style(vis.win.STYLE_COLOR_COLUMN, a, b)
else
vis.win:style(vis.win.STYLE_SELECTION, a, b)
end
end
return -1
end, 'colorize token')

282
vis/.config/vis/fzf.sh Executable file
View File

@@ -0,0 +1,282 @@
#!/bin/sh
prompt=${FZF_PROMPT%> }
cmd=${prompt%+*}
hidden=${prompt#$cmd}
ripgrep='rg --column --line-number --color=always --smart-case'
if [ "$1" = list ]; then
case "$FZF_HEADER_LABEL" in
:?*)
dir=${FZF_HEADER_LABEL#?}
;;
*)
dir=
;;
esac
case "$prompt" in
dir:*)
dir=${FZF_HEADER_LABEL#?}
zoxide query -l
echo $dir
exit
;;
files)
exec fd --type f '' $dir
;;
files+hidden)
exec fd --type f -H '' $dir
;;
search)
exec $ripgrep "$FZF_QUERY" $dir
;;
search+hidden)
exec $ripgrep -. "$FZF_QUERY" $dir
;;
git-files*)
if [ -z "$dir" ]; then
exec git ls-files
else
exec git -C $dir ls-files --format "$dir/%(path)"
fi
;;
git-search*)
if [ -z "$dir" ]; then
exec git grep --column --line-number --color=always "$FZF_QUERY"
else
exec git -C $dir grep --column --line-number --color=always "$FZF_QUERY" | sed "s:^:$dir/:"
fi
;;
jj-files*)
if [ -z "$dir" ]; then
exec jj file list --ignore-working-copy
else
jj=$(cd $dir && jj root --ignore-working-copy 2> /dev/null)
exec jj -R $jj file list --ignore-working-copy $dir
fi
;;
jj-search*)
if [ -z "$dir" ]; then
exec $ripgrep "$FZF_QUERY" $(jj file list --ignore-working-copy)
else
jj=$(cd $dir && jj root --ignore-working-copy 2> /dev/null)
exec $ripgrep "$FZF_QUERY" $(jj -R $jj file list --ignore-working-copy $dir)
fi
;;
esac
exit
fi
if [ "$1" = preview ]; then
if [ -n "$3" ]; then
start=$(( $3 - $FZF_PREVIEW_LINES / 2 ))
if [ $start -lt 1 ]; then
start=1
fi
end=$(( $start + $FZF_PREVIEW_LINES ))
exec bat --style=numbers --color=always --highlight-line $3 --line-range $start:$end $2
else
exec bat --style=numbers --color=always $2
fi
fi
reload="reload(sh $0 list || true)"
no_search="rebind(change)+disable-search"
search="unbind(change)+enable-search"
if [ "$1" = key ]; then
case "$FZF_KEY" in
alt-a)
prompt=${FZF_PROMPT#dir:}
if [ $prompt = $FZF_PROMPT ]; then
echo "change-prompt(dir:$FZF_PROMPT)+$search+$reload"
else
case "$cmd" in
*files)
infix="$search"
;;
*)
infix="$no_search"
;;
esac
echo "change-prompt($prompt)+$infix+$reload"
fi
;;
alt-d)
dir=${FZF_HEADER_LABEL#?}
case "$FZF_HEADER_LABEL" in
.?*)
echo "change-header(path: $dir)+change-header-label(:$dir)+$reload"
;;
*)
echo "change-header()+change-header-label(.$dir)+$reload"
;;
esac
;;
alt-f)
case "$cmd" in
*files|search)
prompt="files$hidden"
;;
*search)
prompt="${cmd%-*}-files$hidden"
;;
esac
echo "change-prompt($prompt> )+$search+$reload"
;;
alt-g)
case "$cmd" in
*files)
prompt="git-files$hidden"
echo "change-prompt($prompt> )+$search+$reload"
;;
*search)
prompt="git-search$hidden"
echo "change-prompt($prompt> )+$no_search+$reload"
;;
esac
;;
alt-h)
if [ -z "$hidden" ]; then
prompt="$cmd+hidden"
else
prompt="$cmd"
fi
echo "change-prompt($prompt> )+$reload"
;;
alt-j)
case "$cmd" in
*files)
prompt="jj-files$hidden"
echo "change-prompt($prompt> )+$search+$reload"
;;
*search)
prompt="jj-search$hidden"
echo "change-prompt($prompt> )+$no_search+$reload"
;;
esac
;;
alt-s)
case "$cmd" in
*search|files)
prompt="search$hidden"
;;
*files)
prompt="${cmd%-*}-search$hidden"
;;
esac
echo "change-prompt($prompt> )+$no_search+$reload"
;;
esac
exit
fi
if [ "$1" = chdir ]; then
dir="$2"
prompt=${FZF_PROMPT#dir:}
case "$cmd" in
*files)
infix="$search"
;;
*)
infix="$no_search"
;;
esac
echo "change-header(path: $dir)+change-header-label(:$dir)+change-prompt($prompt)+$infix+$reload"
exit
fi
if [ -n "$2" ]; then
label=".$2"
else
label=".."
fi
case ${1%+hidden} in
auto-files)
git=$(git rev-parse --show-toplevel 2> /dev/null)
jj=$(jj root --ignore-working-copy 2> /dev/null)
if [ -n "$jj" ] && [ "${git#$jj}" = "$git" -o "$git" = "$jj" ]; then
cmd="jj-files$hidden"
elif [ -n "$git" ] && [ "${jj#$git}" = "$jj" ]; then
cmd="git-files$hidden"
else
cmd="files"
fi
action="$search"
prompt="$cmd> "
;;
auto-search)
git=$(git rev-parse --show-toplevel 2> /dev/null)
jj=$(jj root --ignore-working-copy 2> /dev/null)
if [ -n "$jj" ] && [ "${git#$jj}" = "$git" -o "$git" = "$jj" ]; then
cmd="jj-search$hidden"
elif [ -n "$git" ] && [ "${jj#$git}" = "$jj" ]; then
cmd="git-search$hidden"
else
cmd="search"
fi
action="$no_search"
prompt="$cmd> "
;;
files|git-files|jj-files)
cmd="$1"
action="$search"
prompt="$1> "
;;
search|git-search|jj-search)
cmd="$1"
action="$no_search"
prompt="$1> "
;;
*)
cmd="files"
action="$search"
prompt="files> "
;;
esac
key="transform(sh $0 key)"
HELP='Keys:
alt-? help
alt-a select alternative directory
alt-d toggle alternative directory
alt-f switch to files (twice for plain files)
alt-g switch to git
alt-j switch to jj
alt-h toggle hidden
alt-p toggle preview (also to turn off help)
alt-s switch to search (twice for plain search)
alt-u toggle preview window position (right or up)
'
accept="
if [ \${FZF_PROMPT#dir:} = \$FZF_PROMPT ]; then
echo accept
else
sh $0 chdir {1}
fi
"
exec fzf --query "$3" \
--prompt "$prompt" \
--header-label "$label" \
--multi \
--ansi \
--delimiter : \
--ghost ' (Use alt-? for help)' \
--bind "enter:transform($accept)" \
--bind "change:$reload" \
--bind "start:$reload+$action" \
--bind "alt-a:$key" \
--bind "alt-d:$key" \
--bind "alt-f:$key" \
--bind "alt-g:$key" \
--bind "alt-j:$key" \
--bind "alt-h:$key" \
--bind "alt-s:$key" \
--bind "alt-p:change-preview(sh $0 preview {1} {2})+toggle-preview" \
--bind "alt-u:change-preview-window(up|right)" \
--bind "alt-?:change-preview(echo '$HELP')+show-preview"

View File

@@ -0,0 +1,2 @@
/home/lupan/dotfiles/Makefile:23:22: (PREFIX): make -C dwm install PREFIX="${HOME}/.local"
/home/lupan/dotfiles/Makefile:41:15: (clock): install-lupan-clock:

View File

@@ -0,0 +1,31 @@
-- Copyright 2006-2025 Mitchell. See LICENSE.
-- go with SQL LPeg lexer.
local lexer = lexer
local starts_line = lexer.starts_line
local B, P, S = lpeg.B, lpeg.P, lpeg.S
local lex = lexer.new(..., {inherit = lexer.load('go')})
local open_brace = lex:tag(lexer.OPERATOR, P('{'))
local close_brace = lex:tag(lexer.OPERATOR, P('}'))
local backtick = lex:tag(lexer.CODE, P('`'))
local ws = lex:get_rule('whitespace')
local tpl = lexer.new("template")
tpl:add_rule('keyword', lex:tag(lexer.KEYWORD, lexer.word_match('if else end with range break define continue template block')))
tpl:add_rule('constant', lex:get_rule('constant'))
tpl:add_rule('operator', lex:get_rule('operator') + lex:tag(lexer.OPERATOR, S('$')))
local func = lexer.after_set(' \t\n{|', lexer.word)
tpl:add_rule('function', lex:tag(lexer.FUNCTION, func))
tpl:add_rule('identifier', lex:get_rule('identifier'))
tpl:add_rule('string', lex:get_rule('string'))
tpl:add_rule('number', lex:get_rule('number'))
local sql = lexer.load('sql')
local sql_kwd = lexer.word_match('ALTER CREATE DELETE DROP GRANT INSERT SELECT UPDATE WITH')
sql:embed(tpl, open_brace * open_brace, close_brace * close_brace)
lex:embed(sql, backtick * #(ws^0 * sql_kwd), backtick)
return lex

View File

@@ -0,0 +1,65 @@
-- Copyright 2006-2025 Mitchell. See LICENSE.
-- templ LPeg lexer.
local lexer = lexer
local starts_line = lexer.starts_line
local P, S = lpeg.P, lpeg.S
local lex = lexer.new(..., {inherit = lexer.load('go')})
local close_paren = lex:tag(lexer.OPERATOR, P(')'))
local open_brace = lex:tag(lexer.OPERATOR, P('{'))
local close_brace = lex:tag(lexer.OPERATOR, P('}'))
local colon = lex:tag(lexer.OPERATOR, P(':'))
local at = lex:tag(lexer.OPERATOR, P('@'))
local ws = lex:get_rule('whitespace')
local ident = lex:get_rule('identifier')
local html = lexer.load('html')
local go_expr = lexer.load('go', 'go.expr')
local go_stmt1 = lexer.load('go', 'go.stmt1')
local go_stmt2 = lexer.load('go', 'go.stmt2')
local go_stmt3 = lexer.load('go', 'go.stmt3')
local for_ = lex:tag(lexer.KEYWORD, lexer.word_match('for if switch'))
local else_ = close_brace * ws^0 * lex:tag(lexer.KEYWORD, P('else'))
local case_ = lex:tag(lexer.KEYWORD, lexer.word_match('case default'))
html:embed(go_expr, open_brace, close_brace * close_brace^-1)
html:embed(go_stmt1, starts_line(for_ + else_, true), open_brace * #lexer.newline)
html:embed(go_stmt2, starts_line(case_, true), colon * #lexer.newline)
html:embed(go_stmt3, starts_line(at, true), (ident + open_brace + close_paren) * #lexer.newline)
local func_block_start = close_paren * ws^0 * open_brace
lex:set_word_list(lexer.KEYWORD, 'templ css script', true)
local function starts_with(keyword)
local prefix = '\n' .. keyword .. '%s'
return function(input, index)
local i = index - 1024
if i < 1 then
i = 1
end
local s = input:sub(i, index)
local k = 0
repeat
i = s:find('\n%w', i)
if i then
k = i
i = i + 2
end
until not i
return k > 0 and s:find(prefix, k) and true
end
end
lex:embed(html, func_block_start * P(starts_with("templ")), starts_line(close_brace))
local css = lexer.load('css')
local css_go_expr = lexer.load('go', 'go.expr2')
css:embed(css_go_expr, open_brace, close_brace)
lex:embed(css, func_block_start * P(starts_with("css")), starts_line(close_brace))
local js = lexer.load('javascript')
lex:embed(js, func_block_start * P(starts_with("script")), starts_line(close_brace))
return lex

View File

@@ -0,0 +1,158 @@
-- Eight-color scheme
local lexers = vis.lexers
lexers.STYLE_DEFAULT ='back:#1f212e,fore:#9da0af'
lexers.STYLE_NOTHING = ''
lexers.STYLE_ATTRIBUTE = 'fore:#a1a3aa,bold'
lexers.STYLE_CLASS = 'fore:yellow,bold'
lexers.STYLE_COMMENT = 'fore:#334d40,bold'
lexers.STYLE_CONSTANT = 'fore:cyan,bold'
lexers.STYLE_DEFINITION = 'fore:blue,bold'
lexers.STYLE_ERROR = 'fore:red,italics'
lexers.STYLE_FUNCTION = 'fore:#6b8ac7,bold'
lexers.STYLE_HEADING = 'fore:#d1d147'
lexers.STYLE_KEYWORD = 'fore:#bf8040,bold'
lexers.STYLE_LABEL = 'fore:green,bold'
lexers.STYLE_NUMBER = 'fore:#acac53,bold'
lexers.STYLE_OPERATOR = 'fore:#93806c,bold'
lexers.STYLE_REGEX = 'fore:#59862d,bold'
lexers.STYLE_STRING = 'fore:#3d8f66,bold'
lexers.STYLE_PREPROCESSOR = 'fore:#cc66cc,bold'
lexers.STYLE_TAG = 'fore:#705943,bold'
lexers.STYLE_TYPE = 'fore:#7461d1,bold'
lexers.STYLE_VARIABLE = 'fore:#8c5eba,bold'
lexers.STYLE_WHITESPACE = ''
lexers.STYLE_EMBEDDED = 'back:#2d3353,bold'
lexers.STYLE_IDENTIFIER = ''
lexers.STYLE_LINENUMBER = ''
lexers.STYLE_LINENUMBER_CURSOR = 'fore:#bf8040'
lexers.STYLE_CURSOR = 'back:#bf8040,fore:#1f212e'
lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:#e6fefe'
lexers.STYLE_CURSOR_LINE = 'underlined'
lexers.STYLE_COLOR_COLUMN = 'back:red'
lexers.STYLE_SELECTION = 'back:#4d5580,bold'
lexers.STYLE_STATUS = 'back:#1c3b4a,fore:#73848c'
lexers.STYLE_STATUS_FOCUSED = 'back:#1c3b4a,fore:#abb5ba,bold'
lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT
lexers.STYLE_INFO = 'bold'
lexers.STYLE_EOF = ''
-- lexer specific styles
-- Diff
lexers.STYLE_ADDITION = 'fore:#3a783a'
lexers.STYLE_DELETION = 'fore:#862d2d'
lexers.STYLE_CHANGE = 'fore:#2d3353'
-- CSS
lexers.STYLE_PROPERTY = lexers.STYLE_ATTRIBUTE
lexers.STYLE_PSEUDOCLASS = ''
lexers.STYLE_PSEUDOELEMENT = ''
-- HTML
lexers.STYLE_TAG_UNKNOWN = lexers.STYLE_TAG .. ',italics'
lexers.STYLE_TAG_SINGLE = lexers.STYLE_TAG
lexers.STYLE_TAG_DOCTYPE = lexers.STYLE_TAG .. ',bold'
lexers.STYLE_ATTRIBUTE_UNKNOWN = lexers.STYLE_ATTRIBUTE .. ',italics'
-- Latex, TeX, and Texinfo
lexers.STYLE_COMMAND = lexers.STYLE_KEYWORD
lexers.STYLE_COMMAND_SECTION = lexers.STYLE_CLASS
lexers.STYLE_ENVIRONMENT = lexers.STYLE_TYPE
lexers.STYLE_ENVIRONMENT_MATH = lexers.STYLE_NUMBER
-- Makefile
lexers.STYLE_TARGET = ''
-- Markdown
lexers.STYLE_HR = ''
for i = 1,6 do lexers['STYLE_HEADING_H'..i] = lexers.STYLE_HEADING end
lexers.STYLE_BOLD = 'bold'
lexers.STYLE_ITALIC = 'italics'
lexers.STYLE_LIST = lexers.STYLE_KEYWORD
lexers.STYLE_LINK = lexers.STYLE_KEYWORD
lexers.STYLE_REFERENCE = lexers.STYLE_KEYWORD
lexers.STYLE_CODE = lexers.STYLE_EMBEDDED
-- Output
lexers.STYE_FILENAME = ''
lexers.STYLE_LINE = ''
lexers.STYLE_COLUMN = ''
lexers.STYLE_MESSAGE = ''
-- Python
lexers.STYLE_KEYWORD_SOFT = ''
-- Taskpaper
lexers.STYLE_NOTE = ''
lexers.STYLE_TAG_EXTENDED = ''
lexers.STYLE_TAG_DAY = 'fore:yellow'
lexers.STYLE_TAG_OVERDUE = 'fore:red'
lexers.STYLE_TAG_PLAIN = ''
-- XML
lexers.STYLE_CDATA = ''
-- YAML
lexers.STYLE_ERROR_INDENT = 'back:red'
-- The following are temporary styles until their legacy lexers are migrated.
-- Antlr
lexers.STYLE_ACTION = ''
-- Clojure
lexers.STYLE_CLOJURE_KEYWORD = lexers.STYLE_TYPE
lexers.STYLE_CLOJURE_SYMBOL = lexers.STYLE_TYPE .. ',bold'
-- Crystal
--lexers.STYLE_SYMBOL = lexers.STYLE_STRING
-- Gleam
lexers.STYLE_MODULE = lexers.STYLE_CONSTANT
lexers.STYLE_DISCARD = lexers.STYLE_COMMENT
-- Icon
lexers.STYLE_SPECIAL_KEYWORD = lexers.STYLE_TYPE
-- jq
lexers.STYLE_FORMAT = lexers.STYLE_CONSTANT
lexers.STYLE_SYSVAR = lexers.STYLE_CONSTANT .. ',bold'
-- Julia
-- lexers.STYLE_SYMBOL = lexers.STYLE_STRING
lexers.STYLE_CHARACTER = lexers.STYLE_CONSTANT
-- Mediawiki
lexers.STYLE_BEHAVIOR_SWITCH = lexers.STYLE_KEYWORD
-- Moonscript
lexers.STYLE_TBL_KEY = lexers.STYLE_REGEX
lexers.STYLE_SELF_REF = lexers.STYLE_LABEL
lexers.STYLE_PROPER_IDENT = lexers.STYLE_CLASS
lexers.STYLE_FNDEF = lexers.STYLE_PREPROCESSOR
-- lexers.STYLE_SYMBOL = lexers.STYLE_EMBEDDED
-- reST
lexers.STYLE_LITERAL_BLOCK = lexers.STYLE_EMBEDDED
lexers.STYLE_FOOTNOTE_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_CITATION_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_LINK_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_CODE_BLOCK = lexers.STYLE_CODE
lexers.STYLE_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_SPHINX_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_UNKNOWN_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_SUBSTITUTION = lexers.STYLE_VARIABLE
lexers.STYLE_INLINE_LITERAL = lexers.STYLE_EMBEDDED
lexers.STYLE_ROLE = lexers.STYLE_CLASS
lexers.STYLE_INTERPRETED = lexers.STYLE_STRING
-- txt2tags
lexers.STYLE_LINE = 'bold'
for i = 1,5 do lexers['STYLE_H'..i] = lexers.STYLE_HEADING end
lexers.STYLE_IMAGE = 'fore:green'
lexers.STYLE_STRIKE = 'italics'
lexers.STYLE_TAGGED = lexers.STYLE_EMBEDDED
lexers.STYLE_TAGGED_AREA = lexers.STYLE_EMBEDDED
lexers.STYLE_TABLE_SEP = 'fore:green'
lexers.STYLE_HEADER_CELL_CONTENT = 'fore:green'

View File

@@ -0,0 +1,158 @@
-- Eight-color scheme
local lexers = vis.lexers
lexers.STYLE_DEFAULT ='back:#f2f2f3,#e0e5eb,fore:#1f212e'
lexers.STYLE_NOTHING = ''
lexers.STYLE_ATTRIBUTE = 'fore:#a1a3aa,bold'
lexers.STYLE_CLASS = 'fore:yellow,bold'
lexers.STYLE_COMMENT = 'fore:#334d40,bold'
lexers.STYLE_CONSTANT = 'fore:cyan,bold'
lexers.STYLE_DEFINITION = 'fore:blue,bold'
lexers.STYLE_ERROR = 'fore:red,italics'
lexers.STYLE_FUNCTION = 'fore:#6b8ac7,bold'
lexers.STYLE_HEADING = 'fore:#d1d147'
lexers.STYLE_KEYWORD = 'fore:#bf8040,bold'
lexers.STYLE_LABEL = 'fore:green,bold'
lexers.STYLE_NUMBER = 'fore:#acac53,bold'
lexers.STYLE_OPERATOR = 'fore:#93806c,bold'
lexers.STYLE_REGEX = 'fore:#59862d,bold'
lexers.STYLE_STRING = 'fore:#3d8f66,bold'
lexers.STYLE_PREPROCESSOR = 'fore:#cc66cc,bold'
lexers.STYLE_TAG = 'fore:#705943,bold'
lexers.STYLE_TYPE = 'fore:#7461d1,bold'
lexers.STYLE_VARIABLE = 'fore:#8c5eba,bold'
lexers.STYLE_WHITESPACE = ''
lexers.STYLE_EMBEDDED = 'back:#e0e5eb,bold'
lexers.STYLE_IDENTIFIER = ''
lexers.STYLE_LINENUMBER = ''
lexers.STYLE_LINENUMBER_CURSOR = 'fore:#bf8040'
lexers.STYLE_CURSOR = 'back:#bf8040,fore:#1f212e'
lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:#e6fefe'
lexers.STYLE_CURSOR_LINE = 'underlined'
lexers.STYLE_COLOR_COLUMN = 'back:red'
lexers.STYLE_SELECTION = 'back:#a6c7f2,bold'
lexers.STYLE_STATUS = 'reverse'
lexers.STYLE_STATUS_FOCUSED = 'reverse,bold'
lexers.STYLE_SEPARATOR = lexers.STYLE_DEFAULT
lexers.STYLE_INFO = 'bold'
lexers.STYLE_EOF = ''
-- lexer specific styles
-- Diff
lexers.STYLE_ADDITION = 'fore:#3a783a'
lexers.STYLE_DELETION = 'fore:#862d2d'
lexers.STYLE_CHANGE = 'fore:#2d3353'
-- CSS
lexers.STYLE_PROPERTY = lexers.STYLE_ATTRIBUTE
lexers.STYLE_PSEUDOCLASS = ''
lexers.STYLE_PSEUDOELEMENT = ''
-- HTML
lexers.STYLE_TAG_UNKNOWN = lexers.STYLE_TAG .. ',italics'
lexers.STYLE_TAG_SINGLE = lexers.STYLE_TAG
lexers.STYLE_TAG_DOCTYPE = lexers.STYLE_TAG .. ',bold'
lexers.STYLE_ATTRIBUTE_UNKNOWN = lexers.STYLE_ATTRIBUTE .. ',italics'
-- Latex, TeX, and Texinfo
lexers.STYLE_COMMAND = lexers.STYLE_KEYWORD
lexers.STYLE_COMMAND_SECTION = lexers.STYLE_CLASS
lexers.STYLE_ENVIRONMENT = lexers.STYLE_TYPE
lexers.STYLE_ENVIRONMENT_MATH = lexers.STYLE_NUMBER
-- Makefile
lexers.STYLE_TARGET = ''
-- Markdown
lexers.STYLE_HR = ''
for i = 1,6 do lexers['STYLE_HEADING_H'..i] = lexers.STYLE_HEADING end
lexers.STYLE_BOLD = 'bold'
lexers.STYLE_ITALIC = 'italics'
lexers.STYLE_LIST = lexers.STYLE_KEYWORD
lexers.STYLE_LINK = lexers.STYLE_KEYWORD
lexers.STYLE_REFERENCE = lexers.STYLE_KEYWORD
lexers.STYLE_CODE = lexers.STYLE_EMBEDDED
-- Output
lexers.STYE_FILENAME = ''
lexers.STYLE_LINE = ''
lexers.STYLE_COLUMN = ''
lexers.STYLE_MESSAGE = ''
-- Python
lexers.STYLE_KEYWORD_SOFT = ''
-- Taskpaper
lexers.STYLE_NOTE = ''
lexers.STYLE_TAG_EXTENDED = ''
lexers.STYLE_TAG_DAY = 'fore:yellow'
lexers.STYLE_TAG_OVERDUE = 'fore:red'
lexers.STYLE_TAG_PLAIN = ''
-- XML
lexers.STYLE_CDATA = ''
-- YAML
lexers.STYLE_ERROR_INDENT = 'back:red'
-- The following are temporary styles until their legacy lexers are migrated.
-- Antlr
lexers.STYLE_ACTION = ''
-- Clojure
lexers.STYLE_CLOJURE_KEYWORD = lexers.STYLE_TYPE
lexers.STYLE_CLOJURE_SYMBOL = lexers.STYLE_TYPE .. ',bold'
-- Crystal
--lexers.STYLE_SYMBOL = lexers.STYLE_STRING
-- Gleam
lexers.STYLE_MODULE = lexers.STYLE_CONSTANT
lexers.STYLE_DISCARD = lexers.STYLE_COMMENT
-- Icon
lexers.STYLE_SPECIAL_KEYWORD = lexers.STYLE_TYPE
-- jq
lexers.STYLE_FORMAT = lexers.STYLE_CONSTANT
lexers.STYLE_SYSVAR = lexers.STYLE_CONSTANT .. ',bold'
-- Julia
-- lexers.STYLE_SYMBOL = lexers.STYLE_STRING
lexers.STYLE_CHARACTER = lexers.STYLE_CONSTANT
-- Mediawiki
lexers.STYLE_BEHAVIOR_SWITCH = lexers.STYLE_KEYWORD
-- Moonscript
lexers.STYLE_TBL_KEY = lexers.STYLE_REGEX
lexers.STYLE_SELF_REF = lexers.STYLE_LABEL
lexers.STYLE_PROPER_IDENT = lexers.STYLE_CLASS
lexers.STYLE_FNDEF = lexers.STYLE_PREPROCESSOR
-- lexers.STYLE_SYMBOL = lexers.STYLE_EMBEDDED
-- reST
lexers.STYLE_LITERAL_BLOCK = lexers.STYLE_EMBEDDED
lexers.STYLE_FOOTNOTE_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_CITATION_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_LINK_BLOCK = lexers.STYLE_LABEL
lexers.STYLE_CODE_BLOCK = lexers.STYLE_CODE
lexers.STYLE_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_SPHINX_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_UNKNOWN_DIRECTIVE = lexers.STYLE_KEYWORD
lexers.STYLE_SUBSTITUTION = lexers.STYLE_VARIABLE
lexers.STYLE_INLINE_LITERAL = lexers.STYLE_EMBEDDED
lexers.STYLE_ROLE = lexers.STYLE_CLASS
lexers.STYLE_INTERPRETED = lexers.STYLE_STRING
-- txt2tags
lexers.STYLE_LINE = 'bold'
for i = 1,5 do lexers['STYLE_H'..i] = lexers.STYLE_HEADING end
lexers.STYLE_IMAGE = 'fore:green'
lexers.STYLE_STRIKE = 'italics'
lexers.STYLE_TAGGED = lexers.STYLE_EMBEDDED
lexers.STYLE_TAGGED_AREA = lexers.STYLE_EMBEDDED
lexers.STYLE_TABLE_SEP = 'fore:green'
lexers.STYLE_HEADER_CELL_CONTENT = 'fore:green'

367
vis/.config/vis/visrc.lua Normal file
View File

@@ -0,0 +1,367 @@
require('vis')
require('fast-jump')
local plug = (function()
if not pcall(require, 'plugins/vis-plug') then
os.execute('git clone --quiet https://github.com/erf/vis-plug ' ..
(os.getenv('XDG_CONFIG_HOME') or os.getenv('HOME') .. '/.config')
.. '/vis/plugins/vis-plug')
end
return require('plugins/vis-plug')
end)()
plug = require('plugins/vis-plug')
local plugins = {
{ 'https://gitlab.com/muhq/vis-lspc', alias = 'lspc' },
{ 'lutobler/vis-commentary' },
{ 'https://repo.or.cz/vis-surround.git' },
{ 'peaceant/vis-fzf-mru', file = 'fzf-mru', alias = 'fzfmru' },
{ 'https://gitlab.com/muhq/vis-build' },
{ 'erf/vis-cursors' },
}
plug.init(plugins, true)
vis.ftdetect.filetypes.go_ext = vis.ftdetect.filetypes.go
vis.ftdetect.filetypes.go = nil
plug.plugins.lspc.ls_map.go_ext = plug.plugins.lspc.ls_map.go
vis.ftdetect.filetypes.templ = {
ext = { "%.templ$" },
}
plug.plugins.lspc.message_level = 2
plug.plugins.lspc.ls_map.templ = {
name = 'templ-lsp',
cmd = 'templ lsp',
}
plug.plugins.fzfmru.fzfmru_history = 60
local function open_file(file, cmd)
vis:command((cmd or 'o') .. ' ' .. file)
end
local function nil_or_tonumber(s)
return s and tonumber(s)
end
local function open_file_pos(line, open_cmd)
local iter = line:gmatch('[^:]+')
local file = iter()
local ln = iter()
local col = nil_or_tonumber(iter()) or 1
local i = ln and ln:find(' ')
if i then
ln = ln:sub(0, i)
col = 1
end
local line_num = nil_or_tonumber(ln)
if open_cmd ~= 'e' or vis.win.file ~= file then
open_file(file, open_cmd)
end
if line_num ~= nil then
vis.win.selection:to(line_num, col)
end
end
local function open_file_current_line(open_cmd, keys)
local line = vis.win.file.lines[vis.win.selection.line]
vis:info(line)
if keys then
vis:feedkeys(keys)
end
open_file_pos(line, open_cmd)
end
local function escape_and_quoted(s)
return "'" .. s:gsub("'", [['"'"']]) .. "'"
end
local function cmd_action(cmd, action)
local code, out, err = vis:pipe(cmd, true)
if code == 0 then
action(out)
elseif err ~= nil then
vis:info(err)
elseif code ~= 0 then
vis:info('Program exit code ' .. code)
end
end
local function fzf_sh(arg)
action = function(out)
if (out:find('\n') or #out) == #out then
open_file_pos(out, vis.win.file.modified and 'o' or 'e')
else
vis:message(out)
end
end
local home = os.getenv('HOME')
local path = vis.win.file.path or ''
local dir = path:match('^.*/') or ''
local reg = ''
if vis.register ~= '"' then
reg = string.gsub(vis.registers[vis.register][1], '%z', '')
end
local cmd = home ..
'/.config/vis/fzf.sh ' ..
escape_and_quoted(arg) .. ' ' .. escape_and_quoted(dir) .. ' ' .. escape_and_quoted(reg)
cmd_action(cmd, action)
end
local function search(cmd, action)
if action == nil then
action = function(out)
if (out:find('\n') or #s) == #s then
open_file_pos(out, 'e')
else
vis:message(out)
end
end
end
if cmd:match('^fzf ') and vis.register ~= '"' then
local reg = string.gsub(vis.registers[vis.register][1], '%z', '')
if reg ~= '' then
cmd = cmd .. ' --query=' .. escape_and_quoted(reg)
end
end
cmd_action(cmd, action)
end
local file_slots = {}
local function set_file_slot(num)
local file = vis.win.file.path
if file ~= nil then
file_slots[num] = file
vis:info('File slot [' .. num .. '] updated')
else
vis:info('Window has no file')
end
end
local function open_file_slot(num, open_cmd)
local file = file_slots[num]
if file == nil then
vis:info('File slot [' .. num .. '] empty')
elseif file == vis.win.file.path then
vis:info('File slot [' .. num .. '] is the same file, no file change')
else
vis:info('File slot [' .. num .. '] open')
open_file(file, open_cmd)
end
end
local function fzf_reload(cmd)
local prompt = escape_and_quoted('1. ' .. cmd:match('^%w*') .. '> ')
if not cmd:match('{q}') then
cmd = cmd .. ' {q}'
end
return 'fzf --ansi --bind "start:reload:' .. cmd .. '" --bind "change:reload:' .. cmd .. ' || true"' ..
' --prompt ' .. prompt ..
' --bind "alt-enter:unbind(change,alt-enter)+change-prompt(2. fzf> )+enable-search+clear-query"'
end
local function add_global_mark()
local file = vis.win.file.path
if file ~= nil then
local code, out, err = vis:pipe('vis-menu -p "global mark comment:"', true)
if code == 0 then
local prefix = file .. ':' .. vis.win.selection.line .. ':' .. vis.win.selection.col .. ': '
local line = vis.win.file.lines[vis.win.selection.line]
out = out:gsub('\n$', '')
if out ~= '' then
prefix = prefix .. '(' .. out .. '): '
end
out = io.open(os.getenv('HOME') .. '/.config/vis/global-marks.txt', 'a')
out:write(prefix .. line .. '\n')
out:close()
elseif err ~= nil then
vis:info(err)
elseif code ~= 0 then
vis:info('Program exit code ' .. code)
end
else
vis:info('Save file first')
end
end
function set_current_theme()
local f = io.open(os.getenv('HOME') .. '/.config/xsettingsd/xsettingsd.conf')
if f then
local s = f:read('*all')
f:close()
if s:match('light') then
vis:command('set theme lupan-light')
else
vis:command('set theme lupan-dark')
end
end
end
local ripgrep = 'rg --column --line-number --color=always --smart-case'
local function close_prev_win()
vis:feedkeys('<vis-window-prev>')
if vis.win == win then
vis:info('Last window')
elseif not vis.win:close() then
if vis.win.file.modified then
vis:info('No write since last change')
else
vis:command('q')
end
end
end
local function close_next_win()
vis:feedkeys('<vis-window-next>')
if vis.win == win then
vis:info('Last window')
elseif not vis.win:close() then
if vis.win.file.modified then
vis:info('No write since last change')
else
vis:command('q')
end
end
end
vis.events.subscribe(vis.events.INIT, function()
vis:command('set autoindent')
vis:command_register('search', function(argv, force, win, selection, range)
search(argv[1])
end)
vis:map(vis.modes.NORMAL, '<M-k>', '<vis-window-prev>')
vis:map(vis.modes.NORMAL, '<M-j>', '<vis-window-next>')
vis:map(vis.modes.NORMAL, ' K', close_prev_win)
vis:map(vis.modes.NORMAL, ' J', close_next_win)
vis:map(vis.modes.NORMAL, ' l[', ':lspc-prev-diagnostic<Enter>')
vis:map(vis.modes.NORMAL, ' l]', ':lspc-next-diagnostic<Enter>')
vis:map(vis.modes.NORMAL, ' l=', ':lspc-format<Enter>')
for num = 1, 9 do
vis:map(vis.modes.NORMAL, ' r' .. num, function() set_file_slot(num) end, 'set file slot ' .. num)
vis:map(vis.modes.NORMAL, ' ' .. num, function() open_file_slot(num, 'e') end, 'open file slot ' .. num)
vis:map(vis.modes.NORMAL, ' h' .. num, function() open_file_slot(num, 'o') end, 'open file slot ' .. num)
vis:map(vis.modes.NORMAL, ' v' .. num, function() open_file_slot(num, 'vsplit') end,
'open file slot ' .. num)
end
vis:map(vis.modes.NORMAL, ' s', function()
fzf_sh('auto-search')
end, 'fzf: search')
vis:map(vis.modes.NORMAL, ' f', function()
fzf_sh('auto-files')
end, 'fzf: files')
vis:map(vis.modes.NORMAL, ' /', function()
search(fzf_reload(ripgrep .. ' --with-filename {q} ' .. escape_and_quoted(vis.win.file.path)))
end, 'fzf: rg current file')
vis:map(vis.modes.NORMAL, ' .', function()
local shell = os.getenv('SHELL')
vis:command('!' .. shell)
end, 'run shell')
vis:map(vis.modes.NORMAL, ' ds', function()
local shell = os.getenv('SHELL')
local path = vis.win.file.path
if path then
local dir = path:match('^.*/')
local arg = escape_and_quoted(dir)
vis:command('!cd ' .. arg .. ' && ' .. shell)
else
vis:command('!' .. shell)
end
end, 'run shell in file directory')
vis:map(vis.modes.NORMAL, ' gl', function()
vis:command('!lazygit')
end, 'lazygit')
vis:map(vis.modes.NORMAL, ' gj', function()
vis:command('!lazyjj')
end, 'lazyjj')
vis:map(vis.modes.NORMAL, ' ', function()
vis:command('fzfmru')
end, 'fzf recent')
vis:map(vis.modes.NORMAL, ' w', function()
open_file_current_line('e')
end, 'open file from current line in current window (with optional line and col)')
vis:map(vis.modes.NORMAL, ' o', function()
open_file_current_line('o')
end, 'open file from current line in new window (with optional line and col)')
vis:map(vis.modes.NORMAL, ' k', function()
open_file_current_line('e', '<vis-window-prev>')
end, 'open file from current line in above window (with optional line and col)')
vis:map(vis.modes.NORMAL, ' j', function()
open_file_current_line('e', '<vis-window-next>')
end, 'open file from current line in below window (with optional line and col)')
vis:map(vis.modes.NORMAL, ' c', function()
search('zoxide query -l | fzf', function(path)
vis:command('cd ' .. path)
end)
end, 'fzf change directory')
vis:map(vis.modes.NORMAL, ' yy', function()
vis:command('!yazi')
end, 'yazi')
vis:map(vis.modes.NORMAL, ' y.', function()
local path = vis.win.file.path
if path then
local dir = path:match('^.*/')
local arg = escape_and_quoted(dir)
vis:command('!cd ' .. arg .. ' && yazi')
else
vis:command('!yazi')
end
end, 'yazi in file directory')
vis:map(vis.modes.NORMAL, ' ma', add_global_mark, 'global marks: add')
vis:map(vis.modes.NORMAL, ' mj', function()
search('cat ~/.config/vis/global-marks.txt | fzf --tac')
end, 'global marks: jump')
vis:map(vis.modes.NORMAL, ' me', function()
vis:command('o ~/.config/vis/global-marks.txt')
end, 'global marks: edit')
vis:map(vis.modes.NORMAL, ' td', function()
vis:command('set theme lupan-dark')
end, 'change to dark theme')
vis:map(vis.modes.NORMAL, ' tl', function()
vis:command('set theme lupan-light')
end, 'change to light theme')
vis:map(vis.modes.NORMAL, ' tt', set_current_theme)
set_current_theme()
end)
vis.events.subscribe(vis.events.WIN_OPEN, function(win)
vis:command('set relativenumber')
end)
vis.events.subscribe(vis.events.FILE_SAVE_PRE, function(file, path)
if path:find('[.]go$') then
-- formatting is async, so when reformated you should write file again
vis:command('lspc-format')
end
return true
end)

View File

@@ -1,3 +1,5 @@
#define THEME_DARK
#if HEIGHT >= 2160 #if HEIGHT >= 2160
Xft.dpi: 160 Xft.dpi: 160
Xcursor.size: 48 Xcursor.size: 48
@@ -53,3 +55,49 @@ XTerm.vt100.color14: #8FBCBB
! white ! white
XTerm.vt100.color7: #E5E9F0 XTerm.vt100.color7: #E5E9F0
XTerm.vt100.color15: #ECEFF4 XTerm.vt100.color15: #ECEFF4
st.font: FiraCode Nerd Font:size=10
#ifdef THEME_DARK
st.background: #1f212e
st.foreground: #9da0af
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #1f212e
st.color1: #862d2d
st.color2: #3a783a
st.color3: #707010
st.color4: #345eb2
st.color5: #cc66cc
st.color6: #3a7878
st.color7: #a1a3aa
st.color8: #4d4d4d
st.color9: #c27070
st.color10: #40bf40
st.color11: #acac53
st.color12: #6b8ac7
st.color13: #8f248f
st.color14: #509595
st.color15: #dbdff0
#else
st.background: #f2f2f3
st.foreground: #1f212e
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #1f212e
st.color1: #862d2d
st.color2: #3a783a
st.color3: #707010
st.color4: #345eb2
st.color5: #cc66cc
st.color6: #3a7878
st.color7: #a1a3aa
st.color8: #73778c
st.color9: #c27070
st.color10: #40bf40
st.color11: #acac53
st.color12: #6b8ac7
st.color13: #8f248f
st.color14: #509595
st.color15: #dae4f1
#endif

View File

@@ -6,8 +6,8 @@ fi
xset b off xset b off
xrandr --auto xrandr --auto
xrandr --output HDMI1 --right-of DP1 xrandr --output DP-0 --left-of DP-2 --primary
xrandr --output DP-0 --left-of DP-2 xrandr --output HDMI-0 --left-of DP-0
xrdb -merge ~/.Xresources xrdb -merge ~/.Xresources
setxkbmap pl -option ctrl:nocaps setxkbmap pl -option ctrl:nocaps
@@ -34,6 +34,14 @@ if which awesome > /dev/null; then
exec awesome exec awesome
fi fi
if which dk > /dev/null; then
for m in $(polybar --list-monitors | cut -d: -f1); do
MONITOR=$m polybar --reload bar &
done
fi
exec dk
fi
if which dwm > /dev/null; then if which dwm > /dev/null; then
lupan-clock & lupan-clock &
exec dwm exec dwm

View File

@@ -19,6 +19,16 @@ else
exit 1 exit 1
fi fi
if [ -f ~/.Xresources ]; then
if [ "$THEME" = dark ]; then
sed -i 's/^#undef THEME_DARK/#define THEME_DARK/' ~/.Xresources
elif [ "$THEME" = light ]; then
sed -i 's/^#define THEME_DARK/#undef THEME_DARK/' ~/.Xresources
fi
xrdb -merge ~/.Xresources
killall -USR1 st
fi
# Alacritty # Alacritty
if [ -f ~/.config/alacritty/alacritty.yml ]; then if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml

15
xsession/bin/st-abduco-tabbed Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
if [ $# -eq 0 ]; then
exec tabbed "$0" -w
fi
if [ "$1" = "-w" ] && [ -n "$2" ]; then
name=$(abduco | tail +2 | awk -F'\t' '{ print $NF }' | dmenu -p session: -l 10)
if [ -n "$name" ]; then
exec st -w "$2" -t "$name" -e abduco -A "$name" "$SHELL"
fi
else
echo error: requires either no arguments or single option -w with and argument >&2
exit 1
fi

View File

@@ -5,13 +5,13 @@ imv = [
zathura = [ zathura = [
{ run = 'zathura "$@"', orphan = true }, { run = 'zathura "$@"', orphan = true },
] ]
nvim_cd = [ fzf_vis = [
{ run = 'nvim -c "cd $@"', block = true } { run = 'cd "$@" && fd --type f | fzf --bind "enter:become(vis {})"', block = true }
] ]
[open] [open]
prepend_rules = [ prepend_rules = [
{ mime = "image/*", use = "imv" }, { mime = "image/*", use = "imv" },
{ mime = "application/pdf", use = "zathura" }, { mime = "application/pdf", use = "zathura" },
{ mime = "inode/directory", use = "nvim_cd" } { mime = "inode/directory", use = "fzf_vis" }
] ]