From b951216ef4dc004535ec1202315e785f869f3be6 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Wed, 8 Jan 2025 12:52:00 +1030 Subject: [PATCH] more updates --- .config/nvim/ftplugin/markdown.lua | 43 +++++++++++++++++++ .config/nvim/lua/lazyvim/plugins/angular.lua | 8 +--- .config/nvim/lua/lazyvim/plugins/whichkey.lua | 2 + 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .config/nvim/ftplugin/markdown.lua diff --git a/.config/nvim/ftplugin/markdown.lua b/.config/nvim/ftplugin/markdown.lua new file mode 100644 index 0000000..a40e5ab --- /dev/null +++ b/.config/nvim/ftplugin/markdown.lua @@ -0,0 +1,43 @@ +vim.opt.wrap = true; +vim.opt.textwidth = 80; + +vim.api.nvim_buf_set_keymap(0, "n", "j", "gj", { noremap = true, silent = true }) +vim.api.nvim_buf_set_keymap(0, "n", "k", "gk", { noremap = true, silent = true }) + +--Disable header folding +vim.g.vim_markdown_folding_disabled = 1 + +--Disable math tex conceal and syntax highlight +vim.g.tex_conceal = '' +vim.g.vim_markdown_math = 0 + +--Support front matter of various format +vim.g.vim_markdown_frontmatter = 1 --for YAML format +-- vim.g.vim_markdown_toml_frontmatter = 1 --for TOML format +-- vim.g.vim_markdown_json_frontmatter = 1 --for JSON format + +--Let the TOC window autofit so that it doesn't take too much space +vim.g.vim_markdown_toc_autofit = 1 +vim.g.vim_markdown_fenced_languages = {'python', 'javascript', 'lua', 'bash=sh', 'html', 'css', 'typescript', 'jsx', 'tsx', 'ts', 'js'} + +-- Add asterisks in block comments +vim.opt.formatoptions:append { 'r' } +vim.g.vim_markdown_override_syntax = 1 + +-- don't conceal code fences +vim.cmd([[ + let g:pandoc#syntax#conceal#use = 0 + let g:pandoc#syntax#codeblocks#embeds#langs#prefix = "```" + let g:pandoc#syntax#codeblocks#embeds#langs#suffix = "```" +]]) + +vim.cmd([[autocmd FileType markdown setlocal syntax=pandoc]]) + +vim.cmd([[ + augroup markdown + autocmd! + autocmd FileType markdown setlocal wrap + autocmd FileType markdown setlocal textwidth=80 + autocmd FileType markdown setlocal formatoptions+=a + augroup END +]]) diff --git a/.config/nvim/lua/lazyvim/plugins/angular.lua b/.config/nvim/lua/lazyvim/plugins/angular.lua index 48f1b13..da07e52 100644 --- a/.config/nvim/lua/lazyvim/plugins/angular.lua +++ b/.config/nvim/lua/lazyvim/plugins/angular.lua @@ -4,17 +4,13 @@ return { enabled = true, lazy = false, config = function() - local opts = { noremap = true, silent = true } local ng = require("ng"); vim.keymap.set("n", "at", function() ng.goto_template_for_component({ reuse_window = true }) - end, opts) + end, { desc = "Go to template" }) vim.keymap.set("n", "ac", function() ng.goto_component_with_template_file({ reuse_window = true }) - end, opts) - vim.keymap.set("n", "aT", function() - ng.get_template_tcb({ reuse_window = true }) - end, opts) + end, { desc = "Go to component" }) end, }, } diff --git a/.config/nvim/lua/lazyvim/plugins/whichkey.lua b/.config/nvim/lua/lazyvim/plugins/whichkey.lua index 550be5f..9364f46 100644 --- a/.config/nvim/lua/lazyvim/plugins/whichkey.lua +++ b/.config/nvim/lua/lazyvim/plugins/whichkey.lua @@ -69,6 +69,8 @@ return { { "t", group = "todo" }, { "N", group = "noice" }, { "f", group = "files" }, + { "a", group = "angular" }, + { "T", group = "term" }, }) -- Z = { "ZenMode", "Zen" },