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

@ -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