mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 20:02:58 +01:00
parent
5a4cd4abef
commit
568a4cbd86
3 changed files with 12 additions and 49 deletions
|
@ -1,25 +1,4 @@
|
|||
local lline = require "lualine"
|
||||
local navic = require "nvim-navic"
|
||||
|
||||
local function navic_component()
|
||||
if navic.is_available() then
|
||||
local data = navic.get_data()
|
||||
local s = ""
|
||||
|
||||
for i, v in ipairs(data) do
|
||||
if v.type ~= "Package" then
|
||||
if i ~= 1 then
|
||||
s = s .. " "
|
||||
end
|
||||
|
||||
s = s .. v.icon .. v.name
|
||||
end
|
||||
end
|
||||
|
||||
return s
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
lline.setup {
|
||||
options = {
|
||||
|
@ -28,6 +7,5 @@ lline.setup {
|
|||
sections = {
|
||||
lualine_b = { "branch", "diff", "lsp_progress" },
|
||||
lualine_c = { "filename", "diagnostics" },
|
||||
lualine_x = { "fileformat", "filetype", navic_component },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,29 +1,22 @@
|
|||
local map = vim.api.nvim_set_keymap
|
||||
local lspc = require "lspconfig"
|
||||
local navic = require "nvim-navic"
|
||||
|
||||
local caps = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
end
|
||||
|
||||
local lua_runtime_path = vim.split(package.path, ";")
|
||||
table.insert(lua_runtime_path, "lua/?.lua")
|
||||
table.insert(lua_runtime_path, "lua/?/init.lua")
|
||||
|
||||
lspc.clangd.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.cssls.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.eslint.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.haxe_language_server.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.html.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.jsonls.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.ocamllsp.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.prosemd_lsp.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.clangd.setup { capabilities = caps }
|
||||
lspc.cssls.setup { capabilities = caps }
|
||||
lspc.eslint.setup { capabilities = caps }
|
||||
lspc.haxe_language_server.setup { capabilities = caps }
|
||||
lspc.html.setup { capabilities = caps }
|
||||
lspc.jsonls.setup { capabilities = caps }
|
||||
lspc.ocamllsp.setup { capabilities = caps }
|
||||
lspc.prosemd_lsp.setup { capabilities = caps }
|
||||
lspc.rust_analyzer.setup {
|
||||
capabilities = caps,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
|
@ -34,7 +27,6 @@ lspc.rust_analyzer.setup {
|
|||
}
|
||||
lspc.sumneko_lua.setup {
|
||||
capabilities = caps,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
|
@ -53,14 +45,13 @@ lspc.sumneko_lua.setup {
|
|||
},
|
||||
},
|
||||
}
|
||||
lspc.taplo.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.yamlls.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.zls.setup { capabilities = caps, on_attach = on_attach }
|
||||
lspc.taplo.setup { capabilities = caps }
|
||||
lspc.yamlls.setup { capabilities = caps }
|
||||
lspc.zls.setup { capabilities = caps }
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
|
|
|
@ -149,11 +149,6 @@ return require("packer").startup(function(use)
|
|||
|
||||
use "DingDean/wgsl.vim"
|
||||
|
||||
use {
|
||||
"SmiteshP/nvim-navic",
|
||||
requires = "neovim/nvim-lspconfig",
|
||||
}
|
||||
|
||||
use {
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
|
@ -174,6 +169,5 @@ return require("packer").startup(function(use)
|
|||
require("treesitter-context").setup {}
|
||||
end
|
||||
}
|
||||
|
||||
cmp_plugins(use)
|
||||
end)
|
||||
|
|
Loading…
Reference in a new issue