1
0
Fork 0

Compare commits

...

18 Commits

Author SHA1 Message Date
urosm 2a90369ef0 add `.profile` 2024-01-27 21:15:47 +01:00
urosm e16d20f41e add `.bashrc` 2024-01-27 21:15:39 +01:00
urosm ec16874a6a add `user-dirs.dirs` 2024-01-27 21:15:20 +01:00
urosm 79e8a7aeec add `mimeapps.list` 2024-01-27 21:15:07 +01:00
urosm fce24672dc add `zathura` config 2024-01-27 21:14:54 +01:00
urosm faab7b9bea add `swaylock` config 2024-01-27 21:14:16 +01:00
urosm c676d297e4 add `swayidle` config 2024-01-27 21:14:04 +01:00
urosm 2fe25659a8 add `sudoers.d` config 2024-01-27 21:13:30 +01:00
urosm 04c4f8d70c add `python` config 2024-01-27 21:13:12 +01:00
urosm 25676d07e4 add `nvim` config 2024-01-27 21:12:38 +01:00
urosm 140a281c68 add `mpv` config 2024-01-27 21:12:20 +01:00
urosm cd8ffc620a add `mako` config 2024-01-27 21:12:04 +01:00
urosm e09b38449b add `git` config 2024-01-27 21:11:49 +01:00
urosm 0e74e6b9da add `fuzzel` config 2024-01-27 21:09:50 +01:00
urosm 7bc9abbbb8 add `foot` config 2024-01-27 21:09:37 +01:00
urosm 15244c351c add `fontconfig` config 2024-01-27 21:09:06 +01:00
urosm 201357d8f9 add `apt` config 2024-01-27 21:06:23 +01:00
urosm 93769b3551 add `sway` config 2024-01-27 21:06:04 +01:00
39 changed files with 1741 additions and 0 deletions

66
.bashrc 100644
View File

@ -0,0 +1,66 @@
# ~/.bashrc
# if not running interactively, don't do anything
[ -z "$PS1" ] && return
# history
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=-1
export HISTFILESIZE=-1
PROMPT_COMMAND="history -a;history -n;$PROMPT_COMMAND"
# title
PS1="\[\e]0;\u@\h:\w\a\]$PS1"
# readline
bind "set editing-mode vi"
bind "set keyseq-timeout 50"
bind "set show-mode-in-prompt on"
bind "set vi-ins-mode-string \1\e[35m\2+\1\e[0m\2"
bind "set vi-cmd-mode-string :"
bind "set keymap vi-command"
bind "j:history-substring-search-forward"
bind "k:history-substring-search-backward"
bind "set keymap vi-insert"
bind '"\e[A":history-substring-search-backward'
bind '"\e[B":history-substring-search-forward'
bind "set show-all-if-ambiguous on"
bind "set completion-display-width 0"
bind "set colored-stats on"
bind "set visible-stats on"
# alias
alias q="exit"
alias e='${EDITOR:-vi}'
alias grep="grep --color=auto"
alias ls="ls --color=auto"
alias ll="ls -AF1"
alias lll="ls -AFlh"
# bash completion
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# osc7
osc7_cwd() {
local strlen=${#PWD}
local encoded=""
local pos c o
for (( pos=0; pos<strlen; pos++ )); do
c=${PWD:$pos:1}
case "$c" in
[-/:_.!\'\(\)~[:alnum:]] ) o="${c}" ;;
* ) printf -v o '%%%02X' "'${c}" ;;
esac
encoded+="${o}"
done
printf '\e]7;file://%s%s\e\\' "${HOSTNAME}" "${encoded}"
}
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND}osc7_cwd

View File

@ -0,0 +1 @@
APT::Default-Release "/^testing(|-security)$/";

View File

@ -0,0 +1 @@
APT::AutoRemove::SuggestsImportant "false";

View File

@ -0,0 +1,11 @@
deb http://deb.debian.org/debian/ testing main non-free-firmware
deb-src http://deb.debian.org/debian/ testing main non-free-firmware
deb http://security.debian.org/debian-security testing-security main non-free-firmware
deb-src http://security.debian.org/debian-security testing-security main non-free-firmware
deb http://deb.debian.org/debian/ unstable main non-free-firmware
deb-src http://deb.debian.org/debian/ unstable main non-free-firmware
deb http://deb.debian.org/debian/ experimental main non-free-firmware
deb-src http://deb.debian.org/debian/ experimental main non-free-firmware

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer><family>Agave</family></prefer>
</alias>
</fontconfig>

View File

@ -0,0 +1,23 @@
[main]
dpi-aware=no
font=monospace:size=13
[colors]
foreground=e3e0e1
background=292526
regular0=292526
regular1=ff404f
regular2=00a147
regular3=e06e00
regular4=6185ff
regular5=ff3e8b
regular6=0095d7
regular7=e3e0e1
bright0=958a8d
bright1=ffb3b6
bright2=00e46a
bright3=ffb598
bright4=b8c3ff
bright5=ffb1c5
bright6=92ccff
bright7=f4f3f3

View File

@ -0,0 +1,18 @@
[main]
layer=overlay
dpi-aware=no
font=monospace:size=13
icons-enabled=no
width=72
[colors]
background=292526ff
text=6185ffff
match=e06e00ff
selection=292526ff
selection-text=ff3e8bff
selection-match=ff3e8bff
border=6185ffff
[border]
radius=0

View File

@ -0,0 +1,3 @@
[user]
email = urosm@kompot.si
name = urosm

View File

@ -0,0 +1,12 @@
invisible=1
font=monospace 13
background-color=#e3e0e1
text-color=#292526
border-size=1
border-color=#6185ff
icons=0
format=%s\n%b
anchor=bottom-right
[urgency=critical]
border-color=#ff404f

View File

@ -0,0 +1,5 @@
[Default Applications]
text/plain=nvim.desktop;
text/markdown=nvim.desktop;
application/pdf=org.pwmt.zathura.desktop;
inode/directory=footclient-directory.desktop;

View File

@ -0,0 +1,10 @@
UP ignore
DOWN ignore
LEFT repeatable playlist-prev
RIGHT repeatable playlist-next
MBTN_RIGHT script-binding drag-to-pan
MBTN_LEFT script-binding pan-follows-cursor
MBTN_LEFT_DBL ignore
WHEEL_UP script-message cursor-centric-zoom 0.1
WHEEL_DOWN script-message cursor-centric-zoom -0.1

View File

@ -0,0 +1,8 @@
# window
image-display-duration=inf
# osd
osd-level=0
# gpu renderer options
background="#292526"

View File

@ -0,0 +1,282 @@
local opts = {
drag_to_pan_margin = 50,
drag_to_pan_move_if_full_view = false,
pan_follows_cursor_margin = 50,
cursor_centric_zoom_margin = 50,
cursor_centric_zoom_auto_center = true,
cursor_centric_zoom_dezoom_if_full_view = false,
}
local options = require 'mp.options'
local msg = require 'mp.msg'
local assdraw = require 'mp.assdraw'
options.read_options(opts, nil, function() end)
function clamp(value, low, high)
if value <= low then
return low
elseif value >= high then
return high
else
return value
end
end
local cleanup = nil -- function set up by drag-to-pan/pan-follows cursor and must be called to clean lingering state
function drag_to_pan_handler(table)
if cleanup then
cleanup()
cleanup = nil
end
if table["event"] == "down" then
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local mouse_pos_origin, video_pan_origin = {}, {}
local moved = false
mouse_pos_origin[1], mouse_pos_origin[2] = mp.get_mouse_pos()
video_pan_origin[1] = mp.get_property_number("video-pan-x")
video_pan_origin[2] = mp.get_property_number("video-pan-y")
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
local margin = opts.drag_to_pan_margin
local move_up = true
local move_lateral = true
if not opts.drag_to_pan_move_if_full_view then
if dim.ml >= 0 and dim.mr >= 0 then
move_lateral = false
end
if dim.mt >= 0 and dim.mb >= 0 then
move_up = false
end
end
if not move_up and not move_lateral then return end
local idle = function()
if moved then
local mX, mY = mp.get_mouse_pos()
local pX = video_pan_origin[1]
local pY = video_pan_origin[2]
if move_lateral then
pX = video_pan_origin[1] + (mX - mouse_pos_origin[1]) / video_size[1]
if 2 * margin > dim.ml + dim.mr then
pX = clamp(pX,
(-margin + dim.w / 2) / video_size[1] - 0.5,
(margin - dim.w / 2) / video_size[1] + 0.5)
else
pX = clamp(pX,
(margin - dim.w / 2) / video_size[1] + 0.5,
(-margin + dim.w / 2) / video_size[1] - 0.5)
end
end
if move_up then
pY = video_pan_origin[2] + (mY - mouse_pos_origin[2]) / video_size[2]
if 2 * margin > dim.mt + dim.mb then
pY = clamp(pY,
(-margin + dim.h / 2) / video_size[2] - 0.5,
(margin - dim.h / 2) / video_size[2] + 0.5)
else
pY = clamp(pY,
(margin - dim.h / 2) / video_size[2] + 0.5,
(-margin + dim.h / 2) / video_size[2] - 0.5)
end
end
mp.command("no-osd set video-pan-x " .. clamp(pX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(pY, -3, 3))
moved = false
end
end
mp.register_idle(idle)
mp.add_forced_key_binding("mouse_move", "image-viewer-mouse-move", function() moved = true end)
cleanup = function()
mp.remove_key_binding("image-viewer-mouse-move")
mp.unregister_idle(idle)
end
end
end
function pan_follows_cursor_handler(table)
if cleanup then
cleanup()
cleanup = nil
end
if table["event"] == "down" then
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
local moved = true
local idle = function()
if moved then
local mX, mY = mp.get_mouse_pos()
local x = math.min(1, math.max(-2 * mX / dim.w + 1, -1))
local y = math.min(1, math.max(-2 * mY / dim.h + 1, -1))
local command = ""
local margin = opts.pan_follows_cursor_margin
if dim.ml + dim.mr < 0 then
command = command ..
"no-osd set video-pan-x " .. clamp(x * (2 * margin - dim.ml - dim.mr) / (2 * video_size[1]), -3, 3) .. ";"
elseif mp.get_property_number("video-pan-x") ~= 0 then
command = command .. "no-osd set video-pan-x " .. "0;"
end
if dim.mt + dim.mb < 0 then
command = command ..
"no-osd set video-pan-y " .. clamp(y * (2 * margin - dim.mt - dim.mb) / (2 * video_size[2]), -3, 3) .. ";"
elseif mp.get_property_number("video-pan-y") ~= 0 then
command = command .. "no-osd set video-pan-y " .. "0;"
end
if command ~= "" then
mp.command(command)
end
moved = false
end
end
mp.register_idle(idle)
mp.add_forced_key_binding("mouse_move", "image-viewer-mouse-move", function() moved = true end)
cleanup = function()
mp.remove_key_binding("image-viewer-mouse-move")
mp.unregister_idle(idle)
end
end
end
function cursor_centric_zoom_handler(amt)
local zoom_inc = tonumber(amt)
if not zoom_inc or zoom_inc == 0 then return end
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local margin = opts.cursor_centric_zoom_margin
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
-- the size in pixels of the (in|de)crement
local diff_width = (2 ^ zoom_inc - 1) * video_size[1]
local diff_height = (2 ^ zoom_inc - 1) * video_size[2]
if not opts.cursor_centric_zoom_dezoom_if_full_view and
zoom_inc < 0 and
video_size[1] + diff_width + 2 * margin <= dim.w and
video_size[2] + diff_height + 2 * margin <= dim.h
then
-- the zoom decrement is too much, reduce it such that the full image is visible, no more, no less
-- in addition, this should take care of trying too zoom out while everything is already visible
local new_zoom_inc_x = math.log((dim.w - 2 * margin) / video_size[1]) / math.log(2)
local new_zoom_inc_y = math.log((dim.h - 2 * margin) / video_size[2]) / math.log(2)
local new_zoom_inc = math.min(0, math.min(new_zoom_inc_x, new_zoom_inc_y))
zoom_inc = new_zoom_inc
diff_width = (2 ^ zoom_inc - 1) * video_size[1]
diff_height = (2 ^ zoom_inc - 1) * video_size[2]
end
local new_width = video_size[1] + diff_width
local new_height = video_size[2] + diff_height
local mouse_pos_origin = {}
mouse_pos_origin[1], mouse_pos_origin[2] = mp.get_mouse_pos()
local new_pan_x, new_pan_y
-- some additional constraints:
-- if image can be fully visible (in either direction), set pan to 0
-- if border would show on either side, then prefer adjusting the pan even if not cursor-centric
local auto_c = opts.cursor_centric_zoom_auto_center
if auto_c and video_size[1] + diff_width + 2 * margin <= dim.w then
new_pan_x = 0
else
local pan_x = mp.get_property("video-pan-x")
local rx = (dim.ml + video_size[1] / 2 - mouse_pos_origin[1]) / (video_size[1] / 2)
new_pan_x = (pan_x * video_size[1] + rx * diff_width / 2) / new_width
if auto_c then
new_pan_x = clamp(new_pan_x, (dim.w - 2 * margin) / (2 * new_width) - 0.5,
-(dim.w - 2 * margin) / (2 * new_width) + 0.5)
end
end
if auto_c and video_size[2] + diff_height + 2 * margin <= dim.h then
new_pan_y = 0
else
local pan_y = mp.get_property("video-pan-y")
local ry = (dim.mt + video_size[2] / 2 - mouse_pos_origin[2]) / (video_size[2] / 2)
new_pan_y = (pan_y * video_size[2] + ry * diff_height / 2) / new_height
if auto_c then
new_pan_y = clamp(new_pan_y, (dim.h - 2 * margin) / (2 * new_height) - 0.5,
-(dim.h - 2 * margin) / (2 * new_height) + 0.5)
end
end
local zoom_origin = mp.get_property("video-zoom")
mp.command("no-osd set video-zoom " ..
zoom_origin + zoom_inc ..
"; no-osd set video-pan-x " .. clamp(new_pan_x, -3, 3) .. "; no-osd set video-pan-y " .. clamp(new_pan_y, -3, 3))
end
function align_border(x, y)
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local video_size = { dim.w - dim.ml - dim.mr, dim.h - dim.mt - dim.mb }
local x, y = tonumber(x), tonumber(y)
local command = ""
if x then
command = command .. "no-osd set video-pan-x " .. clamp(-x * (dim.ml + dim.mr) / (2 * video_size[1]), -3, 3) .. ";"
end
if y then
command = command .. "no-osd set video-pan-y " .. clamp(-y * (dim.mt + dim.mb) / (2 * video_size[2]), -3, 3) .. ";"
end
if command ~= "" then
mp.command(command)
end
end
function pan_image(axis, amount, zoom_invariant, image_constrained)
amount = tonumber(amount)
if not amount or amount == 0 or axis ~= "x" and axis ~= "y" then return end
if zoom_invariant == "yes" then
amount = amount / 2 ^ mp.get_property_number("video-zoom")
end
local prop = "video-pan-" .. axis
local old_pan = mp.get_property_number(prop)
if image_constrained == "yes" then
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local margin =
(axis == "x" and amount > 0) and dim.ml
or (axis == "x" and amount < 0) and dim.mr
or (amount > 0) and dim.mt
or (amount < 0) and dim.mb
local vid_size = (axis == "x") and (dim.w - dim.ml - dim.mr) or (dim.h - dim.mt - dim.mb)
local pixels_moved = math.abs(amount) * vid_size
-- the margin is already visible, no point going further
if margin >= 0 then
return
elseif margin + pixels_moved > 0 then
amount = -(math.abs(amount) / amount) * margin / vid_size
end
end
mp.set_property_number(prop, old_pan + amount)
end
function rotate_video(amt)
local rot = mp.get_property_number("video-rotate")
rot = (rot + amt) % 360
mp.set_property_number("video-rotate", rot)
end
function reset_pan_if_visible()
local dim = mp.get_property_native("osd-dimensions")
if not dim then return end
local command = ""
if (dim.ml + dim.mr >= 0) then
command = command .. "no-osd set video-pan-x 0" .. ";"
end
if (dim.mt + dim.mb >= 0) then
command = command .. "no-osd set video-pan-y 0" .. ";"
end
if command ~= "" then
mp.command(command)
end
end
mp.add_key_binding(nil, "drag-to-pan", drag_to_pan_handler, { complex = true })
mp.add_key_binding(nil, "pan-follows-cursor", pan_follows_cursor_handler, { complex = true })
mp.add_key_binding(nil, "cursor-centric-zoom", cursor_centric_zoom_handler)
mp.add_key_binding(nil, "align-border", align_border)
mp.add_key_binding(nil, "pan-image", pan_image)
mp.add_key_binding(nil, "rotate-video", rotate_video)
mp.add_key_binding(nil, "reset-pan-if-visible", reset_pan_if_visible)
mp.add_key_binding(nil, "force-print-filename", force_print_filename)

View File

@ -0,0 +1,2 @@
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -0,0 +1,2 @@
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -0,0 +1,4 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
-- vim.opt.expandtab = true

View File

@ -0,0 +1,4 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true

View File

@ -0,0 +1,7 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -0,0 +1,5 @@
-- options ---------------------------------------------------------------------
vim.bo.tabstop = 2
vim.bo.shiftwidth = 2
vim.bo.expandtab = true
vim.bo.textwidth = 72

View File

@ -0,0 +1,4 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

View File

@ -0,0 +1,2 @@
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -0,0 +1,339 @@
-- basic neovim colorscheme template
--
-- A simple neovim colorscheme template that defines highlight groups
-- from a list of 8 colors.
-- colors ----------------------------------------------------------------------
local C = {
{ 0, "#292526" }, -- black
{ 1, "#ff404f" }, -- red
{ 2, "#00a147" }, -- green
{ 3, "#e06e00" }, -- orange
{ 4, "#6185ff" }, -- blue
{ 5, "#ff3e8b" }, -- magenta
{ 6, "#0095d7" }, -- cyan
{ 7, "#e3e0e1" }, -- white
{ 8, "#958a8d" }, -- black
{ 9, "#ffb3b6" }, -- red
{ 10, "#00e46a" }, -- green
{ 11, "#ffb598" }, -- orange
{ 12, "#b8c3ff" }, -- blue
{ 13, "#ffb1c5" }, -- magenta
{ 14, "#92ccff" }, -- cyan
{ 15, "#f4f3f3" }, -- white
}
local black_c = C[1]
local red_c = C[2]
local green_c = C[3]
local orange_c = C[4]
local blue_c = C[5]
local magenta_c = C[6]
local cyan_c = C[7]
local white_c = C[8]
-- init ------------------------------------------------------------------------
vim.cmd.highlight("clear")
if vim.fn.exists("syntax_on") then
vim.cmd.syntax("reset")
end
vim.opt.background = "dark"
vim.g.colors_name = "basic"
if
vim.env.TERM == "linux" or
vim.env.TERM == "screen" or
vim.env.TERM == "screen.linux"
then
vim.opt.termguicolors = false
else
vim.opt.termguicolors = true
end
local tty = vim.env.TERM == "linux" or vim.env.TERM == "screen.linux"
for _, v in ipairs(C) do
local key = ("terminal_color_%i"):format(v[1])
vim.g[key] = v[2]
end
-- highlights ------------------------------------------------------------------
local H = {}
function H:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
function H:fg(c)
self.ctermfg = c[1]
self.fg = c[2]
if c[1] == 4 and tty then
self.bold = true
end
return self
end
function H:bg(c)
self.ctermbg = c[1]
self.bg = c[2]
if c[1] == 4 and tty then
self.bold = true
end
return self
end
function H:attr(a)
if tty then
if a == "underline" then return self end
end
self[a] = true
return self
end
local fg_c = white_c
local bg_c = black_c
local accent_c = magenta_c
local dimmed_c = blue_c
local function set_hl(group, def) vim.api.nvim_set_hl(0, group, def) end
-- normal ----------------------------------------------------------------------
local normal_h = {}
set_hl("Normal", normal_h)
set_hl("NormalNC", normal_h)
-- tui -------------------------------------------------------------------------
local tui_normal_h = {}
local tui_accent_h = H:new():fg(accent_c)
local tui_dimmed_h = H:new():fg(dimmed_c)
set_hl("StatusLine", tui_dimmed_h)
set_hl("StatusLineNC", tui_dimmed_h)
set_hl("TabLine", tui_dimmed_h)
set_hl("TabLineFill", tui_dimmed_h)
set_hl("TabLineSel", tui_accent_h)
set_hl("WinBar", tui_accent_h)
set_hl("WinBarNC", tui_dimmed_h)
set_hl("WinSeparator", tui_dimmed_h)
set_hl("LineNr", tui_accent_h)
set_hl("LineNrAbove", tui_dimmed_h)
set_hl("LineNrBelow", tui_dimmed_h)
set_hl("SignColumn", tui_dimmed_h)
set_hl("FoldColumn", tui_dimmed_h)
set_hl("WildMenu", tui_accent_h)
-- float -----------------------------------------------------------------------
local float_normal_h = H:new():fg(bg_c):bg(fg_c)
local float_accent_h = H:new():fg(accent_c):bg(fg_c)
set_hl("NormalFloat", float_normal_h)
set_hl("FloatBorder", float_normal_h)
set_hl("FloatTitle", float_accent_h)
-- menu ------------------------------------------------------------------------
local menu_normal_h = H:new():fg(bg_c):bg(fg_c)
local menu_accent_h = H:new():fg(accent_c):bg(fg_c)
local menu_accent_r_h = H:new():fg(accent_c):bg(fg_c):attr("reverse")
set_hl("Pmenu", menu_normal_h)
set_hl("PmenuSel", menu_accent_h)
set_hl("PmenuKind", menu_normal_h)
set_hl("PmenuKindSel", menu_accent_h)
set_hl("PmenuExtra", menu_normal_h)
set_hl("PmenuExtraSel", menu_accent_h)
set_hl("PmenuSbar", menu_accent_h)
set_hl("PmenuThumb", menu_accent_r_h)
-- messages --------------------------------------------------------------------
local message_normal_h = {}
local message_accent_h = H:new():fg(accent_c)
local message_error_h = H:new():fg(red_c)
local message_warn_h = H:new():fg(orange_c)
set_hl("MsgArea", message_normal_h)
set_hl("MsgSeparator", message_normal_h)
set_hl("ModeMsg", message_accent_h)
set_hl("MoreMsg", message_accent_h)
set_hl("WarningMsg", message_warn_h)
set_hl("ErrorMsg", message_error_h)
set_hl("Question", message_accent_h)
set_hl("Title", message_accent_h)
-- buffer ----------------------------------------------------------------------
local buffer_normal_h = H:new():fg(dimmed_c)
local buffer_normal_bg_h = H:new():bg(dimmed_c)
local buffer_accent_h = H:new():fg(accent_c)
set_hl("Conceal", buffer_normal_h)
set_hl("NonText", buffer_normal_h)
set_hl("EndOfBuffer", buffer_normal_h)
set_hl("Whitespace", buffer_normal_h)
set_hl("Folded", buffer_normal_h)
set_hl("SpecialKey", buffer_accent_h)
set_hl("ColorColumn", buffer_normal_bg_h)
-- cursor ----------------------------------------------------------------------
local cursor_normal_h = H:new():attr("reverse")
set_hl("CursorLine", cursor_normal_h)
set_hl("CursorLineNr", cursor_normal_h)
set_hl("CursorLineSign", cursor_normal_h)
set_hl("CursorLineFold", cursor_normal_h)
set_hl("CursorColumn", cursor_normal_h)
set_hl("QuickFixLine", cursor_normal_h)
set_hl("Cursor", cursor_normal_h)
set_hl("lCursor", cursor_normal_h)
set_hl("CursorIM", cursor_normal_h)
set_hl("TermCursor", cursor_normal_h)
set_hl("TermCursorNC", cursor_normal_h)
-- match -----------------------------------------------------------------------
local match_normal_h = H:new():fg(black_c):bg(orange_c)
local match_current_h = H:new():fg(black_c):bg(magenta_c)
local match_paren_h = H:new():fg(magenta_c):bg(orange_c)
set_hl("Search", match_normal_h)
set_hl("Substitute", match_normal_h)
set_hl("IncSearch", match_current_h)
set_hl("CurSearch", match_current_h)
set_hl("MatchParen", match_paren_h)
-- selection -------------------------------------------------------------------
local selection_normal_h = H:new():fg(black_c):bg(white_c)
set_hl("visual", selection_normal_h)
set_hl("visualnos", selection_normal_h)
-- diff ------------------------------------------------------------------------
local diff_add_h = H:new():fg(green_c)
local diff_change_h = H:new():fg(orange_c)
local diff_delete_h = H:new():fg(red_c)
local diff_text_h = H:new():fg(orange_c):attr("underline")
set_hl("DiffAdd", diff_add_h)
set_hl("DiffChange", diff_change_h)
set_hl("DiffDelete", diff_delete_h)
set_hl("DiffText", diff_text_h)
-- spell -----------------------------------------------------------------------
local spell_error_h = H:new():fg(red_c):attr("underline")
local spell_warn_h = H:new():fg(orange_c):attr("underline")
set_hl("SpellBad", spell_error_h)
set_hl("SpellCap", spell_warn_h)
set_hl("SpellLocal", spell_warn_h)
set_hl("SpellRare", spell_warn_h)
-- diagnostic ------------------------------------------------------------------
local diagnostic_error_h = H:new():fg(red_c)
local diagnostic_warn_h = H:new():fg(orange_c)
local diagnostic_info_h = H:new():fg(blue_c)
local diagnostic_hint_h = H:new():fg(white_c)
local diagnostic_ok_h = H:new():fg(green_c)
local diagnostic_error_u_h = H:new():fg(red_c):attr("underline")
local diagnostic_warn_u_h = H:new():fg(orange_c):attr("underline")
local diagnostic_info_u_h = H:new():fg(blue_c):attr("underline")
local diagnostic_hint_u_h = H:new():fg(white_c):attr("underline")
local diagnostic_ok_u_h = H:new():fg(green_c):attr("underline")
set_hl("DiagnosticError", diagnostic_error_h)
set_hl("DiagnosticWarn", diagnostic_warn_h)
set_hl("DiagnosticInfo", diagnostic_info_h)
set_hl("DiagnosticHint", diagnostic_hint_h)
set_hl("DiagnosticOk", diagnostic_ok_h)
set_hl("DiagnosticVirtualError", diagnostic_error_h)
set_hl("DiagnosticVirtualWarn", diagnostic_warn_h)
set_hl("DiagnosticVirtualInfo", diagnostic_info_h)
set_hl("DiagnosticVirtualHint", diagnostic_hint_h)
set_hl("DiagnosticVirtualOk", diagnostic_ok_h)
set_hl("DiagnosticUnderlineError", diagnostic_error_u_h)
set_hl("DiagnosticUnderlineWarn", diagnostic_warn_u_h)
set_hl("DiagnosticUnderlineInfo", diagnostic_info_u_h)
set_hl("DiagnosticUnderlineHint", diagnostic_hint_u_h)
set_hl("DiagnosticUnderlineOk", diagnostic_ok_u_h)
set_hl("DiagnosticFloatingError", diagnostic_error_h)
set_hl("DiagnosticFloatingWarn", diagnostic_warn_h)
set_hl("DiagnosticFloatingInfo", diagnostic_info_h)
set_hl("DiagnosticFloatingHint", diagnostic_hint_h)
set_hl("DiagnosticFloatingOk", diagnostic_ok_h)
set_hl("DiagnosticSingError", diagnostic_error_h)
set_hl("DiagnosticSingWarn", diagnostic_warn_h)
set_hl("DiagnosticSingInfo", diagnostic_info_h)
set_hl("DiagnosticSingHint", diagnostic_hint_h)
set_hl("DiagnosticSingOk", diagnostic_ok_h)
set_hl("DiagnosticDeprecated", diagnostic_hint_u_h)
set_hl("DiagnosticUnnecessary", diagnostic_hint_u_h)
-- misc ------------------------------------------------------------------------
set_hl("Directory", H:new():fg(blue_c):attr("bold"))
-- syntax ----------------------------------------------------------------------
local syntax_normal_h = {}
local syntax_comment_h = H:new():fg(blue_c):attr("bold")
local syntax_constant_h = H:new():fg(red_c)
local syntax_identifier_h = H:new()
local syntax_statement_h = H:new():fg(orange_c)
local syntax_preproc_h = H:new():fg(magenta_c)
local syntax_type_h = H:new():fg(green_c)
local syntax_special_h = H:new():fg(orange_c)
local syntax_underline_h = H:new():fg(blue_c):attr("underline")
local syntax_ignore_h = H:new():fg(black_c)
local syntax_error_h = H:new():fg(black_c):bg(red_c)
local syntax_warn_h = H:new():fg(black_c):bg(orange_c)
local syntax_italic_h = H:new():attr("italic")
local syntax_bold_h = H:new():attr("bold")
local syntax_bolditalic_h = H:new():attr("bold"):attr("italic")
set_hl("Comment", syntax_comment_h)
set_hl("Constant", syntax_constant_h)
set_hl("String", syntax_constant_h)
set_hl("Character", syntax_constant_h)
set_hl("Number", syntax_constant_h)
set_hl("Boolean", syntax_constant_h)
set_hl("Float", syntax_constant_h)
set_hl("Identifier", syntax_identifier_h)
set_hl("Function", syntax_identifier_h)
set_hl("Statement", syntax_statement_h)
set_hl("Conditional", syntax_statement_h)
set_hl("Repeat", syntax_statement_h)
set_hl("Label", syntax_statement_h)
set_hl("Operator", syntax_statement_h)
set_hl("Keyword", syntax_statement_h)
set_hl("Exception", syntax_statement_h)
set_hl("PreProc", syntax_preproc_h)
set_hl("Include", syntax_preproc_h)
set_hl("Define", syntax_preproc_h)
set_hl("Macro", syntax_preproc_h)
set_hl("PreCondit", syntax_preproc_h)
set_hl("Type", syntax_type_h)
set_hl("StorageClass", syntax_type_h)
set_hl("Structure", syntax_type_h)
set_hl("Typedef", syntax_type_h)
set_hl("Special", syntax_special_h)
set_hl("SpecialChar", syntax_special_h)
set_hl("Tag", syntax_special_h)
set_hl("Delimiter", syntax_special_h)
set_hl("SpecialComment", syntax_special_h)
set_hl("Debug", syntax_special_h)
set_hl("Underlined", syntax_underline_h)
set_hl("Ignore", syntax_ignore_h)
set_hl("Error", syntax_error_h)
set_hl("Todo", syntax_warn_h)
set_hl("Italic", syntax_italic_h)
set_hl("Bold", syntax_bold_h)
set_hl("BoldItalic", syntax_bolditalic_h)
-- markdown --------------------------------------------------------------------
local markdown_label_h = H:new():fg(magenta_c)
local markdown_delimiter_h = H:new():fg(blue_c)
local markdown_underline_h = H:new():fg(blue_c):attr("underline")
set_hl("markdownLabel", markdown_label_h)
set_hl("markdownDelimiter", markdown_delimiter_h)
set_hl("markdownUnderlined", markdown_underline_h)

View File

@ -0,0 +1,177 @@
-- options ---------------------------------------------------------------------
-- colorscheme
vim.cmd.colorscheme("basic")
-- leader
vim.g.mapleader = " "
vim.g.maplocalleader = " "
vim.keymap.set({ "n", "v" }, "<space>", "<nop>", { silent = true })
-- general
vim.opt.undofile = true
vim.opt.backup = false
vim.opt.writebackup = false
vim.opt.mouse = {}
vim.opt.title = true
-- appearance
vim.opt.shortmess:append({ I = true })
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.signcolumn = "number"
vim.opt.textwidth = 80
vim.opt.colorcolumn = "+1"
-- tabline, winbar, statusline
vim.opt.showtabline = 2
vim.opt.winbar = "%f%( %h%m%r%y%)"
vim.opt.laststatus = 3
function _G.statusline()
local col = vim.api.nvim_win_get_cursor(0)[2] + 1
local char = vim.api.nvim_get_current_line():sub(col, col):gsub("%%", "%%%1")
local wc = vim.fn.wordcount()
return table.concat({
vim.fn.pathshorten(vim.fn.getcwd()),
"%=",
"<", char, "> %b ",
wc.visual_chars or wc.cursor_chars, "/", wc.chars, " ",
wc.visual_words or wc.cursor_words, "/", wc.words
})
end
vim.opt.statusline = "%!v:lua.statusline()"
-- behaviour
vim.opt.ignorecase = true
vim.opt.infercase = true
vim.opt.smartcase = true
vim.opt.smartindent = true
vim.opt.clipboard = "unnamedplus"
vim.opt.whichwrap = {
["b"] = true,
["s"] = true,
["h"] = true,
["l"] = true,
["<"] = true,
[">"] = true,
["~"] = true,
["["] = true,
["]"] = true
}
vim.opt.wildoptions = { "fuzzy" }
vim.opt.wildignorecase = true
-- path
vim.opt.path = ".,,**"
-- local root = vim.fs.find({ ".git" }, { upward = true })[1]
-- completion
vim.opt.completeopt = {
"menuone",
"preview",
"noinsert",
"noselect"
}
-- keymaps ---------------------------------------------------------------------
-- clear hlsearch
vim.keymap.set( "n", "<esc>", function()
vim.cmd.nohlsearch()
end, { desc = "Stop the highlighting for the 'hlsearch' option" })
-- move cursor with alt in c-mode
vim.keymap.set("c", "<m-h>", "<left>", { desc = "Left" })
vim.keymap.set("c", "<m-l>", "<right>", { desc = "Right" })
-- move cursor with alt in i-mode
vim.keymap.set("i", "<m-h>", "<left>", { desc = "Left" })
vim.keymap.set("i", "<m-j>", "<down>", { desc = "Down" })
vim.keymap.set("i", "<m-k>", "<up>", { desc = "Up" })
vim.keymap.set("i", "<m-l>", "<right>", { desc = "Right" })
-- move cursor with alt in t-mode
vim.keymap.set("t", "<m-h>", "<left>", { desc = "Left" })
vim.keymap.set("t", "<m-j>", "<down>", { desc = "Down" })
vim.keymap.set("t", "<m-k>", "<up>", { desc = "Up" })
vim.keymap.set("t", "<m-l>", "<right>", { desc = "Right" })
-- navigate windows
vim.keymap.set("n", "<c-h>", "<c-w>h", { desc = "Navigate window left"})
vim.keymap.set("n", "<c-j>", "<c-w>j", { desc = "Navigate window down"})
vim.keymap.set("n", "<c-k>", "<c-w>k", { desc = "Navigate window up"})
vim.keymap.set("n", "<c-l>", "<c-w>l", { desc = "Navigate window right"})
vim.keymap.set("i", "<c-h>", "<c-\\><c-n><c-w>h", { desc = "Navigate window left"})
vim.keymap.set("i", "<c-j>", "<c-\\><c-n><c-w>j", { desc = "Navigate window down"})
vim.keymap.set("i", "<c-k>", "<c-\\><c-n><c-w>k", { desc = "Navigate window up"})
vim.keymap.set("i", "<c-l>", "<c-\\><c-n><c-w>l", { desc = "Navigate window right"})
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { desc = "Navigate window left"})
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { desc = "Navigate window down"})
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { desc = "Navigate window up"})
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { desc = "Navigate window right"})
-- navigate buffer
vim.keymap.set("n", "<c-d>", "<c-d>zz")
vim.keymap.set("n", "<c-u>", "<c-u>zz")
-- cmdline history navigation
vim.keymap.set("c", "<c-p>", "<up>")
vim.keymap.set("c", "<c-n>", "<down>")
-- menus
vim.keymap.set("n", "<leader>f", ":find ", { desc = ":find" })
vim.keymap.set("n", "<leader>b", ":buffer ", { desc = ":buffer" })
vim.keymap.set("n", "<leader>h", ":help ", { desc = ":help" })
-- spell
vim.keymap.set("n", "<leader>s", function()
vim.opt_local.spell = not(vim.opt_local.spell:get())
end, { desc = "Toggle spell" })
-- make
vim.keymap.set("n", "<leader>m", "<cmd>make<cr>", { desc = ":make" })
-- buffers ---------------------------------------------------------------------
vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
vim.keymap.set("n", "[b", "<cmd>bprev<cr>", { desc = "Previous buffer" })
vim.keymap.set("n", "<leader>d", "<cmd>enew<cr><cmd>bd #<cr>", { desc = "Delete buffer" })
vim.keymap.set("n", "<leader>D", "<cmd>bd<cr>", { desc = "Delete buffer and close window" })
-- tabs ------------------------------------------------------------------------
vim.keymap.set("n", "]t", "<cmd>tabnext<cr>", { desc = "Next tab" })
vim.keymap.set("n", "[t", "<cmd>tabprevious<cr>", { desc = "Previous tab" })
-- vimgrep ---------------------------------------------------------------------
vim.keymap.set("n", "<leader>g", ":vimgrep / **/*<c-left><c-left>/")
local vimgrep_group = vim.api.nvim_create_augroup("Vimgrep", {})
vim.api.nvim_create_autocmd("QuickfixCmdPost", {
group = vimgrep_group,
pattern = "vimgrep",
desc = "Open quickfix window after :vimgrep",
command = "copen"
})
-- quickfix --------------------------------------------------------------------
vim.keymap.set("n", "co", "<cmd>copen<cr>", { desc = "Open quickfix window" })
vim.keymap.set("n", "cc", "<cmd>cclose<cr>", { desc = "Close quickfix window" })
vim.keymap.set("n", "]q", "<cmd>cnext<cr>zz", { desc = "Next quickfix item" })
vim.keymap.set("n", "[q", "<cmd>cprev<cr>zz", { desc = "Previous quickfix item" })
-- netrw -----------------------------------------------------------------------
vim.g.netrw_use_errorwindow = 0
vim.g.netrw_banner = 0
vim.g.netrw_bufsettings = "noma nomod nowrap ro nobl"
vim.g.netrw_fastbrowse = 0
vim.keymap.set("n", "<leader>.", "<cmd>Explore .<cr>",
{ desc = "Explore current working directory" })
local netrw_group = vim.api.nvim_create_augroup("Netrw", {})
vim.api.nvim_create_autocmd("Filetype", {
group = netrw_group,
pattern = "netrw",
desc = "Set keymap netrw buffers",
callback = function()
vim.keymap.set("n", "<esc>", "<cmd>Rexplore<cr>",
{ buffer = true, desc = "Return to/from Explorer" })
end
})

View File

@ -0,0 +1 @@
gl

Binary file not shown.

View File

@ -0,0 +1,276 @@
" Vim syntax file
" Language: Markdown
" Maintainer: urosm <urosm@kompot.si>
" Last Change: 2024 Jan 13
if exists("b:current_syntax")
finish
endif
runtime! syntax/html.vim
unlet! b:current_syntax
syntax spell toplevel
" comment
syn region markdownHTMLComment start=/<!--\s\=/ end=/\s\=-->/ keepend
hi def link markdownHTMLComment markdownComment
" titleblock
syn region markdownTitleBlock start=/\%^%/ end=/\n\n/ contains=markdownTitleBlockDelimiter
hi def link markdownTitleBlock markdownBold
syn match markdownTitleBlockDelimiter /%\ / contained
hi def link markdownTitleBlockDelimiter markdownDelimiter
" blockquote
syn match markdownBlockquote /\_^\(\s*>\)\+/ containedin=markdownItalic,markdownBold,markdownPCite,markdownSuperscript,markdownSubscript,markdownStrike,markdownUListItem,markdownNoFormatted
hi def link markdownBlockquote markdownDelimiter
" link
syn match markdownLink /!\=\[.\{-}\](.\{-})/ contains=markdownLinkLabel,markdownLinkURL
hi def link markdownLink markdownDelimiter
syn match markdownLinkLabel /\[\@1<=[^\]]\+/ contained
hi def link markdownLinkLabel markdownLabel
syn match markdownLinkURL /(\@1<=[^)]\+/ contained
hi def link markdownLinkURL markdownUnderlined
" automatic link
syn match markdownAutomaticLink /<\(https\{0,1}.\{-}\|[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~.]\{-}@[A-Za-z0-9\-]\{-}\.\w\{-}\)>/ contains=NONE
hi def link markdownAutomaticLink markdownUnderlined
" wikilink
syn region markdownWikilink start=/\[\[/ end=/\]\]/ contains=markdownWikilinkLabel,markdownWikilinkURL keepend display
hi def link markdownWikilink markdownDelimiter
syn match markdownWikilinkLabel /\(\[\[\)\@2<=[^\|\[\]]\+/ contained
hi def link markdownWikilinkLabel markdownLabel
syn match markdownWikilinkURL /|\@1<=[^\]]\+/ contained
hi def link markdownWikilinkURL markdownUnderlined
" definition
syn region markdownReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend
hi def link markdownReferenceDefinition markdownDelimiter
syn match markdownReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=markdownReferenceDefinition display
hi def link markdownReferenceDefinitionLabel markdownLabel
syn match markdownReferenceDefinitionURL /:\s*\zs.*/ contained containedin=markdownReferenceDefinition
hi def link markdownReferenceDefinitionURL markdownUnderlined
syn match markdownReferenceDefinitionTitle /\s*".\{-}"/ contained containedin=markdownReferenceDefinition,markdownReferenceDefinitionURL contains=@Spell,markdownAmpersandEscape
hi def link markdownReferenceDefinitionTitle markdownTitle
" citation
syn match markdownPCite "\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*.\{-}\]" contains=markdownItalic,markdownBold,markdownLatex,markdownCiteKey,@Spell,markdownAmpersandEscape
syn match markdownICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=markdownCiteKey,@Spell display
syn match markdownCiteKey /\(-\=@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\)/ containedin=markdownPCite,markdownICite contains=@NoSpell display
hi def link markdownCiteKey markdownLabel
syn match markdownCiteLocator /[\[\]]/ contained containedin=markdownPCite,markdownICite
hi def link markdownCiteLocator markdownDelimiter
" italic
syn region markdownItalic matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,markdownNoFormattedInEmphasis,markdownLatexInlineMath,markdownAmpersandEscape
syn region markdownItalic matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,markdownNoFormattedInEmphasis,markdownLatexInlineMath,markdownAmpersandEscape
hi def link markdownItalic htmlItalic
" bold
syn region markdownBold matchgroup=markdownDelimiter start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,markdownNoFormattedInStrong,markdownLatexInlineMath,markdownAmpersandEscape
syn region markdownBold matchgroup=markdownDelimiter start=/__/ end=/__/ contains=@Spell,markdownNoFormattedInStrong,markdownLatexInlineMath,markdownAmpersandEscape
hi def link markdownBold htmlBold
" bold italic
syn region markdownBoldItalic matchgroup=markdownDelimiter start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell,markdownAmpersandEscape
syn region markdownBoldItalic matchgroup=markdownDelimiter start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell,markdownAmpersandEscape
hi def link markdownBoldItalic htmlBoldItalic
syn region markdownBoldInItalic matchgroup=markdownDelimiter start=/\*\*/ end=/\*\*/ contained containedin=markdownItalic contains=@Spell,markdownAmpersandEscape
syn region markdownBoldInItalic matchgroup=markdownDelimiter start=/__/ end=/__/ contained containedin=markdownItalic contains=@Spell,markdownAmpersandEscape
syn region markdownItalicInBold matchgroup=markdownDelimiter start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=markdownBold contains=@Spell,markdownAmpersandEscape
syn region markdownItalicInBold matchgroup=markdownDelimiter start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=markdownBold contains=@Spell,markdownAmpersandEscape
hi def link markdownBoldInItalic markdownBoldItalic
hi def link markdownItalicInBold markdownBoldItalic
" strikeout
syn region markdownStrike start=/\~\~/ end=/\~\~/ contains=markdownStrikeout,@Spell keepend
hi def link markdownStrike htmlStrike
syn match markdownStrikeDelimiter /\~\~/ contained
hi def link markdownStrikeDelimiter markdownDelimiter
" subscript
syn region markdownSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ contains=markdownSubscriptDelimiter keepend
syn match markdownSubscriptDelimiter /\~/ contained
hi def link markdownSubscriptDelimiter markdownDelimiter
" superscript
syn region markdownSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ contains=markdownSuperscriptDelimiter keepend
syn match markdownSuperscriptDelimiter /\^/ contained
hi def link markdownSuperscriptDelimiter markdownDelimiter
" heading
syn match markdownAtxHeading /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=markdownItalic,markdownBold,markdownNoFormatted,markdownLaTeXInlineMath,markdownEscapedDollar,@Spell,markdownAmpersandEscape,markdownLink display
hi def link markdownAtxHeading Title
syn match markdownAtxHeadingDelimiter /\(^#\{1,6}\|\\\@<!#\+\(\s*.*$\)\@=\)/ contained containedin=markdownAtxHeading
hi def link markdownAtxHeadingDelimiter markdownDelimiter
syn match markdownSetexHeading /^.\+\n[=]\+$/ contains=markdownItalic,markdownBold,markdownNoFormatted,markdownLaTeXInlineMath,markdownEscapedDollar,@Spell,markdownAmpersandEscape
syn match markdownSetexHeading /^.\+\n[-]\+$/ contains=markdownItalic,markdownBold,markdownNoFormatted,markdownLaTeXInlineMath,markdownEscapedDollar,@Spell,markdownAmpersandEscape
syn match markdownHeadingAttr /{.*}/ contained containedin=markdownAtxHeader,markdownSetexHeader
syn match markdownHeadingID /#[-_:.[:lower:][:upper:]]*/ contained containedin=markdownHeaderAttr
hi def link markdownSetexHeading markdownTitle
hi def link markdownHeadingAttr markdownComment
hi def link markdownHeadingID markdownIdentifier
" line block
syn region markdownLineBlock start=/^|/ end=/\(^|\(.*\n|\@!\)\@=.*\)\@<=\n/ transparent
syn match markdownLineBlockDelimiter /^|/ contained containedin=markdownLineBlock
hi def link markdownLineBlockDelimiter markdownDelimiter
" simple table
syn region markdownSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\{2,}\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownDelimitedCodeBlockStart,markdownYAMLHeader keepend
syn match markdownSimpleTableDelims /\-/ contained containedin=markdownSimpleTable
syn match markdownSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=markdownSimpleTable
hi def link markdownSimpleTableDelims markdownDelimiter
hi def link markdownSimpleTableHeader markdownBold
syn region markdownTable start=/\%#=2^\(-\{2,}\s*\)\+\n\n\@!/ end=/\%#=2^\(-\{2,}\s*\)\+\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
syn match markdownTableDelims /\-/ contained containedin=markdownTable
syn region markdownTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=markdownTable
hi def link markdownTableMultilineHeader markdownBold
hi def link markdownTableDelims markdownDelimiter
" grid table
syn region markdownGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
syn match markdownGridTableDelims /[\|=]/ contained containedin=markdownGridTable
syn match markdownGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=markdownGridTable
syn match markdownGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=markdownGridTable
hi def link markdownGridTableDelims markdownDelimiter
hi def link markdownGridTableHeader markdownDelimiter
" pipe table
syn region markdownPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\(\n\|{\)/ containedin=ALLBUT,markdownDelimitedCodeBlock,markdownYAMLHeader keepend
syn region markdownPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend
syn match markdownPipeTableDelims /[\|\-:+]/ contained containedin=markdownPipeTable
syn match markdownPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=markdownPipeTable
syn match markdownPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=markdownPipeTable
hi def link markdownPipeTableDelims markdownDelimiter
hi def link markdownPipeTableHeader markdownDelimiter
syn match markdownTableHeaderWord /\<.\{-}\>/ contained containedin=markdownGridTableHeader,markdownPipeTableHeader contains=@Spell
hi def link markdownTableHeaderWord markdownBold
" delimited code blocks
syn region markdownDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=markdownDelimitedCodeBlockStart,markdownDelimitedCodeBlockEnd keepend
syn region markdownDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=markdownDelimitedCodeBlockStart,markdownDelimitedCodeBlockEnd keepend
syn match markdownDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=markdownDelimitedCodeBlock nextgroup=markdownDelimitedCodeBlockLanguage
syn match markdownDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained
syn match markdownDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=markdownDelimitedCodeBlock
syn match markdownBlockquoteinDelimitedCodeBlock '^>' contained containedin=markdownDelimitedCodeBlock
syn match markdownCodePre /<pre>.\{-}<\/pre>/ skipnl
syn match markdownCodePre /<code>.\{-}<\/code>/ skipnl
hi def link markdownDelimitedCodeBlock markdownSpecial
hi def link markdownDelimitedCodeBlockStart markdownDelimiter
hi def link markdownDelimitedCodeBlockEnd markdownDelimiter
hi def link markdownDelimitedCodeBlockLanguage markdownComment
hi def link markdownBlockquoteinDelimitedCodeBlock markdownBlockquote
hi def link markdownCodePre markdownString
" footnote
syn match markdownFootnoteID /\[\^[^\]]\+\]/ nextgroup=markdownFootnoteDef
hi def link markdownFootnoteID markdownLabel
" inline footnote
syn region markdownFootnoteDef start=/\^\[/ skip=/\[.\{-}]/ end=/\]/ contains=markdownLink,markdownLatex,markdownPCite,markdownCiteKey,markdownBold,markdownItalic,markdownBoldItalic,markdownNoFormatted,markdownSuperscript,markdownSubscript,markdownStrike,markdownEnDash,markdownEmDash,markdownEllipses,markdownBeginQuote,markdownEndQuote,@Spell,markdownAmpersandEscape skipnl keepend
hi def link markdownFootnoteDef markdownComment
syn match markdownFootnoteDefHead /\^\[/ contained containedin=markdownFootnoteDef
hi def link markdownFootnoteDefHead markdownDelimiter
syn match markdownFootnoteDefTail /\]/ contained containedin=markdownFootnoteDef
hi def link markdownFootnoteDefTail markdownDelimiter
" regular footnotes
syn region markdownFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=markdownLink,markdownLatex,markdownPCite,markdownCiteKey,markdownBold,markdownItalic,markdownNoFormatted,markdownSuperscript,markdownSubscript,markdownStrike,markdownEnDash,markdownEmDash,markdownNewLine,markdownBoldItalic,markdownEllipses,markdownBeginQuote,markdownEndQuote,markdownLaTeXInlineMath,markdownEscapedDollar,markdownLaTeXCommand,markdownLaTeXMathBlock,markdownLaTeXRegion,markdownAmpersandEscape,@Spell skipnl
syn match markdownFootnoteBlockSeparator /:/ contained containedin=markdownFootnoteBlock
hi def link markdownFootnoteBlockSeparator markdownDelimiter
syn match markdownFootnoteID /\[\^.\{-}\]/ contained containedin=markdownFootnoteBlock
syn match markdownFootnoteIDHead /\[\^/ contained containedin=markdownFootnoteID
hi def link markdownFootnoteIDHead markdownDelimiter
syn match markdownFootnoteIDTail /\]/ contained containedin=markdownFootnoteID
hi def link markdownFootnoteIDTail markdownDelimiter
" unordered list
syn match markdownUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=markdownUListItem,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownDelimitedCodeBlock,markdownListItemContinuation contains=@Spell,markdownItalic,markdownBold,markdownNoFormatted,markdownStrike,markdownSubscript,markdownSuperscript,markdownBoldItalic,markdownBoldItalic,markdownPCite,markdownICite,markdownCiteKey,markdownLinkText,markdownLaTeXCommand,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownLinkURL,markdownAutomaticLink,markdownFootnoteDef,markdownFootnoteBlock,markdownFootnoteID,markdownAmpersandEscape skipempty display
syn match markdownUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=markdownUListItem
hi def link markdownUListItemBullet markdownOperator
" ordered list
syn match markdownListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=markdownListItem,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownDelimitedCodeBlock,markdownListItemContinuation contains=@Spell,markdownItalic,markdownBold,markdownNoFormatted,markdownStrike,markdownSubscript,markdownSuperscript,markdownBoldItalic,markdownBoldItalic,markdownPCite,markdownICite,markdownCiteKey,markdownLinkText,markdownLaTeXCommand,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownAutomaticLink,markdownFootnoteDef,markdownFootnoteBlock,markdownFootnoteID,markdownAmpersandEscape skipempty display
syn match markdownListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=markdownListItem,markdownMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownDelimitedCodeBlock,markdownListItemContinuation,markdownAutomaticLink skipempty display
syn match markdownListItemBullet /^(\?.\{-}[.)]/ contained containedin=markdownListItem
syn match markdownListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=markdownListItemBullet
hi def link markdownListItemBullet markdownOperator
hi def link markdownListItemBulletId markdownIdentifier
syn match markdownListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@<!\([[:upper:][:lower:]_"[]\|\*\S\)\@=.*$/ nextgroup=markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownDelimitedCodeBlock,markdownListItemContinuation,markdownListItem contains=@Spell,markdownItalic,markdownBold,markdownNoFormatted,markdownStrike,markdownSubscript,markdownSuperscript,markdownBoldItalic,markdownBoldItalic,markdownPCite,markdownICite,markdownCiteKey,markdownLink,markdownLaTeXCommand,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownAutomaticLink,markdownFootnoteDef,markdownFootnoteBlock,markdownFootnoteID,markdownAmpersandEscape contained skipempty display
" definition list
syn region markdownDefinitionBlock start=/^\%(\_^\s*\([`~]\)\1\{2,}\)\@!.*\n\(^\s*\n\)\=\s\{0,2}\([:~]\)\(\3\{2,}\3*\)\@!/ skip=/\n\n\zs\s/ end=/\n\n/ contains=markdownDefinitionBlockDelimiter,markdownDefinitionBlockTerm,markdownCodeBlockInsideIndent,markdownItalic,markdownBold,markdownBoldItalic,markdownNoFormatted,markdownStrike,markdownSubscript,markdownSuperscript,markdownFootnoteID,markdownLinkURL,markdownLinkText,markdownLaTeXMathBlock,markdownLaTeXInlineMath,markdownEscapedDollar,markdownAutomaticLink,markdownEmDash,markdownEnDash,markdownFootnoteDef,markdownFootnoteBlock,markdownFootnoteID
syn match markdownDefinitionBlockTerm /^.*\n\(^\s*\n\)\=\(\s*[:~]\)\@=/ contained contains=markdownNoFormatted,markdownItalic,markdownBold,markdownLaTeXInlineMath,markdownEscapedDollar,markdownFootnoteDef,markdownFootnoteBlock,markdownFootnoteID nextgroup=markdownDefinitionBlockDelimiter
syn match markdownDefinitionBlockDelimiter /^\s*[:~]/ contained
hi def link markdownDefinitionBlockTerm markdownIdentifier
hi def link markdownDefinitionBlockDelimiter markdownDelimiter
" new line
syn match markdownNewLine /\%(\%(\S\)\@<= \{2,}\|\\\)$/ display containedin=markdownItalic,markdownBold,markdownBoldItalic,markdownBoldInItalic,markdownItalicInBold
hi def link markdownNewLine Error
" rule
syn match markdownHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display
hi def link markdownHRule markdownDelimiter
" &-escape
syn match markdownAmpersandEscape /\v\&(#\d+|#x\x+|[[:alnum:]]+)\;/ contains=NoSpell
hi def link markdownAmpersandEscape Special
" yaml
syn include @YAML syntax/yaml.vim
unlet! b:current_syntax
syn region markdownYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=@YAML containedin=TOP
" Styling
hi def link markdownComment Comment
hi def link markdownConstant Constant
hi def link markdownString String
hi def link markdownCharacter Character
hi def link markdownNumber Number
hi def link markdownBoolean Boolean
hi def link markdownFloat Float
hi def link markdownIdentifier Identifier
hi def link markdownFunction Function
hi def link markdownStatement Statement
hi def link markdownConditional Conditional
hi def link markdownRepeat Repeat
hi def link markdownLabel Label
hi def link markdownOperator Operator
hi def link markdownKeyword Keyword
hi def link markdownException Exception
hi def link markdownPreProc PreProc
hi def link markdownInclude Include
hi def link markdownDefine Define
hi def link markdownMacro Macro
hi def link markdownPreCondit PreCondit
hi def link markdownType Type
hi def link markdownStorageClass StorageClass
hi def link markdownStructure Structure
hi def link markdownTypedef Typedef
hi def link markdownSpecial Special
hi def link markdownSpecialChar SpecialChar
hi def link markdownTag Tag
hi def link markdownDelimiter Delimiter
hi def link markdownSpecialComment SpecialComment
hi def link markdownDebug Debug
hi def link markdownUnderlined Underlined
hi def link markdownIgnore Ignore
hi def link markdownItalic htmlItalic
hi def link markdownBold htmlBold
hi def link markdownItalicBold htmlItalicBold
hi def link markdownStrike htmlStrike
hi def link markdownTitle Title
let b:current_syntax = "markdown"
" vim:set sw=2:

View File

@ -0,0 +1,25 @@
import os
import atexit
import readline
if "PYTHONHISTFILE" in os.environ:
histfile = os.path.expanduser(os.environ["PYTHONHISTFILE"])
elif "XDG_STATE_HOME" in os.environ:
histfile = os.path.join(os.path.expanduser(
os.environ["XDG_STATE_HOME"]), "python", "python_history")
else:
histfile = os.path.join(os.path.expanduser("~"), ".python_history")
histfile = os.path.abspath(histfile)
_dir, _ = os.path.split(histfile)
os.makedirs(_dir, exist_ok=True)
try:
readline.read_history_file(histfile)
except FileNotFoundError:
pass
atexit.register(readline.write_history_file, histfile)

View File

@ -0,0 +1,2 @@
# from dot.git
Defaults !admin_flag

190
.config/sway/config 100644
View File

@ -0,0 +1,190 @@
# variables ####################################################################
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# workspaces
set $ws1 1:www
set $ws2 2:txt
set $ws3 3:doc
set $ws4 4:pdf
set $ws5 5:cmd
set $ws6 6:cmd
set $ws7 7:cmd
set $ws8 8:cmd
set $ws9 9:cmd
set $ws0 10:rdp
# colors
set $bg #292526
set $dimmed #6185ff
set $accent #ff3e8b
set $error #ff404f
# key bindings #################################################################
bindsym $mod+return exec footclient
bindsym $mod+shift+return exec foot
bindsym $mod+w exec firefox
bindsym $mod+shift+w exec thunderbird
# fuzzel
bindsym $mod+space exec fuzzel
bindsym $mod+shift+space exec find -not -path "*/.*" | fuzzel -d | xargs -I{} xdg-open "{}"
bindsym $mod+insert exec lsblk -nrpo"name,type,mountpoint" \
| awk '$2=="part"{printf"%-12s %s\\n",$1,$3}' \
| fuzzel -d \
| awk '{printf($2=="")?"udisksctl mount -b %s":"udisksctl unmount -b %s",$1}' \
| sh \
| xargs -I{} notify-send "{}"
bindsym $mod+home exec nmcli -g "type,name,active" connection show \
| awk 'BEGIN{FS=":"}{printf($3=="yes")?"* %s\\n":" %s\\n",$2}' \
| fuzzel -d \
| awk '{printf($1=="*")?"nmcli connection down \\"%s\\"":"nmcli connection up \\"%s\\"",substr($0,3)}' \
| sh \
| xargs -I{} notify-send "{}"
bindsym $mod+shift+home exec footclient nmtui
# makoctl
bindsym $mod+x exec makoctl dismiss
bindsym $mod+shift+x exec makoctl dismiss -a
bindsym --to-code $mod+z exec makoctl restore
# screenshot
bindsym print exec grim - | wl-copy
# window management ############################################################
workspace_layout tabbed
focus_follows_mouse yes
focus_wrapping yes
floating_modifier $mod normal
# kill
bindsym $mod+q kill
# move focus
bindsym $mod+$up focus up
bindsym $mod+$down focus down
bindsym $mod+$left focus left
bindsym $mod+$right focus right
# move container
bindsym $mod+shift+$up move up
bindsym $mod+shift+$down move down
bindsym $mod+shift+$left move left
bindsym $mod+shift+$right move right
# move focus workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws0
bindsym --to-code $mod+bracketleft workspace prev
bindsym --to-code $mod+bracketright workspace next
bindsym $mod+tab workspace back_and_forth
# move container workspace
bindsym $mod+shift+1 move container to workspace $ws1, workspace $ws1
bindsym $mod+shift+2 move container to workspace $ws2, workspace $ws2
bindsym $mod+shift+3 move container to workspace $ws3, workspace $ws3
bindsym $mod+shift+4 move container to workspace $ws4, workspace $ws4
bindsym $mod+shift+5 move container to workspace $ws5, workspace $ws5
bindsym $mod+shift+6 move container to workspace $ws6, workspace $ws6
bindsym $mod+shift+7 move container to workspace $ws7, workspace $ws7
bindsym $mod+shift+8 move container to workspace $ws8, workspace $ws8
bindsym $mod+shift+9 move container to workspace $ws9, workspace $ws9
bindsym $mod+shift+0 move container to workspace $ws0, workspace $ws0
bindsym --to-code $mod+shift+bracketleft move container to workspace prev, workspace prev
bindsym --to-code $mod+shift+bracketright move container to workspace next, workspace next
bindsym $mod+shift+tab move container to workspace back_and_forth, workspace back_and_forth
# resize
bindsym $mod+control+$left resize shrink width
bindsym $mod+control+$down resize grow height
bindsym $mod+control+$up resize shrink height
bindsym $mod+control+$right resize grow width
# layout
bindsym $mod+a focus parent
bindsym $mod+shift+a focus child
bindsym $mod+s layout toggle split
bindsym $mod+shift+s split toggle
bindsym $mod+d layout toggle tabbed split
bindsym $mod+f fullscreen toggle
bindsym $mod+shift+f floating toggle
bindsym $mod+g focus mode_toggle
bindsym $mod+shift+g sticky toggle
bindsym $mod+period scratchpad show
bindsym $mod+shift+period move scratchpad
# laptop #######################################################################
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+;\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-;\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle;\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
bindsym XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle;\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_source "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
bindsym XF86MonBrightnessUp exec brightnessctl set "+1%";\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym XF86MonBrightnessDown exec brightnessctl set "1%-";\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym shift+XF86MonBrightnessUp exec brightnessctl set "+10%";\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym shift+XF86MonBrightnessDown exec brightnessctl set "10%-";\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
# session ######################################################################
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff"
mode $session_mode {
bindsym r reload, mode default
bindsym l exec swaylock, mode default
bindsym q exit, mode default
bindsym s exec systemctl suspend, mode default
bindsym b exec systemctl reboot, mode default
bindsym p exec systemctl poweroff, mode default
# return
bindsym escape mode default
bindsym $mod+escape mode default
}
bindsym $mod+escape mode $session_mode, fullscreen disable
# theme ########################################################################
output * background wallpaper.svg fill $bg
seat * hide_cursor 5000
font monospace 13
default_border normal 1
default_floating_border normal 1
# class border background text indicator child_border
client.focused $accent $accent $bg $error $bg
client.focused_inactive $dimmed $dimmed $bg $bg $bg
client.unfocused $dimmed $dimmed $bg $bg $bg
client.urgent $error $error $bg $error $bg
# statusbar ####################################################################
bar {
status_command $XDG_CONFIG_HOME/sway/status.sh
separator_symbol " | "
colors {
background $bg
statusline $dimmed
separator $dimmed
# border background text
focused_workspace $bg $bg $accent
active_workspace $dimmed $bg $dimmed
inactive_workspace $bg $bg $dimmed
urgent_workspace $bg $bg $error
}
}
# xwayland #####################################################################
xwayland disable
# autostart ####################################################################
exec swayidle
exec mako
exec wlsunset -l 45 -L 15
workspace $ws1, exec thunderbird, exec firefox
workspace $ws2, exec foot --server
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# include ######################################################################
include $XDG_CONFIG_HOME/sway/`hostname`

View File

@ -0,0 +1,15 @@
# output
output * {
adaptive_sync on
}
# input
input "type:keyboard" {
xkb_layout gb,si
xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
}
input "type:touchpad" {
tap enabled
}

View File

@ -0,0 +1,15 @@
#!/bin/sh
printf "{\"version\":1}\n"
printf "[\n"
while true
do
printf [
swaymsg -t get_inputs | jq -Mcj '[.[] | select(.type=="keyboard")][0] | {"full_text":.xkb_active_layout_name,"urgent":.xkb_active_layout_index}, ","'
cat /sys/class/power_supply/BAT0/capacity | jq -Mcj '{"full_text":.}, ","'
date +%c | jq -RMcj '{"full_text":.}, ","'
swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] | select(.name=="__i3_scratch").floating_nodes | {"full_text":length,"urgent":length}, ","'
makoctl list | jq -Mcj '.data[][0] | {"full_text":(.summary.data // 0),"urgent":((.urgency.data // 0) == 2)}, ","'
printf ],
timeout 1 swaymsg -t subscribe '["input","binding"]' >/dev/null
done

View File

@ -0,0 +1,16 @@
# clamshell
set $laptop LVDS-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# input
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
xkb_numlock enabled
repeat_delay 300
repeat_rate 30
}
input "type:touchpad" {
tap enabled
}

View File

@ -0,0 +1,18 @@
<svg
width="1920"
height="1080">
<text
y="33%"
xml:space="preserve"
fill="#ff3e8b"
font-family="monospace"
font-size="13pt">
<tspan text-anchor="middle" x="50%" dy="13pt"> _____ </tspan>
<tspan text-anchor="middle" x="50%" dy="13pt"> / __ \\</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">| / |</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">| \\___-</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">-_ </tspan>
<tspan text-anchor="middle" x="50%" dy="13pt"> --_ </tspan>
</text>
</svg>

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,3 @@
timeout 300 'swaylock'
timeout 1800 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
before-sleep 'swaylock'

View File

@ -0,0 +1,33 @@
show-failed-attempts
daemonize
image=$XDG_CONFIG_HOME/swaylock/wallpaper.svg
color=292526
bs-hl-color=00000000
caps-lock-bs-hl-color=00000000
caps-lock-key-hl-color=00000000
font=monospace
inside-color=00000000
inside-clear-color=00000000
inside-caps-lock-color=00000000
inside-ver-color=00000000
inside-wrong-color=00000000
key-hl-color=00000000
layout-bg-color=00000000
layout-border-color=00000000
layout-text-color=6185ff
line-color=00000000
line-clear-color=00000000
line-caps-lock-color=00000000
line-ver-color=00000000
line-wrong-color=00000000
ring-color=00000000
ring-clear-color=00000000
ring-caps-lock-color=00000000
ring-ver-color=00000000
ring-wrong-color=00000000
separator-color=00000000
text-color=6185ff
text-clear-color=6185ff
text-caps-lock-color=6185ff
text-ver-color=ff3e8b
text-wrong-color=ff404f

View File

@ -0,0 +1,18 @@
<svg
width="1920"
height="1080">
<text
y="33%"
xml:space="preserve"
fill="#6185ff"
font-family="monospace"
font-size="13pt">
<tspan text-anchor="middle" x="50%" dy="13pt"> _____ </tspan>
<tspan text-anchor="middle" x="50%" dy="13pt"> / __ \\</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">| / |</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">| \\___-</tspan>
<tspan text-anchor="middle" x="50%" dy="13pt">-_ </tspan>
<tspan text-anchor="middle" x="50%" dy="13pt"> --_ </tspan>
</text>
</svg>

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,8 @@
XDG_DOCUMENTS_DIR="$HOME/doc"
XDG_DOWNLOAD_DIR="$HOME/net"
XDG_DESKTOP_DIR="$HOME/net"
XDG_MUSIC_DIR="$HOME/net"
XDG_PICTURES_DIR="$HOME/net"
XDG_PUBLICSHARE_DIR="$HOME/net"
XDG_TEMPLATES_DIR="$HOME/net"
XDG_VIDEOS_DIR="$HOME/net"

View File

@ -0,0 +1,31 @@
set selection-clipboard clipboard
set completion-bg "#e3e0e1"
set completion-fg "#ff3e8b"
set completion-group-bg "#e3e0e1"
set completion-group-fg "#6185ff"
set completion-highlight-bg "#ff3e8b"
set completion-highlight-fg "#e3e0e1"
set default-fg "#e3e0e1"
set default-bg "#292526"
set inputbar-bg "#292526"
set inputbar-fg "#6185ff"
set notification-bg "#292526"
set notification-fg "#6185ff"
set notification-error-bg "#292526"
set notification-error-fg "#ff404f"
set notification-warning-bg "#292526"
set notification-warning-fg "#e06e00"
set statusbar-bg "#292526"
set statusbar-fg "#ff3e8b"
set highlight-color "#6185ff"
set highlight-fg "#00ff00" # find out what this does
set highlight-active-color "#ff3e8b"
set recolor-darkcolor "#e3e0e1"
set recolor-lightcolor "#292526"
set render-loading-bg "#292526"
set render-loading-fg "#6185ff"
set index-fg "#ff3e8b"
set index-bg "#e3e0e1"
set index-active-fg "#e3e0e1"
set index-active-bg "#ff3e8b"
set font "monospace 13"

96
.profile 100644
View File

@ -0,0 +1,96 @@
# ~/.profile
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ]; then
PATH="$HOME/.local/bin:$PATH"
fi
# xdg base directory specification
export XDG_DATA_HOME=$HOME/.local/share
export XDG_CONFIG_HOME=$HOME/.config
export XDG_STATE_HOME=$HOME/.local/state
export XDG_DATA_DIRS=/usr/local/share:/usr/share
export XDG_CONFIG_DIRS=/etc/xdg
export XDG_CACHE_HOME=$HOME/.cache
# .bash_history
export HISTFILE=$XDG_STATE_HOME/bash/history
if [ ! -d "$(dirname "${HISTFILE}")" ]; then
mkdir -p "$(dirname "${HISTFILE}")"
fi
# mysql
export MYSQL_HISTFILE=$XDG_STATE_HOME/mysql/history
if [ ! -d "$(dirname "${MYSQL_HISTFILE}")" ]; then
mkdir -p "$(dirname "${MYSQL_HISTFILE}")"
fi
# wget
export WGETRC=$XDG_CONFIG_HOME/wget/wgetrc
if [ ! -f "${WGETRC}" ]; then
mkdir -p "$(dirname "${WGETRC}")"
printf %s\\n "hsts-file = ${XDG_CACHE_HOME}/wget-hsts" >>"${WGETRC}"
fi
# readline
export INPUTRC=$XDG_CONFIG_HOME/readline/inputrc
# screen
export SCREENRC=$XDG_CONFIG_HOME/screen/screenrc
# gnupg
export GNUPGHOME=$XDG_CONFIG_HOME/gnupg
# node
export NODE_REPL_HISTORY=$XDG_DATA_HOME/node_repl_history
# npm
export npm_config_userconfig=$XDG_CONFIG_HOME/npm/npmrc
export npm_config_prefix=$XDG_DATA_HOME/npm
export npm_config_cache=$XDG_CACHE_HOME/npm
export npm_config_init_module=$XDG_DATA_HOME/npm/config/npm-init.js
# python
export PYTHONSTARTUP=$XDG_CONFIG_HOME/python/pythonrc.py
export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python
export PYTHONUSERBASE=$XDG_DATA_HOME/python
export PYTHONHISTFILE=$XDG_STATE_HOME/python/history
# tex
export TEXMFHOME=$XDG_DATA_HOME/texmf
export TEXMFVAR=$XDG_CACHE_HOME/texlive/texmf-var
export TEXMFCONFIG=$XDG_CONFIG_HOME/texlive/texmf-config
# opam
export OPAMROOT=$XDG_DATA_HOME/opam
# editor
export EDITOR=vi
# desktop
if [ "$(tty)" = "/dev/tty1" ] && command -v sway &>/dev/null; then
# locale
export LANG=sl_SI.UTF-8
export LC_MESSAGES=en_US.UTF-8
# defaults
export EDITOR=nvim
export VISUAL=nvim
export TERMINAL=footclient
export BROWSER=firefox
# run sway
export XDG_CURRENT_DESKTOP=sway
exec sway >/tmp/sway.log 2>&1
fi