Update nvim to have a preview for md files via :pm. Remove commands from sway config since it didn't work.

This commit is contained in:
AM
2026-01-10 09:17:51 -06:00
parent 6dd566999b
commit f8aaa79af7
5 changed files with 30 additions and 12 deletions

View File

@@ -21,6 +21,7 @@
"nvim-tree.lua": { "branch": "master", "commit": "b8b44b6a2494d086a9177251a119f9daec6cace8" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
"peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
"ui": { "branch": "v3.0", "commit": "ebf58649bc5c759ee6c730c87d8d2d4dd4124c0d" },

View File

@@ -1,6 +1,6 @@
require("nvchad.configs.lspconfig").defaults()
local servers = { "html", "cssls" }
local servers = { "html", "cssls", "gopls" }
vim.lsp.enable(servers)
-- read :h vim.lsp.config for changing options of lsp servers

View File

@@ -5,6 +5,7 @@ require "nvchad.mappings"
local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
map("i", "jk", "<ESC>l")
map("n", " pm", ":PeekOpen<Enter>")
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")

View File

@@ -12,7 +12,33 @@ return {
require "configs.lspconfig"
end,
},
{
"toppair/peek.nvim",
event = { "BufEnter" },
build = "deno task --quiet build:fast",
ft = "markdown",
config = function()
require('peek').setup({
auto_load = true, -- whether to automatically load preview when
-- entering another markdown buffer
close_on_bdelete = true, -- close preview window on buffer delete
syntax = true, -- enable syntax highlighting, affects performance
theme = 'dark', -- 'dark' or 'light'
update_on_change = true,
app = 'browser', -- 'webview', 'browser', string or a table of strings
-- explained below
filetype = { 'markdown' },-- list of filetypes to recognize as markdown
-- relevant if update_on_change is true
throttle_at = 200000, -- start throttling when file exceeds this
-- amount of bytes in size
throttle_time = 'auto', -- minimum amount of time in milliseconds
-- that has to pass before starting new render
})
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
end,
},
-- test new blink
-- { import = "nvchad.blink.lazyspec" },

View File

@@ -225,14 +225,4 @@ bindsym $mod+r mode "resize"
# important to make the magic work. And if you want to learn the secret behind
# the trick, it's all in the `wordexp(3)`.
#
exec --no-startup-id $term
# Switch to workspace 2 (second desktop)
workspace number 3
# Open Brave Browser on workspace 2
exec --no-startup-id brave-browser
workspace number 1
include '$(/usr/libexec/sway/layered-include "/usr/share/sway/config.d/*.conf" "/etc/sway/config.d/*.conf" "${XDG_CONFIG_HOME:-$HOME/.config}/sway/config.d/*.conf")'