nvim
This commit is contained in:
		
							parent
							
								
									bdf52d4710
								
							
						
					
					
						commit
						41095142b2
					
				
					 3 changed files with 27 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,8 @@ if not ok then
 | 
			
		|||
    return
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local has_lint, lint = pcall(require, "lint")
 | 
			
		||||
 | 
			
		||||
local nmap = require("my.utils").nmap
 | 
			
		||||
 | 
			
		||||
local border = {
 | 
			
		||||
| 
						 | 
				
			
			@ -91,13 +93,28 @@ local on_attach = function(client, bufnr)
 | 
			
		|||
    if has_lsp_status then
 | 
			
		||||
        lsp_status.on_attach(client)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if has_lint then
 | 
			
		||||
        if vim.filetype.match({ buf = bufnr }) == "php" then
 | 
			
		||||
            lint.linters.psalm.cmd = "./vendor/bin/psalm"
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        lint.linters_by_ft = {
 | 
			
		||||
            php = { "psalm" }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        vim.api.nvim_create_autocmd({ "BufWritePost" }, {
 | 
			
		||||
            pattern = { "*.php" },
 | 
			
		||||
            callback = function()
 | 
			
		||||
                lint.try_lint()
 | 
			
		||||
            end
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local servers = {
 | 
			
		||||
    gopls = {},
 | 
			
		||||
    psalm = {
 | 
			
		||||
        cmd = { "./vendor/bin/psalm-language-server" },
 | 
			
		||||
    },
 | 
			
		||||
    phpactor = {},
 | 
			
		||||
    pylsp = {},
 | 
			
		||||
    rust_analyzer = {
 | 
			
		||||
        assist = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,12 +3,17 @@ if not ok then
 | 
			
		|||
    return
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local luasnip_ok, luasnip = pcall(require, "luasnip")
 | 
			
		||||
if not luasnip_ok then
 | 
			
		||||
    vim.notify("Luasnip is required for nvim-cmp to work", vim.log.levels.WARN)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local lspkind = require "lspkind"
 | 
			
		||||
 | 
			
		||||
cmp.setup {
 | 
			
		||||
    snippet = {
 | 
			
		||||
        expand = function(args)
 | 
			
		||||
            require("luasnip").lsp_expand(args.body)
 | 
			
		||||
            luasnip.lsp_expand(args.body)
 | 
			
		||||
        end,
 | 
			
		||||
    },
 | 
			
		||||
    mapping = cmp.mapping.preset.insert {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,4 +44,5 @@ require "paq" {
 | 
			
		|||
    "L3MON4D3/LuaSnip",
 | 
			
		||||
    "nvim-lua/lsp-status.nvim",
 | 
			
		||||
    "onsails/lspkind.nvim",
 | 
			
		||||
    "mfussenegger/nvim-lint",
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue