From dab3447badd31b64f9bd1f8e5cd5f167527a9e86 Mon Sep 17 00:00:00 2001 From: Joshua Finch Date: Sun, 20 Jul 2025 14:53:21 -0500 Subject: [PATCH] feat: Adding new additions of: - autopairs (trying again and kind of liking it) - render-markdown to render markdown in editor - twilight for dimming other lines - nvim-biscuits Changes to the zshrc settings to add location, color settings environment variables, some keybindings, universal aliases for coloration, etc. Adding a loader.enable to the start of init.lua for faster load times (need to benchmark this but it feels faster). --- nvim/init.lua | 3 + nvim/lua/plugins.lua | 37 +++++---- nvim/lua/plugins/autopairs.lua | 6 ++ nvim/lua/plugins/mason.lua | 5 +- nvim/lua/plugins/nvim-biscuits.lua | 22 +++++ nvim/lua/plugins/nvim-cmp.lua | 1 + nvim/lua/plugins/render-markdown.lua | 115 +++++++++++++++++++++++++++ nvim/lua/plugins/treesitter.lua | 6 +- nvim/lua/plugins/twilight.lua | 18 +++++ zshrc | 41 +++++++++- 10 files changed, 229 insertions(+), 25 deletions(-) create mode 100644 nvim/lua/plugins/autopairs.lua create mode 100644 nvim/lua/plugins/nvim-biscuits.lua create mode 100644 nvim/lua/plugins/render-markdown.lua create mode 100644 nvim/lua/plugins/twilight.lua diff --git a/nvim/init.lua b/nvim/init.lua index 2687669..02f3f4e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -42,6 +42,9 @@ -- -- Created: 7/2/2012 +local vim = vim +vim.loader.enable() + require('custom_functions') require('custom_commands') require('keymappings') diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index c3f7d8f..cddaa0e 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -14,21 +14,24 @@ end vim.opt.rtp:prepend(lazypath) require('lazy').setup({ - require('plugins/mason'), - require('plugins/lspconfig'), - require('plugins/gruvbox'), - require('plugins/comment'), - require('plugins/dap'), - -- require('plugins/dap-python'), - require('plugins/treesitter'), - require('plugins/gitsigns'), - require('plugins/luasnip'), - require('plugins/nvim-cmp'), - require('plugins/lualine'), - require('plugins/telekasten'), - require('plugins/telescope'), - 'tpope/vim-surround', - require('plugins/floaterm'), - require('plugins/vim-godot'), - require('plugins/markdown-preview'), + require('plugins.mason'), -- LSP and DAP manager + require('plugins.gruvbox'), -- Colorscheme + require('plugins.comment'), -- Simple language specific commenting shortcuts + require('plugins.dap'), -- DAP debugging plugin + require('plugins.dap-python'), -- Debug plugin settings specifically for python + require('plugins.treesitter'), -- Treesitter syntax highlighting and tree support + require('plugins.gitsigns'), -- Gutter symbols for Git status and quick actions for Git operations + require('plugins.luasnip'), -- Snippet enging + require('plugins.nvim-cmp'), -- Autocompletion engine + require('plugins.lualine'), -- Status line + require('plugins.telekasten'), -- Note taking setup + require('plugins.telescope'), -- Floating windows for searching and other operations + 'tpope/vim-surround', -- Change surrounding symbols + require('plugins.floaterm'), -- Floating terminal + require('plugins.vim-godot'), -- Godot specific bindings and debug + require('plugins.markdown-preview'), -- Open a preview of markdown rendered in a browser + require('plugins.render-markdown'), -- Render markdown directly in nvim (experimental, may take over for markdown-preview) + require('plugins.autopairs'), -- Autocomplete symbol pairs when typing (experimental) + require('plugins.nvim-biscuits'), -- Virtual text on closing tags for what the start of the block is (experimental) + require('plugins.twilight') -- Focus mode, dim lines around the current segment of code }) diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..d3461dc --- /dev/null +++ b/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,6 @@ +return { + 'windwp/nvim-autopairs', + config = function () + require('nvim-autopairs').setup() + end +} diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua index 012f971..a900ecd 100644 --- a/nvim/lua/plugins/mason.lua +++ b/nvim/lua/plugins/mason.lua @@ -36,13 +36,11 @@ return { 'clangd', -- C/C++ -- 'hadolint', -- Dockerfile linting 'intelephense', -- PHP - -- 'jdtls', -- java 'lua_ls', 'marksman', -- markdown - -- 'pylint', 'pylsp', 'rust_analyzer', - 'ts_ls', -- Typscript + -- 'ts_ls', -- Typscript 'yamlls', } } @@ -136,6 +134,7 @@ return { }) end, dependencies = { + 'neovim/nvim-lspconfig', 'mason-org/mason-lspconfig.nvim', }, lazy = false, diff --git a/nvim/lua/plugins/nvim-biscuits.lua b/nvim/lua/plugins/nvim-biscuits.lua new file mode 100644 index 0000000..91b335e --- /dev/null +++ b/nvim/lua/plugins/nvim-biscuits.lua @@ -0,0 +1,22 @@ +return { + 'code-biscuits/nvim-biscuits', + config = function () + require('nvim-biscuits').setup({ + default_config = { + max_length = 3, + trim_by_words = true, + min_distance = 5, + prefix_string = " 📎 ", + }, + -- on_events = { 'InsertLeave', 'CursorHoldI' }, + max_file_size = '250kb', + -- show_on_start = true, + cursor_line_only = true, + language_config = { + markdown = { + disabled = true + } + } + }) + end +} diff --git a/nvim/lua/plugins/nvim-cmp.lua b/nvim/lua/plugins/nvim-cmp.lua index d25b5cf..437b48f 100644 --- a/nvim/lua/plugins/nvim-cmp.lua +++ b/nvim/lua/plugins/nvim-cmp.lua @@ -41,6 +41,7 @@ return { { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, + { name = 'render-markdown' }, }, { { name = 'buffer' }, }) diff --git a/nvim/lua/plugins/render-markdown.lua b/nvim/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..ae68790 --- /dev/null +++ b/nvim/lua/plugins/render-markdown.lua @@ -0,0 +1,115 @@ +return { + 'meanderingprogrammer/render-markdown.nvim', + config = function () + vim.treesitter.language.register('markdown', 'telekasten') + + require('render-markdown').setup({ + enabled = true, + -- render_modes = { 'n', 'c', 't' }, + max_file_size = 10.0, + debounce = 100, + file_types = { 'markdown', 'telekasten' }, + link = { + enabled = true, + footnote = { + enabled = true, + superscript = true, + prefix = '', + suffix = '', + }, + highlight = 'RenderMarkdownLink', + }, + latex = { + enabled = false, + }, + checkbox = { + enabled = true, + render_modes = false, + bullet = false, + right_pad = 1, + unchecked = { + -- icon = '󰄱 ', + highlight = 'RenderMarkdownUnchecked', + scope_highlight = nil, + }, + checked = { + -- icon = '󰱒 ', + highlight = 'RenderMarkdownChecked', + }, + 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, + ignore = { + code_background = true, + sign = true, + }, + above = 0, + below = 0, + }, + custom = { + }, + 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'}, + }, + }) + end, + dependencies = { + } +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index b9ae81b..4016c5f 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -18,10 +18,13 @@ return { 'javascript', 'json', 'lua', + 'markdown', + 'markdown_inline', 'python', 'query', 'rust', 'sql', + 'tera', 'toml', 'tsx', 'typescript', @@ -41,8 +44,5 @@ return { enable = true, } } - -- require('nvim-treesitter.install').prefer_git = true - -- TSUpdate end, - -- lazy = false, } diff --git a/nvim/lua/plugins/twilight.lua b/nvim/lua/plugins/twilight.lua new file mode 100644 index 0000000..dc41447 --- /dev/null +++ b/nvim/lua/plugins/twilight.lua @@ -0,0 +1,18 @@ +return { + 'folke/twilight.nvim', + config = function () + require('twilight').setup({ + dimming = { + alpha = 0.3, + }, + expand = { + "function", + "method", + "table", + } + }) + end, + keys = { + { 'f', ':Twilight' } + } +} diff --git a/zshrc b/zshrc index 8a0245b..60cf13a 100644 --- a/zshrc +++ b/zshrc @@ -8,8 +8,14 @@ then fi ### ZSH Configuration +## Path variables # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" + +export MANPAGER="less -R --use-color -Dd+r -Du+b" # Colored MAN pages ZSH_THEME="fb-custom" @@ -17,9 +23,22 @@ ZSH_THEME="fb-custom" # Case-sensitive completion must be off. _ and - will be interchangeable. HYPHEN_INSENSITIVE="true" +# History +HISTCONTROL=ignoreboth + # Uncomment one of the following lines to change the auto-update behavior zstyle ':omz:update' mode reminder frequency 14 +# Keybindings +bindkey "^a" beginning-of-line +bindkey "^e" end-of-line +# bindkey "^h" backward-word +# bindkey "^k" kill-line +# bindkey "^j" backward-word +# bindkey "^k" forward-word +# bindkey "^J" history-search-forward +# bindkey "^K" history-search-backward + ### Plugins # Install the zsh-autosuggestions plugin if it doesn't exist if [ ! -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ] @@ -31,6 +50,7 @@ plugins=( aws copypath dotenv + fzf git history zsh-autosuggestions @@ -47,9 +67,18 @@ setopt hist_ignore_all_dups # Replace old history with the newest call to an ide setopt hist_ignore_space # Remove history lines that start with spaces # setopt correctall # Correct commands +# Experimental +setopt append_history inc_append_history share_history +# setopt auto_menu menu_complete +# setopt autocd +setopt auto_param_slash +setopt no_case_glob no_case_match +# setopt globdots + # Enable compinit advanced completion -autoload -Uz compinit -compinit +zmodload zsh/complist +autoload -Uz compinit && compinit +autoload -U colors && colors # Completion options # Give descriptions of what the types of completions given @@ -88,6 +117,14 @@ timezsh() { done } +# Aliases Universal +alias rm="rm -Iv" # Prompt for removal of more than three files or recursively to give some protection of mistakes +alias df="df -h" # Always use the human readable formatting +alias du="du -h -d 1" # Always use human readable format and only for the current dir by default +alias k="killall" # Quick killall +alias p="ps aux | grep $1" # Quick +alias v="$EDITOR" # Just open the usual editor + ### Environment specific include files include_files=( "$HOME/.zsh_aliases"