nvim: add mermaid.vim plugin

Also:
- castero: add default_layout option
- scripts/nmount: set umask=0022 instead of chmod twice
This commit is contained in:
Hoang Nguyen 2022-03-02 11:45:22 +07:00
parent ba7f43532a
commit 0582e4d7d7
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
6 changed files with 21 additions and 7 deletions

View File

@ -25,6 +25,6 @@ indent_style = tab
[*.md]
indent_style = space
indent_size = 4
indent_size = 2
max_line_length = 80
trim_trailing_whitespace = false

View File

@ -27,6 +27,15 @@ max_episodes = -1
# default: False
retain_absent_episodes = False
# Default window layout. This can also be changed within castero by pressing the corresponding key.
# 1 - feeds + episodes + metadata
# 2 - queue + metadata
# 3 - feeds + episodes
# 4 - downloaded episodes + metadata
# 5 - all episodes + metadata
# default: 1
default_layout = 3
# Hide vertical borders between menus.
# default: False
disable_vertical_borders = False

View File

@ -76,6 +76,9 @@ function M.filetype()
extensions = {
gmi = 'gemtext',
gemini = 'gemtext',
mm = 'mermaid',
mmd = 'mermaid',
mermaid = 'mermaid',
j2 = 'jinja',
jinja2 = 'jinja',
log = 'log',

View File

@ -5,6 +5,7 @@ local conf = require('user.modules.editor.config')
M['nfnty/vim-nftables'] = { ft = 'nftables' }
M['MTDL9/vim-log-highlighting'] = { ft = 'log' }
M['Glench/Vim-Jinja2-Syntax'] = { ft = 'jinja' }
M['mracos/mermaid.vim'] = { ft = 'mermaid' }
M['norcalli/nvim-colorizer.lua'] = {
cmd = 'ColorizerToggle',

View File

@ -183,12 +183,15 @@ function M.highlight_languages()
cmd('hi! link asciidocQuotedUnconstrainedEmphasized asciidocQuotedEmphasized')
cmd('hi! link asciidocURL asciidocMacroAttributes')
-- jinja
-- jinja (Vim-Jinja2-Syntax)
hi('jinjaStatement', c.purple, '', 'bold,italic', '')
hi('jinjaOperator', c.blue, '', '', '')
hi('jinjaString', c.green, '', '', '')
hi('jinjaNumber', c.cyan, '', '', '')
hi('jinjaVariable', c.yellow, '', '', '')
-- mermaid (mermaid.vim)
hi('mermaidDiagramType', c.purple, '', 'bold', '')
end
-- Treesitter (:h nvim-treesitter-highlights)

View File

@ -30,13 +30,11 @@ if [ -z "$(mountpoint -x "${device}")" ]; then
fi
# Make the mount dir compatible with udisks (for Waybar's media.sh script)
mount_dir="/run/media"
parent="${mount_dir}/$USER"
parent="/run/media/$USER"
if [ "${mode}" = "mount" ]; then
umask 0022
device_name="${device##*/}"
for dir in ${mount_dir} ${parent}; do
[ ! -d "${dir}" ] && doas mkdir -p -m 0755 "${dir}"
done
[ ! -d "${parent}" ] && doas mkdir -p -m 0755 "${parent}"
mount_point=$(doas mktemp -d "${parent}/${device_name}-XXXXXX")
doas mount -o rw,nosuid,nodev,noexec "${device}" "${mount_point}"