Skip to content

Commit

Permalink
feat(nvim): add formatting of yaml, html, markdown, json via prettierd
Browse files Browse the repository at this point in the history
  • Loading branch information
workflow committed Jun 17, 2024
1 parent 7c914d0 commit 3a3c1d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
24 changes: 13 additions & 11 deletions home/neovim/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ pkgs, inputs, ... }:
let
{
pkgs,
inputs,
...
}: let
nixpkgs-unstable = pkgs.unstable;

bookmarks-nvim = pkgs.vimUtils.buildVimPlugin {
Expand All @@ -21,8 +24,7 @@ let
sha256 = "ys3kgXtgaE5OGyNYZ2PuqM9FDGjxfIjRgXBUDBVIjUM=";
};
};
in
{
in {
imports = [
./carbon
./cmp
Expand Down Expand Up @@ -201,11 +203,11 @@ in
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { silent = true })
'';

extraPackages = [
pkgs.shellcheck
pkgs.shfmt
pkgs.nixd # Nix Language Server
pkgs.nixpkgs-fmt
extraPackages = with pkgs.unstable; [
nixd # Nix Language Server
prettierd # For yaml, html, json, markdown
shellcheck
shfmt
];

plugins = with pkgs.vimPlugins; [
Expand All @@ -220,7 +222,7 @@ in
e = { require("b64").encode, "Base64 [E]ncode" },
d = { require("b64").decode, "Base64 [D]ecode" },
},
}, {
}, {
prefix = "<leader>",
mode = "v",
})
Expand Down Expand Up @@ -321,7 +323,7 @@ in
{
plugin = dressing-nvim; # Better UI for codeactions, code input etc...
config = ''
'';
type = "lua";
}
Expand Down
5 changes: 4 additions & 1 deletion home/neovim/none-ls/none-ls.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.shfmt
null_ls.builtins.formatting.shfmt,
null_ls.builtins.formatting.prettierd.with({
filetypes = { "html", "json", "yaml", "markdown" },
}),
}
})

0 comments on commit 3a3c1d4

Please sign in to comment.