From f643b454327f029e258a6588088275d4c10c8db1 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Mon, 2 Oct 2023 18:30:56 -0400 Subject: [PATCH] Neovim config updates --- nvim/m-housh/lua/user/autocmd.lua | 5 +++-- nvim/m-housh/lua/user/mappings.lua | 4 ++++ nvim/m-housh/lua/user/plugin/formatter.lua | 15 +++++++++++---- nvim/m-housh/lua/user/plugin/noice.lua | 6 ++++++ nvim/m-housh/spell/en.utf-8.add | 3 +++ nvim/m-housh/spell/en.utf-8.add.spl | Bin 0 -> 105 bytes 6 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 nvim/m-housh/spell/en.utf-8.add create mode 100644 nvim/m-housh/spell/en.utf-8.add.spl 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 0000000000000000000000000000000000000000..ebf2c94a89e37bc61caf83960757d369ff1e0e02 GIT binary patch literal 105 zcmWIZ^erw(&B-zP&%nT7#+;E`%$Uzu%2>>p!N|nKn97(4WR@}(0a=AWI+HP(F`JR8 d0W6WjSOOF%0kVNw8Kf9}QIrS5m4jp%7y#@T6rBJ7 literal 0 HcmV?d00001