Compare commits
2 Commits
71dac4d82f
...
a660f0c788
| Author | SHA1 | Date |
|---|---|---|
|
|
a660f0c788 | |
|
|
f75def6081 |
1
init.lua
1
init.lua
|
|
@ -354,7 +354,6 @@ require('custom.catppuccin')
|
||||||
require('custom.lua-line')
|
require('custom.lua-line')
|
||||||
require('custom.telescope')
|
require('custom.telescope')
|
||||||
require('custom.lspconfig')
|
require('custom.lspconfig')
|
||||||
require('custom.lspsaga')
|
|
||||||
require('custom.nvim-cmp')
|
require('custom.nvim-cmp')
|
||||||
require('custom.toggleterm')
|
require('custom.toggleterm')
|
||||||
require('custom.autopairs')
|
require('custom.autopairs')
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
-- lsp.lua (replace your current file with this)
|
-- lsp.lua (replace your current file with this)
|
||||||
-- import cmp-nvim-lsp plugin safely
|
-- import cmp-nvim-lsp plugin safely
|
||||||
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
-- local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||||
if not cmp_nvim_lsp_status then
|
-- if not cmp_nvim_lsp_status then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local keymap = vim.keymap -- for conciseness
|
local keymap = vim.keymap -- for conciseness
|
||||||
|
|
||||||
|
|
@ -84,8 +84,7 @@ local on_attach = function(_, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- capabilities
|
-- capabilities
|
||||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
-- helper for registering server configs (lazy attach)
|
-- helper for registering server configs (lazy attach)
|
||||||
local function setup_server(name, config)
|
local function setup_server(name, config)
|
||||||
local cfg = vim.tbl_deep_extend("force", {
|
local cfg = vim.tbl_deep_extend("force", {
|
||||||
|
|
@ -129,9 +128,13 @@ root_dir = function(fname)
|
||||||
or util.path.dirname(fname)
|
or util.path.dirname(fname)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local fallback_root_dir = function(fname)
|
||||||
|
return util.root_pattern("composer.json", ".git")(fname) or util.path.dirname(fname)
|
||||||
|
end
|
||||||
|
|
||||||
setup_server("phpactor", {
|
setup_server("phpactor", {
|
||||||
filetypes = { "php" },
|
filetypes = { "php" },
|
||||||
root_dir = fallback_root_dir,
|
-- root_dir = fallback_root_dir,
|
||||||
init_options = {
|
init_options = {
|
||||||
["language_server_phpstan.enabled"] = true,
|
["language_server_phpstan.enabled"] = true,
|
||||||
["language_server_psalm.enabled"] = false,
|
["language_server_psalm.enabled"] = false,
|
||||||
|
|
@ -150,7 +153,7 @@ vim.lsp.config("lua_ls", {
|
||||||
|
|
||||||
setup_server("intelephense", {
|
setup_server("intelephense", {
|
||||||
filetypes = { "php" },
|
filetypes = { "php" },
|
||||||
root_dir = fallback_root_dir,
|
-- root_dir = fallback_root_dir,
|
||||||
init_options = {
|
init_options = {
|
||||||
licenceKey = vim.fn.readfile(vim.fn.expand("$HOME/.config/intelephense/license.txt"))[1],
|
licenceKey = vim.fn.readfile(vim.fn.expand("$HOME/.config/intelephense/license.txt"))[1],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
-- import lspsaga safely
|
|
||||||
-- local saga_status, saga = pcall(require, "lspsaga")
|
|
||||||
-- if not saga_status then
|
|
||||||
-- return
|
|
||||||
-- end
|
|
||||||
require("lazy").setup({
|
|
||||||
"glepnir/lspsaga.nvim",
|
|
||||||
event = "BufRead",
|
|
||||||
config = function()
|
|
||||||
require("lspsaga").setup({})
|
|
||||||
end,
|
|
||||||
dependencies = { { "nvim-tree/nvim-web-devicons" } },
|
|
||||||
-- keybinds for navigation in lspsaga window
|
|
||||||
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
|
|
||||||
-- use enter to open file with finder
|
|
||||||
finder_action_keys = {
|
|
||||||
open = "<CR>",
|
|
||||||
},
|
|
||||||
-- use enter to open file with definition preview
|
|
||||||
definition_action_keys = {
|
|
||||||
edit = "<CR>",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
@ -27,15 +27,23 @@ return {
|
||||||
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||||
|
|
||||||
{
|
{
|
||||||
"glepnir/lspsaga.nvim",
|
'nvimdev/lspsaga.nvim',
|
||||||
event = "BufRead",
|
|
||||||
config = function()
|
config = function()
|
||||||
require("lspsaga").setup({})
|
require('lspsaga').setup({})
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "nvim-tree/nvim-web-devicons" },
|
'nvim-treesitter/nvim-treesitter', -- optional
|
||||||
--Please make sure you install markdown and markdown_inline parser
|
'nvim-tree/nvim-web-devicons', -- optional
|
||||||
{ "nvim-treesitter/nvim-treesitter" },
|
},
|
||||||
|
|
||||||
|
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
|
||||||
|
-- use enter to open file with finder
|
||||||
|
finder_action_keys = {
|
||||||
|
open = "<CR>",
|
||||||
|
},
|
||||||
|
-- use enter to open file with definition preview
|
||||||
|
definition_action_keys = {
|
||||||
|
edit = "<CR>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue