added markdown linting and formatting
This commit is contained in:
parent
c35e42337a
commit
fd43e168ee
124
init.lua
124
init.lua
|
@ -32,71 +32,71 @@ require('lazy').setup({
|
||||||
require 'plugins.rhubarb',
|
require 'plugins.rhubarb',
|
||||||
require 'plugins.lsp',
|
require 'plugins.lsp',
|
||||||
require 'plugins.conform',
|
require 'plugins.conform',
|
||||||
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
||||||
--
|
--
|
||||||
-- This is often very useful to both group configuration, as well as handle
|
-- This is often very useful to both group configuration, as well as handle
|
||||||
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
||||||
--
|
--
|
||||||
-- For example, in the following configuration, we use:
|
-- For example, in the following configuration, we use:
|
||||||
-- event = 'VimEnter'
|
-- event = 'VimEnter'
|
||||||
--
|
--
|
||||||
-- which loads which-key before all the UI elements are loaded. Events can be
|
-- which loads which-key before all the UI elements are loaded. Events can be
|
||||||
-- normal autocommands events (`:help autocmd-events`).
|
-- normal autocommands events (`:help autocmd-events`).
|
||||||
--
|
--
|
||||||
-- Then, because we use the `opts` key (recommended), the configuration runs
|
-- Then, because we use the `opts` key (recommended), the configuration runs
|
||||||
-- after the plugin has been loaded as `requpre(MODULE).setup(opts)`.
|
-- after the plugin has been loaded as `requpre(MODULE).setup(opts)`.
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
opts = {
|
opts = {
|
||||||
-- delay between pressing a key and opening which-key (milliseconds)
|
-- delay between pressing a key and opening which-key (milliseconds)
|
||||||
-- this setting is independent of vim.o.timeoutlen
|
-- this setting is independent of vim.o.timeoutlen
|
||||||
delay = 0,
|
delay = 0,
|
||||||
icons = {
|
icons = {
|
||||||
-- set icon mappings to true if you have a Nerd Font
|
-- set icon mappings to true if you have a Nerd Font
|
||||||
mappings = vim.g.have_nerd_font,
|
mappings = vim.g.have_nerd_font,
|
||||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||||
keys = vim.g.have_nerd_font and {} or {
|
keys = vim.g.have_nerd_font and {} or {
|
||||||
Up = '<Up> ',
|
Up = '<Up> ',
|
||||||
Down = '<Down> ',
|
Down = '<Down> ',
|
||||||
Left = '<Left> ',
|
Left = '<Left> ',
|
||||||
Right = '<Right> ',
|
Right = '<Right> ',
|
||||||
C = '<C-…> ',
|
C = '<C-…> ',
|
||||||
M = '<M-…> ',
|
M = '<M-…> ',
|
||||||
D = '<D-…> ',
|
D = '<D-…> ',
|
||||||
S = '<S-…> ',
|
S = '<S-…> ',
|
||||||
CR = '<CR> ',
|
CR = '<CR> ',
|
||||||
Esc = '<Esc> ',
|
Esc = '<Esc> ',
|
||||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
ScrollWheelDown = '<ScrollWheelDown> ',
|
||||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
ScrollWheelUp = '<ScrollWheelUp> ',
|
||||||
NL = '<NL> ',
|
NL = '<NL> ',
|
||||||
BS = '<BS> ',
|
BS = '<BS> ',
|
||||||
Space = '<Space> ',
|
Space = '<Space> ',
|
||||||
Tab = '<Tab> ',
|
Tab = '<Tab> ',
|
||||||
F1 = '<F1>',
|
F1 = '<F1>',
|
||||||
F2 = '<F2>',
|
F2 = '<F2>',
|
||||||
F3 = '<F3>',
|
F3 = '<F3>',
|
||||||
F4 = '<F4>',
|
F4 = '<F4>',
|
||||||
F5 = '<F5>',
|
F5 = '<F5>',
|
||||||
F6 = '<F6>',
|
F6 = '<F6>',
|
||||||
F7 = '<F7>',
|
F7 = '<F7>',
|
||||||
F8 = '<F8>',
|
F8 = '<F8>',
|
||||||
F9 = '<F9>',
|
F9 = '<F9>',
|
||||||
F10 = '<F10>',
|
F10 = '<F10>',
|
||||||
F11 = '<F11>',
|
F11 = '<F11>',
|
||||||
F12 = '<F12>',
|
F12 = '<F12>',
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Document existing key chains
|
|
||||||
spec = {
|
|
||||||
{ '<leader>s', group = '[S]earch' },
|
|
||||||
{ '<leader>t', group = '[T]oggle' },
|
|
||||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Document existing key chains
|
||||||
|
spec = {
|
||||||
|
{ '<leader>s', group = '[S]earch' },
|
||||||
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- NOTE: Plugins can specify dependencies.
|
-- NOTE: Plugins can specify dependencies.
|
||||||
--
|
--
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
||||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "145476d74aaa3236db9dc6705d0fa3eb0f4f8352" },
|
"mini.nvim": { "branch": "main", "commit": "8ca3965e68edfee5f438d4063f5adf5afa255884" },
|
||||||
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" },
|
"nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" },
|
||||||
|
@ -30,6 +30,6 @@
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" },
|
"vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" },
|
||||||
"vim-rhubarb": { "branch": "master", "commit": "386daa2e9d98e23e27ad089afcbe5c5a903e488d" },
|
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
-- You can add your own plugins here or in other files in this directory!
|
|
||||||
-- I promise not to create any merge conflicts in this directory :)
|
|
||||||
--
|
|
||||||
-- See the kickstart.nvim README for more information
|
|
||||||
return {}
|
|
|
@ -6,7 +6,13 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
local lint = require 'lint'
|
local lint = require 'lint'
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
|
yaml = { 'yamllint' },
|
||||||
markdown = { 'markdownlint' },
|
markdown = { 'markdownlint' },
|
||||||
|
typescript = { 'eslint_d' },
|
||||||
|
javascript = { 'eslint_d' },
|
||||||
|
vue = { 'eslint_d' },
|
||||||
|
--python = { 'ruff' } linting already provided by ruff,
|
||||||
|
json = { 'jsonlint' },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||||
|
|
|
@ -41,6 +41,7 @@ return { -- Autoformat
|
||||||
jsonc = { 'prettierd' },
|
jsonc = { 'prettierd' },
|
||||||
yaml = { 'prettierd' },
|
yaml = { 'prettierd' },
|
||||||
go = { 'goimports', 'golines' },
|
go = { 'goimports', 'golines' },
|
||||||
|
markdown = { 'mdformat' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,9 +219,21 @@ return {
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
|
vue_ls = {},
|
||||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- ts_ls = {},
|
ts_ls = {
|
||||||
--
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
{
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server',
|
||||||
|
languages = { 'vue' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yamlls = {},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = { ... },
|
-- cmd = { ... },
|
||||||
-- filetypes = { ... },
|
-- filetypes = { ... },
|
||||||
|
@ -257,6 +269,11 @@ return {
|
||||||
'goimports',
|
'goimports',
|
||||||
'golines',
|
'golines',
|
||||||
'prettierd',
|
'prettierd',
|
||||||
|
'jsonlint',
|
||||||
|
'markdownlint',
|
||||||
|
'mdformat',
|
||||||
|
'yamllint',
|
||||||
|
'eslint_d',
|
||||||
})
|
})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue