plugin/formatter: add neoformat

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-16 10:18:16 +03:00
parent c6d1be78e8
commit 354cef331a
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 21 additions and 1 deletions

View file

@ -10,9 +10,10 @@ let
./plugins/explorer
./plugins/theme
./plugins/lsp
./plugins/formatter
];
basicConfigs = [builtins.readFile ./config/basic.lua];
basicConfigs = map builtins.readFile [ ./config/basic.lua ];
pluginConfigs = lib.extractAttrs "luaConfig" plugins;
allConfigs = basicConfigs ++ pluginConfigs;
in

View file

@ -0,0 +1,9 @@
{ vimPlugins, ... }:
{
luaConfig = builtins.readFile ./neoformat.lua;
plugins = [
vimPlugins.neoformat
];
}

View file

@ -0,0 +1,10 @@
vim.g.neoformat_try_node_exe = 1
vim.g.neoformat_only_msg_on_error = 1
vim.g.neoformat_enabled_markdown = { "denofmt" }
vim.cmd[[
aug fmt
au!
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
aug END
]]