feat(nvim): Markdown Support

This commit is contained in:
js0ny 2024-11-29 17:15:06 +00:00
parent 9076795c4f
commit d2a2ea47de
7 changed files with 25 additions and 10 deletions

View file

@ -35,4 +35,18 @@ function M.cmp_nvim_keymaps(map)
}
end
local function set_markdown_keymaps(bufnr)
local opts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("v", "`", "c`<C-r>\"`<Esc>", opts)
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
set_markdown_keymaps(0)
end,
})
require("keymaps.language")
return M

View file

@ -4,5 +4,5 @@ return {
"L3MON4D3/LuaSnip",
dependencies = { "rafamadriz/friendly-snippets" },
},
{ "rafamadriz/friendly-snippets" }
{ "rafamadriz/friendly-snippets" },
}

View file

@ -18,5 +18,9 @@ return {
desc = "Buffer Local Keymaps (which-key)",
},
},
},
{
"github/copilot.vim",
lazy = false,
}
}

View file

@ -40,14 +40,7 @@ return {
dashboard.button('c', ' 转到设置', ':Telescope find_files cwd=~/.config/nvim<CR>'),
dashboard.button('SPC q', '󱊷 退出', ':qa<CR>'),
}
local handle = io.popen('fortune')
--- Handle the case where fortune is not installed
local fortune = ""
if handle then
fortune = handle:read("*a")
handle:close()
end
dashboard.section.footer.val = "今日 " .. os.date("%Y-%m-%d %A") .. " " .. fortune
dashboard.section.footer.val = "今日 " .. os.date("%Y-%m-%d %A") .. " "
dashboard.config.opts.noautocmd = true

View file

@ -42,6 +42,7 @@ return {
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "copilot" },
}, {
{ name = "buffer" },
{ name = "path" },

View file

@ -2,6 +2,8 @@
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
export PATH=$HOME/.local/share/gem/ruby/3.3.0/bin:$PATH # Ruby Executables
HIST_STAMPS="yyyy-mm-dd"
HISTSIZE=10000
SAVEHIST=10000
export NVM_DIR="$HOME/.config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

View file

@ -15,4 +15,5 @@ done
if [ which brew > /dev/null ]; then
brew update
brew upgrade
fi
fi