nix-format and remove obsolete obsidian derivation

This commit is contained in:
Haak Saxberg 2021-10-10 14:00:02 -07:00
parent 570c2753a7
commit 64f5af878d
9 changed files with 37 additions and 83 deletions

View file

@ -29,7 +29,8 @@ let
sha256 = "0i0p21jkrx99n3dnm5xvnw8n963c67l4lgl4iwngz0psdzwxphkw";
};
};
in with builtins;
in
with builtins;
{
programs.neovim = {
enable = true;
@ -116,17 +117,17 @@ in with builtins;
{
plugin = nvim-lspconfig;
config = ''
lua << EOF
${readFile (
pkgs.substituteAll {
src = ./nvim-lspconfig.lua;
# since both of these are used for actually configuring the system,
# we'll probably always want them around.
lua_ls = pkgs.sumneko-lua-language-server;
rnix_lsp = pkgs.rnix-lsp;
}
) }
EOF
lua << EOF
${readFile (
pkgs.substituteAll {
src = ./nvim-lspconfig.lua;
# since both of these are used for actually configuring the system,
# we'll probably always want them around.
lua_ls = pkgs.sumneko-lua-language-server;
rnix_lsp = pkgs.rnix-lsp;
}
) }
EOF
'';
}
{

View file

@ -1,17 +1,17 @@
local nvim_lsp = require("lspconfig")
local format_async = function(err, _, result, _, bufnr)
if err ~= nil or result == nil then return end
if not vim.api.nvim_buf_get_option(bufnr, "modified") then
local view = vim.fn.winsaveview()
vim.lsp.util.apply_text_edits(result, bufnr)
vim.fn.winrestview(view)
if bufnr == vim.api.nvim_get_current_buf() then
vim.api.nvim_command("noautocmd :update")
end
end
end
vim.lsp.handlers["textDocument/formatting"] = format_async
-- local format_async = function(err, _, result, _, bufnr)
-- if err ~= nil or result == nil then return end
-- if not vim.api.nvim_buf_get_option(bufnr, "modified") then
-- local view = vim.fn.winsaveview()
-- vim.lsp.util.apply_text_edits(result, bufnr)
-- vim.fn.winrestview(view)
-- if bufnr == vim.api.nvim_get_current_buf() then
-- vim.api.nvim_command("noautocmd :update")
-- end
-- end
-- end
-- vim.lsp.handlers["textDocument/formatting"] = format_async
local on_attach = function(client, bufnr)
local buf_map = vim.api.nvim_buf_set_keymap