From 1acff157914d6673fd983dbd5f0a874d3e511038 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 29 Oct 2024 13:56:22 +0100 Subject: [PATCH] nvim: new php config --- nvim/lua/user/plugins/ide.lua | 16 ++++++++++++++++ nvim/lua/user/plugins/lang/php.lua | 26 +++++++++++++++++++++----- tmux.conf | 1 - 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/nvim/lua/user/plugins/ide.lua b/nvim/lua/user/plugins/ide.lua index 51cb53b..fc1d08f 100644 --- a/nvim/lua/user/plugins/ide.lua +++ b/nvim/lua/user/plugins/ide.lua @@ -1,6 +1,22 @@ local icons = require('user.icons') return { + -- Linting + { + 'mfussenegger/nvim-lint', + opts = { + linters_by_ft = {}, + }, + config = function(_, opts) + require('lint').linters_by_ft = opts.linters_by_ft + + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require("lint").try_lint() + end, + }) + end, + }, -- Testing integration { "nvim-neotest/neotest", diff --git a/nvim/lua/user/plugins/lang/php.lua b/nvim/lua/user/plugins/lang/php.lua index 6e3e0b3..9dcde10 100644 --- a/nvim/lua/user/plugins/lang/php.lua +++ b/nvim/lua/user/plugins/lang/php.lua @@ -1,9 +1,10 @@ local lspservers = { - phpactor = { - inlay_hints = { - enabled = false - } - }, + -- phpactor = { + -- inlay_hints = { + -- enabled = false + -- } + -- }, + intelephense = {} } return { @@ -35,6 +36,21 @@ return { } } }, + { + 'phpactor/phpactor', + build = 'composer install --no-dev --optimize-autoloader', + ft = 'php', + }, + -- Linting + { + 'mfussenegger/nvim-lint', + optional = true, + opts = { + linters_by_ft = { + php = { 'phpstan' }, + }, + }, + }, -- LSP { "neovim/nvim-lspconfig", diff --git a/tmux.conf b/tmux.conf index b0dc751..43c050b 100644 --- a/tmux.conf +++ b/tmux.conf @@ -6,7 +6,6 @@ set -g escape-time 10 set -g focus-events on set -g mouse on set -s set-clipboard external -set -s copy-command 'wl-copy -p -f' set -g base-index 1 setw -g pane-base-index 1