From: Tucker Johnson Date: Sat, 16 May 2026 12:32:06 +0000 (-0400) Subject: for-script X-Git-Url: https://git.newer.systems/?a=commitdiff_plain;h=0da74b4456e1abbc42d07483a092cde78190f45b;p=nvim.git for-script --- diff --git a/.config/nvim/ftplugin/awk.vim b/.config/nvim/ftplugin/awk.vim new file mode 100644 index 0000000..b32befc --- /dev/null +++ b/.config/nvim/ftplugin/awk.vim @@ -0,0 +1,2 @@ +set tabstop=2 +set shiftwidth=2 diff --git a/.config/nvim/ftplugin/groff.vim b/.config/nvim/ftplugin/groff.vim new file mode 100644 index 0000000..2738b1f --- /dev/null +++ b/.config/nvim/ftplugin/groff.vim @@ -0,0 +1,5 @@ +map R :vsp$REFER + +" splits +map T :80vsp$TODO +map C :vsp$CALENDAR diff --git a/.config/nvim/ftplugin/lilypond.vim b/.config/nvim/ftplugin/lilypond.vim new file mode 100644 index 0000000..881317a --- /dev/null +++ b/.config/nvim/ftplugin/lilypond.vim @@ -0,0 +1,5 @@ +autocmd FileType lilypond setlocal commentstring=%\ %s + +" splits +map T :80vsp$TODO +map C :vsp$CALENDAR diff --git a/.config/nvim/ftplugin/lua.vim b/.config/nvim/ftplugin/lua.vim new file mode 100644 index 0000000..b32befc --- /dev/null +++ b/.config/nvim/ftplugin/lua.vim @@ -0,0 +1,2 @@ +set tabstop=2 +set shiftwidth=2 diff --git a/.config/nvim/ftplugin/markdown.vim b/.config/nvim/ftplugin/markdown.vim new file mode 100644 index 0000000..259907f --- /dev/null +++ b/.config/nvim/ftplugin/markdown.vim @@ -0,0 +1,20 @@ +set tabstop=2 +set shiftwidth=2 + +" splits +map T :80vsp$TODO +map C :vsp$CALENDAR + +" to-do lists +imap o-[] +nmap o-[] +nmap :.s/\-\[\]/\-\[x\]/ +nmap :.s/\-\[\]/\-\[\-\]/ +nmap :.s/\-\[.*\]/\-\[\]/ + +xnoremap sc :lua require('setclass').analyze_selection() + +lua << EOF +require("plugins.render-markdown") +vim.g.markdown_recommended_style = 0 +EOF diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..8b0b0e2 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,95 @@ +let mapleader ="," + +if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) + echo "Downloading junegunn/vim-plug to manage plugins..." + silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/ + silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim + autocmd VimEnter * PlugInstall +endif + +map ,, :keepp /<++>ca< + +call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) +Plug 'tribela/vim-transparent' +Plug 'sainnhe/gruvbox-material' +Plug 'tpope/vim-surround' +Plug 'tommcdo/vim-express' +Plug 'preservim/nerdtree' +Plug 'vim-airline/vim-airline' +Plug 'tpope/vim-commentary' +Plug 'ap/vim-css-color' +Plug 'davidgranstrom/scnvim' +Plug 'MeanderingProgrammer/render-markdown.nvim' +call plug#end() + +set title +set bg=dark +set nohlsearch +syntax on +set clipboard+=unnamedplus +set noshowmode +set noruler +set nowrap +set laststatus=0 +set noshowcmd +set tabstop=2 +set shiftwidth=2 +set softtabstop=2 +set expandtab +set mouse= + +let g:gruvbox_material_better_performance = 1 +let g:gruvbox_material_ui_contrast = 1 +let g:gruvbox_material_foreground = 'original' + +colorscheme gruvbox-material + +nnoremap c "_c +set nocompatible +filetype plugin on +set encoding=utf-8 +set number relativenumber +set wildmode=longest,list,full +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +" Perform dot commands over visual blocks: +vnoremap . :normal . +" Spell-check set to 'o' for 'orthography': +map o :setlocal spell! spelllang=en_us + +" splits +set splitbelow splitright +map h +map j +map k +map l + +" Nerd tree +let NERDTreeMinimalUI=1 +map n :NERDTreeToggle +let g:NERDTreeChDirMode = 2 +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + +" Replace all +nnoremap S :%s//g + +" Compile and viewing +map c :w! \| !compiler "%:p" +map p :!opout "%:p" + +" Reading Files +autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff + +" Sudo file saves +cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' edit! + +" remove trailing whitespace and newlines on write +autocmd BufWritePre * let currPos = getpos(".") +autocmd BufWritePre * %s/\s\+$//e +autocmd BufWritePre * %s/\n\+\%$//e +autocmd BufWritePre *.[ch] %s/\%$/\r/e +autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) + +" Run xrdb whenever Xdefaults or Xresources are updated. +autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults +autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb % + diff --git a/.config/nvim/lua/plugins/render-markdown.lua b/.config/nvim/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..aa6e0fd --- /dev/null +++ b/.config/nvim/lua/plugins/render-markdown.lua @@ -0,0 +1,335 @@ +require('render-markdown').setup({ + heading = { + -- Useful context to have when evaluating values. + -- | level | the number of '#' in the heading marker | + -- | sections | for each level how deeply nested the heading is | + + -- Turn on / off heading icon & background rendering. + enabled = true, + -- Additional modes to render headings. + render_modes = false, + -- Turn on / off atx heading rendering. + atx = true, + -- Turn on / off setext heading rendering. + setext = true, + -- Turn on / off sign column related rendering. + sign = true, + -- Replaces '#+' of 'atx_h._marker'. + -- Output is evaluated depending on the type. + -- | function | `value(context)` | + -- | string[] | `cycle(value, context.level)` | + icons = { '1 ', '2 ', '3 ', '4 ', '5 ', '6 ' }, + -- Determines how icons fill the available space. + -- | right | '#'s are concealed and icon is appended to right side | + -- | inline | '#'s are concealed and icon is inlined on left side | + -- | overlay | icon is left padded with spaces and inserted on left hiding additional '#' | + position = 'overlay', + -- Added to the sign column if enabled. + -- Output is evaluated by `cycle(value, context.level)`. + signs = { '#' }, + -- Width of the heading background. + -- | block | width of the heading text | + -- | full | full width of the window | + -- Can also be a list of the above values evaluated by `clamp(value, context.level)`. + width = 'full', + -- Amount of margin to add to the left of headings. + -- Margin available space is computed after accounting for padding. + -- If a float < 1 is provided it is treated as a percentage of available window space. + -- Can also be a list of numbers evaluated by `clamp(value, context.level)`. + left_margin = 0, + -- Amount of padding to add to the left of headings. + -- Output is evaluated using the same logic as 'left_margin'. + left_pad = 0, + -- Amount of padding to add to the right of headings when width is 'block'. + -- Output is evaluated using the same logic as 'left_margin'. + right_pad = 0, + -- Minimum width to use for headings when width is 'block'. + -- Can also be a list of integers evaluated by `clamp(value, context.level)`. + min_width = 0, + -- Determines if a border is added above and below headings. + -- Can also be a list of booleans evaluated by `clamp(value, context.level)`. + border = false, + -- Always use virtual lines for heading borders instead of attempting to use empty lines. + border_virtual = false, + -- Highlight the start of the border using the foreground highlight. + border_prefix = false, + -- Used above heading for border. + above = '▄', + -- Used below heading for border. + below = '▀', + -- Highlight for the heading icon and extends through the entire line. + -- Output is evaluated by `clamp(value, context.level)`. + backgrounds = { + 'RenderMarkdownH6Bg', + 'RenderMarkdownH2Bg', + 'RenderMarkdownH3Bg', + 'RenderMarkdownH4Bg', + 'RenderMarkdownH5Bg', + 'RenderMarkdownH6Bg', + }, + -- Highlight for the heading and sign icons. + -- Output is evaluated using the same logic as 'backgrounds'. + foregrounds = { + 'RenderMarkdownError', + 'RenderMarkdownH2', + 'RenderMarkdownH3', + 'RenderMarkdownH4', + 'RenderMarkdownH5', + 'RenderMarkdownH6', + }, + -- Define custom heading patterns which allow you to override various properties based on + -- the contents of a heading. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | pattern | matched against the heading text @see :h lua-patterns | + -- | icon | optional override for the icon | + -- | background | optional override for the background | + -- | foreground | optional override for the foreground | + custom = {}, + }, + link = { + -- Turn on / off inline link icon rendering. + enabled = true, + -- Additional modes to render links. + render_modes = false, + -- How to handle footnote links, start with a '^'. + footnote = { + -- Turn on / off footnote rendering. + enabled = true, + -- Replace value with superscript equivalent. + superscript = true, + -- Added before link content. + prefix = '', + -- Added after link content. + suffix = '', + }, + -- Inlined with 'image' elements. + image = ' ', + -- Inlined with 'email_autolink' elements. + email = ' ', + -- Fallback icon for 'inline_link' and 'uri_autolink' elements. + hyperlink = ' ', + -- Applies to the inlined icon as a fallback. + highlight = 'RenderMarkdownLink', + -- Applies to WikiLink elements. + wiki = { + icon = '🔗 ', + body = function() + return nil + end, + highlight = 'RenderMarkdownWikiLink', + }, + -- Define custom destination patterns so icons can quickly inform you of what a link + -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple + -- patterns match a link the one with the longer pattern is used. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | pattern | matched against the destination text | + -- | icon | gets inlined before the link text | + -- | kind | optional determines how pattern is checked | + -- | | pattern | @see :h lua-patterns, is the default if not set | + -- | | suffix | @see :h vim.endswith() | + -- | priority | optional used when multiple match, uses pattern length if empty | + -- | highlight | optional highlight for 'icon', uses fallback highlight if empty | + custom = { + web = { pattern = '^http', icon = '🌐 ' }, + }, + }, + callout = { + -- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'. + -- The key is for healthcheck and to allow users to change its values, value type below. + -- | raw | matched against the raw text of a 'shortcut_link', case insensitive | + -- | rendered | replaces the 'raw' value when rendering | + -- | highlight | highlight for the 'rendered' text and quote markers | + -- | quote_icon | optional override for quote.icon value for individual callout | + -- | category | optional metadata useful for filtering | + + note = { raw = '[!NOTE]', rendered = '❕ Note', highlight = 'RenderMarkdownInfo'}, + tip = { raw = '[!TIP]', rendered = '💡 Tip', highlight = 'RenderMarkdownSuccess'}, + important = { raw = '[!IMPORTANT]', rendered = '❕ Important', highlight = 'RenderMarkdownHint'}, + warning = { raw = '[!WARNING]', rendered = '⚠️ Warning', highlight = 'RenderMarkdownWarn'}, + caution = { raw = '[!CAUTION]', rendered = '🛑 Caution', highlight = 'RenderMarkdownError'}, + abstract = { raw = '[!ABSTRACT]', rendered = '📃 Abstract', highlight = 'RenderMarkdownInfo'}, + summary = { raw = '[!SUMMARY]', rendered = '📃 Summary', highlight = 'RenderMarkdownInfo'}, + tldr = { raw = '[!TLDR]', rendered = '📃 Tldr', highlight = 'RenderMarkdownInfo'}, + info = { raw = '[!INFO]', rendered = '🔎 Info', highlight = 'RenderMarkdownInfo'}, + todo = { raw = '[!TODO]', rendered = '☑️ Todo', highlight = 'RenderMarkdownInfo'}, + hint = { raw = '[!HINT]', rendered = '💡 Hint', highlight = 'RenderMarkdownSuccess'}, + success = { raw = '[!SUCCESS]', rendered = '🎯 Success', highlight = 'RenderMarkdownSuccess'}, + check = { raw = '[!CHECK]', rendered = '✔️ Check', highlight = 'RenderMarkdownSuccess'}, + done = { raw = '[!DONE]', rendered = '✔️ Done', highlight = 'RenderMarkdownSuccess'}, + question = { raw = '[!QUESTION]', rendered = '❔ Question', highlight = 'RenderMarkdownWarn'}, + help = { raw = '[!HELP]', rendered = '❔ Help', highlight = 'RenderMarkdownWarn'}, + faq = { raw = '[!FAQ]', rendered = '❔ Faq', highlight = 'RenderMarkdownWarn'}, + attention = { raw = '[!ATTENTION]', rendered = '⚠️ Attention', highlight = 'RenderMarkdownWarn'}, + failure = { raw = '[!FAILURE]', rendered = '❗ Failure', highlight = 'RenderMarkdownError'}, + fail = { raw = '[!FAIL]', rendered = '❗ Fail', highlight = 'RenderMarkdownError'}, + missing = { raw = '[!MISSING]', rendered = '🪹 Missing', highlight = 'RenderMarkdownError'}, + danger = { raw = '[!DANGER]', rendered = '❗ Danger', highlight = 'RenderMarkdownError'}, + error = { raw = '[!ERROR]', rendered = '❓ Error', highlight = 'RenderMarkdownError'}, + bug = { raw = '[!BUG]', rendered = '🐛 Bug', highlight = 'RenderMarkdownError'}, + example = { raw = '[!EXAMPLE]', rendered = '❕ Example', highlight = 'RenderMarkdownHint' }, + quote = { raw = '[!QUOTE]', rendered = '🖋️ Quote', highlight = 'RenderMarkdownQuote'}, + cite = { raw = '[!CITE]', rendered = '📚 Cite', highlight = 'RenderMarkdownQuote'}, + bibliography = { raw = '[!BIB]', rendered = '📚 Bibliography', highlight = 'RenderMarkdownQuote'}, + }, + checkbox = { + enabled = true, + render_modes = false, + bullet = false, + right_pad = 1, + unchecked = { + icon = '⚪', + highlight = 'RenderMarkdownUnchecked', + scope_highlight = nil, + }, + checked = { + icon = '🟢', + highlight = 'RenderMarkdownChecked', + scope_highlight = nil, + }, + custom = { + todo = { raw = '[-]', rendered = '🔴', highlight = 'RenderMarkdownTodo', scope_highlight = nil }, + }, + }, + bullet = { + enabled = true, + render_modes = false, + icons = { '●', '○', '◆', '◇' }, + ordered_icons = function(ctx) + local value = vim.trim(ctx.value) + local index = tonumber(value:sub(1, #value - 1)) + return ('%d.'):format(index > 1 and index or ctx.index) + end, + left_pad = 0, + right_pad = 0, + highlight = 'RenderMarkdownBullet', + scope_highlight = {}, + }, + quote = { icon = '▋' }, + anti_conceal = { + enabled = true, + -- Which elements to always show, ignoring anti conceal behavior. Values can either be + -- booleans to fix the behavior or string lists representing modes where anti conceal + -- behavior will be ignored. Valid values are: + -- head_icon, head_background, head_border, code_language, code_background, code_border, + -- dash, bullet, check_icon, check_scope, quote, table_border, callout, link, sign + ignore = { + code_background = true, + sign = true, + }, + above = 0, + below = 0, + }, + code = { + -- Turn on / off code block & inline code rendering. + enabled = true, + -- Additional modes to render code blocks. + render_modes = false, + -- Turn on / off sign column related rendering. + sign = true, + -- Whether to conceal nodes at the top and bottom of code blocks. + conceal_delimiters = true, + -- Turn on / off language heading related rendering. + language = true, + -- Determines where language icon is rendered. + -- | right | right side of code block | + -- | left | left side of code block | + position = 'left', + -- Whether to include the language icon above code blocks. + language_icon = true, + -- Whether to include the language name above code blocks. + language_name = true, + -- Whether to include the language info above code blocks. + language_info = true, + -- Amount of padding to add around the language. + -- If a float < 1 is provided it is treated as a percentage of available window space. + language_pad = 0, + -- A list of language names for which background highlighting will be disabled. + -- Likely because that language has background highlights itself. + -- Use a boolean to make behavior apply to all languages. + -- Borders above & below blocks will continue to be rendered. + disable_background = { 'diff' }, + -- Width of the code block background. + -- | block | width of the code block | + -- | full | full width of the window | + width = 'full', + -- Amount of margin to add to the left of code blocks. + -- If a float < 1 is provided it is treated as a percentage of available window space. + -- Margin available space is computed after accounting for padding. + left_margin = 0, + -- Amount of padding to add to the left of code blocks. + -- If a float < 1 is provided it is treated as a percentage of available window space. + left_pad = 0, + -- Amount of padding to add to the right of code blocks when width is 'block'. + -- If a float < 1 is provided it is treated as a percentage of available window space. + right_pad = 0, + -- Minimum width to use for code blocks when width is 'block'. + min_width = 0, + -- Determines how the top / bottom of code block are rendered. + -- | none | do not render a border | + -- | thick | use the same highlight as the code body | + -- | thin | when lines are empty overlay the above & below icons | + -- | hide | conceal lines unless language name or icon is added | + border = 'hide', + -- Used above code blocks to fill remaining space around language. + language_border = '█', + -- Added to the left of language. + language_left = '', + -- Added to the right of language. + language_right = '', + -- Used above code blocks for thin border. + above = '▄', + -- Used below code blocks for thin border. + below = '▀', + -- Turn on / off inline code related rendering. + inline = true, + -- Icon to add to the left of inline code. + inline_left = '', + -- Icon to add to the right of inline code. + inline_right = '', + -- Padding to add to the left & right of inline code. + inline_pad = 0, + -- Priority to assign to code background highlight. + priority = nil, + -- Highlight for code blocks. + highlight = 'RenderMarkdownCode', + -- Highlight for code info section, after the language. + highlight_info = 'RenderMarkdownCodeInfo', + -- Highlight for language, overrides icon provider value. + highlight_language = nil, + -- Highlight for border, use false to add no highlight. + highlight_border = 'RenderMarkdownCodeBorder', + -- Highlight for language, used if icon provider does not have a value. + highlight_fallback = 'RenderMarkdownCodeFallback', + -- Highlight for inline code. + highlight_inline = 'RenderMarkdownCodeInline', + -- Determines how code blocks & inline code are rendered. + -- | none | { enabled = false } | + -- | normal | { language = false } | + -- | language | { disable_background = true, inline = false } | + -- | full | uses all default values | + style = 'full', + }, + dash = { + -- Useful context to have when evaluating values. + -- | width | width of the current window | + -- Turn on / off thematic break rendering. + enabled = true, + -- Additional modes to render dash. + render_modes = false, + -- Replaces '---'|'***'|'___'|'* * *' of 'thematic_break'. + -- The icon gets repeated across the window's width. + icon = '─', + -- Width of the generated line. + -- If a float < 1 is provided it is treated as a percentage of available window space. + -- Output is evaluated depending on the type. + -- | function | `value(context)` | + -- | number | `value` | + -- | full | width of the window | + width = 'full', + -- Amount of margin to add to the left of dash. + -- If a float < 1 is provided it is treated as a percentage of available window space. + left_margin = 0, + -- Highlight for the whole line generated from the icon. + highlight = 'RenderMarkdownDash', + }, +}) diff --git a/.gitignore b/.gitignore index 0f781b0..208e433 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,2 @@ -autoload/ -plugged/ -lua/ -!init.vim -!shortcuts.vim -!ftplugin/*.vim -!lua/*.lua -!lua/plugins/*.lua +.config/nvim/autoload/ +.config/nvim/plugged/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..04035c0 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +PREFIX = /usr/local + +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f scripts/compiler scripts/opout scripts/getcomproot scripts/lilypuddle $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/compiler + chmod 755 $(DESTDIR)$(PREFIX)/bin/opout + chmod 755 $(DESTDIR)$(PREFIX)/bin/getcomproot + chmod 755 $(DESTDIR)$(PREFIX)/bin/lilypuddle + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/compiler \ + $(DESTDIR)$(PREFIX)/bin/opout \ + $(DESTDIR)$(PREFIX)/bin/getcomproot \ + $(DESTDIR)$(PREFIX)/bin/lilypuddle + +.PHONY: install uninstall diff --git a/ftplugin/awk.vim b/ftplugin/awk.vim deleted file mode 100644 index b32befc..0000000 --- a/ftplugin/awk.vim +++ /dev/null @@ -1,2 +0,0 @@ -set tabstop=2 -set shiftwidth=2 diff --git a/ftplugin/groff.vim b/ftplugin/groff.vim deleted file mode 100644 index 2738b1f..0000000 --- a/ftplugin/groff.vim +++ /dev/null @@ -1,5 +0,0 @@ -map R :vsp$REFER - -" splits -map T :80vsp$TODO -map C :vsp$CALENDAR diff --git a/ftplugin/lilypond.vim b/ftplugin/lilypond.vim deleted file mode 100644 index 881317a..0000000 --- a/ftplugin/lilypond.vim +++ /dev/null @@ -1,5 +0,0 @@ -autocmd FileType lilypond setlocal commentstring=%\ %s - -" splits -map T :80vsp$TODO -map C :vsp$CALENDAR diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim deleted file mode 100644 index b32befc..0000000 --- a/ftplugin/lua.vim +++ /dev/null @@ -1,2 +0,0 @@ -set tabstop=2 -set shiftwidth=2 diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim deleted file mode 100644 index 259907f..0000000 --- a/ftplugin/markdown.vim +++ /dev/null @@ -1,20 +0,0 @@ -set tabstop=2 -set shiftwidth=2 - -" splits -map T :80vsp$TODO -map C :vsp$CALENDAR - -" to-do lists -imap o-[] -nmap o-[] -nmap :.s/\-\[\]/\-\[x\]/ -nmap :.s/\-\[\]/\-\[\-\]/ -nmap :.s/\-\[.*\]/\-\[\]/ - -xnoremap sc :lua require('setclass').analyze_selection() - -lua << EOF -require("plugins.render-markdown") -vim.g.markdown_recommended_style = 0 -EOF diff --git a/init.vim b/init.vim deleted file mode 100644 index c55731c..0000000 --- a/init.vim +++ /dev/null @@ -1,96 +0,0 @@ -let mapleader ="," - -if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"')) - echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim - autocmd VimEnter * PlugInstall -endif - -map ,, :keepp /<++>ca< - -call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) -Plug 'tribela/vim-transparent' -Plug 'sainnhe/gruvbox-material' -Plug 'tpope/vim-surround' -Plug 'tommcdo/vim-express' -Plug 'preservim/nerdtree' -Plug 'vim-airline/vim-airline' -Plug 'tpope/vim-commentary' -Plug 'ap/vim-css-color' -Plug 'davidgranstrom/scnvim' -Plug 'MeanderingProgrammer/render-markdown.nvim' -call plug#end() - -set title -set bg=dark -set nohlsearch -syntax on -set clipboard+=unnamedplus -set noshowmode -set noruler -set nowrap -set laststatus=0 -set noshowcmd -set tabstop=2 -set shiftwidth=2 -set softtabstop=2 -set expandtab -set mouse= - -let g:gruvbox_material_better_performance = 1 -let g:gruvbox_material_ui_contrast = 1 -let g:gruvbox_material_foreground = 'original' - -colorscheme gruvbox-material - -nnoremap c "_c -set nocompatible -filetype plugin on -set encoding=utf-8 -set number relativenumber -set wildmode=longest,list,full -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o -" Perform dot commands over visual blocks: -vnoremap . :normal . -" Spell-check set to 'o' for 'orthography': -map o :setlocal spell! spelllang=en_us - -" splits -set splitbelow splitright -map h -map j -map k -map l - -" Nerd tree -let NERDTreeMinimalUI=1 -map n :NERDTreeToggle -let g:NERDTreeChDirMode = 2 -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - -" Replace all -nnoremap S :%s//g - -" Compile and viewing -map c :w! \| !compiler "%:p" -map p :!opout "%:p" - -" Reading Files -autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff - -" Sudo file saves -cabbrev w!! execute 'silent! write !sudo tee % >/dev/null' edit! - -" remove trailing whitespace and newlines on write -autocmd BufWritePre * let currPos = getpos(".") -autocmd BufWritePre * %s/\s\+$//e -autocmd BufWritePre * %s/\n\+\%$//e -autocmd BufWritePre *.[ch] %s/\%$/\r/e -autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) - -" Run xrdb whenever Xdefaults or Xresources are updated. -autocmd BufRead,BufNewFile Xresources,Xdefaults,xresources,xdefaults set filetype=xdefaults -autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb % - -silent! source ~/.config/nvim/shortcuts.vim diff --git a/lua/plugins/render-markdown.lua b/lua/plugins/render-markdown.lua deleted file mode 100644 index aa6e0fd..0000000 --- a/lua/plugins/render-markdown.lua +++ /dev/null @@ -1,335 +0,0 @@ -require('render-markdown').setup({ - heading = { - -- Useful context to have when evaluating values. - -- | level | the number of '#' in the heading marker | - -- | sections | for each level how deeply nested the heading is | - - -- Turn on / off heading icon & background rendering. - enabled = true, - -- Additional modes to render headings. - render_modes = false, - -- Turn on / off atx heading rendering. - atx = true, - -- Turn on / off setext heading rendering. - setext = true, - -- Turn on / off sign column related rendering. - sign = true, - -- Replaces '#+' of 'atx_h._marker'. - -- Output is evaluated depending on the type. - -- | function | `value(context)` | - -- | string[] | `cycle(value, context.level)` | - icons = { '1 ', '2 ', '3 ', '4 ', '5 ', '6 ' }, - -- Determines how icons fill the available space. - -- | right | '#'s are concealed and icon is appended to right side | - -- | inline | '#'s are concealed and icon is inlined on left side | - -- | overlay | icon is left padded with spaces and inserted on left hiding additional '#' | - position = 'overlay', - -- Added to the sign column if enabled. - -- Output is evaluated by `cycle(value, context.level)`. - signs = { '#' }, - -- Width of the heading background. - -- | block | width of the heading text | - -- | full | full width of the window | - -- Can also be a list of the above values evaluated by `clamp(value, context.level)`. - width = 'full', - -- Amount of margin to add to the left of headings. - -- Margin available space is computed after accounting for padding. - -- If a float < 1 is provided it is treated as a percentage of available window space. - -- Can also be a list of numbers evaluated by `clamp(value, context.level)`. - left_margin = 0, - -- Amount of padding to add to the left of headings. - -- Output is evaluated using the same logic as 'left_margin'. - left_pad = 0, - -- Amount of padding to add to the right of headings when width is 'block'. - -- Output is evaluated using the same logic as 'left_margin'. - right_pad = 0, - -- Minimum width to use for headings when width is 'block'. - -- Can also be a list of integers evaluated by `clamp(value, context.level)`. - min_width = 0, - -- Determines if a border is added above and below headings. - -- Can also be a list of booleans evaluated by `clamp(value, context.level)`. - border = false, - -- Always use virtual lines for heading borders instead of attempting to use empty lines. - border_virtual = false, - -- Highlight the start of the border using the foreground highlight. - border_prefix = false, - -- Used above heading for border. - above = '▄', - -- Used below heading for border. - below = '▀', - -- Highlight for the heading icon and extends through the entire line. - -- Output is evaluated by `clamp(value, context.level)`. - backgrounds = { - 'RenderMarkdownH6Bg', - 'RenderMarkdownH2Bg', - 'RenderMarkdownH3Bg', - 'RenderMarkdownH4Bg', - 'RenderMarkdownH5Bg', - 'RenderMarkdownH6Bg', - }, - -- Highlight for the heading and sign icons. - -- Output is evaluated using the same logic as 'backgrounds'. - foregrounds = { - 'RenderMarkdownError', - 'RenderMarkdownH2', - 'RenderMarkdownH3', - 'RenderMarkdownH4', - 'RenderMarkdownH5', - 'RenderMarkdownH6', - }, - -- Define custom heading patterns which allow you to override various properties based on - -- the contents of a heading. - -- The key is for healthcheck and to allow users to change its values, value type below. - -- | pattern | matched against the heading text @see :h lua-patterns | - -- | icon | optional override for the icon | - -- | background | optional override for the background | - -- | foreground | optional override for the foreground | - custom = {}, - }, - link = { - -- Turn on / off inline link icon rendering. - enabled = true, - -- Additional modes to render links. - render_modes = false, - -- How to handle footnote links, start with a '^'. - footnote = { - -- Turn on / off footnote rendering. - enabled = true, - -- Replace value with superscript equivalent. - superscript = true, - -- Added before link content. - prefix = '', - -- Added after link content. - suffix = '', - }, - -- Inlined with 'image' elements. - image = ' ', - -- Inlined with 'email_autolink' elements. - email = ' ', - -- Fallback icon for 'inline_link' and 'uri_autolink' elements. - hyperlink = ' ', - -- Applies to the inlined icon as a fallback. - highlight = 'RenderMarkdownLink', - -- Applies to WikiLink elements. - wiki = { - icon = '🔗 ', - body = function() - return nil - end, - highlight = 'RenderMarkdownWikiLink', - }, - -- Define custom destination patterns so icons can quickly inform you of what a link - -- contains. Applies to 'inline_link', 'uri_autolink', and wikilink nodes. When multiple - -- patterns match a link the one with the longer pattern is used. - -- The key is for healthcheck and to allow users to change its values, value type below. - -- | pattern | matched against the destination text | - -- | icon | gets inlined before the link text | - -- | kind | optional determines how pattern is checked | - -- | | pattern | @see :h lua-patterns, is the default if not set | - -- | | suffix | @see :h vim.endswith() | - -- | priority | optional used when multiple match, uses pattern length if empty | - -- | highlight | optional highlight for 'icon', uses fallback highlight if empty | - custom = { - web = { pattern = '^http', icon = '🌐 ' }, - }, - }, - callout = { - -- Callouts are a special instance of a 'block_quote' that start with a 'shortcut_link'. - -- The key is for healthcheck and to allow users to change its values, value type below. - -- | raw | matched against the raw text of a 'shortcut_link', case insensitive | - -- | rendered | replaces the 'raw' value when rendering | - -- | highlight | highlight for the 'rendered' text and quote markers | - -- | quote_icon | optional override for quote.icon value for individual callout | - -- | category | optional metadata useful for filtering | - - note = { raw = '[!NOTE]', rendered = '❕ Note', highlight = 'RenderMarkdownInfo'}, - tip = { raw = '[!TIP]', rendered = '💡 Tip', highlight = 'RenderMarkdownSuccess'}, - important = { raw = '[!IMPORTANT]', rendered = '❕ Important', highlight = 'RenderMarkdownHint'}, - warning = { raw = '[!WARNING]', rendered = '⚠️ Warning', highlight = 'RenderMarkdownWarn'}, - caution = { raw = '[!CAUTION]', rendered = '🛑 Caution', highlight = 'RenderMarkdownError'}, - abstract = { raw = '[!ABSTRACT]', rendered = '📃 Abstract', highlight = 'RenderMarkdownInfo'}, - summary = { raw = '[!SUMMARY]', rendered = '📃 Summary', highlight = 'RenderMarkdownInfo'}, - tldr = { raw = '[!TLDR]', rendered = '📃 Tldr', highlight = 'RenderMarkdownInfo'}, - info = { raw = '[!INFO]', rendered = '🔎 Info', highlight = 'RenderMarkdownInfo'}, - todo = { raw = '[!TODO]', rendered = '☑️ Todo', highlight = 'RenderMarkdownInfo'}, - hint = { raw = '[!HINT]', rendered = '💡 Hint', highlight = 'RenderMarkdownSuccess'}, - success = { raw = '[!SUCCESS]', rendered = '🎯 Success', highlight = 'RenderMarkdownSuccess'}, - check = { raw = '[!CHECK]', rendered = '✔️ Check', highlight = 'RenderMarkdownSuccess'}, - done = { raw = '[!DONE]', rendered = '✔️ Done', highlight = 'RenderMarkdownSuccess'}, - question = { raw = '[!QUESTION]', rendered = '❔ Question', highlight = 'RenderMarkdownWarn'}, - help = { raw = '[!HELP]', rendered = '❔ Help', highlight = 'RenderMarkdownWarn'}, - faq = { raw = '[!FAQ]', rendered = '❔ Faq', highlight = 'RenderMarkdownWarn'}, - attention = { raw = '[!ATTENTION]', rendered = '⚠️ Attention', highlight = 'RenderMarkdownWarn'}, - failure = { raw = '[!FAILURE]', rendered = '❗ Failure', highlight = 'RenderMarkdownError'}, - fail = { raw = '[!FAIL]', rendered = '❗ Fail', highlight = 'RenderMarkdownError'}, - missing = { raw = '[!MISSING]', rendered = '🪹 Missing', highlight = 'RenderMarkdownError'}, - danger = { raw = '[!DANGER]', rendered = '❗ Danger', highlight = 'RenderMarkdownError'}, - error = { raw = '[!ERROR]', rendered = '❓ Error', highlight = 'RenderMarkdownError'}, - bug = { raw = '[!BUG]', rendered = '🐛 Bug', highlight = 'RenderMarkdownError'}, - example = { raw = '[!EXAMPLE]', rendered = '❕ Example', highlight = 'RenderMarkdownHint' }, - quote = { raw = '[!QUOTE]', rendered = '🖋️ Quote', highlight = 'RenderMarkdownQuote'}, - cite = { raw = '[!CITE]', rendered = '📚 Cite', highlight = 'RenderMarkdownQuote'}, - bibliography = { raw = '[!BIB]', rendered = '📚 Bibliography', highlight = 'RenderMarkdownQuote'}, - }, - checkbox = { - enabled = true, - render_modes = false, - bullet = false, - right_pad = 1, - unchecked = { - icon = '⚪', - highlight = 'RenderMarkdownUnchecked', - scope_highlight = nil, - }, - checked = { - icon = '🟢', - highlight = 'RenderMarkdownChecked', - scope_highlight = nil, - }, - custom = { - todo = { raw = '[-]', rendered = '🔴', highlight = 'RenderMarkdownTodo', scope_highlight = nil }, - }, - }, - bullet = { - enabled = true, - render_modes = false, - icons = { '●', '○', '◆', '◇' }, - ordered_icons = function(ctx) - local value = vim.trim(ctx.value) - local index = tonumber(value:sub(1, #value - 1)) - return ('%d.'):format(index > 1 and index or ctx.index) - end, - left_pad = 0, - right_pad = 0, - highlight = 'RenderMarkdownBullet', - scope_highlight = {}, - }, - quote = { icon = '▋' }, - anti_conceal = { - enabled = true, - -- Which elements to always show, ignoring anti conceal behavior. Values can either be - -- booleans to fix the behavior or string lists representing modes where anti conceal - -- behavior will be ignored. Valid values are: - -- head_icon, head_background, head_border, code_language, code_background, code_border, - -- dash, bullet, check_icon, check_scope, quote, table_border, callout, link, sign - ignore = { - code_background = true, - sign = true, - }, - above = 0, - below = 0, - }, - code = { - -- Turn on / off code block & inline code rendering. - enabled = true, - -- Additional modes to render code blocks. - render_modes = false, - -- Turn on / off sign column related rendering. - sign = true, - -- Whether to conceal nodes at the top and bottom of code blocks. - conceal_delimiters = true, - -- Turn on / off language heading related rendering. - language = true, - -- Determines where language icon is rendered. - -- | right | right side of code block | - -- | left | left side of code block | - position = 'left', - -- Whether to include the language icon above code blocks. - language_icon = true, - -- Whether to include the language name above code blocks. - language_name = true, - -- Whether to include the language info above code blocks. - language_info = true, - -- Amount of padding to add around the language. - -- If a float < 1 is provided it is treated as a percentage of available window space. - language_pad = 0, - -- A list of language names for which background highlighting will be disabled. - -- Likely because that language has background highlights itself. - -- Use a boolean to make behavior apply to all languages. - -- Borders above & below blocks will continue to be rendered. - disable_background = { 'diff' }, - -- Width of the code block background. - -- | block | width of the code block | - -- | full | full width of the window | - width = 'full', - -- Amount of margin to add to the left of code blocks. - -- If a float < 1 is provided it is treated as a percentage of available window space. - -- Margin available space is computed after accounting for padding. - left_margin = 0, - -- Amount of padding to add to the left of code blocks. - -- If a float < 1 is provided it is treated as a percentage of available window space. - left_pad = 0, - -- Amount of padding to add to the right of code blocks when width is 'block'. - -- If a float < 1 is provided it is treated as a percentage of available window space. - right_pad = 0, - -- Minimum width to use for code blocks when width is 'block'. - min_width = 0, - -- Determines how the top / bottom of code block are rendered. - -- | none | do not render a border | - -- | thick | use the same highlight as the code body | - -- | thin | when lines are empty overlay the above & below icons | - -- | hide | conceal lines unless language name or icon is added | - border = 'hide', - -- Used above code blocks to fill remaining space around language. - language_border = '█', - -- Added to the left of language. - language_left = '', - -- Added to the right of language. - language_right = '', - -- Used above code blocks for thin border. - above = '▄', - -- Used below code blocks for thin border. - below = '▀', - -- Turn on / off inline code related rendering. - inline = true, - -- Icon to add to the left of inline code. - inline_left = '', - -- Icon to add to the right of inline code. - inline_right = '', - -- Padding to add to the left & right of inline code. - inline_pad = 0, - -- Priority to assign to code background highlight. - priority = nil, - -- Highlight for code blocks. - highlight = 'RenderMarkdownCode', - -- Highlight for code info section, after the language. - highlight_info = 'RenderMarkdownCodeInfo', - -- Highlight for language, overrides icon provider value. - highlight_language = nil, - -- Highlight for border, use false to add no highlight. - highlight_border = 'RenderMarkdownCodeBorder', - -- Highlight for language, used if icon provider does not have a value. - highlight_fallback = 'RenderMarkdownCodeFallback', - -- Highlight for inline code. - highlight_inline = 'RenderMarkdownCodeInline', - -- Determines how code blocks & inline code are rendered. - -- | none | { enabled = false } | - -- | normal | { language = false } | - -- | language | { disable_background = true, inline = false } | - -- | full | uses all default values | - style = 'full', - }, - dash = { - -- Useful context to have when evaluating values. - -- | width | width of the current window | - -- Turn on / off thematic break rendering. - enabled = true, - -- Additional modes to render dash. - render_modes = false, - -- Replaces '---'|'***'|'___'|'* * *' of 'thematic_break'. - -- The icon gets repeated across the window's width. - icon = '─', - -- Width of the generated line. - -- If a float < 1 is provided it is treated as a percentage of available window space. - -- Output is evaluated depending on the type. - -- | function | `value(context)` | - -- | number | `value` | - -- | full | width of the window | - width = 'full', - -- Amount of margin to add to the left of dash. - -- If a float < 1 is provided it is treated as a percentage of available window space. - left_margin = 0, - -- Highlight for the whole line generated from the icon. - highlight = 'RenderMarkdownDash', - }, -}) diff --git a/scripts/compiler b/scripts/compiler index 60f2013..50efbfc 100755 --- a/scripts/compiler +++ b/scripts/compiler @@ -18,7 +18,7 @@ case "$ext" in ms) mstarget="$(getcomproot "${file}" || echo "${file}")" cd "${mstarget%/*}" - preconv "${mstarget}" | soelim | refer -PS -e -p "$HOME/.local/share/groff/library.txt" | groff -U -ms -kept -dpaper=letter -P-pletter -T pdf > "${mstarget%.*}".pdf ;; + preconv "${mstarget}" | soelim | refer -PS -e -p "${XDG_DATA_HOME:-$HOME/.local/share}/groff/library.txt" | groff -U -ms -kept -dpaper=letter -P-pletter -T pdf > "${mstarget%.*}".pdf ;; c) cc "${file}" -o "${base}" && "./${base}" ;; cpp) g++ "${file}" -o "${base}" && "./${base}" ;; cs) mcs "${file}" && mono "${base}.exe" ;; @@ -29,7 +29,7 @@ case "$ext" in md) mdtarget="$(getcomproot "${file}" || echo "${file}")" cd "${mdtarget%/*}" - md2ms "${mdtarget}" | preconv | soelim | refer -PS -e -p "$HOME/.local/share/groff/library.txt" | groff -U -ms -kept -dpaper=letter -T pdf > "${mdtarget%.*}".pdf ;; + md2ms "${mdtarget}" | preconv | soelim | refer -PS -e -p "${XDG_DATA_HOME:-$HOME/.local/share}/groff/library.txt" | groff -U -ms -kept -dpaper=letter -T pdf > "${mdtarget%.*}".pdf ;; org) emacs "${file}" --batch -u "${USER}" -f org-latex-export-to-pdf ;; py) python "${file}" ;; [rR]md) Rscript -e "rmarkdown::render('${file}', quiet=TRUE)" ;; diff --git a/shortcuts.vim b/shortcuts.vim deleted file mode 100644 index c2d07bb..0000000 --- a/shortcuts.vim +++ /dev/null @@ -1,29 +0,0 @@ -cmap ;cac /home/tuckerj/.cache -cmap ;cf /home/tuckerj/.config -cmap ;D /home/tuckerj/Downloads -cmap ;d /home/tuckerj/Documents -cmap ;dt /home/tuckerj/.local/share -cmap ;rr /home/tuckerj/.local/src -cmap ;h /home/tuckerj -cmap ;m /home/tuckerj/Music -cmap ;mn /mnt -cmap ;pp /home/tuckerj/Pictures -cmap ;sc /home/tuckerj/.local/bin -cmap ;src /home/tuckerj/.local/src -cmap ;vv /home/tuckerj/Videos -cmap ;bf /home/tuckerj/.config/shell/bm-files -cmap ;bd /home/tuckerj/.config/shell/bm-dirs -cmap ;cfx /home/tuckerj/.config/x11/xresources -cmap ;cfb ~/.local/src/dwmblocks/config.h -cmap ;cfv /home/tuckerj/.config/nvim/init.vim -cmap ;cfz /home/tuckerj/.config/zsh/.zshrc -cmap ;cfa /home/tuckerj/.config/shell/aliasrc -cmap ;cfp /home/tuckerj/.config/shell/profile -cmap ;cfm /home/tuckerj/.config/mutt/muttrc -cmap ;cfn /home/tuckerj/.config/newsboat/config -cmap ;cfu /home/tuckerj/.config/newsboat/urls -cmap ;cfmb /home/tuckerj/.config/ncmpcpp/bindings -cmap ;cfmc /home/tuckerj/.config/ncmpcpp/config -cmap ;cfl /home/tuckerj/.config/lf/lfrc -cmap ;cfL /home/tuckerj/.config/lf/scope -cmap ;cfX /home/tuckerj/.config/nsxiv/exec/key-handler