From 28545a12df4b7a83e3cb61f51c3cfe22c0a835c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= <dev@felschr.com> Date: Tue, 4 Oct 2022 10:59:05 +0200 Subject: [PATCH] chore(flake): update inputs Includes update to neovim 0.8 which required some configuration changes. --- flake.lock | 30 +++++++++++++++--------------- home/editors/neovim/filetype.lua | 6 +----- home/editors/neovim/init.lua | 4 ---- home/editors/neovim/lsp/lsp.lua | 6 +++--- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 5ca98e5..4b374e4 100644 --- a/flake.lock +++ b/flake.lock @@ -85,11 +85,11 @@ ] }, "locked": { - "lastModified": 1664286632, - "narHash": "sha256-fKENvLanhmBENlIbmDAVB8SKSbwdLLBYKu6B7oJ0rLc=", + "lastModified": 1664783440, + "narHash": "sha256-KlMwR7mUf5h8MPnzV7nGFUAt6ih/euW5xgvZ5x+hwvI=", "owner": "nix-community", "repo": "home-manager", - "rev": "6dc8a43f397c92afbc3f771385ac803d96d5eeb5", + "rev": "e4e639dd4dc3e431aa5b5f95325f9a66ac7e0dd9", "type": "github" }, "original": { @@ -101,11 +101,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1663229557, - "narHash": "sha256-1uU4nsDLXKG0AHc/VCsNBAEPkTA/07juYhcEWRb1O1E=", + "lastModified": 1664628729, + "narHash": "sha256-A1J0ZPhBfZZiWI6ipjKJ8+RpMllzOMu/An/8Tk3t4oo=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a0df6cd6e199df4a78c833c273781ea92fa62cfb", + "rev": "3024c67a2e9a35450558426c42e7419ab37efd95", "type": "github" }, "original": { @@ -117,11 +117,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1664281702, - "narHash": "sha256-haixZ4TJLu1Dciow54wrHrHvlGDVr5sW6MTeAV/ZLuI=", + "lastModified": 1664780719, + "narHash": "sha256-Oxe6la5dSqRfJogjtY4sRzJjDDqvroJIVkcGEOT87MA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7e52b35fe98481a279d89f9c145f8076d049d2b9", + "rev": "fd54651f5ffb4a36e8463e0c327a78442b26cbe7", "type": "github" }, "original": { @@ -149,11 +149,11 @@ }, "nur": { "locked": { - "lastModified": 1664343176, - "narHash": "sha256-3UJnfUJsBInjHLc+yM7ynQ9fmIqDaTvFXmWU9sTLkiY=", + "lastModified": 1664866618, + "narHash": "sha256-eJZNYKFVubevxkkixhm++8u5VygO11IA9e1q4PjtMuQ=", "owner": "nix-community", "repo": "NUR", - "rev": "9dd8331154e6555760240be703fbf85dd3c41bab", + "rev": "ec3f8863164de94d1463a880f6e715a387d3c733", "type": "github" }, "original": { @@ -189,11 +189,11 @@ ] }, "locked": { - "lastModified": 1663082609, - "narHash": "sha256-lmCCIu4dj59qbzkGKHQtolhpIEQMeAd2XUbXVPqgPYo=", + "lastModified": 1664708386, + "narHash": "sha256-aCD8UUGNYb5nYzRmtsq/0yP9gFOQQHr/Lsb5vW+mucw=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "60cad1a326df17a8c6cf2bb23436609fdd83024e", + "rev": "2e4a708918e14fdbd534cc94aaa9470cd19b2464", "type": "github" }, "original": { diff --git a/home/editors/neovim/filetype.lua b/home/editors/neovim/filetype.lua index c6134e6..578f127 100644 --- a/home/editors/neovim/filetype.lua +++ b/home/editors/neovim/filetype.lua @@ -1,7 +1,3 @@ --- opt-in to filetype.lua -vim.g.do_filetype_lua = 1 -vim.g.did_load_filetypes = 0 - vim.filetype.add({ extension = { vert = "glsl", @@ -22,7 +18,7 @@ vim.filetype.add({ [".env.*"] = "direnv", [".*"] = function(path, bufnr) local first_line = vim.api.nvim_buf_get_lines(bufnr, 0, 1, true)[1] - if first_line:match("^#!.*nix%-shell") ~= nil then + if first_line ~= nil and first_line:match("^#!.*nix%-shell") ~= nil then local second_line = vim.api.nvim_buf_get_lines(bufnr, 1, 2, true)[1] local command = second_line:match("^#!.*nix%-shell .*%-i ([%a%d]*)") if command == nil then diff --git a/home/editors/neovim/init.lua b/home/editors/neovim/init.lua index b372971..f71a781 100644 --- a/home/editors/neovim/init.lua +++ b/home/editors/neovim/init.lua @@ -19,10 +19,6 @@ vim.g.camelcasemotion_key = "<leader>" vim.opt.relativenumber = true vim.opt.splitbelow = true --- opt-in to filetype.lua -vim.g.do_filetype_lua = 1 -vim.g.did_load_filetypes = 0 - vim.g.nvcode_termcolors = 256 vim.cmd("syntax on") vim.cmd("colorscheme nvcode") diff --git a/home/editors/neovim/lsp/lsp.lua b/home/editors/neovim/lsp/lsp.lua index ba1ffae..b62088b 100644 --- a/home/editors/neovim/lsp/lsp.lua +++ b/home/editors/neovim/lsp/lsp.lua @@ -9,7 +9,7 @@ require("nvim-lightbulb").setup({ local format_augroup = vim.api.nvim_create_augroup("LspFormatting", {}) local on_attach = function(client, bufnr) -- codelens - if client.resolved_capabilities.code_lens then + if client.server_capabilities.codeLensProvider then vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI", "InsertLeave" }, { callback = vim.lsp.codelens.refresh, buffer = bufnr, @@ -63,8 +63,8 @@ local c = { }, no_formatting = { on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false on_attach(client, bufnr) end, capabilities = capabilities_no_formatting,