Add initial configs

This commit is contained in:
2026-05-25 00:32:00 +03:00
parent 18fe98a122
commit bc1c135526
34 changed files with 1330 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
if test -z "$SSH_ENV"
set -xg SSH_ENV $HOME/.ssh/environment
end
if not __ssh_agent_is_started
__ssh_agent_start
end
@@ -0,0 +1,14 @@
# This file was created by fish when upgrading to version 4.3, to migrate
# the 'fish_key_bindings' variable from its old default scope (universal)
# to its new default scope (global). We recommend you delete this file
# and configure key bindings in ~/.config/fish/config.fish if needed.
# set --global fish_key_bindings fish_default_key_bindings
# Prior to version 4.3, fish shipped an event handler that runs
# `set --universal fish_key_bindings fish_default_key_bindings`
# whenever the fish_key_bindings variable is erased.
# This means that as long as any fish < 4.3 is still running on this system,
# we cannot complete the migration.
# As a workaround, erase the universal variable at every shell startup.
set --erase --universal fish_key_bindings
+37
View File
@@ -0,0 +1,37 @@
# This file was created by fish when upgrading to version 4.3, to migrate
# theme variables from universal to global scope.
# Don't edit this file, as it will be written by the web-config tool (`fish_config`).
# To customize your theme, delete this file and see
# help interactive#syntax-highlighting
# or
# man fish-interactive | less +/^SYNTAX.HIGHLIGHTING
# for appropriate commands to add to ~/.config/fish/config.fish instead.
# See also the release notes for fish 4.3.0 (run `help relnotes`).
set --global fish_color_autosuggestion brblack
set --global fish_color_cancel -r
set --global fish_color_command normal
set --global fish_color_comment red
set --global fish_color_cwd green
set --global fish_color_cwd_root red
set --global fish_color_end green
set --global fish_color_error brred
set --global fish_color_escape brcyan
set --global fish_color_history_current --bold
set --global fish_color_host normal
set --global fish_color_host_remote yellow
set --global fish_color_normal normal
set --global fish_color_operator brcyan
set --global fish_color_param cyan
set --global fish_color_quote yellow
set --global fish_color_redirection cyan --bold
set --global fish_color_search_match white --background=brblack
set --global fish_color_selection white --bold --background=brblack
set --global fish_color_status red
set --global fish_color_user brgreen
set --global fish_color_valid_path --underline
set --global fish_pager_color_completion normal
set --global fish_pager_color_description yellow -i
set --global fish_pager_color_prefix normal --bold --underline
set --global fish_pager_color_progress brwhite --background=cyan
set --global fish_pager_color_selected_background -r
+27
View File
@@ -0,0 +1,27 @@
if status is-interactive
# Commands to run in interactive sessions can go here
set fish_greeting
end
set -gx EDITOR nvim
set -gx MANPAGER 'nvim +Man!'
set -gx GOPATH "$HOME/go"
set PATH $PATH $HOME/.config/scripts
set PATH $PATH $HOME/go/bin
alias vim="nvim"
alias cat="bat"
alias g="git"
alias gs="git status --short"
alias gd="git diff --output-indicator-new=' ' --output-indicator-old=' '"
alias gl="git log --graph"
alias ga="git add"
alias gc="git commit"
alias gco="git checkout"
alias gp="git push"
alias gu="git pull"
+3
View File
@@ -0,0 +1,3 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:4300
@@ -0,0 +1,23 @@
function __ssh_agent_is_started -d "check if ssh agent is already started"
if test -n "$SSH_CONNECTION"
# This is an SSH session
ssh-add -l > /dev/null 2>&1
if test $status -eq 0 -o $status -eq 1
# An SSH agent was forwarded
return 0
end
end
if begin; test -f "$SSH_ENV"; and test -z "$SSH_AGENT_PID"; end
source $SSH_ENV > /dev/null
end
if test -z "$SSH_AGENT_PID"
return 1
end
ssh-add -l > /dev/null 2>&1
if test $status -eq 2
return 1
end
end
@@ -0,0 +1,5 @@
function __ssh_agent_start -d "start a new ssh agent"
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
chmod 600 $SSH_ENV
source $SSH_ENV > /dev/null
end
+30
View File
@@ -0,0 +1,30 @@
[core]
compression = 9
preloadindex = true
[advice]
addEmptyPathspec = false
pushNonFastForward = false
statusHints = false
[init]
defaultBranch = master
[status]
branch = true
showStash = true
showUntrackedFiles = all
[log]
abbrevCommit = true
[push]
autoSetupRemote = true
[diff]
context = 3
renames = copies
interHunkContext = 10
[pager]
diff = bat
+98
View File
@@ -0,0 +1,98 @@
# ----------
# Monitors
# ----------
monitor=eDP-1, 1920x1080@60.05, 0x0, 1
# ----------
# Programs
# ----------
exec-once = hyprpaper
exec-once = waybar
$terminal = kitty
$fileManager = kitty -e ranger
$menu = pgrep wofi > /dev/null 2>&1 && killall wofi || wofi --show run
# ----------
# Input
# ----------
input {
kb_layout = us,ru
kb_options = grp:win_space_toggle
touchpad {
natural_scroll = true
}
}
cursor {
no_hardware_cursors = true
}
# ----------
# Design
# ----------
animations {
enabled = false
}
general {
gaps_in = 5
gaps_out = 10
border_size = 1
resize_on_border = true
layout = dwindle
}
decoration {
rounding = 0
active_opacity = 1.0
inactive_opacity = 1.0
}
dwindle {
force_split = 2
preserve_split = true
}
misc {
force_default_wallpaper = 0
disable_hyprland_logo = true
}
# ----------
# Keybinds
# ----------
$mainMod = SUPER
bind = $mainMod, Return, exec, $terminal
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, D, exec, $menu
bind = $mainMod, Q, killactive,
bind = $mainMod SHIFT, SPACE, togglefloating,
bind = $mainMod, F, fullscreen
bind = $mainMod SHIFT, S, exec, hyprshot --mode region --output-folder ~/pictures/screenshots
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
+5
View File
@@ -0,0 +1,5 @@
wallpaper {
monitor = eDP-1
path = ~/pictures/wallpapers/forest-bridge.jpg
fit_mode = cover
}
+51
View File
@@ -0,0 +1,51 @@
# vim:ft=kitty
## name: Adwaita dark
## license: MIT
## author: Emil Löfquist (https://github.com/ewal)
## upstream: https://github.com/ewal/kitty-adwaita/blob/main/adwaita_dark.conf
## blurb: Adwaita dark - based on https://github.com/Mofiqul/adwaita.nvim
background #1d1d1d
foreground #deddda
selection_background #303030
selection_foreground #c0bfbc
url_color #1a5fb4
wayland_titlebar_color system
macos_titlebar_color system
cursor #deddda
cursor_text_color #1d1d1d
active_border_color #4f4f4f
inactive_border_color #282828
bell_border_color #ed333b
visual_bell_color none
active_tab_background #242424
active_tab_foreground #fcfcfc
inactive_tab_background #303030
inactive_tab_foreground #b0afac
tab_bar_background none
tab_bar_margin_color none
color0 #1d1d1d
color1 #ed333b
color2 #57e389
color3 #ff7800
color4 #62a0ea
color5 #9141ac
color6 #5bc8af
color7 #deddda
color8 #9a9996
color9 #f66151
color10 #8ff0a4
color11 #ffa348
color12 #99c1f1
color13 #dc8add
color14 #93ddc2
color15 #f6f5f4
+20
View File
@@ -0,0 +1,20 @@
hide_window_decorations titlebar-only
scrollback_lines 10000
enable_audio_bell no
underline_hyperlinks always
url_color #0087bd
url_style straight
font_family family="FiraCode Nerd Font Mono"
font_size 13.0
bold_font auto
italic_font auto
bold_italic_font auto
disable_ligatures always
map ctrl+shift+t new_tab_with_cwd
theme "Adwaita Dark"
include current-theme.conf
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
ESC ignore
ALT+k add sub-scale +0.02
ALT+j add sub-scale -0.02
KP3 add chapter -1
KP9 add chapter 1
WHEEL_UP add volume 5
WHEEL_DOWN add volume -5
+229
View File
@@ -0,0 +1,229 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Quality
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
profile=gpu-hq
# Hardware decoding
vo=gpu
hwdec=auto-safe
# Scaling
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=mitchell
# Deband
deband=yes
# Range 1-16. Higher = better quality but more GPU usage. >5 is redundant.
deband-iterations=1
# Range 0-4096. Deband strength.
deband-threshold=35
# Range 1-64. Range of deband. Too high may destroy details.
deband-range=20
# Range 0-4096. Inject grain to cover up bad banding, higher value needed for poor sources.
deband-grain=5
# Interpolation
interpolation=no
video-sync=display-resample
blend-subtitles=yes
# Dithering
dither-depth=auto
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Interface
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Force starting with centered window
geometry=50%:50%
# Restrict window's size
autofit-larger=75%
# Make window at least this size
autofit-smaller=50%
# Always open window (maximum GUI)
force-window=immediate
# Disable window border
border=no
# Disable progress indicator in the taskbar
taskbar-progress=no
# Window title
title='${filename} - mpv'
# Don't close the player + don't advance to the next file on finish
keep-open=always
# Don't pause on finish
keep-open-pause=no
# Reset some settings on next file
reset-on-next-file=pause
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# OSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Custom status message
osd-status-msg='${time-pos} / ${duration}${?percent-pos: (${percent-pos}%)}\n${?chapter:Chapter: ${chapter}} (${chapter-list/count})'
# Show ms in the console
osd-fractions
# Status message font
osd-font="Gordita Medium"
osd-font-size=30
osd-color="#ffffff"
osd-border-size=2.0
osd-border-color="#262626"
# Interval of the osd disappearing (ms)
osd-duration=500
# Don't scale OSD according to the window size
osd-scale-by-window=no
# Don't show the bar
no-osd-bar
# Less annoying OSD bar on seeking
osd-on-seek=msg-bar
# Hide the cursor in 500 ms
cursor-autohide=500
# Prepend module name to log messages
msg-module
# Color log messages on terminal
msg-color
# Display a progress bar on the terminal
term-osd-bar
# Disable not important log messages
msg-level=input=error,demux=error
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Language
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Audio priority
alang=Japanese,jap,jpn,jp,ja,English,en,eng,Russian,rus,ru
# Subtitles priority
slang=English,eng,en,Russian,rus,ru
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Audio
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Volume
volume=100
volume-max=100
# Correct pitch when changing the playback speed
audio-pitch-correction=yes
# Load external audio tracks automatically
audio-file-auto=fuzzy
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Subtitles
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Load external subtitle tracks automatically
sub-auto=fuzzy
sub-file-paths=Sub;Subs;Subtitles
# Subtitles encoding
# sub-codepage=cp1251
# Forces showing subtitles while seeking through the video
demuxer-mkv-subtitle-preroll=yes
# Backward compatibility for vsfilter fansubs
sub-ass-vsfilter-blur-compat=yes
# Fixes subtitle timing for gaps smaller than 210ms (works with PGS subtitles)
sub-fix-timing=yes
# ASS subtitles override
sub-ass-force-margins=yes
sub-ass-force-style=kerning=yes
sub-ass-override=force
# Disable ligatures
sub-ass-shaper=simple
# Subtitles style
sub-font="Verdana"
sub-font-size=36
sub-color="#E6FFFFFF"
sub-border-size = 2.5
sub-border-color="#D21C1C1C"
sub-margin-x=100
sub-margin-y=50
sub-shadow-color=0.0/0.0/0.0/0.25
sub-shadow-offset=0
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Screenshots
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Output format
screenshot-format=png
# Better quality
screenshot-high-bit-depth=yes
screenshot-tag-colorspace=yes
# Compression of PNG pictures (1-9)
screenshot-png-compression=5
# Output directory
screenshot-directory="~/Pictures/Screenshots"
# Name format to save the screenshots
screenshot-template="%f-%wH.%wM.%wS.%wT-#%#00n"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Streaming
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[protocol.http]
# Display media title instead of the URL
title='${media-title}'
osd-playing-msg='${media-title}'
# Cache
demuxer-max-bytes=150000000 # 150 MB
demuxer-max-back-bytes=75000000 # 75 MB
demuxer-seekable-cache=yes
force-seekable=yes
# youtube-dl default format
ytdl-format=((bestvideo[vcodec=vp9][height<=?1080]/bestvideo)+(bestaudio[acodec=opus]/bestaudio))/best
# UA (the most common chrome)
user-agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
# Automatically advance in the playlist
keep-open=yes
# Turn off dither and deband
dither=no
deband=no
[protocol.https]
profile=protocol.http
[protocol.ytdl]
profile=protocol.http
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# File-specific
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WebMs
[extension.webm]
loop-file=yes
# Animated gif
[extension.gif]
loop-file=yes
# Audio files
[extension.mp3]
autofit-larger=30%
script-opts=osc-layout=box,osc-visibility=always,osc-scalewindowed=2
keep-open=yes
[extension.flac]
profile=extension.mp3
[extension.opus]
profile=extension.mp3
[extension.m4a]
profile=extension.mp3
+4
View File
@@ -0,0 +1,4 @@
disabled=no
images=no
videos=yes
audio=yes
+9
View File
@@ -0,0 +1,9 @@
layout=bottombar
title=${media-title}
hidetimeout=500
fadeduration=0
vidscale=no
# Show OSC only when hovered directly
deadzonesize=1
minmousemove=1
+2
View File
@@ -0,0 +1,2 @@
duration=2
font_size=7
+155
View File
@@ -0,0 +1,155 @@
-- This script adds control to the dynamic range compression ffmpeg
-- filter including key bindings for adjusting parameters.
--
-- See https://ffmpeg.org/ffmpeg-filters.html#acompressor for explanation
-- of the parameteres.
local mp = require 'mp'
local options = require 'mp.options'
local o = {
default_enable = false,
show_osd = true,
osd_timeout = 4000,
filter_label = mp.get_script_name(),
key_toggle = 'n',
key_increase_threshold = 'F1',
key_decrease_threshold = 'Shift+F1',
key_increase_ratio = 'F2',
key_decrease_ratio = 'Shift+F2',
key_increase_knee = 'F3',
key_decrease_knee = 'Shift+F3',
key_increase_makeup = 'F4',
key_decrease_makeup = 'Shift+F4',
key_increase_attack = 'F5',
key_decrease_attack = 'Shift+F5',
key_increase_release = 'F6',
key_decrease_release = 'Shift+F6',
default_threshold = -25.0,
default_ratio = 3.0,
default_knee = 2.0,
default_makeup = 8.0,
default_attack = 20.0,
default_release = 250.0,
step_threshold = -2.5,
step_ratio = 1.0,
step_knee = 1.0,
step_makeup = 1.0,
step_attack = 10.0,
step_release = 10.0,
}
options.read_options(o)
local params = {
{ name = 'attack', min=0.01, max=2000, hide_default=true, dB='' },
{ name = 'release', min=0.01, max=9000, hide_default=true, dB='' },
{ name = 'threshold', min= -30, max= 0, hide_default=false, dB='dB' },
{ name = 'ratio', min= 1, max= 20, hide_default=false, dB='' },
{ name = 'knee', min= 1, max= 10, hide_default=true, dB='dB' },
{ name = 'makeup', min= 0, max= 24, hide_default=false, dB='dB' },
}
local function parse_value(value)
-- Using nil here because tonumber differs between lua 5.1 and 5.2 when parsing fractions in combination with explicit base argument set to 10.
-- And we can't omit it because gsub returns 2 values which would get unpacked and cause more problems. Gotta love scripting languages.
return tonumber(value:gsub('dB$', ''), nil)
end
local function format_value(value, dB)
return string.format('%g%s', value, dB)
end
local function show_osd(filter)
if not o.show_osd then
return
end
if not filter.enabled then
mp.commandv('show-text', 'Dynamic range compressor: disabled', o.osd_timeout)
return
end
local pretty = {}
for _,param in ipairs(params) do
local value = parse_value(filter.params[param.name])
if not (param.hide_default and value == o['default_' .. param.name]) then
pretty[#pretty+1] = string.format('%s: %g%s', param.name:gsub("^%l", string.upper), value, param.dB)
end
end
if #pretty == 0 then
pretty = ''
else
pretty = '\n(' .. table.concat(pretty, ', ') .. ')'
end
mp.commandv('show-text', 'Dynamic range compressor: enabled' .. pretty, o.osd_timeout)
end
local function get_filter()
local af = mp.get_property_native('af', {})
for i = 1, #af do
if af[i].label == o.filter_label then
return af, i
end
end
af[#af+1] = {
name = 'acompressor',
label = o.filter_label,
enabled = false,
params = {},
}
for _,param in pairs(params) do
af[#af].params[param.name] = format_value(o['default_' .. param.name], param.dB)
end
return af, #af
end
local function toggle_acompressor()
local af, i = get_filter()
af[i].enabled = not af[i].enabled
mp.set_property_native('af', af)
show_osd(af[i])
end
local function update_param(name, increment)
for _,param in pairs(params) do
if param.name == string.lower(name) then
local af, i = get_filter()
local value = parse_value(af[i].params[param.name])
value = math.max(param.min, math.min(value + increment, param.max))
af[i].params[param.name] = format_value(value, param.dB)
af[i].enabled = true
mp.set_property_native('af', af)
show_osd(af[i])
return
end
end
mp.msg.error('Unknown parameter "' .. name .. '"')
end
mp.add_key_binding(o.key_toggle, "toggle-acompressor", toggle_acompressor)
mp.register_script_message('update-param', update_param)
for _,param in pairs(params) do
for direction,step in pairs({increase=1, decrease=-1}) do
mp.add_key_binding(o['key_' .. direction .. '_' .. param.name],
'acompressor-' .. direction .. '-' .. param.name,
function() update_param(param.name, step*o['step_' .. param.name]); end,
{ repeatable = true })
end
end
if o.default_enable then
local af, i = get_filter()
af[i].enabled = true
mp.set_property_native('af', af)
end
+220
View File
@@ -0,0 +1,220 @@
-- This script automatically loads playlist entries before and after the
-- the currently played file. It does so by scanning the directory a file is
-- located in when starting playback. It sorts the directory entries
-- alphabetically, and adds entries before and after the current file to
-- the internal playlist. (It stops if it would add an already existing
-- playlist entry at the same position - this makes it "stable".)
-- Add at most 5000 * 2 files when starting a file (before + after).
--[[
To configure this script use file autoload.conf in directory script-opts (the "script-opts"
directory must be in the mpv configuration directory, typically ~/.config/mpv/).
Example configuration would be:
disabled=no
images=no
videos=yes
audio=yes
--]]
MAXENTRIES = 5000
local msg = require 'mp.msg'
local options = require 'mp.options'
local utils = require 'mp.utils'
o = {
disabled = false,
images = true,
videos = true,
audio = true
}
options.read_options(o)
function Set (t)
local set = {}
for _, v in pairs(t) do set[v] = true end
return set
end
function SetUnion (a,b)
local res = {}
for k in pairs(a) do res[k] = true end
for k in pairs(b) do res[k] = true end
return res
end
EXTENSIONS_VIDEO = Set {
'mkv', 'avi', 'mp4', 'ogv', 'webm', 'rmvb', 'flv', 'wmv', 'mpeg', 'mpg', 'm4v', '3gp'
}
EXTENSIONS_AUDIO = Set {
'mp3', 'wav', 'ogm', 'flac', 'm4a', 'wma', 'ogg', 'opus'
}
EXTENSIONS_IMAGES = Set {
'jpg', 'jpeg', 'png', 'tif', 'tiff', 'gif', 'webp', 'svg', 'bmp'
}
EXTENSIONS = Set {}
if o.videos then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_VIDEO) end
if o.audio then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_AUDIO) end
if o.images then EXTENSIONS = SetUnion(EXTENSIONS, EXTENSIONS_IMAGES) end
function add_files_at(index, files)
index = index - 1
local oldcount = mp.get_property_number("playlist-count", 1)
for i = 1, #files do
mp.commandv("loadfile", files[i], "append")
mp.commandv("playlist-move", oldcount + i - 1, index + i - 1)
end
end
function get_extension(path)
match = string.match(path, "%.([^%.]+)$" )
if match == nil then
return "nomatch"
else
return match
end
end
table.filter = function(t, iter)
for i = #t, 1, -1 do
if not iter(t[i]) then
table.remove(t, i)
end
end
end
-- splitbynum and alnumcomp from alphanum.lua (C) Andre Bogus
-- Released under the MIT License
-- http://www.davekoelle.com/files/alphanum.lua
-- split a string into a table of number and string values
function splitbynum(s)
local result = {}
for x, y in (s or ""):gmatch("(%d*)(%D*)") do
if x ~= "" then table.insert(result, tonumber(x)) end
if y ~= "" then table.insert(result, y) end
end
return result
end
function clean_key(k)
k = (' '..k..' '):gsub("%s+", " "):sub(2, -2):lower()
return splitbynum(k)
end
-- compare two strings
function alnumcomp(x, y)
local xt, yt = clean_key(x), clean_key(y)
for i = 1, math.min(#xt, #yt) do
local xe, ye = xt[i], yt[i]
if type(xe) == "string" then ye = tostring(ye)
elseif type(ye) == "string" then xe = tostring(xe) end
if xe ~= ye then return xe < ye end
end
return #xt < #yt
end
local autoloaded = nil
function find_and_add_entries()
local path = mp.get_property("path", "")
local dir, filename = utils.split_path(path)
msg.trace(("dir: %s, filename: %s"):format(dir, filename))
if o.disabled then
msg.verbose("stopping: autoload disabled")
return
elseif #dir == 0 then
msg.verbose("stopping: not a local path")
return
end
local pl_count = mp.get_property_number("playlist-count", 1)
-- check if this is a manually made playlist
if (pl_count > 1 and autoloaded == nil) or
(pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
msg.verbose("stopping: manually made playlist")
return
else
autoloaded = true
end
local pl = mp.get_property_native("playlist", {})
local pl_current = mp.get_property_number("playlist-pos-1", 1)
msg.trace(("playlist-pos-1: %s, playlist: %s"):format(pl_current,
utils.to_string(pl)))
local files = utils.readdir(dir, "files")
if files == nil then
msg.verbose("no other files in directory")
return
end
table.filter(files, function (v, k)
if string.match(v, "^%.") then
return false
end
local ext = get_extension(v)
if ext == nil then
return false
end
return EXTENSIONS[string.lower(ext)]
end)
table.sort(files, alnumcomp)
if dir == "." then
dir = ""
end
-- Find the current pl entry (dir+"/"+filename) in the sorted dir list
local current
for i = 1, #files do
if files[i] == filename then
current = i
break
end
end
if current == nil then
return
end
msg.trace("current file position in files: "..current)
local append = {[-1] = {}, [1] = {}}
for direction = -1, 1, 2 do -- 2 iterations, with direction = -1 and +1
for i = 1, MAXENTRIES do
local file = files[current + i * direction]
local pl_e = pl[pl_current + i * direction]
if file == nil or file[1] == "." then
break
end
local filepath = dir .. file
if pl_e then
-- If there's a playlist entry, and it's the same file, stop.
msg.trace(pl_e.filename.." == "..filepath.." ?")
if pl_e.filename == filepath then
break
end
end
if direction == -1 then
if pl_current == 1 then -- never add additional entries in the middle
msg.info("Prepending " .. file)
table.insert(append[-1], 1, filepath)
end
else
msg.info("Adding " .. file)
table.insert(append[1], filepath)
end
end
end
add_files_at(pl_current + 1, append[1])
add_files_at(pl_current, append[-1])
end
mp.register_event("start-file", find_and_add_entries)
@@ -0,0 +1,3 @@
mp.add_hook('on_load', 10, function ()
mp.set_property('sub-file-paths', 'Subs/' .. mp.get_property('filename/no-ext'))
end)
+1
View File
@@ -0,0 +1 @@
/plugin
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.expandtab = false
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
vim.opt_local.colorcolumn = '80'
+30
View File
@@ -0,0 +1,30 @@
local function keymap()
if vim.o.iminsert == 1 then
return 'RU'
else
return ''
end
end
local function fileinfo()
return string.format('%s[%s]', vim.bo.fileencoding, vim.bo.fileformat)
end
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'edge',
component_separators = { left = '|', right = '|' },
section_separators = {},
globalstatus = true,
},
sections = {
lualine_a = { 'mode', keymap },
lualine_b = { 'FugitiveHead' },
lualine_c = { 'filename' },
lualine_x = { 'filetype', fileinfo },
lualine_y = { 'progress' },
lualine_z = { 'location' },
},
extensions = { 'quickfix', 'fugitive' },
}
+34
View File
@@ -0,0 +1,34 @@
local telescope = require('telescope')
local actions = require('telescope.actions')
telescope.setup({
defaults = {
layout_config = {
prompt_position = 'bottom',
horizontal = {
width_padding = 0.04,
height_padding = 0.1,
preview_width = 0.6,
},
vertical = {
width_padding = 0.05,
height_padding = 1,
preview_height = 0.5,
},
},
mappings = {
i = {
['<C-x>'] = false,
['<C-s>'] = actions.select_horizontal,
},
},
},
})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', builtin.git_files)
vim.keymap.set('n', '<leader>ff', builtin.find_files)
vim.keymap.set('n', '<leader>fg', builtin.live_grep)
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
+3
View File
@@ -0,0 +1,3 @@
require('config.plugins')
require('config.set')
require('config.remap')
+73
View File
@@ -0,0 +1,73 @@
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd.packadd 'packer.nvim'
end
require('packer').startup(function(use)
use('wbthomason/packer.nvim')
-- Appearance
use {
'sainnhe/edge',
config = function()
vim.g.edge_transparent_background = 2
vim.g.edge_better_performance = 1
vim.g.edge_enable_italic = false
vim.cmd.colorscheme 'edge'
end,
}
use('nvim-tree/nvim-web-devicons')
use('hoob3rt/lualine.nvim')
-- File navigation
use {
'nvim-telescope/telescope.nvim',
requires = {
'nvim-lua/plenary.nvim',
'nvim-lua/popup.nvim',
},
}
use {
'stevearc/oil.nvim',
config = function()
require('oil').setup({ view_options = { show_hidden = true } })
vim.keymap.set('n', '-', ':Oil<CR>')
end
}
-- Editing
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup({ ignore = '^$' })
end,
}
use('tpope/vim-surround')
use('tpope/vim-repeat')
use {
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function()
require('nvim-autopairs').setup()
end,
}
-- Miscellaneous
use('tpope/vim-fugitive')
use {
'nathom/filetype.nvim',
setup = function()
vim.g.did_load_filetypes = 1
end,
}
if packer_bootstrap then
require('packer').sync()
end
end)
if vim.fn.exists('g:loaded_matchit') == 0 then
vim.cmd('runtime! macros/matchit.vim')
end
+31
View File
@@ -0,0 +1,31 @@
vim.g.mapleader = ' '
vim.keymap.set('n', 'Q', '<nop>')
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-l>', '<C-w>l')
vim.keymap.set('n', '<Right>', ':vertical resize +2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Left>', ':vertical resize -2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Up>', ':resize +2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<Down>', ':resize -2<CR>', { noremap = true, silent = true })
vim.keymap.set('n', 'n', 'nzzzv')
vim.keymap.set('n', 'N', 'Nzzzv')
vim.keymap.set('n', '<C-d>', '<C-d>zz')
vim.keymap.set('n', '<C-u>', '<C-u>zz')
vim.keymap.set('n', 'J', 'v:count ? \'J\' : \'mzJ`z\'', { expr = true })
vim.keymap.set('n', '<leader>y', '\"+y')
vim.keymap.set('v', '<leader>y', '\"+y')
vim.cmd [[
function! Sort(type, ...)
'[,']sort
endfunction
nnoremap <silent> gs :set opfunc=Sort<CR>g@
]]
vim.keymap.set('i', '<C-j>', '<C-^>')
+44
View File
@@ -0,0 +1,44 @@
vim.opt.updatetime = 50
vim.opt.lazyredraw = true
vim.opt.swapfile = false
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.background = 'dark'
vim.opt.termguicolors = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.cursorline = true
vim.opt.winborder = 'rounded'
vim.opt.smartindent = true
vim.opt.copyindent = true
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = -1
vim.opt.shiftround = true
vim.opt.wrap = false
vim.opt.scrolloff = 5
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.cmdheight = 2
vim.opt.showmode = false
vim.opt.confirm = true
vim.opt.wildmode = 'longest,list,full'
vim.opt.wildignorecase = true
vim.opt.completeopt = 'menuone,noselect'
vim.opt.shortmess:append('c')
vim.opt.diffopt:append('internal,algorithm:patience')
vim.opt.keymap = 'russian-jcukenwin'
vim.opt.spelllang = 'en_us,ru_yo'
vim.opt.iminsert = 0
+1
View File
@@ -0,0 +1 @@
set show_hidden true
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
set -o errexit
update_system() {
print_header "updating system..."
sudo pacman -Syu
echo
}
clear_pacman_cache() {
print_header "clearing pacman cache..."
PACMAN_CACHE_SPACE="$(du -sh /var/cache/pacman/pkg/)"
paccache -vrk2
paccache -ruk0
echo "pacman cache cleared, reclaimed $PACMAN_CACHE_SPACE"
echo
}
remove_orphaned_packages() {
print_header "removing orphaned packages..."
ORPHANED=$(pacman -Qdtq)
if [ -n "$ORPHANED" ]; then
echo "$ORPHANED" | sudo pacman -Rns -
ORPHANED_COUNT=$(echo "$ORPHANED" | wc -l)
echo "removed $ORPHANED_COUNT orphaned packages"
else
echo "no orphaned packages found"
fi
echo
}
clear_local_cache() {
print_header "clearing local cache..."
LOCAL_CACHE_SPACE="$(du -sh ~/.cache)"
rm -rf ~/.cache/
echo "local cache cleard, reclaimed $LOCAL_CACHE_SPACE"
echo
}
clear_system_logs() {
print_header "clearing system logs..."
sudo journalctl --vacuum-time=7d
echo
}
print_header() {
GREEN='\033[0;32m'
NC='\033[0m'
echo -e "${GREEN}${1}${NC}"
}
update_system
clear_pacman_cache
remove_orphaned_packages
clear_local_cache
clear_system_logs
+12
View File
@@ -0,0 +1,12 @@
show=drun
show_all=true
location=center
insensitive=false
allow_markup=true
allow_images=true
line_wrap=word
lines=8
width=500
no_actions=true
prompt= Search
hide_scroll=true
+84
View File
@@ -0,0 +1,84 @@
*
{
font-family: Maple Mono;
background: transparent;
color: #d8cab8;
}
#window
{
color: #d8cab8;
border-color: #d8cab8;
border-style: solid;
border-width: 1px;
background-image: linear-gradient(to bottom, #141216 100%);
border-radius: 14px;
}
#scroll
{
border-top-style: solid;
border-width: 1px;
border-color: #d8cab8;
}
#inner-box
{
padding-top: 12px;
}
#entry
{
border-style: none;
border-color: #d8cab8;
color: #d8cab8;
padding: 6px;
margin-bottom: 8px;
margin-left: 12px;
margin-right: 12;
border-radius: 12px;
}
#entry:selected
{
background: #27232b;
color: #d8cab8;
font-weight: bold;
outline: none;
}
#input
{
background-color: #141216;
color: #d8cab8;
border-color: #d8cab8;
border-style: none;
border-bottom-style: solid;
border-width: 1px;
font-style: normal;
border-radius: 8;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
padding: 12px;
margin: 8px;
}
#input:focus
{
background: #27232b;
background-color: #27232b;
border-color: #ac82e9;
font-style: italic;
}
#img
{
padding: 4px;
margin-right: 6px;
}