diff --git a/nvim/m-housh/lua/user/autocmd.lua b/nvim/m-housh/lua/user/autocmd.lua index 0ee06e2..e3198eb 100644 --- a/nvim/m-housh/lua/user/autocmd.lua +++ b/nvim/m-housh/lua/user/autocmd.lua @@ -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, } diff --git a/nvim/m-housh/lua/user/mappings.lua b/nvim/m-housh/lua/user/mappings.lua index 4b6ba16..1b0ba2f 100644 --- a/nvim/m-housh/lua/user/mappings.lua +++ b/nvim/m-housh/lua/user/mappings.lua @@ -48,6 +48,10 @@ end vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') +-- Formatting +keymap('n', 'f', ':Format', default_options) +keymap('n', 'F', ':FormatWrite', default_options) + -- LuaSnip Keymaps --local ls = require('luasnip') diff --git a/nvim/m-housh/lua/user/plugin/formatter.lua b/nvim/m-housh/lua/user/plugin/formatter.lua index 1d1b620..4bc9b8f 100644 --- a/nvim/m-housh/lua/user/plugin/formatter.lua +++ b/nvim/m-housh/lua/user/plugin/formatter.lua @@ -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 diff --git a/nvim/m-housh/lua/user/plugin/noice.lua b/nvim/m-housh/lua/user/plugin/noice.lua index 7a1a179..30dca6b 100644 --- a/nvim/m-housh/lua/user/plugin/noice.lua +++ b/nvim/m-housh/lua/user/plugin/noice.lua @@ -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 diff --git a/nvim/m-housh/spell/en.utf-8.add b/nvim/m-housh/spell/en.utf-8.add new file mode 100644 index 0000000..2d394e0 --- /dev/null +++ b/nvim/m-housh/spell/en.utf-8.add @@ -0,0 +1,3 @@ +MeasureQuick +Housh +sealtite diff --git a/nvim/m-housh/spell/en.utf-8.add.spl b/nvim/m-housh/spell/en.utf-8.add.spl new file mode 100644 index 0000000..ebf2c94 Binary files /dev/null and b/nvim/m-housh/spell/en.utf-8.add.spl differ