Compare commits

..

5 Commits

5 changed files with 51 additions and 17 deletions

View File

@ -0,0 +1,30 @@
-- mpv script to mark videos
local utils = require 'mp.utils'
local marked_videos = {}
local marked_file = "marked"
function toggle_mark()
local path = mp.get_property("path")
if marked_videos[path] then
marked_videos[path] = nil
mp.osd_message("Unmarked: " .. path)
else
marked_videos[path] = true
mp.osd_message("Marked: " .. path)
end
end
function save_marks()
-- Do not write anything if "marked_videos" is empty
if next(marked_videos) == nil then
return
end
local file = io.open(marked_file, "a")
for path, _ in pairs(marked_videos) do
file:write(path .. "\n")
end
file:close()
end
mp.add_key_binding("M", "toggle_mark", toggle_mark)
mp.register_event("shutdown", save_marks)

View File

@ -1,4 +1,5 @@
let mapleader ="," let mapleader =","
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..." echo "Downloading junegunn/vim-plug to manage plugins..."
@ -7,6 +8,8 @@ if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autolo
autocmd VimEnter * PlugInstall autocmd VimEnter * PlugInstall
endif endif
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree' Plug 'preservim/nerdtree'
@ -28,10 +31,11 @@ Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript' Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte', {'branch': 'main'} Plug 'evanleck/vim-svelte', {'branch': 'main'}
Plug 'github/copilot.vim', Plug 'github/copilot.vim',
Plug 'dmadisetti/AirLatex.vim', {'branch': 'main'}
Plug 'nathangrigg/vim-beancount' Plug 'nathangrigg/vim-beancount'
call plug#end() call plug#end()
let g:vimwiki_list = [{'path': '~/dox/notes/', 'index': 'Main'}]
set title set title
set bg=light set bg=light
set go=a set go=a
@ -124,7 +128,7 @@ let g:jukit_convert_open_default = -1
let g:jukit_hist_use_ueberzug = 0 let g:jukit_hist_use_ueberzug = 0
" - Set to 1 to use Überzug to display saved outputs instead of an ipython split window " - Set to 1 to use Überzug to display saved outputs instead of an ipython split window
let g:jukit_ueberzug_use_cached = 0 let g:jukit_ueberzug_use_cached = 1
" - Whether to cache created images of saved outputs. If set to 0, will convert saved outputs to png from scratch each time. Note that this will make displaying saved outputs significantly slower. " - Whether to cache created images of saved outputs. If set to 0, will convert saved outputs to png from scratch each time. Note that this will make displaying saved outputs significantly slower.
let g:jukit_ueberzug_pos = [0.25, 0.25, 0.4, 0.6] let g:jukit_ueberzug_pos = [0.25, 0.25, 0.4, 0.6]
" - position and dimension of Überzug window WITH output split present - [x, y, width, height]. Use `:call jukit#ueberzug#set_default_pos()` to modify/visualize. " - position and dimension of Überzug window WITH output split present - [x, y, width, height]. Use `:call jukit#ueberzug#set_default_pos()` to modify/visualize.
@ -145,7 +149,7 @@ let g:jukit_ueberzug_jupyter_cmd = 'jupyter'
" - path to jupyter executable. By default it just uses the jupyter command found in your environment. If you started an output split in a virtual environment, make sure that you either have jupyter installed in that environment or set the absolute path to the python3 command. " - path to jupyter executable. By default it just uses the jupyter command found in your environment. If you started an output split in a virtual environment, make sure that you either have jupyter installed in that environment or set the absolute path to the python3 command.
let g:jukit_ueberzug_cutycapt_cmd = 'CutyCapt' let g:jukit_ueberzug_cutycapt_cmd = 'CutyCapt'
" - path to cutycapt executable " - path to cutycapt executable
let g:jukit_ueberzug_imagemagick_cmd = 'convert' let g:jukit_ueberzug_imagemagick_cmd = 'magick'
" - path to imagemagick (`convert` command) executable " - path to imagemagick (`convert` command) executable
" Nerd tree " Nerd tree
@ -166,12 +170,6 @@ let R_start_libs = 'base,stats,graphics,grDevices,utils,methods'
let R_hl_term = 0 let R_hl_term = 0
" let Rout_more_colors = 1 " let Rout_more_colors = 1
" AirLatex
" your login-name
" let g:AirLatexCookieDB="~/.mozilla/firefox/do0jepvp.default-release/cookies.sqlite"
let g:AirLatexCookie="cookies:overleaf2_session=s%3AtveT0u3Xn8VXTJmkUuSpO2p1o5SLGNYI.ARSAQd4K%2FO7L5ilui54Ht7voJWjD%2BxctQ1ngTRrlo6A"
" let g:AirLatexUsername="cookies:overleaf_session2=s%3AMANcnaAAj4VeIgXsNIiCINZ0QgwtYNzn.9x0PVRqOp8egbGYpnIHuffJUxmH%2F%2F2W%2FFnTBPmDny1M"
"This allows for change paste motion cp{motion} "This allows for change paste motion cp{motion}
nmap <silent> cp :set opfunc=ChangePaste<CR>g@ nmap <silent> cp :set opfunc=ChangePaste<CR>g@
function! ChangePaste(type, ...) function! ChangePaste(type, ...)
@ -179,11 +177,6 @@ function! ChangePaste(type, ...)
silent exe "normal! p" silent exe "normal! p"
endfunction endfunction
" optional: set server name
let g:AirLatexDomain="www.overleaf.com"
let g:AirLatexAllowInsecure=0
" vimtex: " vimtex:
let g:vimtex_view_method = 'zathura' let g:vimtex_view_method = 'zathura'
let g:vimtex_compiler_latexmk = { 'build_dir' : '', let g:vimtex_compiler_latexmk = { 'build_dir' : '',

View File

@ -7,13 +7,13 @@ formatter = jinja2
# Format folder & file in format <year>-<last_name_first_author>-<paper_title> # Format folder & file in format <year>-<last_name_first_author>-<paper_title>
add-file-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }} add-file-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
add-folder-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }} add-folder-name = {{ doc.year }}-{{ (doc.author_list[0].family if doc.author_list else "AUTHOR_MISSING") }}-{{ ' '.join(doc.title.split()[:10]) }}
ref-format = {{doc.author_listp[0].family if doc.author_list else "AUTHOR MISSING"}}{{doc.year}}{{doc.title[:15]}} ref-format = {{doc.author_list[0].family if doc.author_list else "AUTHOR MISSING"}}{{doc.year}}{{doc.title.title().translate(None, ' -')[:15]}}
# Defaults simply converted to jinja2 # Defaults simply converted to jinja2
header-format = <ansired>{{doc.html_escape.title}}</ansired>\n <ansigreen>{{doc.html_escape.author}}</ansigreen>\n <ansiblue>({{doc.html_escape.year}})</ansiblue> [<ansiyellow>{{doc.html_escape.tags}}</ansiyellow>] header-format = <ansired>{{doc.html_escape.title}}</ansired>\n <ansigreen>{{doc.html_escape.author}}</ansigreen>\n <ansiblue>({{doc.html_escape.year}})</ansiblue> [<ansiyellow>{{doc.html_escape.tags}}</ansiyellow>]
match-format = {{doc.tags}}{{doc.subfolder}}{{doc.title}}{{doc.author}}{{doc.year}} match-format = {{doc.tags}}{{doc.subfolder}}{{doc.title}}{{doc.author}}{{doc.year}}
document-description-format = {{doc.title}} - {{doc.author}} document-description-format = {{doc.title}} - {{doc.author}}
multiple-authors-format = {au[family]}, {au[given]} multiple-authors-format = {{au.family}}, {{au.given}}
browse-query-format = {{doc.title}} {{doc.author}} browse-query-format = {{doc.title}} {{doc.author}}
notes-name = notes.md notes-name = notes.md

View File

@ -101,7 +101,7 @@ fade-out-step = 0.03;
# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) # Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0)
# inactive-opacity = 1 # inactive-opacity = 1
inactive-opacity = 0.8; inactive-opacity = 1.0;
# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) # Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default)
# frame-opacity = 1.0 # frame-opacity = 1.0

View File

@ -14,6 +14,17 @@ if echo "$1" | grep -qE 'youtube.*list'; then
sed 's/^/https:\/\/www.youtube.com\/watch?v=/' | sed 's/^/https:\/\/www.youtube.com\/watch?v=/' |
xargs mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' || xargs mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' ||
notify-send "startmpv" "An error has occured with playlist $playlist_id" notify-send "startmpv" "An error has occured with playlist $playlist_id"
elif echo "$1" | grep -qE 'rumble.com'; then
notify-send "startmpv" "Rumble videos are not supported by mpv, first ripping, then playing..."
(
cd /tmp
yt-dlp "$1" &
# get the filename of the downloaded video
filename="$(yt-dlp -e "$1")"
sleep 5
mpv /tmp/$filename*part
rm /tmp/$filename*part
)
else else
mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1" mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1"
fi fi