GithubHelp home page GithubHelp logo

dauliac / phpactor.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gbprod/phpactor.nvim

0.0 0.0 0.0 45 KB

Lua version of the Phpactor vim plugin to take advantage of the latest Neovim features

Lua 100.00%

phpactor.nvim's Introduction

๐Ÿ˜ phpactor.nvim

Lua version of phpactor nvim plugin.

โœจ Features

It allows to use phpactor commands using new neovim lua api. It uses vim.ui and vim.notify to provide modern UI using plugins like nvim-notify, notifier.nvim, dressing.nvim or telescope.nvim.

I've only implemented commands that are not available using LSP Code Actions.

It also automaticly install, update and configure phpactor using nvim-lspconfig.

This provides PhpActor command to call phpactor rpc methods:

PhpActor [
  class_inflect
  context_menu
  expand_class
  generate_accessor
  change_visibility
  copy_class
  import_class
  import_missing_classes
  move_class
  navigate
  new_class
  transform
  update
  config
  status
  cache_clear
  lsp/status
  lsp/reindex
  lsp/debug/config
  lsp/debug/config
  blackfire/start
  blackfire/stop
]

You can also use the lua function require('phpactor').rpc(name, options). Eg: :lua require('phpactor').rpc('context_menu', {})

โšก๏ธ Requirements

  • Neovim >= 0.7.0

๐Ÿ“ฆ Installation

Install the plugin with your preferred package manager:

-- Lua
use({
  "gbprod/phpactor.nvim",
  run = require("phpactor.handler.update"), -- To install/update phpactor when installing this plugin
  requires = {
    "nvim-lua/plenary.nvim", -- required to update phpactor
    "neovim/nvim-lspconfig" -- required to automaticly register lsp serveur
  },
  config = function()
    require("phpactor").setup({
      -- your configuration comes here
      -- or leave it empty to use the default settings
      -- refer to the configuration section below
    })
  end
})

โš™๏ธ Configuration

phpactor.nvim comes with the following defaults:

{
  install = {
    path = vim.fn.stdpath("data") .. "/opt/",
    branch = "master",
    bin = vim.fn.stdpath("data") .. "/opt/phpactor/bin/phpactor",
    php_bin = "php",
    composer_bin = "composer",
    git_bin = "git",
    check_on_startup = "none",
  },
  lspconfig = {
    enabled = true,
    options = {},
  },
}

install.path

Default : vim.fn.stdpath("data") .. "/opt/"

Path where phpactor will be installed by the plugin. This could be an existing install of phpactor.

install.branch

Default : master

Branch that will be used for phpactor.

install.bin

Default: vim.fn.stdpath("data") .. "/opt/phpactor/bin/phpactor"

Phpactor binary.

install.php_bin

Default: php

Php binary.

install.composer_bin

Default: composer

Composer binary.

install.git_bin

Default: git

Git binary.

install.check_on_startup

Default: none
Accepted values: none|daily|always

This will check if phpactor install is up-to-date on nvim startup. This could be slow, use wisely.

lspconfig.enabled

Default: true

Does phpactor.nvim should configure lsp server using nvim-lspconfig.

lspconfig.options

Default: {}

This is here where you can define options to pass to nvim-lspconfig. Basicly, you should pass a on_attach function to set your mappings ;)

๐ŸŽ‰ Credits

phpactor.nvim's People

Contributors

gbprod avatar jdauliac avatar mikedfunk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.