From e35cdd8c8a0512386bfd0a503e848fd5fbbd9a33 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Tue, 26 Sep 2023 14:08:09 +0100 Subject: [PATCH] Added go and htmlcls lsps --- lua/andr3/langs/go.lua | 12 ++++++++++++ lua/andr3/langs/htmlcss.lua | 19 +++++++++++++++++++ lua/andr3/lsp.lua | 3 +++ lua/andr3/packer.lua | 1 + 4 files changed, 35 insertions(+) create mode 100644 lua/andr3/langs/go.lua create mode 100644 lua/andr3/langs/htmlcss.lua diff --git a/lua/andr3/langs/go.lua b/lua/andr3/langs/go.lua new file mode 100644 index 0000000..5287ffa --- /dev/null +++ b/lua/andr3/langs/go.lua @@ -0,0 +1,12 @@ +local O = {}; +local lspConfig = require('lspconfig') + +function O.setup(on_attach, lsp_flags, capabilities) + lspConfig['gopls'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } +end + +return O diff --git a/lua/andr3/langs/htmlcss.lua b/lua/andr3/langs/htmlcss.lua new file mode 100644 index 0000000..19dff66 --- /dev/null +++ b/lua/andr3/langs/htmlcss.lua @@ -0,0 +1,19 @@ +local O = {}; +local lspConfig = require('lspconfig') + +function O.setup(on_attach, lsp_flags, capabilities) + lspConfig['cssls'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + cmd = {"css-languageserver", "--stdio"} + } + lspConfig['html'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + cmd = {"html-languageserver", "--stdio"} + } +end + +return O diff --git a/lua/andr3/lsp.lua b/lua/andr3/lsp.lua index 8d5dbf6..b6dc066 100644 --- a/lua/andr3/lsp.lua +++ b/lua/andr3/lsp.lua @@ -124,6 +124,7 @@ keymap("n", "sf", "Lspsaga lsp_finder", { silent = true }) keymap("n", "t", "terminal", { silent = true }) keymap({"n","v"}, "ca", function () saga.code_action() end, {}) keymap("n", "gr", "Lspsaga rename", { silent = true }) +keymap("n", "", "Lspsaga rename", { silent = true }) keymap("n", "gd", "Lspsaga peek_definition", { silent = true }) keymap("n", "cd", "Lspsaga show_cursor_diagnostics", { silent = true }) keymap("n", "cr", "Lspsaga rename", { silent = true }) @@ -270,4 +271,6 @@ require 'andr3.langs.bash'.setup(on_attach, lsp_flags, capabilities) require 'andr3.langs.zig'.setup(on_attach, lsp_flags, capabilities) require 'andr3.langs.tex'.setup(on_attach, lsp_flags, capabilities) require 'andr3.langs.ocaml'.setup(on_attach, lsp_flags, capabilities) +require 'andr3.langs.go'.setup(on_attach, lsp_flags, capabilities) +require 'andr3.langs.htmlcss'.setup(on_attach, lsp_flags, capabilities) diff --git a/lua/andr3/packer.lua b/lua/andr3/packer.lua index b020b12..3f27b12 100644 --- a/lua/andr3/packer.lua +++ b/lua/andr3/packer.lua @@ -13,6 +13,7 @@ return require('packer').startup(function() use { "catppuccin/nvim", as = "catppuccin" } use {'nyoom-engineering/oxocarbon.nvim'} use 'NLKNguyen/papercolor-theme' + -- use 'baskerville/bubblegum' use 'git@git.andr3h3nriqu3s.com:andr3/bubblegum-theme.git' use 'xiyaowong/transparent.nvim'