chore(flake): update inputs

Includes update to neovim 0.8 which required some configuration changes.
This commit is contained in:
Felix Schröter 2022-10-04 10:59:05 +02:00
parent 2f7c1124ce
commit 28545a12df
Signed by: felschr
GPG key ID: 671E39E6744C807D
4 changed files with 19 additions and 27 deletions
home/editors/neovim

View file

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

View file

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

View file

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