mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
Neovim config updates
This commit is contained in:
@@ -26,6 +26,7 @@ createCmd(
|
||||
pattern = { '*.md', '*.markdown', '*.txt', '*.tex' },
|
||||
group = spellGroup,
|
||||
callback = function(_)
|
||||
vim.cmd.setlocal('textwidth=80')
|
||||
vim.cmd.setlocal('spell spelllang=en_us')
|
||||
end,
|
||||
}
|
||||
@@ -33,13 +34,13 @@ createCmd(
|
||||
|
||||
-- Markdown
|
||||
createCmd(
|
||||
"BufWritePre",
|
||||
"BufWritePost",
|
||||
{
|
||||
pattern = { "*.md", "*.markdown" },
|
||||
group = markdownGroup,
|
||||
callback = function(_)
|
||||
local cursor = vim.fn.getpos('.')
|
||||
vim.cmd(':normal ggVgq')
|
||||
vim.cmd("FormatWrite")
|
||||
vim.fn.setpos('.', cursor)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -48,6 +48,10 @@ end
|
||||
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
-- Formatting
|
||||
keymap('n', '<leader>f', '<cmd>:Format<CR>', default_options)
|
||||
keymap('n', '<leader>F', '<cmd>:FormatWrite<CR>', default_options)
|
||||
|
||||
-- LuaSnip Keymaps
|
||||
--local ls = require('luasnip')
|
||||
|
||||
|
||||
@@ -4,16 +4,23 @@ return {
|
||||
local util = require("formatter.util")
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
markdown = {
|
||||
markdown = function()
|
||||
return {
|
||||
exe = "prettier",
|
||||
args = {
|
||||
"--stdin-filepath",
|
||||
util.escape_path(util.get_current_buffer_file_path()),
|
||||
"--line-width",
|
||||
"100"
|
||||
"--print-width",
|
||||
"80",
|
||||
"--prose-wrap",
|
||||
"always",
|
||||
"--parser",
|
||||
"markdown"
|
||||
},
|
||||
stdin = true,
|
||||
try_node_modules = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
["*"] = {
|
||||
-- formatter for any / all file types.
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||
|
||||
@@ -19,6 +19,12 @@ return {
|
||||
},
|
||||
signature = { enabled = false },
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
}
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
|
||||
Reference in New Issue
Block a user