Compare commits
86
Commits
fb623dd26b
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
273e83051c | ||
|
|
76cafd8bc7 | ||
|
|
a7c4dc8407 | ||
|
|
42c44aec68 | ||
|
|
2fd2d691fd | ||
|
|
96d3086885 | ||
|
|
699473d7b5 | ||
|
|
a5686ccee0 | ||
|
|
dcb2b320eb | ||
|
|
dc10b3dfb3 | ||
|
|
79036dce2c | ||
|
|
2dcbd80842 | ||
|
|
e5fb57c279 | ||
|
|
14c53abbf3 | ||
|
|
23718c9477 | ||
|
|
f308f2fe75 | ||
|
|
a945adae10 | ||
|
|
6c156422be | ||
|
|
897bc92c94 | ||
|
|
aa96285da3 | ||
|
|
b9959d2c6f | ||
|
|
b7fccc80db | ||
|
|
7efc69cc34 | ||
|
|
93c1b94387 | ||
|
|
f222bd9b8f | ||
|
|
24979c1872 | ||
|
|
0050404bd9 | ||
|
|
d9375906f0 | ||
|
|
505734efa7 | ||
|
|
a4afa92102 | ||
|
|
e25799c2a1 | ||
|
|
1ac2a8be73 | ||
|
|
6433bb1a07 | ||
|
|
94ddccdf87 | ||
|
|
aae3258c5a | ||
|
|
850248e3f5 | ||
|
|
719d1e09f6 | ||
|
|
551993863a | ||
|
|
bcadb46269 | ||
|
|
1d7fe2bd1c | ||
|
|
695ff3c445 | ||
|
|
70fc63237e | ||
|
|
b2f77ac50a | ||
|
|
5bd080b9f2 | ||
|
|
42c9eca457 | ||
|
|
a09d7b7492 | ||
|
|
72799bf294 | ||
|
|
6d1617b41d | ||
|
|
1b3ff2ad98 | ||
|
|
b9c1ab8ead | ||
|
|
f148347f3c | ||
|
|
47e7f07201 | ||
|
|
09966d3ae6 | ||
|
|
4a8e5bc3fa | ||
|
|
2199599f58 | ||
|
|
03324d92c8 | ||
|
|
0048525dd7 | ||
|
|
053142e4bd | ||
|
|
8d5cd15b5b | ||
|
|
62c7fe82ab | ||
|
|
b148ac001b | ||
|
|
3b16e12acb | ||
|
|
e5fe648676 | ||
|
|
e2bfb0798c | ||
|
|
e02df5fe7c | ||
|
|
d90cf27df2 | ||
|
|
9e391c6aed | ||
|
|
bf968fbedc | ||
|
|
e3c16f0ede | ||
|
|
335fc89219 | ||
|
|
9435d90b0c | ||
|
|
40e646695c | ||
|
|
b2900f607e | ||
|
|
eb1937c691 | ||
|
|
7b59554e7c | ||
|
|
891df806ae | ||
|
|
a4a1cb0242 | ||
|
|
fc00db05bf | ||
|
|
6f6a59457c | ||
|
|
e721a014b6 | ||
|
|
9602ddf9f8 | ||
|
|
465c107a89 | ||
|
|
4a119c9fe9 | ||
|
|
74ce4577e1 | ||
|
|
54e0dbd116 | ||
|
|
228f20862a |
-13
@@ -1,13 +0,0 @@
|
||||
[submodule "nord-tmux"]
|
||||
path = tmux/.tmux/plugins/nord-tmux
|
||||
url = https://git::@github.com/arcticicestudio/nord-tmux
|
||||
fetch = +refs/heads/develop:refs/remotes/origin/develop
|
||||
[submodule "tmux-sensible"]
|
||||
path = tmux/.tmux/plugins/tmux-sensible
|
||||
url = https://git::@github.com/tmux-plugins/tmux-sensible
|
||||
fetch = +refs/heads/master:refs/remotes/origin/master
|
||||
[submodule "tpm"]
|
||||
path = tmux/.tmux/plugins/tpm
|
||||
url = https://github.com/tmux-plugins/tpm
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# Setup after pulling (Arch)
|
||||
|
||||
Everything needed to bring the Cursor Dark theme up on a machine that has just
|
||||
pulled these changes.
|
||||
|
||||
## 1. Packages
|
||||
|
||||
```sh
|
||||
sudo pacman -S --needed papirus-icon-theme ttf-nerd-fonts-symbols-mono
|
||||
```
|
||||
|
||||
| Package | Why |
|
||||
| --- | --- |
|
||||
| `papirus-icon-theme` | rofi, dunst and the GTK configs all reference `Papirus-Dark` |
|
||||
| `ttf-nerd-fonts-symbols-mono` | the tmux status bar uses powerline separators (U+E0B0–E0B3), and `kitty.conf` maps that range to `Symbols Nerd Font Mono` |
|
||||
|
||||
Not in the repos: **Berkeley Mono** (`kitty.conf`) and **Hack JBM Ligatured**
|
||||
(waybar, rofi, hyprlock) are installed by hand.
|
||||
|
||||
## 2. Deploy
|
||||
|
||||
```sh
|
||||
cd ~/.dotfiles
|
||||
stow fish kitty tmux nvim hypr waybar rofi dunst gtktheme
|
||||
```
|
||||
|
||||
> The README suggests `stow *`, which now also picks up `SETUP.md`.
|
||||
> Use `stow */` or an explicit list.
|
||||
|
||||
## 3. Reload
|
||||
|
||||
```sh
|
||||
# fish - close every running fish session BEFORE pulling (see notes)
|
||||
exec fish
|
||||
|
||||
# tmux - plugins now bootstrap themselves, no prefix+I needed
|
||||
tmux kill-server && tmux
|
||||
|
||||
# nvim - installs vscode.nvim, drops everforest
|
||||
nvim --headless "+Lazy! sync" +qa
|
||||
|
||||
# desktop
|
||||
hyprctl reload
|
||||
killall -SIGUSR2 waybar
|
||||
killall dunst # respawns via dbus
|
||||
```
|
||||
|
||||
kitty: `ctrl+shift+F5` to reload, or restart it. rofi has no daemon.
|
||||
|
||||
## 4. GTK theme
|
||||
|
||||
The configs are set to `Orchis-Dark-Compact` (Material Design, accent `#1A73E8`).
|
||||
|
||||
```sh
|
||||
sudo pacman -S orchis-theme xdg-desktop-portal-gtk
|
||||
```
|
||||
|
||||
libadwaita ignores `gtk-theme-name`, so GTK4 apps also need the portal settings
|
||||
and Orchis' own GTK4 stylesheet linked in:
|
||||
|
||||
```sh
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark'
|
||||
gsettings set org.gnome.desktop.interface gtk-theme 'Orchis-Dark-Compact'
|
||||
|
||||
mkdir -p ~/.config/gtk-4.0
|
||||
ln -sf /usr/share/themes/Orchis-Dark-Compact/gtk-4.0/gtk.css ~/.config/gtk-4.0/gtk.css
|
||||
ln -sf /usr/share/themes/Orchis-Dark-Compact/gtk-4.0/assets ~/.config/gtk-4.0/assets
|
||||
```
|
||||
|
||||
`nwg-look` can do the symlink step for you — `nwg/.config/nwg-look/config` already
|
||||
has `export-gtk4-symlinks: true`. Set the gsettings values above first, then run
|
||||
`nwg-look` and hit Apply; it writes `.gtkrc-2.0`, both `settings.ini` files and the
|
||||
GTK4 symlinks from those values.
|
||||
|
||||
### Window buttons
|
||||
|
||||
Both `settings.ini` files set `gtk-decoration-layout=close,minimize,maximize:`
|
||||
— everything left of the `:` sits on the **left**, which is macOS placement and
|
||||
order. That is client-side decoration, so it is all Hyprland apps use.
|
||||
|
||||
Orchis' `--tweaks macos` is **not** useful here: it only replaces `xfwm4` and
|
||||
`metacity-1` assets (Xfce / Marco window managers) and touches no GTK CSS, so it
|
||||
would change nothing under Hyprland — and it requires building from source,
|
||||
giving up the packaged theme. Circular red/yellow/green buttons are not
|
||||
available from Orchis for GTK client-side decorations.
|
||||
|
||||
## Notes
|
||||
|
||||
- **fish universal variables.** The colours live in `fish/.config/fish/fish_variables`,
|
||||
which fish rewrites from memory whenever any universal variable changes. Close
|
||||
running fish sessions before pulling so an old session can't write the previous
|
||||
palette back over it.
|
||||
- **`cat` is broken on Arch.** `config.fish` defines `cat` as `batcat …`, which is
|
||||
the Debian binary name. Arch's `bat` package installs `/usr/bin/bat`. Either
|
||||
`sudo pacman -S bat` and rename the call, or add an alias.
|
||||
- **nwg-look overwrites GTK config.** It regenerates `.gtkrc-2.0` and the
|
||||
`settings.ini` files. Run it *before* editing these by hand, or re-apply after.
|
||||
- **`gtktheme/.gtkrc-2.0` line 4** includes `/home/n0x/.gtkrc-2.0.mine`, a stale
|
||||
path from a previous username. Harmless, but dead.
|
||||
- **`~/.tmux/plugins/nord-tmux`** is no longer used or tracked. Safe to delete.
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
if [ -n "$FIFO_UEBERZUG" ]; then
|
||||
printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG"
|
||||
fi
|
||||
@@ -0,0 +1,55 @@
|
||||
# Basic Settings
|
||||
set preview
|
||||
set icons
|
||||
set cleaner '~/.config/lf/cleaner'
|
||||
set previewer '~/.config/lf/scope'
|
||||
set cursorpreviewfmt "\033[7m"
|
||||
set shell fish
|
||||
|
||||
### Commands ###
|
||||
cmd edit-config ${{
|
||||
$EDITOR ~/.config/lf/lfrc
|
||||
lf -remote "send $id source ~/.config/lf/lfrc"
|
||||
}}
|
||||
|
||||
cmd open ${{
|
||||
switch $(file --mime-type "$(readlink -f $f)" -b)
|
||||
case image/vnd.djvu application/pdf application/octet-stream application/postscript application/pdf application/vnd.djvu "application/epub*"
|
||||
setsid -f zathura $fx >/dev/null 2>&1
|
||||
case "text/*" application/json inode/x-empty application/x-subrip
|
||||
$EDITOR $fx
|
||||
case image/x-xcf
|
||||
setsid -f gimp $f >/dev/null 2>&1
|
||||
case image/svg+xml
|
||||
display -- $f
|
||||
case "image/*"
|
||||
rotdir $f | grep -i "\.\(png\|jpg\|jpeg\|gif\|webp\|avif\|tif\|ico\)\(_large\)*\$" |
|
||||
setsid -f nsxiv -aio 2>/dev/null |
|
||||
while read -r file;
|
||||
[ -z "$file" ] && continue;
|
||||
lf -remote "send select \"$file\"";
|
||||
lf -remote "send toggle";
|
||||
end
|
||||
case "audio/*" video/x-ms-asf
|
||||
mpv --volume=45 --audio-display=no $f
|
||||
case "video/*"
|
||||
setsid -f mpv --volume=45 $f -quiet >/dev/null 2>&1
|
||||
case application/pgp-encrypted
|
||||
$EDITOR $fx
|
||||
case application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.oasis.opendocument.text application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/octet-stream application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.spreadsheet-template application/vnd.openxmlformats-officedocument.presentationml.presentation application/vnd.oasis.opendocument.presentation-template application/vnd.oasis.opendocument.presentation application/vnd.ms-powerpoint application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.graphics-template application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.database
|
||||
setsid -f libreoffice $fx >/dev/null 2>&1
|
||||
case "*"
|
||||
for f in $fx
|
||||
setsid -f $OPENER $f >/dev/null 2>&1
|
||||
end
|
||||
end
|
||||
}}
|
||||
|
||||
|
||||
### Mappings and stuff ###
|
||||
map C edit-config
|
||||
map J :updir; set dironly true; down; set dironly false; open
|
||||
map K :updir; set dironly true; up; set dironly false; open
|
||||
map o open;
|
||||
map <c-s> set hidden!
|
||||
|
||||
Executable
+61
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
# File preview handler for lf.
|
||||
|
||||
set -C -f
|
||||
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"
|
||||
|
||||
image() {
|
||||
if [ -f "$1" ] && [ -n "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ] && command -V ueberzug >/dev/null 2>&1; then
|
||||
printf '{"action": "add", "identifier": "PREVIEW", "x": "%s", "y": "%s", "width": "%s", "height": "%s", "scaler": "contain", "path": "%s"}\n' "$4" "$5" "$(($2-1))" "$(($3-1))" "$1" > "$FIFO_UEBERZUG"
|
||||
else
|
||||
mediainfo "$6"
|
||||
fi
|
||||
}
|
||||
|
||||
# Note that the cache file name is a function of file information, meaning if
|
||||
# an image appears in multiple places across the machine, it will not have to
|
||||
# be regenerated once seen.
|
||||
|
||||
case "$(file --dereference --brief --mime-type -- "$1")" in
|
||||
image/avif) CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE" ] && convert "$1" "$CACHE.jpg"
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||
image/vnd.djvu)
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE" ] && djvused "$1" -e 'select 1; save-page-with /dev/stdout' | convert -density 200 - "$CACHE.jpg" > /dev/null 2>&1
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1" ;;
|
||||
image/svg+xml)
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE" ] && inkscape --convert-dpi-method=none -o "$CACHE.png" --export-overwrite -D --export-png-color-mode=RGBA_16 "$1"
|
||||
image "$CACHE.png" "$2" "$3" "$4" "$5" "$1" ;;
|
||||
image/*)
|
||||
image "$1" "$2" "$3" "$4" "$5" "$1" ;;
|
||||
text/html)
|
||||
lynx -width="$4" -display_charset=utf-8 -dump "$1" ;;
|
||||
text/troff)
|
||||
man ./ "$1" | col -b ;;
|
||||
text/* | */xml | application/json | application/x-ndjson)
|
||||
bat -p --theme nord --terminal-width "$(($4-2))" -f "$1" ;;
|
||||
audio/* | application/octet-stream)
|
||||
mediainfo "$1" || exit 1 ;;
|
||||
video/* )
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE" ] && ffmpegthumbnailer -i "$1" -o "$CACHE" -s 0
|
||||
image "$CACHE" "$2" "$3" "$4" "$5" "$1"
|
||||
;;
|
||||
*/pdf)
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||
;;
|
||||
*/epub+zip|*/mobi*)
|
||||
CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/lf/thumb.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | cut -d' ' -f1)"
|
||||
[ ! -f "$CACHE.jpg" ] && gnome-epub-thumbnailer "$1" "$CACHE.jpg"
|
||||
image "$CACHE.jpg" "$2" "$3" "$4" "$5" "$1"
|
||||
;;
|
||||
application/*zip) atool --list -- "$1" ;;
|
||||
*opendocument*) odt2txt "$1" ;;
|
||||
application/pgp-encrypted) gpg -d -- "$1" ;;
|
||||
esac
|
||||
exit 1
|
||||
@@ -0,0 +1,13 @@
|
||||
require "user.options"
|
||||
require "user.keymaps"
|
||||
require "user.plugins"
|
||||
require "user.colorscheme"
|
||||
require "user.cmp"
|
||||
require "user.lsp"
|
||||
require "user.telescope"
|
||||
require "user.treesitter"
|
||||
require "user.nvim-tree"
|
||||
require "user.bufferline"
|
||||
require "user.statusline"
|
||||
require "user.gitsigns"
|
||||
require "user.rust-tools"
|
||||
+22
-12
@@ -46,16 +46,22 @@ local kind_icons = {
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
cmp.setup {
|
||||
--snippet = {
|
||||
-- expand = function(args)
|
||||
-- luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- end,
|
||||
--},
|
||||
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping {
|
||||
@@ -102,19 +108,23 @@ cmp.setup {
|
||||
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snippet]",
|
||||
buffer = "[Buffer]",
|
||||
luasnip = "[Snip]",
|
||||
buffer = "[Buff]",
|
||||
path = "[Path]",
|
||||
vsnip = "[VSnip]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
},
|
||||
{ name = 'path' }, -- file paths
|
||||
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
|
||||
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
||||
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
|
||||
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
|
||||
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
|
||||
{ name = 'calc'}, -- source for math calculation
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
+6
-12
@@ -4,12 +4,12 @@ if not status_ok then
|
||||
end
|
||||
|
||||
gitsigns.setup {
|
||||
signs = {
|
||||
add = { hl = 'GitSignsAdd', text = '│', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' },
|
||||
change = { hl = 'GitSignsChange', text = '│', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||
delete = { hl = 'GitSignsDelete', text = '契', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||
topdelete = { hl = 'GitSignsDelete', text = '契', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||
changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "▎" },
|
||||
topdelete = { text = "▎" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
@@ -27,9 +27,6 @@ gitsigns.setup {
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
@@ -42,7 +39,4 @@ gitsigns.setup {
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
+1
-1
@@ -61,6 +61,7 @@ local function lsp_highlight_document(client)
|
||||
end
|
||||
|
||||
local function lsp_keymaps(bufnr)
|
||||
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.format()' ]]
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
@@ -81,7 +82,6 @@ local function lsp_keymaps(bufnr)
|
||||
-- for german keyboard ...
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "*d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.format()' ]]
|
||||
end
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
@@ -0,0 +1,42 @@
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require "user.lsp.mason"
|
||||
require("user.lsp.handlers").setup()
|
||||
require "user.lsp.null-ls"
|
||||
|
||||
-- LSP Diagnostics Options Setup
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = ''
|
||||
})
|
||||
end
|
||||
|
||||
sign({name = 'DiagnosticSignError', text = ''})
|
||||
sign({name = 'DiagnosticSignWarn', text = ''})
|
||||
sign({name = 'DiagnosticSignHint', text = ''})
|
||||
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = false,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
-1
@@ -16,6 +16,5 @@ null_ls.setup({
|
||||
extra_filetypes = {"inl"},
|
||||
extra_args = {"-style=file:~/.config/nvim/lua/user/lsp/settings/clang-format"},
|
||||
}),
|
||||
null_ls.builtins.formatting.rustfmt,
|
||||
},
|
||||
})
|
||||
+12
-20
@@ -1,18 +1,18 @@
|
||||
-- following options are the default
|
||||
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
|
||||
if not config_status_ok then
|
||||
return
|
||||
end
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
local tree_cb = nvim_tree_config.nvim_tree_callback
|
||||
nvimtree.setup {
|
||||
on_attach = function(bufnr)
|
||||
local api = require("nvim-tree.api")
|
||||
|
||||
nvim_tree.setup {
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
vim.keymap.set("n", "<space>", api.node.open.edit, opts("Open"))
|
||||
end,
|
||||
renderer = {
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
@@ -86,18 +86,10 @@ nvim_tree.setup {
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
hide_root_folder = false,
|
||||
side = "left",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
{ key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
|
||||
{ key = "h", cb = tree_cb "close_node" },
|
||||
{ key = "v", cb = tree_cb "vsplit" },
|
||||
},
|
||||
float = {
|
||||
quit_on_focus_loss = true,
|
||||
},
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
+25
@@ -51,3 +51,28 @@ vim.cmd "set listchars=tab:\\ \\ ,space:·"
|
||||
--vim.cmd "set term=screen-256color"
|
||||
vim.g.vimwiki_list = {{path = '~/Documents/vimwiki', syntax = 'markdown', ext = '.md'}}
|
||||
vim.g.nord_disable_background = true
|
||||
|
||||
--Set completeopt to have a better completion experience
|
||||
-- :help completeopt
|
||||
-- menuone: popup even when there's only one match
|
||||
-- noinsert: Do not insert text until a selection is made
|
||||
-- noselect: Do not select, force to select one from the menu
|
||||
-- shortness: avoid showing extra messages when using completion
|
||||
-- updatetime: set updatetime for CursorHold
|
||||
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||
vim.api.nvim_set_option('updatetime', 300)
|
||||
|
||||
-- Fixed column for diagnostics to appear
|
||||
-- Show autodiagnostic popup on cursor hover_range
|
||||
-- Goto previous / next diagnostic warning / error
|
||||
-- Show inlay_hints more frequently
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
|
||||
-- Treesitter folding
|
||||
vim.wo.foldmethod = 'expr'
|
||||
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
+14
-2
@@ -47,13 +47,20 @@ return packer.startup(function(use)
|
||||
|
||||
-- Colorschemes
|
||||
use "shaunsingh/nord.nvim"
|
||||
|
||||
-- cmp plugins
|
||||
use "hrsh7th/nvim-cmp" -- The completion plugin
|
||||
use "hrsh7th/cmp-buffer" -- buffer completions
|
||||
use "hrsh7th/cmp-nvim-lsp"
|
||||
|
||||
use 'hrsh7th/cmp-nvim-lua'
|
||||
use 'hrsh7th/cmp-nvim-lsp-signature-help'
|
||||
|
||||
use 'hrsh7th/cmp-vsnip'
|
||||
use "hrsh7th/cmp-path" -- path completions
|
||||
use "hrsh7th/cmp-buffer" -- buffer completions
|
||||
use "hrsh7th/vim-vsnip"
|
||||
use "hrsh7th/cmp-cmdline" -- cmdline completions
|
||||
use "saadparwaiz1/cmp_luasnip" -- snippet completions
|
||||
use "hrsh7th/cmp-nvim-lsp"
|
||||
|
||||
-- snippets
|
||||
use "L3MON4D3/LuaSnip" --snippet engine
|
||||
@@ -65,6 +72,8 @@ return packer.startup(function(use)
|
||||
use "williamboman/mason-lspconfig.nvim" -- simple to use language server installer
|
||||
use 'jose-elias-alvarez/null-ls.nvim' -- LSP diagnostics and code actions
|
||||
|
||||
use 'simrat39/rust-tools.nvim'
|
||||
|
||||
-- Telescope
|
||||
use "nvim-telescope/telescope.nvim"
|
||||
use 'nvim-telescope/telescope-media-files.nvim'
|
||||
@@ -102,6 +111,9 @@ return packer.startup(function(use)
|
||||
-- dicord fuckery
|
||||
use 'andweeb/presence.nvim'
|
||||
|
||||
-- LaTeX
|
||||
use 'lervag/vimtex'
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then
|
||||
@@ -0,0 +1,12 @@
|
||||
local rt = require("rust-tools")
|
||||
|
||||
rt.setup({
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
+11
-6
@@ -6,13 +6,18 @@ end
|
||||
configs.setup({
|
||||
ensure_installed = { "bash", "c", "cpp", "javascript", "json", "lua", "python", "typescript", "tsx", "css", "rust", "java", "yaml", "markdown", "markdown_inline" }, -- one of "all" or a list of languages
|
||||
ignore_install = { "phpdoc" }, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "css" }, -- list of language that will be disabled
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting=false,
|
||||
},
|
||||
ident = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
[Added Associations]
|
||||
application/pdf=userapp-librewolf.desktop;
|
||||
application/x-extension-htm=userapp-librewolf.desktop;
|
||||
application/x-extension-html=userapp-librewolf.desktop;
|
||||
application/x-extension-shtml=userapp-librewolf.desktop;
|
||||
application/x-extension-xht=userapp-librewolf.desktop;
|
||||
application/x-extension-xhtml=userapp-librewolf.desktop;
|
||||
application/xhtml+xml=userapp-librewolf.desktop;
|
||||
message/rfc822=userapp-Thunderbird-OZQMR0.desktop;
|
||||
text/html=userapp-librewolf.desktop;
|
||||
x-scheme-handler/chrome=userapp-librewolf.desktop;
|
||||
x-scheme-handler/ftp=userapp-librewolf.desktop;
|
||||
x-scheme-handler/http=userapp-librewolf.desktop;
|
||||
x-scheme-handler/https=userapp-librewolf.desktop;
|
||||
x-scheme-handler/mailto=userapp-Thunderbird-OZQMR0.desktop;userapp-Thunderbird-86ACV1.desktop;userapp-Thunderbird-WB8BX2.desktop;userapp-Thunderbird-P5H422.desktop;
|
||||
x-scheme-handler/tg=userapp-Telegram Desktop-4ZQQX0.desktop;org.telegram.desktop.desktop;
|
||||
x-scheme-handler/mid=userapp-Thunderbird-86ACV1.desktop;userapp-Thunderbird-WB8BX2.desktop;userapp-Thunderbird-P5H422.desktop;
|
||||
text/plain=codium.desktop;
|
||||
application/zip=xarchiver.desktop;teamspeak3.desktop;
|
||||
x-scheme-handler/webcal=userapp-Thunderbird-ID7522.desktop;
|
||||
x-scheme-handler/webcals=userapp-Thunderbird-ID7522.desktop;
|
||||
|
||||
[Default Applications]
|
||||
application/pdf=librewolf.desktop
|
||||
application/x-extension-htm=librewolf.desktop
|
||||
application/x-extension-html=librewolf.desktop
|
||||
application/x-extension-shtml=librewolf.desktop
|
||||
application/x-extension-xht=librewolf.desktop
|
||||
application/x-extension-xhtml=librewolf.desktop
|
||||
application/xhtml+xml=librewolf.desktop
|
||||
message/rfc822=userapp-Thunderbird-P5H422.desktop
|
||||
text/html=librewolf.desktop
|
||||
x-scheme-handler/bitwarden=bitwarden.desktop
|
||||
x-scheme-handler/chrome=librewolf.desktop
|
||||
x-scheme-handler/ftp=librewolf.desktop
|
||||
x-scheme-handler/http=librewolf.desktop
|
||||
x-scheme-handler/https=librewolf.desktop
|
||||
x-scheme-handler/mailto=userapp-Thunderbird-P5H422.desktop
|
||||
x-scheme-handler/tg=org.telegram.desktop.desktop
|
||||
x-scheme-handler/mid=userapp-Thunderbird-P5H422.desktop
|
||||
image/png=imv-dir.desktop
|
||||
image/jpg=imv-dir.desktop
|
||||
application/json=codium.desktop
|
||||
application/xml=codium.desktop
|
||||
inode/directory=pcmanfm.desktop
|
||||
text/plain=codium.desktop
|
||||
image/jpeg=imv-dir.desktop
|
||||
x-scheme-handler/about=librewolf.desktop
|
||||
x-scheme-handler/unknown=librewolf.desktop
|
||||
x-scheme-handler/discord=vesktop.desktop
|
||||
application/zip=xarchiver.desktop
|
||||
image/gif=imv-dir.desktop
|
||||
image/webp=imv-dir.desktop
|
||||
image/bmp=imv-dir.desktop
|
||||
image/tiff=imv-dir.desktop
|
||||
image/x-icon=imv-dir.desktop
|
||||
image/svg+xml=imv-dir.desktop
|
||||
x-scheme-handler/webcal=userapp-Thunderbird-ID7522.desktop
|
||||
text/calendar=userapp-Thunderbird-ID7522.desktop
|
||||
application/x-extension-ics=userapp-Thunderbird-ID7522.desktop
|
||||
x-scheme-handler/webcals=userapp-Thunderbird-ID7522.desktop
|
||||
application/x-tar=xarchiver.desktop
|
||||
application/x-7z-compressed=xarchiver.desktop
|
||||
application/x-rar=xarchiver.desktop
|
||||
application/x-bzip=xarchiver.desktop
|
||||
application/x-bzip2=xarchiver.desktop
|
||||
application/gzip=xarchiver.desktop
|
||||
application/x-xz=xarchiver.desktop
|
||||
application/x-lzma=xarchiver.desktop
|
||||
application/x-iso9660-image=xarchiver.desktop
|
||||
application/vnd.rar=xarchiver.desktop
|
||||
x-scheme-handler/wootwoot=wootility.desktop
|
||||
x-scheme-handler/web+wootwoot=wootility.desktop
|
||||
+19
-14
@@ -24,7 +24,7 @@
|
||||
# dynamic width from 0 to 300
|
||||
# width = (0, 300)
|
||||
# constant width of 300
|
||||
width = 0
|
||||
width = (50, 400)
|
||||
|
||||
# The maximum height of a single notification, excluding the frame.
|
||||
height = 300
|
||||
@@ -33,7 +33,7 @@
|
||||
origin = top-right
|
||||
|
||||
# Offset from the origin
|
||||
offset = 15x48
|
||||
offset = 15x15
|
||||
|
||||
# Scale factor. It is auto-detected if value is 0.
|
||||
scale = 0
|
||||
@@ -92,10 +92,11 @@
|
||||
|
||||
# Defines width in pixels of frame around the notification window.
|
||||
# Set to 0 to disable.
|
||||
frame_width = 5
|
||||
frame_width = 2
|
||||
|
||||
# Defines color of the frame around the notification window.
|
||||
frame_color = "#8FBCBB"
|
||||
# Cursor Dark: neutral by default, overridden per urgency below.
|
||||
frame_color = "#2b2b2b"
|
||||
|
||||
# Size of gap to display between notifications - requires a compositor.
|
||||
# If value is greater than 0, separator_height will be ignored and a border
|
||||
@@ -201,12 +202,12 @@
|
||||
enable_recursive_icon_lookup = true
|
||||
|
||||
# Set icon theme (only used for recursive icon lookup)
|
||||
icon_theme = Adwaita
|
||||
icon_theme = Papirus-Dark
|
||||
# You can also set multiple icon themes, with the leftmost one being used first.
|
||||
# icon_theme = "Adwaita, breeze"
|
||||
|
||||
# Align icons left/right/top/off
|
||||
icon_position = left
|
||||
icon_position = top
|
||||
|
||||
# Scale small icons up to this size, set to 0 to disable. Helpful
|
||||
# for e.g. small files or high-dpi screens. In case of conflict,
|
||||
@@ -214,7 +215,7 @@
|
||||
min_icon_size = 32
|
||||
|
||||
# Scale larger icons down to this size, set to 0 to disable
|
||||
max_icon_size = 128
|
||||
max_icon_size = 64
|
||||
|
||||
# Paths to default icons (only neccesary when not using recursive icon lookup)
|
||||
icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/
|
||||
@@ -250,7 +251,7 @@
|
||||
# corners.
|
||||
# The radius will be automatically lowered if it exceeds half of the
|
||||
# notification height to avoid clipping text and/or icons.
|
||||
corner_radius = 0
|
||||
corner_radius = 10
|
||||
|
||||
# Ignore the dbus closeNotification message.
|
||||
# Useful to enforce the timeout set by dunst configuration. Without this
|
||||
@@ -313,23 +314,27 @@
|
||||
[urgency_low]
|
||||
# IMPORTANT: colors have to be defined in quotation marks.
|
||||
# Otherwise the "#" and following would be interpreted as a comment.
|
||||
background = "#2E3440"
|
||||
foreground = "#888888"
|
||||
background = "#181818"
|
||||
foreground = "#9d9d9d"
|
||||
frame_color = "#2b2b2b"
|
||||
timeout = 10
|
||||
# Icon for notifications with low urgency, uncomment to enable
|
||||
#icon = /path/to/icon
|
||||
|
||||
[urgency_normal]
|
||||
background = "#3b4252"
|
||||
foreground = "#ffffff"
|
||||
background = "#181818"
|
||||
foreground = "#cccccc"
|
||||
frame_color = "#2472c8"
|
||||
timeout = 10
|
||||
# Icon for notifications with normal urgency, uncomment to enable
|
||||
#icon = /path/to/icon
|
||||
|
||||
[urgency_critical]
|
||||
background = "#900000"
|
||||
# #5a1d1d is VS Code's error-validation background, so it stays in-family
|
||||
# while still reading as alarming.
|
||||
background = "#5a1d1d"
|
||||
foreground = "#ffffff"
|
||||
frame_color = "#ff0000"
|
||||
frame_color = "#f14c4c"
|
||||
timeout = 0
|
||||
# Icon for notifications with critical urgency, uncomment to enable
|
||||
#icon = /path/to/icon
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Cursor Dark colour theme.
|
||||
#
|
||||
# Kept here as globals rather than only in fish_variables: fish's first-run
|
||||
# migration (__fish_config_interactive, __fish_initialized < 3400) runs
|
||||
# `fish_config theme save "fish default"`, which blanks every universal
|
||||
# fish_color_*/fish_pager_color_* variable. Globals are re-applied on every
|
||||
# start, so the theme survives that and travels with the repo.
|
||||
|
||||
set -g fish_color_normal normal
|
||||
set -g fish_color_command 569CD6
|
||||
set -g fish_color_keyword C586C0
|
||||
set -g fish_color_quote CE9178
|
||||
set -g fish_color_redirection 9CDCFE
|
||||
set -g fish_color_end C586C0
|
||||
set -g fish_color_error F14C4C
|
||||
set -g fish_color_param normal
|
||||
set -g fish_color_option 9CDCFE
|
||||
set -g fish_color_comment 6A9955
|
||||
set -g fish_color_selection E5E5E5 --bold --background=264F78
|
||||
set -g fish_color_operator D4D4D4
|
||||
set -g fish_color_escape D7BA7D
|
||||
set -g fish_color_autosuggestion 666666
|
||||
set -g fish_color_cwd 4EC9B0
|
||||
set -g fish_color_cwd_root F14C4C
|
||||
set -g fish_color_user 9CDCFE
|
||||
set -g fish_color_host 569CD6
|
||||
set -g fish_color_host_remote DCDCAA
|
||||
set -g fish_color_cancel -r
|
||||
set -g fish_color_search_match --background=264F78
|
||||
set -g fish_color_match --background=264F78
|
||||
set -g fish_color_history_current --bold
|
||||
set -g fish_color_status F14C4C
|
||||
set -g fish_color_valid_path --underline
|
||||
|
||||
set -g fish_pager_color_progress E5E5E5 --background=264F78
|
||||
set -g fish_pager_color_background
|
||||
set -g fish_pager_color_prefix 569CD6 --bold --underline
|
||||
set -g fish_pager_color_completion normal
|
||||
set -g fish_pager_color_description 9D9D9D
|
||||
set -g fish_pager_color_selected_background --background=264F78
|
||||
set -g fish_pager_color_selected_prefix 569CD6 --bold
|
||||
set -g fish_pager_color_selected_completion E5E5E5
|
||||
set -g fish_pager_color_selected_description 9D9D9D
|
||||
set -g fish_pager_color_secondary_background
|
||||
set -g fish_pager_color_secondary_prefix 569CD6
|
||||
set -g fish_pager_color_secondary_completion normal
|
||||
set -g fish_pager_color_secondary_description 9D9D9D
|
||||
@@ -1,20 +1,21 @@
|
||||
if [ -z "$DISPLAY" ] && [ (fgconsole) -eq 1 ];
|
||||
startx
|
||||
end
|
||||
|
||||
# uncomment to automatically start tmux
|
||||
if status is-interactive
|
||||
and not set -q TMUX
|
||||
exec tmux
|
||||
start-hyprland
|
||||
end
|
||||
|
||||
fish_ssh_agent
|
||||
|
||||
umask 0077
|
||||
|
||||
function q
|
||||
exit
|
||||
end
|
||||
|
||||
function cl
|
||||
function ff
|
||||
#fastfetch -l ~/.config/fish/img/ff.png -c neofetch.jsonc
|
||||
fastfetch --logo-type kitty-direct --logo ~/.config/fish/img/ff.png -c neofetch.jsonc
|
||||
end
|
||||
|
||||
function cls
|
||||
command clear && ls
|
||||
end
|
||||
|
||||
@@ -22,8 +23,8 @@ function cat
|
||||
bat --theme=Nord $argv
|
||||
end
|
||||
|
||||
function cnas
|
||||
curlftpfs 10.0.0.250 ~/NAS -o ssl,no_verify_peer,no_verify_hostname,uid=1000,gid=1000,umask=022
|
||||
function tn
|
||||
tmux new -s (pwd | sed 's/.*\///g')
|
||||
end
|
||||
|
||||
function ls
|
||||
@@ -43,15 +44,7 @@ function tree
|
||||
end
|
||||
|
||||
function ds
|
||||
command du -sch * | sort -rh
|
||||
end
|
||||
|
||||
function hv
|
||||
command nmcli --ask connection up "HP VPN"
|
||||
end
|
||||
|
||||
function hvd
|
||||
command nmcli connection down "HP VPN"
|
||||
command du -sch (ls -A) | sort -rh
|
||||
end
|
||||
|
||||
function nv
|
||||
|
||||
@@ -1,37 +1,48 @@
|
||||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR --export COMPOSE_BAKE:true
|
||||
SETUVAR --export DISPLAY:\x3a0
|
||||
SETUVAR --export EDITOR:nvim
|
||||
SETUVAR --export VISUAL:nvim
|
||||
SETUVAR --export TERM:xterm\x2d256color
|
||||
SETUVAR --export _JAVA_AWT_WM_NONREPARENTING:1
|
||||
SETUVAR __fish_initialized:3400
|
||||
SETUVAR fish_color_autosuggestion:4c566a
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR fish_color_autosuggestion:666666
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
SETUVAR fish_color_command:green
|
||||
SETUVAR fish_color_comment:434c5e
|
||||
SETUVAR fish_color_cwd:green
|
||||
SETUVAR fish_color_cwd_root:red
|
||||
SETUVAR fish_color_end:88c0d0
|
||||
SETUVAR fish_color_error:ebcb8b
|
||||
SETUVAR fish_color_escape:00a6b2
|
||||
SETUVAR fish_color_command:569CD6
|
||||
SETUVAR fish_color_comment:6A9955
|
||||
SETUVAR fish_color_cwd:4EC9B0
|
||||
SETUVAR fish_color_cwd_root:F14C4C
|
||||
SETUVAR fish_color_end:C586C0
|
||||
SETUVAR fish_color_error:F14C4C
|
||||
SETUVAR fish_color_escape:D7BA7D
|
||||
SETUVAR fish_color_history_current:\x2d\x2dbold
|
||||
SETUVAR fish_color_host:normal
|
||||
SETUVAR fish_color_host_remote:yellow
|
||||
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
|
||||
SETUVAR fish_color_host:569CD6
|
||||
SETUVAR fish_color_host_remote:DCDCAA
|
||||
SETUVAR fish_color_keyword:C586C0
|
||||
SETUVAR fish_color_match:\x2d\x2dbackground\x3d264F78
|
||||
SETUVAR fish_color_normal:normal
|
||||
SETUVAR fish_color_operator:00a6b2
|
||||
SETUVAR fish_color_operator:D4D4D4
|
||||
SETUVAR fish_color_option:9CDCFE
|
||||
SETUVAR fish_color_param:normal
|
||||
SETUVAR fish_color_quote:999900
|
||||
SETUVAR fish_color_redirection:00afff
|
||||
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
|
||||
SETUVAR fish_color_status:red
|
||||
SETUVAR fish_color_user:brgreen
|
||||
SETUVAR fish_color_quote:CE9178
|
||||
SETUVAR fish_color_redirection:9CDCFE
|
||||
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d264F78
|
||||
SETUVAR fish_color_selection:E5E5E5\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3d264F78
|
||||
SETUVAR fish_color_status:F14C4C
|
||||
SETUVAR fish_color_user:9CDCFE
|
||||
SETUVAR fish_color_valid_path:\x2d\x2dunderline
|
||||
SETUVAR fish_key_bindings:fish_default_key_bindings
|
||||
SETUVAR fish_pager_color_background:\x1d
|
||||
SETUVAR fish_pager_color_completion:normal
|
||||
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
SETUVAR fish_user_paths:/home/n0x/\x2elocal/bin
|
||||
SETUVAR fish_pager_color_description:9D9D9D
|
||||
SETUVAR fish_pager_color_prefix:569CD6\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:E5E5E5\x1e\x2d\x2dbackground\x3d264F78
|
||||
SETUVAR fish_pager_color_secondary_background:\x1d
|
||||
SETUVAR fish_pager_color_secondary_completion:\x1d
|
||||
SETUVAR fish_pager_color_secondary_description:\x1d
|
||||
SETUVAR fish_pager_color_secondary_prefix:\x1d
|
||||
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3d264F78
|
||||
SETUVAR fish_pager_color_selected_completion:\x1d
|
||||
SETUVAR fish_pager_color_selected_description:\x1d
|
||||
SETUVAR fish_pager_color_selected_prefix:\x1d
|
||||
SETUVAR fish_user_paths:/home/tfoerster/\x2eopencode/bin\x1e/home/tfoerster/\x2elocal/bin\x1e/home/n0x/\x2ecargo/bin\x1e/home/n0x/\x2elocal/bin
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
set fish_prompt_pwd_dir_length 0
|
||||
set __fish_git_prompt_show_informative_status 1
|
||||
|
||||
# Fish command and parameter colors
|
||||
set fish_color_command green
|
||||
set fish_color_param $fish_color_normal
|
||||
# Command and parameter colors come from fish_variables (Cursor Dark)
|
||||
|
||||
# Git prompt
|
||||
set __fish_git_prompt_showdirtystate 'yes'
|
||||
set __fish_git_prompt_showupstream 'yes'
|
||||
|
||||
set __fish_git_prompt_color_branch brown
|
||||
set __fish_git_prompt_color_dirtystate FCBC47
|
||||
set __fish_git_prompt_color_stagedstate yellow
|
||||
set __fish_git_prompt_color_upstream cyan
|
||||
set __fish_git_prompt_color_cleanstate green
|
||||
set __fish_git_prompt_color_invalidstate red
|
||||
# Colors mirror Cursor's git decorations
|
||||
set __fish_git_prompt_color_branch 569CD6
|
||||
set __fish_git_prompt_color_dirtystate E2C08D
|
||||
set __fish_git_prompt_color_stagedstate 73C991
|
||||
set __fish_git_prompt_color_upstream 4EC9B0
|
||||
set __fish_git_prompt_color_cleanstate 73C991
|
||||
set __fish_git_prompt_color_invalidstate E4676B
|
||||
|
||||
# Git Characters
|
||||
set __fish_git_prompt_char_dirtystate '*'
|
||||
@@ -41,9 +40,9 @@ end
|
||||
|
||||
function _prompt_color_for_status
|
||||
if test $argv[1] -eq 0
|
||||
echo magenta
|
||||
echo C586C0
|
||||
else
|
||||
echo red
|
||||
echo F14C4C
|
||||
end
|
||||
end
|
||||
|
||||
@@ -51,7 +50,7 @@ function fish_prompt
|
||||
set -l last_status $status
|
||||
|
||||
# username and hostname
|
||||
_print_in_color "┏["$USER"@"(prompt_hostname)"]" blue
|
||||
_print_in_color "┏["$USER"@"(prompt_hostname)"]" 569CD6
|
||||
|
||||
# current working dir
|
||||
_print_in_color " "(prompt_pwd) $fish_color_cwd
|
||||
@@ -59,10 +58,10 @@ function fish_prompt
|
||||
__fish_git_prompt " (%s)"
|
||||
|
||||
# beginning of new line
|
||||
_print_in_color "\n┗" blue
|
||||
_print_in_color "\n┗" 569CD6
|
||||
|
||||
# time information
|
||||
_print_in_color " "(date "+%H:%M:%S") green
|
||||
_print_in_color " "(date "+%H:%M:%S") 73C991
|
||||
|
||||
# little error that indicates the status of the previous command
|
||||
_print_in_color " ❯ " (_prompt_color_for_status $last_status)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -1 +0,0 @@
|
||||
857d7eaa-7f62-4984-85b0-3d498590c26c
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,52 @@
|
||||
# Specify the git user in the .gituser files to keep config the same across work and priv systems
|
||||
[include]
|
||||
path = .gituser
|
||||
|
||||
# global settings to improve git and its behavior
|
||||
# See https://blog.gitbutler.com/how-git-core-devs-configure-git/
|
||||
[column]
|
||||
ui = auto
|
||||
[branch]
|
||||
sort = -committerdate
|
||||
[tag]
|
||||
sort = version:refname
|
||||
[init]
|
||||
defaultBranch = master
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
[push]
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
[fetch]
|
||||
prune = true
|
||||
pruneTags = true
|
||||
all = true
|
||||
[help]
|
||||
autocorrect = prompt
|
||||
[commit]
|
||||
verbose = true
|
||||
[rebase]
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
[pull]
|
||||
rebase = true
|
||||
[merge]
|
||||
conflictstyle = zdiff3
|
||||
[core]
|
||||
fsmonitor = true
|
||||
untrackedCache = true
|
||||
[log]
|
||||
date = iso
|
||||
[apply]
|
||||
# Remove trailing whitespaces
|
||||
whitespace = fix
|
||||
[color "diff"]
|
||||
whitespace = red reverse
|
||||
[alias]
|
||||
ll = !git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all
|
||||
s = status
|
||||
unstage = reset HEAD --
|
||||
[advice]
|
||||
addIgnoredFile = false
|
||||
@@ -1,6 +1,4 @@
|
||||
file:///home/n0x/Documents Documents
|
||||
file:///home/n0x/Downloads Downloads
|
||||
file:///home/n0x/Nextcloud Nextcloud
|
||||
file:///home/n0x/Pictures Pictures
|
||||
file:///home/n0x/Videos Videos
|
||||
file:///home/n0x/Workspace Workspace
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
[Settings]
|
||||
gtk-application-prefer-dark-theme=true
|
||||
gtk-button-images=true
|
||||
gtk-cursor-theme-name=Adwaita
|
||||
gtk-theme-name=Orchis-Dark-Compact
|
||||
gtk-icon-theme-name=Papirus-Dark
|
||||
gtk-font-name=Noto Sans 11
|
||||
gtk-cursor-theme-name=default
|
||||
gtk-cursor-theme-size=24
|
||||
gtk-decoration-layout=close,minimize,maximize:
|
||||
gtk-enable-animations=true
|
||||
gtk-font-name=Noto Sans, 10
|
||||
gtk-icon-theme-name=Nordzy-green-dark
|
||||
gtk-menu-images=true
|
||||
gtk-modules=colorreload-gtk-module:appmenu-gtk-module
|
||||
gtk-primary-button-warps-slider=false
|
||||
gtk-shell-shows-menubar=1
|
||||
gtk-theme-name=Nordic-darker
|
||||
gtk-toolbar-style=3
|
||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||
gtk-button-images=1
|
||||
gtk-menu-images=1
|
||||
gtk-enable-event-sounds=1
|
||||
gtk-enable-input-feedback-sounds=0
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle=hintmedium
|
||||
gtk-xft-rgba=rgb
|
||||
gtk-application-prefer-dark-theme=1
|
||||
gtk-decoration-layout=close,minimize,maximize:
|
||||
gtk-enable-animations=1
|
||||
gtk-primary-button-warps-slider=0
|
||||
gtk-shell-shows-menubar=1
|
||||
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/share/themes/Everforest-Teal-Dark/gtk-4.0/assets
|
||||
@@ -0,0 +1,77 @@
|
||||
@define-color borders_breeze #3b4047;
|
||||
@define-color content_view_bg_breeze #0f1019;
|
||||
@define-color error_color_backdrop_breeze #fd547e;
|
||||
@define-color error_color_breeze #fd547e;
|
||||
@define-color error_color_insensitive_backdrop_breeze #5e263a;
|
||||
@define-color error_color_insensitive_breeze #5e263a;
|
||||
@define-color insensitive_base_color_breeze #0e0f18;
|
||||
@define-color insensitive_base_fg_color_breeze #50575e;
|
||||
@define-color insensitive_bg_color_breeze #0e0f18;
|
||||
@define-color insensitive_borders_breeze #1d1f27;
|
||||
@define-color insensitive_fg_color_breeze #494f56;
|
||||
@define-color insensitive_selected_bg_color_breeze #0e0f18;
|
||||
@define-color insensitive_selected_fg_color_breeze #494f56;
|
||||
@define-color insensitive_unfocused_bg_color_breeze #0e0f18;
|
||||
@define-color insensitive_unfocused_fg_color_breeze #494f56;
|
||||
@define-color insensitive_unfocused_selected_bg_color_breeze #0e0f18;
|
||||
@define-color insensitive_unfocused_selected_fg_color_breeze #494f56;
|
||||
@define-color link_color_breeze #00b8b8;
|
||||
@define-color link_visited_color_breeze #b2c1c3;
|
||||
@define-color success_color_backdrop_breeze #006e28;
|
||||
@define-color success_color_breeze #006e28;
|
||||
@define-color success_color_insensitive_backdrop_breeze #092f1d;
|
||||
@define-color success_color_insensitive_breeze #092f1d;
|
||||
@define-color theme_base_color_breeze #0f1019;
|
||||
@define-color theme_bg_color_breeze #0f1019;
|
||||
@define-color theme_button_background_backdrop_breeze #0f1019;
|
||||
@define-color theme_button_background_backdrop_insensitive_breeze #0e0f18;
|
||||
@define-color theme_button_background_insensitive_breeze #0e0f18;
|
||||
@define-color theme_button_background_normal_breeze #0f1019;
|
||||
@define-color theme_button_decoration_focus_backdrop_breeze #2e8b8b;
|
||||
@define-color theme_button_decoration_focus_backdrop_insensitive_breeze #19383e;
|
||||
@define-color theme_button_decoration_focus_breeze #2e8b8b;
|
||||
@define-color theme_button_decoration_focus_insensitive_breeze #19383e;
|
||||
@define-color theme_button_decoration_hover_backdrop_breeze #009696;
|
||||
@define-color theme_button_decoration_hover_backdrop_insensitive_breeze #093c42;
|
||||
@define-color theme_button_decoration_hover_breeze #009696;
|
||||
@define-color theme_button_decoration_hover_insensitive_breeze #093c42;
|
||||
@define-color theme_button_foreground_active_backdrop_breeze #becfd2;
|
||||
@define-color theme_button_foreground_active_backdrop_insensitive_breeze #494f56;
|
||||
@define-color theme_button_foreground_active_breeze #0f1019;
|
||||
@define-color theme_button_foreground_active_insensitive_breeze #494f56;
|
||||
@define-color theme_button_foreground_backdrop_breeze #becfd2;
|
||||
@define-color theme_button_foreground_backdrop_insensitive_breeze #494f56;
|
||||
@define-color theme_button_foreground_insensitive_breeze #494f56;
|
||||
@define-color theme_button_foreground_normal_breeze #becfd2;
|
||||
@define-color theme_fg_color_breeze #becfd2;
|
||||
@define-color theme_hovering_selected_bg_color_breeze #009696;
|
||||
@define-color theme_selected_bg_color_breeze #009696;
|
||||
@define-color theme_selected_fg_color_breeze #0f1019;
|
||||
@define-color theme_text_color_breeze #d4e7ea;
|
||||
@define-color theme_titlebar_background_backdrop_breeze #0f1019;
|
||||
@define-color theme_titlebar_background_breeze #0f1019;
|
||||
@define-color theme_titlebar_background_light_breeze #0f1019;
|
||||
@define-color theme_titlebar_foreground_backdrop_breeze #a5c8cf;
|
||||
@define-color theme_titlebar_foreground_breeze #a5c8cf;
|
||||
@define-color theme_titlebar_foreground_insensitive_backdrop_breeze #a5c8cf;
|
||||
@define-color theme_titlebar_foreground_insensitive_breeze #a5c8cf;
|
||||
@define-color theme_unfocused_base_color_breeze #0f1019;
|
||||
@define-color theme_unfocused_bg_color_breeze #0f1019;
|
||||
@define-color theme_unfocused_fg_color_breeze #becfd2;
|
||||
@define-color theme_unfocused_selected_bg_color_alt_breeze #033536;
|
||||
@define-color theme_unfocused_selected_bg_color_breeze #033536;
|
||||
@define-color theme_unfocused_selected_fg_color_breeze #becfd2;
|
||||
@define-color theme_unfocused_text_color_breeze #d4e7ea;
|
||||
@define-color theme_unfocused_view_bg_color_breeze #0e0f18;
|
||||
@define-color theme_unfocused_view_text_color_breeze #50575e;
|
||||
@define-color theme_view_active_decoration_color_breeze #009696;
|
||||
@define-color theme_view_hover_decoration_color_breeze #009696;
|
||||
@define-color tooltip_background_breeze #0f1019;
|
||||
@define-color tooltip_border_breeze #3b4047;
|
||||
@define-color tooltip_text_breeze #becfd2;
|
||||
@define-color unfocused_borders_breeze #3b4047;
|
||||
@define-color unfocused_insensitive_borders_breeze #1d1f27;
|
||||
@define-color warning_color_backdrop_breeze #ffaa7f;
|
||||
@define-color warning_color_breeze #ffaa7f;
|
||||
@define-color warning_color_insensitive_backdrop_breeze #5e433a;
|
||||
@define-color warning_color_insensitive_breeze #5e433a;
|
||||
+1
@@ -0,0 +1 @@
|
||||
/usr/share/themes/Everforest-Teal-Dark/gtk-4.0/gtk-dark.css
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/share/themes/Everforest-Teal-Dark/gtk-4.0/gtk.css
|
||||
@@ -0,0 +1,7 @@
|
||||
[Settings]
|
||||
gtk-theme-name=Orchis-Dark-Compact
|
||||
gtk-icon-theme-name=Papirus-Dark
|
||||
gtk-font-name=Noto Sans 11
|
||||
gtk-cursor-theme-name=default
|
||||
gtk-cursor-theme-size=24
|
||||
gtk-application-prefer-dark-theme=1
|
||||
+16
-9
@@ -1,12 +1,19 @@
|
||||
# DO NOT EDIT! This file will be overwritten by nwg-look.
|
||||
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
|
||||
|
||||
include "/home/n0x/.gtkrc-2.0.mine"
|
||||
gtk-theme-name="Orchis-Dark-Compact"
|
||||
gtk-icon-theme-name="Papirus-Dark"
|
||||
gtk-font-name="Noto Sans 11"
|
||||
gtk-cursor-theme-name="default"
|
||||
gtk-cursor-theme-size=24
|
||||
gtk-theme-name="Nordic-darker"
|
||||
gtk-enable-animations=1
|
||||
gtk-primary-button-warps-slider=0
|
||||
gtk-toolbar-style=3
|
||||
gtk-menu-images=1
|
||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||
gtk-button-images=1
|
||||
gtk-cursor-theme-name="Adwaita"
|
||||
gtk-icon-theme-name="Nordzy-green-dark"
|
||||
gtk-font-name="Noto Sans, 10"
|
||||
gtk-application-prefer-dark-theme = true
|
||||
gtk-modules=appmenu-gtk-module
|
||||
gtk-menu-images=1
|
||||
gtk-enable-event-sounds=1
|
||||
gtk-enable-input-feedback-sounds=0
|
||||
gtk-xft-antialias=1
|
||||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle="hintmedium"
|
||||
gtk-xft-rgba="rgb"
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
-----------------------
|
||||
---- LOOK AND FEEL ----
|
||||
-----------------------
|
||||
hl.config({
|
||||
general = {
|
||||
gaps_in = 5,
|
||||
gaps_out = 10,
|
||||
border_size = 2,
|
||||
col = {
|
||||
-- Cursor Dark: accent blue gradient, neutral dark inactive
|
||||
active_border = { colors = { "rgba(2472c8ee)", "rgba(3b8eeaee)" }, angle = 45 },
|
||||
inactive_border = "rgba(2b2b2baa)",
|
||||
},
|
||||
resize_on_border = false,
|
||||
allow_tearing = false,
|
||||
layout = "dwindle",
|
||||
},
|
||||
|
||||
decoration = {
|
||||
rounding = 10,
|
||||
active_opacity = 1.0,
|
||||
inactive_opacity = 1.0,
|
||||
|
||||
shadow = {
|
||||
enabled = true,
|
||||
range = 4,
|
||||
render_power = 3,
|
||||
color = "rgba(1a1a1aee)",
|
||||
},
|
||||
|
||||
blur = {
|
||||
enabled = true,
|
||||
size = 3,
|
||||
passes = 1,
|
||||
vibrancy = 0.1696,
|
||||
},
|
||||
},
|
||||
|
||||
animations = {
|
||||
enabled = true,
|
||||
},
|
||||
|
||||
dwindle = {
|
||||
-- pseudotile = true,
|
||||
preserve_split = true,
|
||||
},
|
||||
|
||||
master = {
|
||||
new_status = "master",
|
||||
},
|
||||
|
||||
misc = {
|
||||
force_default_wallpaper = -1,
|
||||
disable_hyprland_logo = false,
|
||||
},
|
||||
|
||||
cursor = {
|
||||
no_hardware_cursors = true,
|
||||
},
|
||||
})
|
||||
|
||||
---------------------
|
||||
---- ANIMATIONS -----
|
||||
---------------------
|
||||
|
||||
-- Curves and animation leaves are now top-level hl.curve / hl.animation calls.
|
||||
hl.curve("myBezier", { type = "bezier", points = { { 0.05, 0.9 }, { 0.1, 1.05 } } })
|
||||
|
||||
hl.animation({ leaf = "windows", enabled = true, speed = 7, bezier = "myBezier" })
|
||||
hl.animation({ leaf = "windowsOut", enabled = true, speed = 7, bezier = "default", style = "popin 80%" })
|
||||
hl.animation({ leaf = "border", enabled = true, speed = 10, bezier = "default" })
|
||||
hl.animation({ leaf = "borderangle", enabled = true, speed = 8, bezier = "default" })
|
||||
hl.animation({ leaf = "fade", enabled = true, speed = 7, bezier = "default" })
|
||||
hl.animation({ leaf = "workspaces", enabled = true, speed = 6, bezier = "default" })
|
||||
|
||||
---------------
|
||||
---- INPUT ----
|
||||
---------------
|
||||
hl.config({
|
||||
input = {
|
||||
kb_layout = "de",
|
||||
kb_variant = "",
|
||||
kb_model = "",
|
||||
kb_options = "",
|
||||
kb_rules = "",
|
||||
follow_mouse = 1,
|
||||
sensitivity = 0,
|
||||
numlock_by_default = true,
|
||||
touchpad = {
|
||||
natural_scroll = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,53 @@
|
||||
---------------------
|
||||
---- KEYBINDINGS ----
|
||||
---------------------
|
||||
|
||||
-- Core
|
||||
hl.bind(mainMod .. " + SHIFT + return", hl.dsp.exec_cmd(terminal))
|
||||
hl.bind(mainMod .. " + SHIFT + C", hl.dsp.window.close())
|
||||
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.exit())
|
||||
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
|
||||
hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }))
|
||||
hl.bind(mainMod .. " + P", hl.dsp.exec_cmd(menu))
|
||||
hl.bind(mainMod .. " + SHIFT + P", hl.dsp.window.pseudo()) -- dwindle
|
||||
hl.bind(mainMod .. " + J", hl.dsp.layout("togglesplit")) -- dwindle
|
||||
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd(screenshot))
|
||||
hl.bind(mainMod .. " + SHIFT + B", hl.dsp.exec_cmd(pwmanager))
|
||||
hl.bind(mainMod .. " + L", hl.dsp.exec_cmd(lockscreen))
|
||||
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen())
|
||||
hl.bind(mainMod .. " + ESCAPE", hl.dsp.exec_cmd("nwg-bar"))
|
||||
|
||||
-- Move focus
|
||||
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "l" }))
|
||||
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "r" }))
|
||||
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "u" }))
|
||||
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "d" }))
|
||||
|
||||
-- Special workspace (scratchpad)
|
||||
hl.bind(mainMod .. " + space", hl.dsp.workspace.toggle_special("magic"))
|
||||
hl.bind(mainMod .. " + SHIFT + space", hl.dsp.window.move({ workspace = "special:magic" }))
|
||||
|
||||
-- Scroll through existing workspaces
|
||||
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
|
||||
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
|
||||
|
||||
-- Mouse drag/resize (mouse = true replaces the old `bindm`)
|
||||
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
|
||||
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
|
||||
|
||||
-- Multimedia (locked = true makes them work while session is locked,
|
||||
-- replacing the bindel flags `e` and `l`)
|
||||
hl.bind(
|
||||
"XF86AudioRaiseVolume",
|
||||
hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"),
|
||||
{ locked = true, repeating = true }
|
||||
)
|
||||
hl.bind(
|
||||
"XF86AudioLowerVolume",
|
||||
hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"),
|
||||
{ locked = true, repeating = true }
|
||||
)
|
||||
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true })
|
||||
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
|
||||
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl s 5%+"), { locked = true, repeating = true })
|
||||
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl s 5%-"), { locked = true, repeating = true })
|
||||
@@ -0,0 +1,13 @@
|
||||
------------------
|
||||
---- MONITORS ----
|
||||
------------------
|
||||
-- Hyprland uses an inverse Y cartesian system: negative y places a monitor
|
||||
-- HIGHER. The original conf had DP-2 at y=1440 (below DP-1). Kept as-is.
|
||||
hl.monitor({ output = "DP-1", mode = "2560x1440@165", position = "0x0", scale = 1 })
|
||||
hl.monitor({ output = "DP-2", mode = "3440x1440@165", position = "-440x1440", scale = 1 })
|
||||
|
||||
-- Persistent workspace 1 on DP-2
|
||||
hl.workspace_rule({
|
||||
workspace = "1",
|
||||
monitor = "DP-2",
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
hl.config({
|
||||
plugin = {
|
||||
split_monitor_workspaces = {
|
||||
count = 6,
|
||||
keep_focused = 0,
|
||||
enable_notifications = 0,
|
||||
enable_persistent_workspaces = 1,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local smw = hl.plugin.split_monitor_workspaces
|
||||
-- Switch workspaces with mainMod + [1-5]
|
||||
for i = 1, 6 do
|
||||
local key = tostring(i)
|
||||
hl.bind(mainMod .. " + " .. key, function()
|
||||
return smw.workspace(i)
|
||||
end)
|
||||
hl.bind(mainMod .. " + SHIFT + " .. key, function()
|
||||
return smw.move_to_workspace_silent(i)
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
general {
|
||||
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
|
||||
before_sleep_cmd = loginctl lock-session # lock before suspend.
|
||||
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
|
||||
}
|
||||
|
||||
listener {
|
||||
timeout = 300 # 5min
|
||||
on-timeout = loginctl lock-session # lock screen when timeout has passed
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
-- ##########################################################################
|
||||
-- Hyprland 0.55+ Lua configuration.
|
||||
-- Migrated from hyprland.conf (hyprlang). Hyprlang is deprecated since 0.55.
|
||||
-- File location: $XDG_CONFIG_HOME/hypr/hyprland.lua (~/.config/hypr/hyprland.lua)
|
||||
-- Wiki: https://wiki.hypr.land/Configuring/Start/
|
||||
-- ##########################################################################
|
||||
|
||||
local configDir = os.getenv("HOME") .. "/.config/hypr/"
|
||||
package.path = configDir .. "?.lua;" .. package.path
|
||||
|
||||
|
||||
----------------------
|
||||
---- GLOBAL BINDS ----
|
||||
----------------------
|
||||
_G.mainMod = "SUPER"
|
||||
|
||||
---------------------
|
||||
---- MY PROGRAMS ----
|
||||
---------------------
|
||||
_G.terminal = "kitty"
|
||||
_G.fileManager = "pcmanfm"
|
||||
_G.menu = "rofi -show drun"
|
||||
_G.screenshot = 'grim -g "$(slurp)" - | swappy -f -'
|
||||
_G.pwmanager = "bitwarden-desktop"
|
||||
_G.lockscreen = "hyprlock"
|
||||
|
||||
require("hyprconf.base")
|
||||
require("hyprconf.monitor")
|
||||
require("hyprconf.keybinds")
|
||||
require("hyprconf.split-workspace")
|
||||
|
||||
-------------------
|
||||
---- AUTOSTART ----
|
||||
-------------------
|
||||
-- exec-once is gone; use hl.on("hyprland.start", ...).
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("hyprpm reload")
|
||||
hl.exec_cmd("waybar")
|
||||
hl.exec_cmd("hyprpaper")
|
||||
hl.exec_cmd("nm-applet")
|
||||
hl.exec_cmd("blueman-applet")
|
||||
hl.exec_cmd("bitwarden-desktop")
|
||||
hl.exec_cmd("udiskie")
|
||||
hl.exec_cmd("dunst")
|
||||
hl.exec_cmd("nextcloud --background")
|
||||
end)
|
||||
|
||||
|
||||
-------------------------------
|
||||
---- ENVIRONMENT VARIABLES ----
|
||||
-------------------------------
|
||||
hl.env("XCURSOR_SIZE", "24")
|
||||
hl.env("HYPRCURSOR_SIZE", "24")
|
||||
|
||||
-- NVIDIA / Wayland environment.
|
||||
hl.env("LIBVA_DRIVER_NAME", "nvidia")
|
||||
hl.env("XDG_SESSION_TYPE", "wayland")
|
||||
hl.env("GBM_BACKEND", "nvidia-drm")
|
||||
hl.env("__GLX_VENDOR_LIBRARY_NAME", "nvidia")
|
||||
hl.env("NVD_BACKEND", "direct")
|
||||
|
||||
|
||||
|
||||
--------------------------------
|
||||
---- WINDOWS AND WORKSPACES ----
|
||||
--------------------------------
|
||||
-- Float Bitwarden
|
||||
hl.window_rule({
|
||||
name = "bw-float",
|
||||
match = { title = "^(Bitwarden)$" },
|
||||
float = true,
|
||||
})
|
||||
|
||||
-- Suppress maximize events from all clients
|
||||
hl.window_rule({
|
||||
name = "suppress-maximize-events",
|
||||
match = { class = ".*" },
|
||||
suppress_event = "maximize",
|
||||
})
|
||||
@@ -0,0 +1,76 @@
|
||||
background {
|
||||
monitor =
|
||||
path = $HOME/.config/hypr/wp.png
|
||||
color = rgba(24,24,24,1)
|
||||
|
||||
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
|
||||
blur_size = 5
|
||||
blur_passes = 0 # 0 disables blurring
|
||||
noise = 0.0117
|
||||
contrast = 1.3000 # Vibrant!!!
|
||||
brightness = 0.8000
|
||||
vibrancy = 0.2100
|
||||
vibrancy_darkness = 0.0
|
||||
}
|
||||
|
||||
input-field {
|
||||
monitor =
|
||||
size = 450, 50
|
||||
outline_thickness = 3
|
||||
dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
|
||||
dots_spacing = 1.00 # Scale of dots' absolute size, 0.0 - 1.0
|
||||
dots_center = true
|
||||
outer_color = rgba(36,114,200,1)
|
||||
inner_color = rgba(43,43,43,1)
|
||||
font_color = rgba(204,204,204,1)
|
||||
fade_on_empty = true
|
||||
placeholder_text = <i>Password...</i> # Text rendered in the input box when it's empty.
|
||||
hide_input = false
|
||||
position = 0, 60
|
||||
halign = center
|
||||
valign = bottom
|
||||
}
|
||||
|
||||
|
||||
# Current time
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%H") </big></b>"
|
||||
color =rgb(255,255,255)
|
||||
font_size = 128
|
||||
font_family = HackJBMLigatured-Regular 10
|
||||
position = 0, 140
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%M") </big></b>"
|
||||
color =rgb(255,255,255)
|
||||
font_size = 128
|
||||
font_family = HackJBMLigatured-Regular 10
|
||||
position = 0, -20
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%d %b") </big></b>"
|
||||
color =rgb(59,142,234)
|
||||
font_size = 16
|
||||
font_family = HackJBMLigatured-Regular 10
|
||||
position = 0, -160
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
label {
|
||||
monitor =
|
||||
text = cmd[update:1000] echo "<b><big> $(date +"%A") </big></b>"
|
||||
color =rgb(59,142,234)
|
||||
font_size = 16
|
||||
font_family = HackJBMLigatured-Regular 10
|
||||
position = 0, -180
|
||||
halign = center
|
||||
valign = center
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
wallpaper {
|
||||
monitor =
|
||||
path = ~/.config/hypr/wp.png
|
||||
fit_mode = cover
|
||||
}
|
||||
splash = false
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 MiB |
@@ -0,0 +1,104 @@
|
||||
|
||||
# Font stuff
|
||||
font_family family="Berkeley Mono Regular"
|
||||
italic_font auto
|
||||
bold_font auto
|
||||
bold_italic_font auto
|
||||
|
||||
font_size 11.0
|
||||
|
||||
# Nerd Fonts v3.2.0
|
||||
symbol_map U+e000-U+e00a,U+ea60-U+ebeb,U+e0a0-U+e0c8,U+e0ca,U+e0cc-U+e0d7,U+e200-U+e2a9,U+e300-U+e3e3,U+e5fa-U+e6b1,U+e700-U+e7c5,U+ed00-U+efc1,U+f000-U+f2ff,U+f000-U+f2e0,U+f300-U+f372,U+f400-U+f533,U+f0001-U+f1af0 Symbols Nerd Font Mono
|
||||
|
||||
# Transparency
|
||||
background_opacity 0.85
|
||||
|
||||
foreground #cccccc
|
||||
background #181818
|
||||
selection_foreground none
|
||||
selection_background #264f78
|
||||
|
||||
cursor #aeafad
|
||||
cursor_text_color #181818
|
||||
|
||||
url_color #3b8eea
|
||||
|
||||
active_border_color #2472c8
|
||||
inactive_border_color #2b2b2b
|
||||
bell_border_color #e5e510
|
||||
visual_bell_color none
|
||||
|
||||
wayland_titlebar_color system
|
||||
macos_titlebar_color system
|
||||
|
||||
active_tab_background #1f1f1f
|
||||
active_tab_foreground #ffffff
|
||||
inactive_tab_background #181818
|
||||
inactive_tab_foreground #9d9d9d
|
||||
tab_bar_background #181818
|
||||
tab_bar_margin_color none
|
||||
|
||||
# Set up term-colors (Cursor Dark)
|
||||
|
||||
#: black
|
||||
color0 #000000
|
||||
color8 #666666
|
||||
|
||||
#: red
|
||||
color1 #cd3131
|
||||
color9 #f14c4c
|
||||
|
||||
#: green
|
||||
color2 #0dbc79
|
||||
color10 #23d18b
|
||||
|
||||
#: yellow
|
||||
color3 #e5e510
|
||||
color11 #f5f543
|
||||
|
||||
#: blue
|
||||
color4 #2472c8
|
||||
color12 #3b8eea
|
||||
|
||||
#: magenta
|
||||
color5 #bc3fbc
|
||||
color13 #d670d6
|
||||
|
||||
#: cyan
|
||||
color6 #11a8cd
|
||||
color14 #29b8db
|
||||
|
||||
#: white
|
||||
color7 #e5e5e5
|
||||
color15 #e5e5e5
|
||||
|
||||
|
||||
# The cursor shape can be one of (block, beam, underline)
|
||||
shell_integration no-cursor
|
||||
cursor_shape block
|
||||
cursor_blink_interval 0.5
|
||||
cursor_stop_blinking_after 15.0
|
||||
|
||||
# Number of lines of history to keep in memory for scrolling back
|
||||
scrollback_lines 2000
|
||||
scrollback_pager less +G -R
|
||||
wheel_scroll_multiplier 5.0
|
||||
|
||||
# The width (in pts) of window borders. Will be rounded to the nearest number of pixels based on screen resolution.
|
||||
window_border_width 0
|
||||
window_margin_width 20
|
||||
|
||||
|
||||
# Manage font size
|
||||
map ctrl+shift+up increase_font_size
|
||||
map ctrl+shift+down decrease_font_size
|
||||
map ctrl+shift+backspace restore_font_size
|
||||
|
||||
|
||||
# Misc stuff
|
||||
enable_audio_bell yes
|
||||
#open_url_modifiers ctrl+shift
|
||||
term xterm-kitty
|
||||
open_url_with default
|
||||
allow_remote_control yes
|
||||
confirm_os_window_close 0
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This is a wrapper script for lf that allows it to create image previews with
|
||||
# ueberzug. This works in concert with the lf configuration file and the
|
||||
# lf-cleaner script.
|
||||
|
||||
set -e
|
||||
|
||||
cleanup() {
|
||||
exec 3>&-
|
||||
rm "$FIFO_UEBERZUG"
|
||||
}
|
||||
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
lf "$@"
|
||||
else
|
||||
[ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf"
|
||||
export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$"
|
||||
mkfifo "$FIFO_UEBERZUG"
|
||||
ueberzug layer -s <"$FIFO_UEBERZUG" -p json &
|
||||
exec 3>"$FIFO_UEBERZUG"
|
||||
trap cleanup HUP INT QUIT TERM PWR EXIT
|
||||
lf "$@" 3>&-
|
||||
fi
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
|
||||
base="$(basename "$1")"
|
||||
ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'
|
||||
@@ -0,0 +1,4 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=File Manager
|
||||
Exec=/usr/local/bin/st -e lfub %u
|
||||
@@ -0,0 +1,155 @@
|
||||
General usage
|
||||
=============
|
||||
|
||||
::
|
||||
|
||||
mpv infile --o=outfile [--of=outfileformat] [--ofopts=formatoptions] [--orawts] \
|
||||
[(any other mpv options)] \
|
||||
--ovc=outvideocodec [--ovcopts=outvideocodecoptions] \
|
||||
--oac=outaudiocodec [--oacopts=outaudiocodecoptions]
|
||||
|
||||
Help for these options is provided if giving help as parameter, as in::
|
||||
|
||||
mpv --ovc=help
|
||||
|
||||
The suboptions of these generally are identical to ffmpeg's (as option parsing
|
||||
is simply delegated to ffmpeg). The option --ocopyts enables copying timestamps
|
||||
from the source as-is, instead of fixing them to match audio playback time
|
||||
(note: this doesn't work with all output container formats); --orawts even turns
|
||||
off discontinuity fixing.
|
||||
|
||||
Note that if neither --ofps nor --oautofps is specified, VFR encoding is assumed
|
||||
and the time base is 24000fps. --oautofps sets --ofps to a guessed fps number
|
||||
from the input video. Note that not all codecs and not all formats support VFR
|
||||
encoding, and some which do have bugs when a target bitrate is specified - use
|
||||
--ofps or --oautofps to force CFR encoding in these cases.
|
||||
|
||||
Of course, the options can be stored in a profile, like this .config/mpv/mpv.conf
|
||||
section::
|
||||
|
||||
[myencprofile]
|
||||
vf-add = scale=480:-2
|
||||
ovc = libx264
|
||||
ovcopts-add = preset=medium
|
||||
ovcopts-add = tune=fastdecode
|
||||
ovcopts-add = crf=23
|
||||
ovcopts-add = maxrate=1500k
|
||||
ovcopts-add = bufsize=1000k
|
||||
ovcopts-add = rc_init_occupancy=900k
|
||||
ovcopts-add = refs=2
|
||||
ovcopts-add = profile=baseline
|
||||
oac = aac
|
||||
oacopts-add = b=96k
|
||||
|
||||
It's also possible to define default encoding options by putting them into
|
||||
the section named ``[encoding]``. (This behavior changed after mpv 0.3.x. In
|
||||
mpv 0.3.x, config options in the default section / no section were applied
|
||||
to encoding. This is not the case anymore.)
|
||||
|
||||
One can then encode using this profile using the command::
|
||||
|
||||
mpv infile --o=outfile.mp4 --profile=myencprofile
|
||||
|
||||
Some example profiles are provided in a file
|
||||
etc/encoding-profiles.conf; as for this, see below.
|
||||
|
||||
|
||||
Encoding examples
|
||||
=================
|
||||
|
||||
These are some examples of encoding targets this code has been used and tested
|
||||
for.
|
||||
|
||||
Typical MPEG-4 Part 2 ("ASP", "DivX") encoding, AVI container::
|
||||
|
||||
mpv infile --o=outfile.avi \
|
||||
--vf=fps=25 \
|
||||
--ovc=mpeg4 --ovcopts=qscale=4 \
|
||||
--oac=libmp3lame --oacopts=b=128k
|
||||
|
||||
Note: AVI does not support variable frame rate, so the fps filter must be used.
|
||||
The frame rate should ideally match the input (25 for PAL, 24000/1001 or
|
||||
30000/1001 for NTSC)
|
||||
|
||||
Typical MPEG-4 Part 10 ("AVC", "H.264") encoding, Matroska (MKV) container::
|
||||
|
||||
mpv infile --o=outfile.mkv \
|
||||
--ovc=libx264 --ovcopts=preset=medium,crf=23,profile=baseline \
|
||||
--oac=libopus --oacopts=qscale=3
|
||||
|
||||
Typical MPEG-4 Part 10 ("AVC", "H.264") encoding, MPEG-4 (MP4) container::
|
||||
|
||||
mpv infile --o=outfile.mp4 \
|
||||
--ovc=libx264 --ovcopts=preset=medium,crf=23,profile=baseline \
|
||||
--oac=aac --oacopts=b=128k
|
||||
|
||||
Typical VP8 encoding, WebM (restricted Matroska) container::
|
||||
|
||||
mpv infile -o outfile.mkv \
|
||||
--of=webm \
|
||||
--ovc=libvpx --ovcopts=qmin=6,b=1000000k \
|
||||
--oac=libopus --oacopts=qscale=3
|
||||
|
||||
|
||||
Device targets
|
||||
==============
|
||||
|
||||
As the options for various devices can get complex, profiles can be used.
|
||||
|
||||
An example profile file for encoding is provided in
|
||||
etc/encoding-profiles.conf in the source tree. This file is installed and loaded
|
||||
by default. If you want to modify it, you can replace and it with your own copy
|
||||
by doing::
|
||||
|
||||
mkdir -p ~/.mpv
|
||||
cp /etc/mpv/encoding-profiles.conf ~/.mpv/encoding-profiles.conf
|
||||
|
||||
Keep in mind that the default profile is the playback one. If you want to add
|
||||
options that apply only in encoding mode, put them into a ``[encoding]``
|
||||
section.
|
||||
|
||||
Refer to the top of that file for more comments - in a nutshell, the following
|
||||
options are added by it::
|
||||
|
||||
--profile=enc-to-dvdpal # DVD-Video PAL, use dvdauthor -v pal+4:3 -a ac3+en
|
||||
--profile=enc-to-dvdntsc # DVD-Video NTSC, use dvdauthor -v ntsc+4:3 -a ac3+en
|
||||
--profile=enc-to-bb-9000 # MP4 for Blackberry Bold 9000
|
||||
--profile=enc-to-nok-6300 # 3GP for Nokia 6300
|
||||
--profile=enc-to-psp # MP4 for PlayStation Portable
|
||||
--profile=enc-to-iphone # MP4 for iPhone
|
||||
--profile=enc-to-iphone-4 # MP4 for iPhone 4 (double res)
|
||||
--profile=enc-to-iphone-5 # MP4 for iPhone 5 (even larger res)
|
||||
|
||||
You can encode using these with a command line like::
|
||||
|
||||
mpv infile --o=outfile.mp4 --profile=enc-to-bb-9000
|
||||
|
||||
Of course, you are free to override options set by these profiles by specifying
|
||||
them after the -profile option.
|
||||
|
||||
|
||||
What works
|
||||
==========
|
||||
|
||||
* Encoding at variable frame rate (default)
|
||||
* Encoding at constant frame rate using --vf=fps=RATE
|
||||
* 2-pass encoding (specify flags=+pass1 in the first pass's --ovcopts, specify
|
||||
flags=+pass2 in the second pass)
|
||||
* Hardcoding subtitles using vobsub, ass or srt subtitle rendering (just
|
||||
configure mpv for the subtitles as usual)
|
||||
* Hardcoding any other mpv OSD (e.g. time codes, using --osdlevel=3 and
|
||||
--vf=expand=::::1)
|
||||
* Encoding directly from a DVD, network stream, webcam, or any other source
|
||||
mpv supports
|
||||
* Using x264 presets/tunings/profiles (by using profile=, tune=, preset= in the
|
||||
--ovcopts)
|
||||
* Deinterlacing/Inverse Telecine with any of mpv's filters for that
|
||||
* Audio file converting: mpv --o=outfile.m4a infile.flac --no-video
|
||||
--oac=aac --oacopts=b=320k
|
||||
|
||||
What does not work yet
|
||||
======================
|
||||
|
||||
* 3-pass encoding (ensuring constant total size and bitrate constraints while
|
||||
having VBR audio; mencoder calls this "frameno")
|
||||
* Direct stream copy
|
||||
@@ -0,0 +1,170 @@
|
||||
# mpv keybindings
|
||||
#
|
||||
# Location of user-defined bindings: ~/.config/mpv/input.conf
|
||||
#
|
||||
# Lines starting with # are comments. Use SHARP to assign the # key.
|
||||
# Copy this file and uncomment and edit the bindings you want to change.
|
||||
#
|
||||
# List of commands and further details: DOCS/man/input.rst
|
||||
# List of special keys: --input-keylist
|
||||
# Keybindings testing mode: mpv --input-test --force-window --idle
|
||||
#
|
||||
# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore').
|
||||
#
|
||||
# Strings need to be quoted and escaped:
|
||||
# KEY show-text "This is a single backslash: \\ and a quote: \" !"
|
||||
#
|
||||
# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with
|
||||
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal).
|
||||
#
|
||||
# The default keybindings are hardcoded into the mpv binary.
|
||||
# You can disable them completely with: --no-input-default-bindings
|
||||
|
||||
# Developer note:
|
||||
# On compilation, this file is baked into the mpv binary, and all lines are
|
||||
# uncommented (unless '#' is followed by a space) - thus this file defines the
|
||||
# default key bindings.
|
||||
|
||||
# If this is enabled, treat all the following bindings as default.
|
||||
#default-bindings start
|
||||
|
||||
#MBTN_LEFT ignore # don't do anything
|
||||
MBTN_LEFT_DBL cycle fullscreen # toggle fullscreen
|
||||
MBTN_RIGHT cycle pause # toggle pause/playback mode
|
||||
#MBTN_BACK playlist-prev # skip to the previous file
|
||||
#MBTN_FORWARD playlist-next # skip to the next file
|
||||
|
||||
# Mouse wheels, touchpad or other input devices that have axes
|
||||
# if the input devices supports precise scrolling it will also scale the
|
||||
# numeric value accordingly
|
||||
WHEEL_UP add volume 2
|
||||
WHEEL_DOWN add volume -2
|
||||
#WHEEL_LEFT seek -10 # seek 10 seconds backward
|
||||
#WHEEL_RIGHT seek 10 # seek 10 seconds forward
|
||||
|
||||
## Seek units are in seconds, but note that these are limited by keyframes
|
||||
RIGHT seek 5 # seek 5 seconds forward
|
||||
LEFT seek -5 # seek 5 seconds backward
|
||||
#UP seek 60 # seek 1 minute forward
|
||||
#DOWN seek -60 # seek 1 minute backward
|
||||
# Do smaller, always exact (non-keyframe-limited), seeks with shift.
|
||||
# Don't show them on the OSD (no-osd).
|
||||
#Shift+RIGHT no-osd seek 1 exact # seek exactly 1 second forward
|
||||
#Shift+LEFT no-osd seek -1 exact # seek exactly 1 second backward
|
||||
#Shift+UP no-osd seek 5 exact # seek exactly 5 seconds forward
|
||||
#Shift+DOWN no-osd seek -5 exact # seek exactly 5 seconds backward
|
||||
#Ctrl+LEFT no-osd sub-seek -1 # seek to the previous subtitle
|
||||
#Ctrl+RIGHT no-osd sub-seek 1 # seek to the next subtitle
|
||||
#Ctrl+Shift+LEFT sub-step -1 # change subtitle timing such that the previous subtitle is displayed
|
||||
#Ctrl+Shift+RIGHT sub-step 1 # change subtitle timing such that the next subtitle is displayed
|
||||
#Alt+left add video-pan-x 0.1 # move the video right
|
||||
#Alt+right add video-pan-x -0.1 # move the video left
|
||||
#Alt+up add video-pan-y 0.1 # move the video down
|
||||
#Alt+down add video-pan-y -0.1 # move the video up
|
||||
#Alt++ add video-zoom 0.1 # zoom in
|
||||
#ZOOMIN add video-zoom 0.1 # zoom in
|
||||
#Alt+- add video-zoom -0.1 # zoom out
|
||||
#ZOOMOUT add video-zoom -0.1 # zoom out
|
||||
#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings
|
||||
#PGUP add chapter 1 # seek to the next chapter
|
||||
#PGDWN add chapter -1 # seek to the previous chapter
|
||||
#Shift+PGUP seek 600 # seek 10 minutes forward
|
||||
#Shift+PGDWN seek -600 # seek 10 minutes backward
|
||||
#[ multiply speed 1/1.1 # decrease the playback speed
|
||||
#] multiply speed 1.1 # increase the playback speed
|
||||
#{ multiply speed 0.5 # halve the playback speed
|
||||
#} multiply speed 2.0 # double the playback speed
|
||||
#BS set speed 1.0 # reset the speed to normal
|
||||
#Shift+BS revert-seek # undo the previous (or marked) seek
|
||||
#Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek
|
||||
#q quit
|
||||
#Q quit-watch-later # exit and remember the playback position
|
||||
#q {encode} quit 4
|
||||
#ESC set fullscreen no # leave fullscreen
|
||||
#ESC {encode} quit 4
|
||||
#p cycle pause # toggle pause/playback mode
|
||||
#. frame-step # advance one frame and pause
|
||||
#, frame-back-step # go back by one frame and pause
|
||||
#SPACE cycle pause # toggle pause/playback mode
|
||||
#> playlist-next # skip to the next file
|
||||
#ENTER playlist-next # skip to the next file
|
||||
#< playlist-prev # skip to the previous file
|
||||
#O no-osd cycle-values osd-level 3 1 # toggle displaying the OSD on user interaction or always
|
||||
#o show-progress # show playback progress
|
||||
#P show-progress # show playback progress
|
||||
#i script-binding stats/display-stats # display information and statistics
|
||||
#I script-binding stats/display-stats-toggle # toggle displaying information and statistics
|
||||
#` script-binding console/enable # open the console
|
||||
#z add sub-delay -0.1 # shift subtitles 100 ms earlier
|
||||
#Z add sub-delay +0.1 # delay subtitles by 100 ms
|
||||
#x add sub-delay +0.1 # delay subtitles by 100 ms
|
||||
#ctrl++ add audio-delay 0.100 # change audio/video sync by delaying the audio
|
||||
#ctrl+- add audio-delay -0.100 # change audio/video sync by shifting the audio earlier
|
||||
#Shift+g add sub-scale +0.1 # increase the subtitle font size
|
||||
#Shift+f add sub-scale -0.1 # decrease the subtitle font size
|
||||
#9 add volume -2
|
||||
#/ add volume -2
|
||||
#0 add volume 2
|
||||
#* add volume 2
|
||||
m cycle mute # toggle mute
|
||||
#1 add contrast -1
|
||||
#2 add contrast 1
|
||||
#3 add brightness -1
|
||||
#4 add brightness 1
|
||||
#5 add gamma -1
|
||||
#6 add gamma 1
|
||||
#7 add saturation -1
|
||||
#8 add saturation 1
|
||||
#Alt+0 set current-window-scale 0.5 # halve the window size
|
||||
#Alt+1 set current-window-scale 1.0 # reset the window size
|
||||
#Alt+2 set current-window-scale 2.0 # double the window size
|
||||
#d cycle deinterlace # toggle the deinterlacing filter
|
||||
#r add sub-pos -1 # move subtitles up
|
||||
#R add sub-pos +1 # move subtitles down
|
||||
#t add sub-pos +1 # move subtitles down
|
||||
#v cycle sub-visibility # hide or show the subtitles Alt+v cycle secondary-sub-visibility # hide or show the secondary subtitles V cycle sub-ass-vsfilter-aspect-compat # toggle stretching SSA/ASS subtitles with anamorphic videos to match the historical renderer u cycle-values sub-ass-override "force" "yes" # toggle overriding SSA/ASS subtitle styles with the normal styles j cycle sub # switch subtitle track J cycle sub down # switch subtitle track backwards SHARP cycle audio # switch audio track _ cycle video # switch video track T cycle ontop # toggle placing the video on top of other windows f cycle fullscreen # toggle fullscreen s screenshot # take a screenshot of the video in its original resolution with subtitles S screenshot video # take a screenshot of the video in its original resolution without subtitles
|
||||
#Ctrl+s screenshot window # take a screenshot of the window with OSD and subtitles
|
||||
#Alt+s screenshot each-frame # automatically screenshot every frame; issue this command again to stop taking screenshots
|
||||
#w add panscan -0.1 # decrease panscan
|
||||
#W add panscan +0.1 # shrink black bars by cropping the video
|
||||
#e add panscan +0.1 # shrink black bars by cropping the video
|
||||
#A cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" # cycle the video aspect ratio ("-1" is the container aspect)
|
||||
#POWER quit
|
||||
#PLAY cycle pause # toggle pause/playback mode
|
||||
#PAUSE cycle pause # toggle pause/playback mode
|
||||
#PLAYPAUSE cycle pause # toggle pause/playback mode
|
||||
#PLAYONLY set pause no # unpause
|
||||
#PAUSEONLY set pause yes # pause
|
||||
#STOP quit
|
||||
#FORWARD seek 60 # seek 1 minute forward
|
||||
#REWIND seek -60 # seek 1 minute backward
|
||||
#NEXT playlist-next # skip to the next file
|
||||
#PREV playlist-prev # skip to the previous file
|
||||
#VOLUME_UP add volume 2
|
||||
#VOLUME_DOWN add volume -2
|
||||
#MUTE cycle mute # toggle mute
|
||||
#CLOSE_WIN quit
|
||||
#CLOSE_WIN {encode} quit 4
|
||||
#ctrl+w quit
|
||||
#E cycle edition # switch edition
|
||||
#l ab-loop # set/clear A-B loop points
|
||||
#L cycle-values loop-file "inf" "no" # toggle infinite looping
|
||||
#ctrl+c quit 4
|
||||
#DEL script-binding osc/visibility # cycle OSC visibility between never, auto (mouse-move) and always
|
||||
#ctrl+h cycle-values hwdec "auto-safe" "no" # toggle hardware decoding
|
||||
#F8 show-text ${playlist} # show the playlist
|
||||
#F9 show-text ${track-list} # show the list of video, audio and sub tracks
|
||||
|
||||
#
|
||||
# Legacy bindings (may or may not be removed in the future)
|
||||
#
|
||||
#! add chapter -1 # seek to the previous chapter
|
||||
#@ add chapter 1 # seek to the next chapter
|
||||
|
||||
#
|
||||
# Not assigned by default
|
||||
# (not an exhaustive list of unbound commands)
|
||||
#
|
||||
|
||||
# ? cycle sub-forced-events-only # display only DVD/PGS forced subtitle events
|
||||
# ? stop # stop playback (quit or enter idle mode)
|
||||
@@ -0,0 +1,93 @@
|
||||
##
|
||||
## MPlayer-style key bindings
|
||||
##
|
||||
## Save it as ~/.config/mpv/input.conf to use it.
|
||||
##
|
||||
## Generally, it's recommended to use this as reference-only.
|
||||
##
|
||||
|
||||
RIGHT seek +10
|
||||
LEFT seek -10
|
||||
DOWN seek -60
|
||||
UP seek +60
|
||||
PGUP seek 600
|
||||
PGDWN seek -600
|
||||
m cycle mute
|
||||
SHARP cycle audio # switch audio streams
|
||||
+ add audio-delay 0.100
|
||||
= add audio-delay 0.100
|
||||
- add audio-delay -0.100
|
||||
[ multiply speed 0.9091 # scale playback speed
|
||||
] multiply speed 1.1
|
||||
{ multiply speed 0.5
|
||||
} multiply speed 2.0
|
||||
BS set speed 1.0 # reset speed to normal
|
||||
q quit
|
||||
ESC quit
|
||||
ENTER playlist-next force # skip to next file
|
||||
p cycle pause
|
||||
. frame-step # advance one frame and pause
|
||||
SPACE cycle pause
|
||||
HOME set playlist-pos 0 # not the same as MPlayer
|
||||
#END pt_up_step -1
|
||||
> playlist-next # skip to next file
|
||||
< playlist-prev # previous
|
||||
#INS alt_src_step 1
|
||||
#DEL alt_src_step -1
|
||||
o osd
|
||||
I show-text "${filename}" # display filename in osd
|
||||
P show-progress
|
||||
z add sub-delay -0.1 # subtract 100 ms delay from subs
|
||||
x add sub-delay +0.1 # add
|
||||
9 add volume -1
|
||||
/ add volume -1
|
||||
0 add volume 1
|
||||
* add volume 1
|
||||
1 add contrast -1
|
||||
2 add contrast 1
|
||||
3 add brightness -1
|
||||
4 add brightness 1
|
||||
5 add hue -1
|
||||
6 add hue 1
|
||||
7 add saturation -1
|
||||
8 add saturation 1
|
||||
( add balance -0.1 # adjust audio balance in favor of left
|
||||
) add balance +0.1 # right
|
||||
d cycle framedrop
|
||||
D cycle deinterlace # toggle deinterlacer (auto-inserted filter)
|
||||
r add sub-pos -1 # move subtitles up
|
||||
t add sub-pos +1 # down
|
||||
#? sub-step +1 # immediately display next subtitle
|
||||
#? sub-step -1 # previous
|
||||
#? add sub-scale +0.1 # increase subtitle font size
|
||||
#? add sub-scale -0.1 # decrease subtitle font size
|
||||
f cycle fullscreen
|
||||
T cycle ontop # toggle video window ontop of other windows
|
||||
w add panscan -0.1 # zoom out with -panscan 0 -fs
|
||||
e add panscan +0.1 # in
|
||||
c cycle stream-capture # save (and append) file/stream to stream.dump with -capture
|
||||
s screenshot # take a screenshot (if you want PNG, use "--screenshot-format=png")
|
||||
S screenshot - each-frame # S will take a png screenshot of every frame
|
||||
|
||||
h cycle tv-channel 1
|
||||
l cycle tv-channel -1
|
||||
n cycle tv-norm
|
||||
#b tv_step_chanlist
|
||||
|
||||
#? add chapter -1 # skip to previous dvd chapter
|
||||
#? add chapter +1 # next
|
||||
|
||||
##
|
||||
## Advanced seek
|
||||
## Uncomment the following lines to be able to seek to n% of the media with
|
||||
## the Fx keys.
|
||||
##
|
||||
#F1 seek 10 absolute-percent
|
||||
#F2 seek 20 absolute-percent
|
||||
#F3 seek 30 absolute-percent
|
||||
#F4 seek 40 absolute-percent
|
||||
#F5 seek 50 absolute-percent
|
||||
#F6 seek 60 absolute-percent
|
||||
#F7 seek 70 absolute-percent
|
||||
#F8 seek 80 absolute-percent
|
||||
#F9 seek 90 absolute-percent
|
||||
@@ -0,0 +1,143 @@
|
||||
#
|
||||
# Example mpv configuration file
|
||||
#
|
||||
# Warning:
|
||||
#
|
||||
# The commented example options usually do _not_ set the default values. Call
|
||||
# mpv with --list-options to see the default values for most options. There is
|
||||
# no builtin or example mpv.conf with all the defaults.
|
||||
#
|
||||
#
|
||||
# Configuration files are read system-wide from /usr/local/etc/mpv.conf
|
||||
# and per-user from ~/.config/mpv/mpv.conf, where per-user settings override
|
||||
# system-wide settings, all of which are overridden by the command line.
|
||||
#
|
||||
# Configuration file settings and the command line options use the same
|
||||
# underlying mechanisms. Most options can be put into the configuration file
|
||||
# by dropping the preceding '--'. See the man page for a complete list of
|
||||
# options.
|
||||
#
|
||||
# Lines starting with '#' are comments and are ignored.
|
||||
#
|
||||
# See the CONFIGURATION FILES section in the man page
|
||||
# for a detailed description of the syntax.
|
||||
#
|
||||
# Profiles should be placed at the bottom of the configuration file to ensure
|
||||
# that settings wanted as defaults are not restricted to specific profiles.
|
||||
|
||||
##################
|
||||
# video settings #
|
||||
##################
|
||||
|
||||
# Start in fullscreen mode by default.
|
||||
#fs=yes
|
||||
|
||||
# force starting with centered window
|
||||
#geometry=50%:50%
|
||||
|
||||
# don't allow a new window to have a size larger than 90% of the screen size
|
||||
#autofit-larger=90%x90%
|
||||
|
||||
# Do not close the window on exit.
|
||||
#keep-open=yes
|
||||
|
||||
# Do not wait with showing the video window until it has loaded. (This will
|
||||
# resize the window once video is loaded. Also always shows a window with
|
||||
# audio.)
|
||||
#force-window=immediate
|
||||
|
||||
# Disable the On Screen Controller (OSC).
|
||||
#osc=no
|
||||
|
||||
# Keep the player window on top of all other windows.
|
||||
#ontop=yes
|
||||
|
||||
# Specify fast video rendering preset (for --vo=<gpu|gpu-next> only)
|
||||
# Recommended for mobile devices or older hardware with limited processing power
|
||||
#profile=fast
|
||||
|
||||
# Specify high quality video rendering preset (for --vo=<gpu|gpu-next> only)
|
||||
# Offers superior image fidelity and visual quality for an enhanced viewing
|
||||
# experience on capable hardware
|
||||
#profile=high-quality
|
||||
|
||||
# Force video to lock on the display's refresh rate, and change video and audio
|
||||
# speed to some degree to ensure synchronous playback - can cause problems
|
||||
# with some drivers and desktop environments.
|
||||
#video-sync=display-resample
|
||||
|
||||
# Enable hardware decoding if available. Often, this does not work with all
|
||||
# video outputs, but should work well with default settings on most systems.
|
||||
# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs
|
||||
# may or may not help.
|
||||
#hwdec=auto
|
||||
|
||||
##################
|
||||
# audio settings #
|
||||
##################
|
||||
|
||||
# Specify default audio device. You can list devices with: --audio-device=help
|
||||
# The option takes the device string (the stuff between the '...').
|
||||
#audio-device=alsa/default
|
||||
|
||||
# Do not filter audio to keep pitch when changing playback speed.
|
||||
#audio-pitch-correction=no
|
||||
|
||||
# Output 5.1 audio natively, and upmix/downmix audio with a different format.
|
||||
#audio-channels=5.1
|
||||
# Disable any automatic remix, _if_ the audio output accepts the audio format.
|
||||
# of the currently played file. See caveats mentioned in the manpage.
|
||||
# (The default is "auto-safe", see manpage.)
|
||||
#audio-channels=auto
|
||||
|
||||
##################
|
||||
# other settings #
|
||||
##################
|
||||
|
||||
# Pretend to be a web browser. Might fix playback with some streaming sites,
|
||||
# but also will break with shoutcast streams.
|
||||
#user-agent="Mozilla/5.0"
|
||||
|
||||
# cache settings
|
||||
#
|
||||
# Use a large seekable RAM cache even for local input.
|
||||
#cache=yes
|
||||
#
|
||||
# Use extra large RAM cache (needs cache=yes to make it useful).
|
||||
#demuxer-max-bytes=500M
|
||||
#demuxer-max-back-bytes=100M
|
||||
#
|
||||
# Disable the behavior that the player will pause if the cache goes below a
|
||||
# certain fill size.
|
||||
#cache-pause=no
|
||||
#
|
||||
# Store cache payload on the hard disk instead of in RAM. (This may negatively
|
||||
# impact performance unless used for slow input such as network.)
|
||||
#cache-dir=~/.cache/
|
||||
#cache-on-disk=yes
|
||||
|
||||
# Display English subtitles if available.
|
||||
#slang=en
|
||||
|
||||
# Play Finnish audio if available, fall back to English otherwise.
|
||||
#alang=fi,en
|
||||
|
||||
# Change subtitle encoding. For Arabic subtitles use 'cp1256'.
|
||||
# If the file seems to be valid UTF-8, prefer UTF-8.
|
||||
# (You can add '+' in front of the codepage to force it.)
|
||||
#sub-codepage=cp1256
|
||||
|
||||
# You can also include other configuration files.
|
||||
#include=/path/to/the/file/you/want/to/include
|
||||
|
||||
############
|
||||
# Profiles #
|
||||
############
|
||||
|
||||
# The options declared as part of profiles override global default settings,
|
||||
# but only take effect when the profile is active.
|
||||
|
||||
# The following profile can be enabled on the command line with: --profile=eye-cancer
|
||||
|
||||
#[eye-cancer]
|
||||
#sharpen=5
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
# This file contains all bindings that were removed after a certain release.
|
||||
# If you want MPlayer bindings, use mplayer-input.conf
|
||||
|
||||
# Pick the bindings you want back and add them to your own input.conf. Append
|
||||
# this file to your input.conf if you want them all back:
|
||||
#
|
||||
# cat restore-old-bindings.conf >> ~/.config/mpv/input.conf
|
||||
#
|
||||
# Older installations use ~/.mpv/input.conf instead.
|
||||
|
||||
# changed in mpv 0.37.0
|
||||
|
||||
WHEEL_UP seek 10 # seek 10 seconds forward
|
||||
WHEEL_DOWN seek -10 # seek 10 seconds backward
|
||||
WHEEL_LEFT add volume -2
|
||||
WHEEL_RIGHT add volume 2
|
||||
|
||||
# changed in mpv 0.27.0 (macOS and Wayland only)
|
||||
|
||||
# WHEEL_LEFT seek 5
|
||||
# WHEEL_RIGHT seek -5
|
||||
|
||||
# changed in mpv 0.26.0
|
||||
|
||||
H cycle dvbin-channel-switch-offset up
|
||||
K cycle dvbin-channel-switch-offset down
|
||||
|
||||
I show-text "${filename}" # display filename in osd
|
||||
|
||||
# changed in mpv 0.24.0
|
||||
|
||||
L cycle-values loop-playlist "inf" "no"
|
||||
|
||||
# changed in mpv 0.10.0
|
||||
|
||||
O osd
|
||||
D cycle deinterlace
|
||||
d cycle framedrop
|
||||
|
||||
# changed in mpv 0.7.0
|
||||
|
||||
ENTER playlist-next force
|
||||
|
||||
# changed in mpv 0.6.0
|
||||
|
||||
ESC quit
|
||||
|
||||
# changed in mpv 0.5.0
|
||||
|
||||
PGUP seek 600
|
||||
PGDWN seek -600
|
||||
RIGHT seek 10
|
||||
LEFT seek -10
|
||||
+ add audio-delay 0.100
|
||||
- add audio-delay -0.100
|
||||
F cycle sub-forced-events-only
|
||||
U stop
|
||||
o cycle-values osd-level
|
||||
@@ -0,0 +1,656 @@
|
||||
This file intends to give a big picture overview of how mpv is structured.
|
||||
|
||||
player/*.c:
|
||||
Essentially makes up the player applications, including the main() function
|
||||
and the playback loop.
|
||||
|
||||
Generally, it accesses all other subsystems, initializes them, and pushes
|
||||
data between them during playback.
|
||||
|
||||
The structure is as follows (as of commit e13c05366557cb):
|
||||
* main():
|
||||
* basic initializations (e.g. init_libav() and more)
|
||||
* pre-parse command line (verbosity level, config file locations)
|
||||
* load config files (parse_cfgfiles())
|
||||
* parse command line, add files from the command line to playlist
|
||||
(m_config_parse_mp_command_line())
|
||||
* check help options etc. (call handle_help_options()), possibly exit
|
||||
* call mp_play_files() function that works down the playlist:
|
||||
* run idle loop (idle_loop()), until there are files in the
|
||||
playlist or an exit command was given (only if --idle it set)
|
||||
* actually load and play a file in play_current_file():
|
||||
* run all the dozens of functions to load the file and
|
||||
initialize playback
|
||||
* run a small loop that does normal playback, until the file is
|
||||
done or a command terminates playback
|
||||
(on each iteration, run_playloop() is called, which is rather
|
||||
big and complicated - it decodes some audio and video on
|
||||
each frame, waits for input, etc.)
|
||||
* uninitialize playback
|
||||
* determine next entry on the playlist to play
|
||||
* loop, or exit if no next file or quit is requested
|
||||
(see enum stop_play_reason)
|
||||
* call mp_destroy()
|
||||
* run_playloop():
|
||||
* calls fill_audio_out_buffers()
|
||||
This checks whether new audio needs to be decoded, and pushes it
|
||||
to the AO.
|
||||
* calls write_video()
|
||||
Decode new video, and push it to the VO.
|
||||
* determines whether playback of the current file has ended
|
||||
* determines when to start playback after seeks
|
||||
* and calls a whole lot of other stuff
|
||||
(Really, this function does everything.)
|
||||
|
||||
Things worth saying about the playback core:
|
||||
- most state is in MPContext (core.h), which is not available to the
|
||||
subsystems (and should not be made available)
|
||||
- the currently played tracks are in mpctx->current_tracks, and decoder
|
||||
state in track.dec/d_sub
|
||||
- the other subsystems rarely call back into the frontend, and the frontend
|
||||
polls them instead (probably a good thing)
|
||||
- one exceptions are wakeup callbacks, which notify a "higher" component
|
||||
of a changed situation in a subsystem
|
||||
|
||||
I like to call the player/*.c files the "frontend".
|
||||
|
||||
ta.h & ta.c:
|
||||
Hierarchical memory manager inspired by talloc from Samba. It's like a
|
||||
malloc() with more features. Most importantly, each talloc allocation can
|
||||
have a parent, and if the parent is free'd, all children will be free'd as
|
||||
well. The parent is an arbitrary talloc allocation. It's either set by the
|
||||
allocation call by passing a talloc parent, usually as first argument to the
|
||||
allocation function. It can also be set or reset later by other calls (at
|
||||
least talloc_steal()). A talloc allocation that is used as parent is often
|
||||
called a talloc context.
|
||||
|
||||
One very useful feature of talloc is fast tracking of memory leaks. ("Fast"
|
||||
as in it doesn't require valgrind.) You can enable it by setting the
|
||||
MPV_LEAK_REPORT environment variable to "1":
|
||||
export MPV_LEAK_REPORT=1
|
||||
Or permanently by building with --enable-ta-leak-report.
|
||||
This will list all unfree'd allocations on exit.
|
||||
|
||||
Documentation can be found here:
|
||||
http://git.samba.org/?p=samba.git;a=blob;f=lib/talloc/talloc.h;hb=HEAD
|
||||
|
||||
For some reason, we're still using API-compatible wrappers instead of TA
|
||||
directly. The talloc wrapper has only a subset of the functionality, and
|
||||
in particular the wrappers abort() on memory allocation failure.
|
||||
|
||||
Note: unlike tcmalloc, jemalloc, etc., talloc() is not actually a malloc
|
||||
replacement. It works on top of system malloc and provides additional
|
||||
features that are supposed to make memory management easier.
|
||||
|
||||
player/command.c:
|
||||
This contains the implementation for client API commands and properties.
|
||||
Properties are essentially dynamic variables changed by certain commands.
|
||||
This is basically responsible for all user commands, like initiating
|
||||
seeking, switching tracks, etc. It calls into other player/*.c files,
|
||||
where most of the work is done, but also calls other parts of mpv.
|
||||
|
||||
player/core.h:
|
||||
Data structures and function prototypes for most of player/*.c. They are
|
||||
usually not accessed by other parts of mpv for the sake of modularization.
|
||||
|
||||
player/client.c:
|
||||
This implements the client API (libmpv/client.h). For the most part, this
|
||||
just calls into other parts of the player. This also manages a ringbuffer
|
||||
of events from player to clients.
|
||||
|
||||
options/options.h, options/options.c
|
||||
options.h contains the global option struct MPOpts. The option declarations
|
||||
(option names, types, and MPOpts offsets for the option parser) are in
|
||||
options.c. Most default values for options and MPOpts are in
|
||||
mp_default_opts at the end of options.c.
|
||||
|
||||
MPOpts is unfortunately quite monolithic, but is being incrementally broken
|
||||
up into sub-structs. Many components have their own sub-option structs
|
||||
separate from MPOpts. New options should be bound to the component that uses
|
||||
them. Add a new option table/struct if needed.
|
||||
|
||||
The global MPOpts still contains the sub-structs as fields, which serves to
|
||||
link them to the option parser. For example, an entry like this may be
|
||||
typical:
|
||||
|
||||
{"", OPT_SUBSTRUCT(demux_opts, demux_conf)},
|
||||
|
||||
This directs the option access code to include all options in demux_conf
|
||||
into the global option list, with no prefix (""), and as part of the
|
||||
MPOpts.demux_opts field. The MPOpts.demux_opts field is actually not
|
||||
accessed anywhere, and instead demux.c does this:
|
||||
|
||||
struct m_config_cache *opts_cache =
|
||||
m_config_cache_alloc(demuxer, global, &demux_conf);
|
||||
struct demux_opts *opts = opts_cache->opts;
|
||||
|
||||
... to get a copy of its options.
|
||||
|
||||
See m_config.h (below) how to access options.
|
||||
|
||||
The actual option parser is spread over m_option.c, m_config.c, and
|
||||
parse_commandline.c, and uses the option table in options.c.
|
||||
|
||||
options/m_config.h & m_config.c:
|
||||
Code for querying and managing options. This (unfortunately) contains both
|
||||
declarations for the "legacy-ish" global m_config struct, and ways to access
|
||||
options in a threads-safe way anywhere, like m_config_cache_alloc().
|
||||
|
||||
m_config_cache_alloc() lets anyone read, observe, and write options in any
|
||||
thread. The only state it needs is struct mpv_global, which is an opaque
|
||||
type that can be passed "down" the component hierarchy. For safety reasons,
|
||||
you should not pass down any pointers to option structs (like MPOpts), but
|
||||
instead pass down mpv_global, and use m_config_cache_alloc() (or similar)
|
||||
to get a synchronized copy of the options.
|
||||
|
||||
input/input.c:
|
||||
This translates keyboard input coming from VOs and other sources (such
|
||||
as remote control devices like Apple IR or client API commands) to the
|
||||
key bindings listed in the user's (or the builtin) input.conf and turns
|
||||
them into items of type struct mp_cmd. These commands are queued, and read
|
||||
by playloop.c. They get pushed with run_command() to command.c.
|
||||
|
||||
Note that keyboard input and commands used by the client API are the same.
|
||||
The client API only uses the command parser though, and has its own queue
|
||||
of input commands somewhere else.
|
||||
|
||||
common/msg.h:
|
||||
All terminal output must go through mp_msg().
|
||||
|
||||
stream/*:
|
||||
File input is implemented here. stream.h/.c provides a simple stream based
|
||||
interface (like reading a number of bytes at a given offset). mpv can
|
||||
also play from http streams and such, which is implemented here.
|
||||
|
||||
E.g. if mpv sees "http://something" on the command line, it will pick
|
||||
stream_lavf.c based on the prefix, and pass the rest of the filename to it.
|
||||
|
||||
Some stream inputs are quite special: stream_dvd.c turns DVDs into mpeg
|
||||
streams (DVDs are actually a bunch of vob files etc. on a filesystem),
|
||||
stream_tv.c provides TV input including channel switching.
|
||||
|
||||
Some stream inputs are just there to invoke special demuxers, like
|
||||
stream_mf.c. (Basically to make the prefix "mf://" do something special.)
|
||||
|
||||
demux/:
|
||||
Demuxers split data streams into audio/video/sub streams, which in turn
|
||||
are split in packets. Packets (see demux_packet.h) are mostly byte chunks
|
||||
tagged with a playback time (PTS). These packets are passed to the decoders.
|
||||
|
||||
Most demuxers have been removed from this fork, and the only important and
|
||||
"actual" demuxers left are demux_mkv.c and demux_lavf.c (uses libavformat).
|
||||
There are some pseudo demuxers like demux_cue.c.
|
||||
|
||||
The main interface is in demux.h. The stream headers are in stheader.h.
|
||||
There is a stream header for each audio/video/sub stream, and each of them
|
||||
holds codec information about the stream and other information.
|
||||
|
||||
demux.c is a bit big, the main reason being that it contains the demuxer
|
||||
cache, which is implemented as a list of packets. The cache is complex
|
||||
because it support seeking, multiple ranges, prefetching, and so on.
|
||||
|
||||
video/:
|
||||
This contains several things related to audio/video decoding, as well as
|
||||
video filters.
|
||||
|
||||
mp_image.h and img_format.h define how mpv stores decoded video frames
|
||||
internally.
|
||||
|
||||
video/decode/:
|
||||
vd_*.c are video decoders. (There's only vd_lavc.c left.) dec_video.c
|
||||
handles most of connecting the frontend with the actual decoder.
|
||||
|
||||
video/filter/:
|
||||
vf_*.c and vf.c form the video filter chain. They are fed by the video
|
||||
decoder, and output the filtered images to the VOs though vf_vo.c. By
|
||||
default, no video filters (except vf_vo) are used. vf_scale is automatically
|
||||
inserted if the video output can't handle the video format used by the
|
||||
decoder.
|
||||
|
||||
video/out/:
|
||||
Video output. They also create GUI windows and handle user input. In most
|
||||
cases, the windowing code is shared among VOs, like x11_common.c for X11 and
|
||||
w32_common.c for Windows. The VOs stand between frontend and windowing code.
|
||||
vo_gpu can pick a windowing system at runtime, e.g. the same binary can
|
||||
provide both X11 and Cocoa support on OSX.
|
||||
|
||||
VOs can be reconfigured at runtime. A vo_reconfig() call can change the video
|
||||
resolution and format, without destroying the window.
|
||||
|
||||
vo_gpu should be taken as reference.
|
||||
|
||||
audio/:
|
||||
format.h/format.c define the uncompressed audio formats. (As well as some
|
||||
compressed formats used for spdif.)
|
||||
|
||||
audio/decode/:
|
||||
ad_*.c and dec_audio.c handle audio decoding. ad_lavc.c is the
|
||||
decoder using ffmpeg. ad_spdif.c is not really a decoder, but is used for
|
||||
compressed audio passthrough.
|
||||
|
||||
audio/filter/:
|
||||
Audio filter chain. af_lavrresample is inserted if any form of conversion
|
||||
between audio formats is needed.
|
||||
|
||||
audio/out/:
|
||||
Audio outputs.
|
||||
|
||||
Unlike VOs, AOs can't be reconfigured on a format change. On audio format
|
||||
changes, the AO will simply be closed and re-opened.
|
||||
|
||||
There are wrappers to support for two types of audio APIs: push.c and
|
||||
pull.c. ao.c calls into one of these. They contain generic code to deal
|
||||
with the data flow these APIs impose.
|
||||
|
||||
Note that mpv synchronizes the video to the audio. That's the reason
|
||||
why buggy audio drivers can have a bad influence on playback quality.
|
||||
|
||||
sub/:
|
||||
Contains subtitle and OSD rendering.
|
||||
|
||||
osd.c/.h is actually the OSD code. It queries dec_sub.c to retrieve
|
||||
decoded/rendered subtitles. osd_libass.c is the actual implementation of
|
||||
the OSD text renderer (which uses libass, and takes care of all the tricky
|
||||
fontconfig/freetype API usage and text layouting).
|
||||
|
||||
The VOs call osd.c to render OSD and subtitle (via e.g. osd_draw()). osd.c
|
||||
in turn asks dec_sub.c for subtitle overlay bitmaps, which relays the
|
||||
request to one of the sd_*.c subtitle decoders/renderers.
|
||||
|
||||
Subtitle loading is in demux/. The MPlayer subreader.c is mostly gone - parts
|
||||
of it survive in demux_subreader.c. It's used as last fallback, or to handle
|
||||
some text subtitle types on Libav. It should go away eventually. Normally,
|
||||
subtitles are loaded via demux_lavf.c.
|
||||
|
||||
The subtitles are passed to dec_sub.c and the subtitle decoders in sd_*.c
|
||||
as they are demuxed. All text subtitles are rendered by sd_ass.c. If text
|
||||
subtitles are not in the ASS format, the libavcodec subtitle converters are
|
||||
used (lavc_conv.c).
|
||||
|
||||
Text subtitles can be preloaded, in which case they are read fully as soon
|
||||
as the subtitle is selected. In this case, they are effectively stored in
|
||||
sd_ass.c's internal state.
|
||||
|
||||
etc/:
|
||||
The file input.conf is actually integrated into the mpv binary by the
|
||||
build system. It contains the default keybindings.
|
||||
|
||||
Best practices and Concepts within mpv
|
||||
======================================
|
||||
|
||||
General contribution etc.
|
||||
-------------------------
|
||||
|
||||
See: DOCS/contribute.md
|
||||
|
||||
Error checking
|
||||
--------------
|
||||
|
||||
If an error is relevant, it should be handled. If it's interesting, log the
|
||||
error. However, mpv often keeps errors silent and reports failures somewhat
|
||||
coarsely by propagating them upwards the caller chain. This is OK, as long as
|
||||
the errors are not very interesting, or would require a developer to debug it
|
||||
anyway (in which case using a debugger would be more convenient, and the
|
||||
developer would need to add temporary debug printfs to get extremely detailed
|
||||
information which would not be appropriate during normal operation).
|
||||
|
||||
Basically, keep a balance on error reporting. But always check them, unless you
|
||||
have a good argument not to.
|
||||
|
||||
Memory allocation errors (OOM) are a special class of errors. Normally such
|
||||
allocation failures are not handled "properly". Instead, abort() is called.
|
||||
(New code should use MP_HANDLE_OOM() for this.) This is done out of laziness and
|
||||
for convenience, and due to the fact that MPlayer/mplayer2 never handled it
|
||||
correctly. (MPlayer varied between handling it correctly, trying to do so but
|
||||
failing, and just not caring, while mplayer2 started using abort() for it.)
|
||||
|
||||
This is justifiable in a number of ways. Error handling paths are notoriously
|
||||
untested and buggy, so merely having them won't make your program more reliable.
|
||||
Having these error handling paths also complicates non-error code, due to the
|
||||
need to roll back state at any point after a memory allocation.
|
||||
|
||||
Take any larger body of code, that is supposed to handle OOM, and test whether
|
||||
the error paths actually work, for example by overriding malloc with a version
|
||||
that randomly fails. You will find bugs quickly, and often they will be very
|
||||
annoying to fix (if you can even reproduce them).
|
||||
|
||||
In addition, a clear indication that something went wrong may be missing. On
|
||||
error your program may exhibit "degraded" behavior by design. Consider a video
|
||||
encoder dropping frames somewhere in the middle of a video due to temporary
|
||||
allocation failures, instead of just exiting with an errors. In other cases, it
|
||||
may open conceptual security holes. Failing fast may be better.
|
||||
|
||||
mpv uses GPU APIs, which may be break on allocation errors (because driver
|
||||
authors will have the same issues as described here), or don't even have a real
|
||||
concept for dealing with OOM (OpenGL).
|
||||
|
||||
libmpv is often used by GUIs, which I predict always break if OOM happens.
|
||||
|
||||
Last but not least, OSes like Linux use "overcommit", which basically means that
|
||||
your program may crash any time OOM happens, even if it doesn't use malloc() at
|
||||
all!
|
||||
|
||||
But still, don't just assume malloc() always succeeds. Use MP_HANDLE_OOM(). The
|
||||
ta* APIs do this for you. The reason for this is that dereferencing a NULL
|
||||
pointer can have security relevant consequences if large offsets are involved.
|
||||
Also, a clear error message is better than a random segfault.
|
||||
|
||||
Some big memory allocations are checked anyway. For example, all code must
|
||||
assume that allocating video frames or packets can fail. (The above example
|
||||
of dropping video frames during encoding is entirely possible in mpv.)
|
||||
|
||||
Undefined behavior
|
||||
------------------
|
||||
|
||||
Undefined behavior (UB) is a concept in the C language. C is famous for being a
|
||||
language that makes it almost impossible to write working code, because
|
||||
undefined behavior is so easily triggered, compilers will happily abuse it to
|
||||
generate "faster" code, debugging tools will shout at you, and sometimes it
|
||||
even means your code doesn't work.
|
||||
|
||||
There is a lot of literature on this topic. Read it.
|
||||
|
||||
(In C's defense, UB exists in other languages too, but since they're not used
|
||||
for low level infrastructure, and/or these languages are at times not rigorously
|
||||
defined, simply nobody cares. However, the C standard committee is still guilty
|
||||
for not addressing this. I'll admit that I can't even tell from the standard's
|
||||
gibberish whether some specific behavior is UB or not. It's written like tax
|
||||
law.)
|
||||
|
||||
In mpv, we generally try to avoid undefined behavior. For one, we want portable
|
||||
and reliable operation. But more importantly, we want clean output from
|
||||
debugging tools, in order to find real bugs more quickly and effectively.
|
||||
|
||||
Avoid the "works in practice" argument. Once debugging tools come into play, or
|
||||
simply when "in practice" stops being true, this will all get back to you in a
|
||||
bad way.
|
||||
|
||||
Global state, library safety
|
||||
----------------------------
|
||||
|
||||
Mutable global state is when code uses global variables that are not read-only.
|
||||
This must be avoided in mpv. Always use context structs that the caller of
|
||||
your code needs to allocate, and whose pointers are passed to your functions.
|
||||
|
||||
Library safety means that your code (or library) can be used by a library
|
||||
without causing conflicts with other library users in the same process. To any
|
||||
piece of code, a "safe" library's API can simply be used, without having to
|
||||
worry about other API users that may be around somewhere.
|
||||
|
||||
Libraries are often not library safe, because they use global mutable state
|
||||
or other "global" resources. Typical examples include use of signals, simple
|
||||
global variables (like hsearch() in libc), or internal caches not protected by
|
||||
locks.
|
||||
|
||||
A surprisingly high number of libraries are not library safe because they need
|
||||
global initialization. Typically they provide an API function, which
|
||||
"initializes" the library, and which must be called before calling any other
|
||||
API functions. Often, you are to provide global configuration parameters, which
|
||||
can change the behavior of the library. If two libraries A and B use library C,
|
||||
but A and B initialize C with different parameters, something "bad" may happen.
|
||||
In addition, these global initialization functions are often not thread-safe. So
|
||||
if A and B try to initialize C at the same time (from different threads and
|
||||
without knowing about each other), it may cause undefined behavior. (libcurl is
|
||||
a good example of both of these issues. FFmpeg and some TLS libraries used to be
|
||||
affected, but improved.)
|
||||
|
||||
This is so bad because library A and B from the previous example most likely
|
||||
have no way to cooperate, because they're from different authors and have no
|
||||
business knowing each others. They'd need a library D, which wraps library C
|
||||
in a safe way. Unfortunately, typically something worse happens: libraries get
|
||||
"infected" by the unsafeness of its sub-libraries, and export a global init API
|
||||
just to initialize the sub-libraries. In the previous example, libraries A and B
|
||||
would export global init APIs just to init library C, even though the rest of
|
||||
A/B are clean and library safe. (Again, libcurl is an example of this, if you
|
||||
subtract other historic anti-features.)
|
||||
|
||||
The main problem with library safety is that its lack propagates to all
|
||||
libraries using the library.
|
||||
|
||||
We require libmpv to be library safe. This is not really possible, because some
|
||||
libraries are not library safe (FFmpeg, Xlib, partially ALSA). However, for
|
||||
ideological reasons, there is no global init API, and best effort is made to try
|
||||
to avoid problems.
|
||||
|
||||
libmpv has some features that are not library safe, but which are disabled by
|
||||
default (such as terminal usage aka stdout, or JSON IPC blocking SIGPIPE for
|
||||
internal convenience).
|
||||
|
||||
A notable, very disgustingly library unsafe behavior of libmpv is calling
|
||||
abort() on some memory allocation failure. See error checking section.
|
||||
|
||||
Logging
|
||||
-------
|
||||
|
||||
All logging and terminal output in mpv goes through the functions and macros
|
||||
provided in common/msg.h. This is in part for library safety, and in part to
|
||||
make sure users can silence all output, or to redirect the output elsewhere,
|
||||
like a log file or the internal console.lua script.
|
||||
|
||||
Locking
|
||||
-------
|
||||
|
||||
See generally available literature. In mpv, we use mp_thread for this.
|
||||
|
||||
Always keep locking clean. Don't skip locking just because it will work "in
|
||||
practice". (See undefined behavior section.) If your use case is simple, you may
|
||||
use C11 atomics, but most likely you will only hurt yourself and others.
|
||||
|
||||
Always make clear which fields in a struct are protected by which lock. If a
|
||||
field is immutable, or simply not thread-safe (e.g. state for a single worker
|
||||
thread), document it as well.
|
||||
|
||||
Internal mpv APIs are assumed to be not thread-safe by default. If they have
|
||||
special guarantees (such as being usable by more than one thread at a time),
|
||||
these should be explicitly documented.
|
||||
|
||||
All internal mpv APIs must be free of global state. Even if a component is not
|
||||
thread-safe, multiple threads can use _different_ instances of it without any
|
||||
locking.
|
||||
|
||||
On a side note, recursive locks may seem convenient at first, but introduce
|
||||
additional problems with condition variables and locking hierarchies. They
|
||||
should be avoided.
|
||||
|
||||
Locking hierarchy
|
||||
-----------------
|
||||
|
||||
A simple way to avoid deadlocks with classic locking is to define a locking
|
||||
hierarchy or lock order. If all threads acquire locks in the same order, no
|
||||
deadlocks will happen.
|
||||
|
||||
For example, a "leaf" lock is a lock that is below all other locks in the
|
||||
hierarchy. You can acquire it any time, as long as you don't acquire other
|
||||
locks while holding it.
|
||||
|
||||
Unfortunately, C has no way to declare or check the lock order, so you should at
|
||||
least document it.
|
||||
|
||||
In addition, try to avoid exposing locks to the outside. Making the declaration
|
||||
of a lock private to a specific .c file (and _not_ exporting accessors or
|
||||
lock/unlock functions that manipulate the lock) is a good idea. Your component's
|
||||
API may acquire internal locks, but should release them when returning. Keeping
|
||||
the entire locking in a single file makes it easy to check it.
|
||||
|
||||
Avoiding callback hell
|
||||
----------------------
|
||||
|
||||
mpv code is separated in components, like the "frontend" (i.e. MPContext mpctx),
|
||||
VOs, AOs, demuxers, and more. The frontend usually calls "down" the usage
|
||||
hierarchy: mpctx almost on top, then things like vo/ao, and utility code on the
|
||||
very bottom.
|
||||
|
||||
"Callback hell" is when components call both up and down the hierarchy,
|
||||
which for example leads to accidentally recursion, reentrancy problems, or
|
||||
locking nightmares. This is avoided by (mostly) calling only down the hierarchy.
|
||||
Basically the call graph forms a DAG. The other direction is handled by event
|
||||
queues, wakeup callbacks, and similar mechanisms.
|
||||
|
||||
Typically, a component provides an API, and does not know anything about its
|
||||
user. The API user (component higher in the hierarchy) polls the state of the
|
||||
lower component when needed.
|
||||
|
||||
This also enforces some level of modularization, and with some luck the locking
|
||||
hierarchy. (Basically, locks of lower components automatically become leaf
|
||||
locks.) Another positive effect is simpler memory management.
|
||||
|
||||
(Also see e.g.: http://250bpm.com/blog:24)
|
||||
|
||||
Wakeup callbacks
|
||||
----------------
|
||||
|
||||
This is a common concept in mpv. Even the public API uses it. It's used when an
|
||||
API has internal threads (or otherwise triggers asynchronous events), but the
|
||||
component call hierarchy needs to be kept. The wakeup callback is the only
|
||||
exception to the call hierarchy, and always calls up.
|
||||
|
||||
For example, vo spawns a thread that the API user (the mpv frontend) does not
|
||||
need to know about. vo simply provides a single-threaded API (or that looks like
|
||||
one). This API needs a way to notify the API user of new events. But the vo
|
||||
event producer is on the vo thread - it can't simply invoke a callback back into
|
||||
the API user, because then the API user has to deal with locking, despite not
|
||||
using threads. In addition, this will probably cause problems like mentioned in
|
||||
the "callback hell" section, especially lock order issues.
|
||||
|
||||
The solution is the wakeup callback. It merely unblocks the API user from
|
||||
waiting, and the API user then uses the normal vo API to examine whether or
|
||||
which state changed. As a concept, it documents what a wakeup callback is
|
||||
allowed to do and what not, to avoid the aforementioned problems.
|
||||
|
||||
Generally, you are not allowed to call any API from the wakeup callback. You
|
||||
just do whatever is needed to unblock your thread. For example, if it's waiting
|
||||
on a mutex/condition variable, acquire the mutex, set a change flag, signal
|
||||
the condition variable, unlock, return. (This mutex must not be held when
|
||||
calling the API. It must be a leaf lock.)
|
||||
|
||||
Restricting the wakeup callback like this sidesteps any reentrancy issues and
|
||||
other complexities. The API implementation can simply hold internal (and
|
||||
non-recursive) locks while invoking the wakeup callback.
|
||||
|
||||
The API user still needs to deal with locking (probably), but there's only the
|
||||
need to implement a single "receiver", that can handle the entire API of the
|
||||
used component. (Or multiple APIs - MPContext for example has only 1 wakeup
|
||||
callback that handles all AOs, VOs, input, demuxers, and more. It simple re-runs
|
||||
the playloop.)
|
||||
|
||||
You could get something more advanced by turning this into a message queue. The
|
||||
API would append a message to the queue, and the API user can read it. But then
|
||||
you still need a way to "wakeup" the API user (unless you force the API user
|
||||
to block on your API, which will make things inconvenient for the API user). You
|
||||
also need to worry about what happens if the message queue overruns (you either
|
||||
lose messages or have unbounded memory usage). In the mpv public API, the
|
||||
distinction between message queue and wakeup callback is sort of blurry, because
|
||||
it does provide a message queue, but an additional wakeup callback, so API
|
||||
users are not required to call mpv_wait_event() with a high timeout.
|
||||
|
||||
mpv itself prefers using wakeup callbacks over a generic event queue, because
|
||||
most times an event queue is not needed (or complicates things), and it is
|
||||
better to do it manually.
|
||||
|
||||
(You could still abstract the API user side of wakeup callback handling, and
|
||||
avoid reimplementing it all the time. Although mp_dispatch_queue already
|
||||
provides mechanisms for this.)
|
||||
|
||||
Condition variables
|
||||
-------------------
|
||||
|
||||
They're used whenever a thread needs to wait for something, without nonsense
|
||||
like sleep calls or busy waiting. mpv uses the mp_thread API for this.
|
||||
There's a lot of literature on condition variables, threading in general. Read it.
|
||||
|
||||
For initial understanding, it may be helpful to know that condition variables
|
||||
are not variables that signal a condition. mp_cond does not have any
|
||||
state per-se. Maybe mp_cond would better be named mp_interrupt,
|
||||
because its sole purpose is to interrupt a thread waiting via mp_cond_wait()
|
||||
(or similar). The "something" in "waiting for something" can be called
|
||||
predicate (to avoid confusing it with "condition"). Consult literature for the
|
||||
proper terms.
|
||||
|
||||
The very short version is...
|
||||
|
||||
Shared declarations:
|
||||
|
||||
mp_mutex lock;
|
||||
mp_cond cond_var;
|
||||
struct something state_var; // protected by lock, changes signaled by cond_var
|
||||
|
||||
Waiter thread:
|
||||
|
||||
mp_mutex_lock(&lock);
|
||||
|
||||
// Wait for a change in state_var. We want to wait until predicate_fulfilled()
|
||||
// returns true.
|
||||
// Must be a loop for 2 reasons:
|
||||
// 1. cond_var may be associated with other conditions too
|
||||
// 2. mp_cond_wait() can have sporadic wakeups
|
||||
while (!predicate_fulfilled(&state_var)) {
|
||||
// This unlocks, waits for cond_var to be signaled, and then locks again.
|
||||
// The _whole_ point of cond_var is that unlocking and waiting for the
|
||||
// signal happens atomically.
|
||||
mp_cond_wait(&cond_var, &lock);
|
||||
}
|
||||
|
||||
// Here you may react to the state change. The state cannot change
|
||||
// asynchronously as long as you still hold the lock (and didn't release
|
||||
// and reacquire it).
|
||||
// ...
|
||||
|
||||
mp_mutex_unlock(&lock);
|
||||
|
||||
Signaler thread:
|
||||
|
||||
mp_mutex_lock(&lock);
|
||||
|
||||
// Something changed. Update the shared variable with the new state.
|
||||
update_state(&state_var);
|
||||
|
||||
// Notify that something changed. This will wake up the waiter thread if
|
||||
// it's blocked in mp_cond_wait(). If not, nothing happens.
|
||||
mp_cond_broadcast(&cond_var);
|
||||
|
||||
// Fun fact: good implementations wake up the waiter only when the lock is
|
||||
// released, to reduce kernel scheduling overhead.
|
||||
mp_mutex_unlock(&lock);
|
||||
|
||||
Some basic rules:
|
||||
1. Always access your state under proper locking
|
||||
2. Always check your predicate before every call to mp_cond_wait()
|
||||
(And don't call mp_cond_wait() if the predicate is fulfilled.)
|
||||
3. Always call mp_cond_wait() in a loop
|
||||
(And only if your predicate failed without releasing the lock..)
|
||||
4. Always call mp_cond_broadcast()/_signal() inside of its associated
|
||||
lock
|
||||
|
||||
mpv sometimes violates rule 3, and leaves "retrying" (i.e. looping) to the
|
||||
caller.
|
||||
|
||||
Common pitfalls:
|
||||
- Thinking that mp_cond is some kind of semaphore, or holds any
|
||||
application state or the user predicate (it _only_ wakes up threads
|
||||
that are at the same time blocking on mp_cond_wait() and friends,
|
||||
nothing else)
|
||||
- Changing the predicate, but not updating all mp_cond_broadcast()/
|
||||
_signal() calls correctly
|
||||
- Forgetting that mp_cond_wait() unlocks the lock (other threads can
|
||||
and must acquire the lock)
|
||||
- Holding multiple nested locks while trying to wait (=> deadlock, violates
|
||||
the lock order anyway)
|
||||
- Waiting for a predicate correctly, but unlocking/relocking before acting
|
||||
on it (unlocking allows arbitrary state changes)
|
||||
- Confusing which lock/condition var. is used to manage a bit of state
|
||||
|
||||
Generally available literature probably has better examples and explanations.
|
||||
|
||||
Using condition variables the proper way is generally preferred over using more
|
||||
messy variants of them. (Just saying because on win32, "SetEvent" exists, and
|
||||
it's inferior to condition variables. Try to avoid the win32 primitives, even if
|
||||
you're dealing with Windows-only code.)
|
||||
|
||||
Threads
|
||||
-------
|
||||
|
||||
Threading should be conservatively used. Normally, mpv code pretends to be
|
||||
single-threaded, and provides thread-unsafe APIs. Threads are used coarsely,
|
||||
and if you can avoid messing with threads, you should. For example, VOs and AOs
|
||||
do not need to deal with threads normally, even though they run on separate
|
||||
threads. The glue code "isolates" them from any threading issues.
|
||||
+36
-12
@@ -1,12 +1,36 @@
|
||||
require "user.options"
|
||||
require "user.keymaps"
|
||||
require "user.plugins"
|
||||
require "user.colorscheme"
|
||||
require "user.cmp"
|
||||
require "user.lsp"
|
||||
require "user.telescope"
|
||||
require "user.treesitter"
|
||||
require "user.nvim-tree"
|
||||
require "user.bufferline"
|
||||
require "user.statusline"
|
||||
require "user.gitsigns"
|
||||
require "keymap"
|
||||
require "options"
|
||||
require "lazy-setup"
|
||||
require "vars"
|
||||
|
||||
-- LSP Diagnostics Options Setup
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = ''
|
||||
})
|
||||
end
|
||||
|
||||
sign({name = 'DiagnosticSignError', text = ''})
|
||||
sign({name = 'DiagnosticSignWarn', text = ''})
|
||||
sign({name = 'DiagnosticSignHint', text = ''})
|
||||
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = false,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '', prefix = '',
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "fd3e882e56956675c620898bf1ffcf4fcbe7ec84" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "67029ccdac1ef8941e13b826417bc0ffac24cc86" },
|
||||
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "b2aadda94b107480c48e548d6db51c6840b7b33c" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "7b6cc8949f9999c5ed91436cbe24aa5f99c42025" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "bb4ba7952e906408e1f83b215f55ffe57efcade6" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "9bcfabea653abdcdac584283b5097c3f8760abaa" },
|
||||
"vimtex": { "branch": "master", "commit": "154eca8f68a5ad54eb12308bb378e88bdd0dfb3e" },
|
||||
"vimwiki": { "branch": "dev", "commit": "a54a3002e229c4b43d69ced170ff77663a5b2c40" },
|
||||
"vscode.nvim": { "branch": "main", "commit": "aa1102a7e15195c9cca22730b09224a7f7745ba8" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local term_opts = { silent = true }
|
||||
|
||||
-- Shorten function name
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
--Remap space as leader key
|
||||
keymap("", "<Space>", "<Nop>", opts)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Modes
|
||||
-- normal_mode = "n",
|
||||
-- insert_mode = "i",
|
||||
-- visual_mode = "v",
|
||||
-- visual_block_mode = "x",
|
||||
-- term_mode = "t",
|
||||
-- command_mode = "c",
|
||||
|
||||
-- Disable Arrow keys to force myself to the Vim-Way of movement --
|
||||
keymap("i", "<Up>", "<Nop>", opts)
|
||||
keymap("i", "<Down>", "<Nop>", opts)
|
||||
keymap("i", "<Left>", "<Nop>", opts)
|
||||
keymap("i", "<Right>", "<Nop>", opts)
|
||||
|
||||
keymap("n", "<Up>", "<Nop>", opts)
|
||||
keymap("n", "<Down>", "<Nop>", opts)
|
||||
keymap("n", "<Left>", "<Nop>", opts)
|
||||
keymap("n", "<Right>", "<Nop>", opts)
|
||||
|
||||
-- German ISO-DE keyboard friendly mappings --
|
||||
-- On German keyboard, { and } require AltGr+7/0 which is awkward
|
||||
-- These mappings make paragraph navigation much easier
|
||||
keymap("n", "ü", "{", opts)
|
||||
keymap("n", "<C-ü>", "<C-{>", opts)
|
||||
|
||||
keymap("n", "+", "}", opts)
|
||||
keymap("n", "<C-+>", "<C-}>", opts)
|
||||
|
||||
-- Alternative: You could also use ö and ä for other bracket operations
|
||||
-- Uncomment if needed:
|
||||
-- keymap("n", "ö", "[", opts)
|
||||
-- keymap("n", "ä", "]", opts)
|
||||
|
||||
-- Normal --
|
||||
-- Better window navigation
|
||||
keymap("n", "<C-h>", "<C-w>h", opts)
|
||||
keymap("n", "<C-j>", "<C-w>j", opts)
|
||||
keymap("n", "<C-k>", "<C-w>k", opts)
|
||||
keymap("n", "<C-l>", "<C-w>l", opts)
|
||||
|
||||
keymap("n", "<leader>e", ":NvimTreeToggle<cr>", opts)
|
||||
|
||||
-- Resize with hjkl instead of arrows (stay disciplined!)
|
||||
keymap("n", "<C-S-k>", ":resize -2<CR>", opts)
|
||||
keymap("n", "<C-S-j>", ":resize +2<CR>", opts)
|
||||
keymap("n", "<C-S-h>", ":vertical resize -2<CR>", opts)
|
||||
keymap("n", "<C-S-l>", ":vertical resize +2<CR>", opts)
|
||||
|
||||
-- Navigate buffers
|
||||
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("n", "<A-j>", "<Esc>:m .+1<CR>==gi", opts)
|
||||
keymap("n", "<A-k>", "<Esc>:m .-2<CR>==gi", opts)
|
||||
|
||||
-- Insert --
|
||||
-- Press jk fast to enter
|
||||
keymap("i", "jk", "<ESC>", opts)
|
||||
|
||||
-- Visual --
|
||||
-- Disable arrow keys in visual mode too
|
||||
keymap("v", "<Up>", "<Nop>", opts)
|
||||
keymap("v", "<Down>", "<Nop>", opts)
|
||||
keymap("v", "<Left>", "<Nop>", opts)
|
||||
keymap("v", "<Right>", "<Nop>", opts)
|
||||
|
||||
-- Stay in indent mode
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
|
||||
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
|
||||
keymap("v", "p", '"_dP', opts)
|
||||
|
||||
-- Visual Block --
|
||||
-- Disable arrow keys in visual block mode
|
||||
keymap("x", "<Up>", "<Nop>", opts)
|
||||
keymap("x", "<Down>", "<Nop>", opts)
|
||||
keymap("x", "<Left>", "<Nop>", opts)
|
||||
keymap("x", "<Right>", "<Nop>", opts)
|
||||
|
||||
-- Move text up and down
|
||||
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
|
||||
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
|
||||
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
|
||||
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
|
||||
|
||||
-- Terminal --
|
||||
-- Better terminal navigation
|
||||
keymap("t", "<Esc>", "<C-\\><C-n>", term_opts)
|
||||
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
|
||||
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
|
||||
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
|
||||
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
|
||||
|
||||
-- close buffer --
|
||||
keymap("n", "<leader>q", "<cmd>Bdelete!<cr>", opts)
|
||||
|
||||
-- toggle whitespace --
|
||||
keymap("n", "<leader>w", "<cmd>set list!<cr>", opts)
|
||||
|
||||
-- floaterm
|
||||
keymap("n", "<F7>", ":FloatermNew<cr>", opts)
|
||||
keymap("n", "<F8>", ":FloatermPrev<cr>", opts)
|
||||
keymap("n", "<F9>", ":FloatermNext<cr>", opts)
|
||||
keymap("n", "<F12>", ":FloatermToggle<cr>", opts)
|
||||
|
||||
-- LSP
|
||||
keymap("n", "<leader><leader>f", "<cmd>Format<cr>", opts)
|
||||
keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
|
||||
|
||||
keymap("n", "<leader>f", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", opts)
|
||||
keymap("n", "<c-t>", "<cmd>Telescope live_grep<cr>", opts)
|
||||
@@ -0,0 +1,34 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- Import all plugin specs from lua/plugins/
|
||||
{ import = "plugins" },
|
||||
},
|
||||
install = {
|
||||
colorscheme = { "vscode" },
|
||||
},
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,85 @@
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||
cmdheight = 2, -- more space in the neovim command line for displaying messages
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
incsearch = true, -- show search matches as you type
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||
showtabline = 2, -- always show tabs
|
||||
smartcase = true, -- smart case
|
||||
smartindent = true, -- make indenting smarter again
|
||||
splitbelow = true, -- force all horizontal splits to go below current window
|
||||
splitright = true, -- force all vertical splits to go to the right of current window
|
||||
swapfile = false, -- creates a swapfile
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 300, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 4, -- the number of spaces inserted for each indentation
|
||||
tabstop = 4, -- insert 2 spaces for a tab
|
||||
cursorline = true, -- highlight the current line
|
||||
number = true, -- set numbered lines
|
||||
relativenumber = true, -- set relative numbered lines
|
||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||
wrap = false, -- display lines as one long line
|
||||
scrolloff = 8, -- is one of my fav
|
||||
sidescrolloff = 8,
|
||||
guifont = "monospace:h17", -- the font used in graphical neovim applications
|
||||
list = true,
|
||||
foldenable = false,
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append "c"
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.format()' ]]
|
||||
|
||||
vim.g.vimwiki_list = {{path = '~/Documents/vimwiki', syntax = 'markdown', ext = '.md'}}
|
||||
vim.g.nord_disable_background = true
|
||||
|
||||
--Set completeopt to have a better completion experience
|
||||
-- :help completeopt
|
||||
-- menuone: popup even when there's only one match
|
||||
-- noinsert: Do not insert text until a selection is made
|
||||
-- noselect: Do not select, force to select one from the menu
|
||||
-- shortness: avoid showing extra messages when using completion
|
||||
-- updatetime: set updatetime for CursorHold
|
||||
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||
vim.api.nvim_set_option('updatetime', 300)
|
||||
|
||||
-- Fixed column for diagnostics to appear
|
||||
-- Show autodiagnostic popup on cursor hover_range
|
||||
-- Goto previous / next diagnostic warning / error
|
||||
-- Show inlay_hints more frequently
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
-- Treesitter folding
|
||||
vim.wo.foldmethod = 'expr'
|
||||
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
||||
vim.g.dashboard_default_executive ='telescope'
|
||||
vim.g.dashboard_custom_header = {
|
||||
"███████╗██╗ ██╗███████╗██████╗ ███████╗ ██████╗ ██████╗ ███████╗███████╗████████╗",
|
||||
"██╔════╝██║ ██║██╔════╝██╔══██╗██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔════╝╚══██╔══╝",
|
||||
"█████╗ ██║ ██║█████╗ ██████╔╝█████╗ ██║ ██║██████╔╝█████╗ ███████╗ ██║ ",
|
||||
"██╔══╝ ╚██╗ ██╔╝██╔══╝ ██╔══██╗██╔══╝ ██║ ██║██╔══██╗██╔══╝ ╚════██║ ██║ ",
|
||||
"███████╗ ╚████╔╝ ███████╗██║ ██║██║ ╚██████╔╝██║ ██║███████╗███████║ ██║ ",
|
||||
"╚══════╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ",
|
||||
" NEOVIM"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
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,
|
||||
}
|
||||
print "Installing packer close and reopen Neovim..."
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
vim.cmd [[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init {
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "rounded" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- Install your plugins here
|
||||
return packer.startup(function(use)
|
||||
-- My plugins here
|
||||
use "wbthomason/packer.nvim" -- Have packer manage itself
|
||||
|
||||
-- Colorschemes
|
||||
--use "shaunsingh/nord.nvim"
|
||||
use({
|
||||
"neanias/everforest-nvim",
|
||||
-- Optional; default configuration will be used if setup isn't called.
|
||||
config = function()
|
||||
require("everforest").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- LSP
|
||||
use "neovim/nvim-lspconfig" -- enable LSP
|
||||
use "mason-org/mason.nvim" -- simple to use language server installer
|
||||
use "mason-org/mason-lspconfig.nvim" -- simple to use language server installer
|
||||
|
||||
use 'mrcjkb/rustaceanvim'
|
||||
|
||||
-- Completion framework:
|
||||
use 'hrsh7th/nvim-cmp'
|
||||
|
||||
-- LSP completion source:
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
|
||||
-- Useful completion sources:
|
||||
use 'hrsh7th/cmp-nvim-lua'
|
||||
use 'hrsh7th/cmp-nvim-lsp-signature-help'
|
||||
use 'hrsh7th/cmp-vsnip'
|
||||
use 'hrsh7th/cmp-path'
|
||||
use 'hrsh7th/vim-vsnip'
|
||||
use "hrsh7th/cmp-cmdline" -- cmdline completions
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate'
|
||||
}
|
||||
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
|
||||
-- lualine (bottom line)
|
||||
use {'nvim-lualine/lualine.nvim', requires = { 'nvim-tree/nvim-web-devicons', opt = true} }
|
||||
|
||||
-- nvim-tree
|
||||
use {'kyazdani42/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons'}
|
||||
|
||||
-- Bufferline
|
||||
use {'akinsho/bufferline.nvim', requires = 'nvim-tree/nvim-web-devicons'}
|
||||
use 'moll/vim-bbye'
|
||||
|
||||
-- VimWiki
|
||||
use { 'vimwiki/vimwiki', branch='dev'}
|
||||
|
||||
-- Dashboard
|
||||
use {
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
require('dashboard').setup {
|
||||
-- config
|
||||
}
|
||||
end,
|
||||
requires = {'nvim-tree/nvim-web-devicons'}
|
||||
}
|
||||
|
||||
-- Telescope
|
||||
use "nvim-lua/plenary.nvim"
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.8',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
-- dicord fuckery
|
||||
use 'andweeb/presence.nvim'
|
||||
|
||||
-- floaterm
|
||||
use 'voldikss/vim-floaterm'
|
||||
|
||||
-- git gud
|
||||
use 'lewis6991/gitsigns.nvim'
|
||||
|
||||
-- LaTeX
|
||||
use 'lervag/vimtex'
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,44 @@
|
||||
-- Cursor Dark.
|
||||
--
|
||||
-- Cursor's default theme is VS Code Dark Modern lineage, so vscode.nvim already
|
||||
-- ships the exact token colors (#569CD6 keywords, #CE9178 strings, #6A9955
|
||||
-- comments, #4EC9B0 types). Only the chrome and the :terminal palette need
|
||||
-- pinning so Neovim matches kitty/tmux/fish.
|
||||
return {
|
||||
{
|
||||
"Mofiqul/vscode.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.o.background = "dark"
|
||||
|
||||
require("vscode").setup({
|
||||
-- The editor background is pinned to kitty's #181818 instead of Cursor's
|
||||
-- #1F1F1F: kitty only leaves a cell transparent when it uses the default
|
||||
-- background, so matching it keeps background_opacity working in nvim.
|
||||
color_overrides = {
|
||||
vscBack = "#181818",
|
||||
vscTabCurrent = "#1F1F1F",
|
||||
vscTabOther = "#181818",
|
||||
vscTabOutside = "#181818",
|
||||
vscLeftDark = "#181818",
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme("vscode")
|
||||
|
||||
-- :terminal gets the same 16 colors as kitty and tmux. vscode.nvim would
|
||||
-- otherwise map them onto the syntax palette, which makes green the
|
||||
-- comment green (#6A9955) and looks nothing like the shell.
|
||||
local palette = {
|
||||
[0] = "#000000", "#cd3131", "#0dbc79", "#e5e510",
|
||||
"#2472c8", "#bc3fbc", "#11a8cd", "#e5e5e5",
|
||||
"#666666", "#f14c4c", "#23d18b", "#f5f543",
|
||||
"#3b8eea", "#d670d6", "#29b8db", "#e5e5e5",
|
||||
}
|
||||
for i, color in pairs(palette) do
|
||||
vim.g["terminal_color_" .. i] = color
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
return {
|
||||
-- Completion framework
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||
"hrsh7th/cmp-vsnip",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/vim-vsnip",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
-- Enable LSP snippets
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- Add tab support
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
})
|
||||
},
|
||||
-- Installed sources:
|
||||
sources = {
|
||||
{ name = 'path' }, -- file paths
|
||||
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
|
||||
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
||||
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
|
||||
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
|
||||
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
|
||||
{ name = 'calc'}, -- source for math calculation
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = {'menu', 'abbr', 'kind'},
|
||||
format = function(entry, item)
|
||||
local menu_icon = {
|
||||
nvim_lsp = 'λ',
|
||||
vsnip = '⋗',
|
||||
buffer = 'Ω',
|
||||
path = '🖫',
|
||||
}
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
return {
|
||||
-- Fuzzy finder
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require('telescope').setup{}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Git signs
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup {
|
||||
signs = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true,
|
||||
numhl = false,
|
||||
linehl = false,
|
||||
word_diff = false,
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol',
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil,
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Floating terminal
|
||||
{
|
||||
"voldikss/vim-floaterm",
|
||||
},
|
||||
|
||||
-- VimWiki
|
||||
{
|
||||
"vimwiki/vimwiki",
|
||||
branch = "dev",
|
||||
},
|
||||
|
||||
-- Discord presence
|
||||
{
|
||||
"andweeb/presence.nvim",
|
||||
},
|
||||
|
||||
-- LaTeX support
|
||||
{
|
||||
"lervag/vimtex",
|
||||
},
|
||||
|
||||
-- Better buffer closing
|
||||
{
|
||||
"moll/vim-bbye",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
return {
|
||||
-- Mason: LSP installer
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "",
|
||||
package_pending = "",
|
||||
package_uninstalled = "",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Mason LSP Config bridge
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
dependencies = { "mason-org/mason.nvim" },
|
||||
config = function()
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
-- Setup LSP servers using vim.lsp.config (new API)
|
||||
vim.lsp.config('clangd', {})
|
||||
vim.lsp.config('pylsp', {})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^5",
|
||||
lazy = false,
|
||||
ft = { "rust" },
|
||||
config = function()
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "<C-space>", function()
|
||||
vim.cmd.RustLsp('hover', 'actions')
|
||||
end, { buffer = bufnr, desc = "Rust hover actions" })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", function()
|
||||
vim.cmd.RustLsp('codeAction')
|
||||
end, { buffer = bufnr, desc = "Rust code actions" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local ts = require("nvim-treesitter")
|
||||
ts.setup()
|
||||
|
||||
local ensure = {
|
||||
"bash", "c", "cpp", "javascript", "json", "python",
|
||||
"css", "rust", "lua", "markdown", "markdown_inline",
|
||||
"php", "html", "terraform",
|
||||
}
|
||||
ts.install(ensure)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"bash", "sh", "c", "cpp", "javascript", "json", "python",
|
||||
"css", "rust", "lua", "markdown",
|
||||
"php", "html", "terraform",
|
||||
},
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
return {
|
||||
-- File explorer
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local nvimtree = require("nvim-tree")
|
||||
nvimtree.setup {
|
||||
on_attach = function(bufnr)
|
||||
local api = require("nvim-tree.api")
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
vim.keymap.set("n", "<space>", api.node.open.edit, opts("Open"))
|
||||
end,
|
||||
renderer = {
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
git_placement = "before",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = true,
|
||||
folder = true,
|
||||
folder_arrow = true,
|
||||
git = true,
|
||||
},
|
||||
glyphs = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
deleted = "",
|
||||
untracked = "U",
|
||||
ignored = "◌",
|
||||
},
|
||||
folder = {
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
highlight_git = true,
|
||||
root_folder_modifier = ":t",
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
hijack_cursor = false,
|
||||
update_cwd = true,
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = true,
|
||||
ignore_list = {},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 500,
|
||||
},
|
||||
view = {
|
||||
width = 35,
|
||||
side = "left",
|
||||
float = {
|
||||
quit_on_focus_loss = true,
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
actions = {
|
||||
open_file = {
|
||||
resize_window = true,
|
||||
quit_on_open = false,
|
||||
window_picker = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Status line
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "Mofiqul/vscode.nvim" },
|
||||
config = function()
|
||||
-- Cursor Dark, deliberately mirroring the tmux status bar: same #181818
|
||||
-- bar, same #2b2b2b raised segments, mode colour from the shared palette.
|
||||
local bar, raised, text, dim = "#181818", "#2b2b2b", "#cccccc", "#9d9d9d"
|
||||
|
||||
local function mode(bg, fg)
|
||||
return {
|
||||
a = { bg = bg, fg = fg or "#ffffff", gui = "bold" },
|
||||
b = { bg = raised, fg = text },
|
||||
c = { bg = bar, fg = dim },
|
||||
}
|
||||
end
|
||||
|
||||
local cursor_dark = {
|
||||
normal = mode("#2472c8"),
|
||||
insert = mode("#0dbc79"),
|
||||
visual = mode("#bc3fbc"),
|
||||
replace = mode("#cd3131"),
|
||||
-- dark text on yellow; white would be unreadable here
|
||||
command = mode("#e5e510", "#181818"),
|
||||
inactive = {
|
||||
a = { bg = bar, fg = "#666666" },
|
||||
b = { bg = bar, fg = "#666666" },
|
||||
c = { bg = bar, fg = "#666666" },
|
||||
},
|
||||
}
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = cursor_dark,
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
}
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Buffer line
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local bufferline = require("bufferline")
|
||||
bufferline.setup {
|
||||
options = {
|
||||
mode = "buffers",
|
||||
style_preset = bufferline.style_preset.default,
|
||||
themable = true,
|
||||
numbers = "none",
|
||||
close_command = "bdelete! %d",
|
||||
right_mouse_command = "bdelete! %d",
|
||||
left_mouse_command = "buffer %d",
|
||||
middle_mouse_command = nil,
|
||||
indicator = {
|
||||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '● ',
|
||||
close_icon = ' ',
|
||||
left_trunc_marker = ' ',
|
||||
right_trunc_marker = ' ',
|
||||
max_name_length = 30,
|
||||
max_prefix_length = 30,
|
||||
truncate_names = true,
|
||||
tab_size = 25,
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_update_on_event = true,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "NvimTree",
|
||||
text = "File Explorer",
|
||||
text_align = "left",
|
||||
separator = true
|
||||
}
|
||||
},
|
||||
color_icons = true,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = true,
|
||||
show_tab_indicators = true,
|
||||
show_duplicate_prefix = true,
|
||||
duplicates_across_groups = true,
|
||||
persist_buffer_sort = true,
|
||||
move_wraps_at_ends = false,
|
||||
separator_style = "thin",
|
||||
enforce_regular_tabs = true,
|
||||
always_show_bufferline = true,
|
||||
auto_toggle_bufferline = true,
|
||||
hover = {
|
||||
enabled = true,
|
||||
delay = 200,
|
||||
reveal = {'close'}
|
||||
},
|
||||
sort_by = 'insert_after_current',
|
||||
}
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Dashboard
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require('dashboard').setup {}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
config = function()
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.setup({
|
||||
plugins = {
|
||||
marks = true,
|
||||
registers = true,
|
||||
spelling = {
|
||||
enabled = true,
|
||||
suggestions = 20,
|
||||
},
|
||||
presets = {
|
||||
operators = true,
|
||||
motions = true,
|
||||
text_objects = true,
|
||||
windows = true,
|
||||
nav = true,
|
||||
z = true,
|
||||
g = true,
|
||||
},
|
||||
},
|
||||
win = {
|
||||
border = "rounded",
|
||||
position = "bottom",
|
||||
margin = { 1, 0, 1, 0 },
|
||||
padding = { 2, 2, 2, 2 },
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 },
|
||||
width = { min = 20, max = 50 },
|
||||
spacing = 3,
|
||||
align = "left",
|
||||
},
|
||||
})
|
||||
|
||||
-- Register leader key mappings with descriptions
|
||||
wk.add({
|
||||
{ "<leader>e", desc = "Toggle File Explorer" },
|
||||
{ "<leader>q", desc = "Close Buffer" },
|
||||
{ "<leader>w", desc = "Toggle Whitespace" },
|
||||
{ "<leader>f", desc = "Find Files" },
|
||||
{ "<leader>rn", desc = "LSP Rename" },
|
||||
{ "<leader>a", desc = "Code Actions (Rust)" },
|
||||
{ "<leader><leader>f", desc = "Format Code" },
|
||||
})
|
||||
|
||||
-- Register LSP mappings (global, not buffer-specific)
|
||||
wk.add({
|
||||
{ "gD", desc = "Go to Declaration" },
|
||||
{ "gd", desc = "Go to Definition" },
|
||||
{ "gi", desc = "Go to Implementation" },
|
||||
{ "gr", desc = "Find References" },
|
||||
{ "K", desc = "Hover Documentation" },
|
||||
})
|
||||
|
||||
-- Register German keyboard specific mappings
|
||||
wk.add({
|
||||
{ "ü", desc = "Jump to previous paragraph {" },
|
||||
{ "+", desc = "Jump to next paragraph }" },
|
||||
})
|
||||
|
||||
-- Register buffer navigation
|
||||
wk.add({
|
||||
{ "<S-h>", desc = "Previous Buffer" },
|
||||
{ "<S-l>", desc = "Next Buffer" },
|
||||
})
|
||||
|
||||
-- Register Telescope
|
||||
wk.add({
|
||||
{ "<c-t>", desc = "Live Grep" },
|
||||
})
|
||||
|
||||
-- Register Floaterm
|
||||
wk.add({
|
||||
{ "<F7>", desc = "New Float Terminal" },
|
||||
{ "<F8>", desc = "Previous Float Terminal" },
|
||||
{ "<F9>", desc = "Next Float Terminal" },
|
||||
{ "<F12>", desc = "Toggle Float Terminal" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
local status_ok, _ = pcall(require, "lspconfig")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require "user.lsp.mason"
|
||||
require("user.lsp.handlers").setup()
|
||||
require "user.lsp.null-ls"
|
||||
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"label": "Lock",
|
||||
"exec": "hyprlock",
|
||||
"icon": "/usr/share/nwg-bar/images/system-lock-screen.svg"
|
||||
},
|
||||
{
|
||||
"label": "Logout",
|
||||
"exec": "hyprctl dispatch exit 1",
|
||||
"icon": "/usr/share/nwg-bar/images/system-log-out.svg"
|
||||
},
|
||||
{
|
||||
"label": "Reboot",
|
||||
"exec": "systemctl reboot",
|
||||
"icon": "/usr/share/nwg-bar/images/system-reboot.svg"
|
||||
},
|
||||
{
|
||||
"label": "Shutdown",
|
||||
"exec": "systemctl -i poweroff",
|
||||
"icon": "/usr/share/nwg-bar/images/system-shutdown.svg"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,36 @@
|
||||
window {
|
||||
background-color: rgba (0, 0, 0, 00)
|
||||
}
|
||||
|
||||
/* Outer bar container, takes all the window width/height */
|
||||
#outer-box {
|
||||
margin: 0px
|
||||
}
|
||||
|
||||
/* Inner bar container, surrounds buttons */
|
||||
/* Cursor Dark: #181818 panel, #cccccc outline */
|
||||
#inner-box {
|
||||
background-color: rgba (24, 24, 24, 1);
|
||||
border-radius: 10px;
|
||||
border-style: solid;
|
||||
border-width: 2px;
|
||||
border-color: rgba (204, 204, 204, 0.7);
|
||||
padding: 10px;
|
||||
margin: 10px
|
||||
}
|
||||
|
||||
button, image {
|
||||
background: none;
|
||||
border: none;
|
||||
box-shadow: none
|
||||
}
|
||||
|
||||
button {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin: 5px
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: rgba (204, 204, 204, 0.1)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"export-settings-ini": true,
|
||||
"export-gtkrc-20": true,
|
||||
"export-index-theme": true,
|
||||
"export-xsettingsd": true,
|
||||
"export-gtk4-symlinks": true,
|
||||
"flatpak-export-gtk-theme-override": false,
|
||||
"flatpak-export-icon-theme-override": false,
|
||||
"flatpak-install-current-gtk-theme": false
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
configuration {
|
||||
|
||||
display-drun: "Apps";
|
||||
display-window: "Windows";
|
||||
font: "HackJBMLigatured-Regular 11";
|
||||
modi: "combi,run,drun";
|
||||
|
||||
show-icons: true;
|
||||
icon-theme: "Papirus-Dark";
|
||||
}
|
||||
|
||||
@theme "/dev/null"
|
||||
|
||||
/* Cursor Dark */
|
||||
* {
|
||||
bgdark: #181818;
|
||||
bgalt: #2b2b2b;
|
||||
bgraised: #313131;
|
||||
fg0: #cccccc;
|
||||
fgalt: #6e6e6e;
|
||||
|
||||
accent-color: #2472c8;
|
||||
urgent-color: #e2c08d;
|
||||
|
||||
font: "Roboto 12";
|
||||
|
||||
background-color: transparent;
|
||||
text-color: @fg0;
|
||||
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
spacing: 0px;
|
||||
}
|
||||
|
||||
element selected {
|
||||
text-color: #ffffff;
|
||||
}
|
||||
|
||||
window {
|
||||
location: center;
|
||||
width: 720px;
|
||||
border-radius: 10px;
|
||||
|
||||
background-color: @bgdark;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
inputbar {
|
||||
background-color: @bgalt;
|
||||
border-color: @bgraised;
|
||||
|
||||
border: 2px;
|
||||
border-radius: 8px;
|
||||
|
||||
padding: 8px 16px;
|
||||
spacing: 8px;
|
||||
children: [ prompt, entry ];
|
||||
}
|
||||
|
||||
prompt {
|
||||
text-color: @accent-color;
|
||||
}
|
||||
|
||||
entry {
|
||||
placeholder: "Search";
|
||||
placeholder-color: @fgalt;
|
||||
}
|
||||
|
||||
message {
|
||||
margin: 12px 0 0;
|
||||
border-radius: 8px;
|
||||
border-color: @bgraised;
|
||||
background-color: @bgraised;
|
||||
}
|
||||
|
||||
textbox {
|
||||
padding: 8px 24px;
|
||||
}
|
||||
|
||||
listview {
|
||||
background-color: transparent;
|
||||
|
||||
margin: 12px 0 0;
|
||||
lines: 8;
|
||||
columns: 1;
|
||||
|
||||
fixed-height: true;
|
||||
}
|
||||
|
||||
element {
|
||||
padding: 8px 16px;
|
||||
spacing: 8px;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
element normal active {
|
||||
text-color: @accent-color;
|
||||
}
|
||||
|
||||
element alternate active {
|
||||
text-color: @accent-color;
|
||||
}
|
||||
|
||||
element selected normal, element selected active {
|
||||
background-color: @accent-color;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
size: 1em;
|
||||
vertical-align: 0.5;
|
||||
}
|
||||
|
||||
element-text {
|
||||
text-color: inherit;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Default]
|
||||
save_dir=$HOME/Pictures/Screenshots
|
||||
save_filename_format=swappy-%Y%m%d-%H%M%S.png
|
||||
show_panel=false
|
||||
line_size=5
|
||||
text_size=20
|
||||
text_font=sans-serif
|
||||
paint_mode=brush
|
||||
early_exit=true
|
||||
fill_shape=false
|
||||
auto_save=true
|
||||
custom_color=rgba(193,125,17,1)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user