From f8e343a6201462926ad3d853054e3b4e9fcd878d Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Thu, 14 Sep 2023 20:38:52 +0100 Subject: [PATCH 1/2] added a lot of stuff --- after/plugin/colors.lua | 5 +++-- lua/andr3/langs/.gitignore | 1 + lua/andr3/langs/ltex-key-bak | 3 +++ lua/andr3/langs/ocaml.lua | 12 +++++++++++ lua/andr3/langs/tex.lua | 40 ++++++++++++++++++++++++++++++++++++ lua/andr3/lsp.lua | 5 +++++ lua/andr3/packer.lua | 4 +--- 7 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 lua/andr3/langs/.gitignore create mode 100644 lua/andr3/langs/ltex-key-bak create mode 100644 lua/andr3/langs/ocaml.lua diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index 5a60ceb..24b0928 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -53,7 +53,7 @@ require("nvim-tree").setup{ -- BEGIN_DEFAULT_OPTS centralize_selection = false, width = 30, hide_root_folder = false, - side = "left", + side = "right", preserve_window_proportions = false, number = false, relativenumber = false, @@ -153,7 +153,7 @@ require("nvim-tree").setup{ -- BEGIN_DEFAULT_OPTS enable = true, show_on_dirs = false, debounce_delay = 50, - icons = { error = "â˜Ŗī¸ ", warning = "😞", hint = "❤ī¸ ", info = "ℹī¸ " } + icons = { error = "â˜Ŗī¸ ", warning = "😞", hint = "❤ī¸ ", info = "🆓" } , }, filters = { @@ -283,4 +283,5 @@ for key, value in pairs(hls) do vim.api.nvim_set_hl(0, key, value) end +require("transparent").setup() diff --git a/lua/andr3/langs/.gitignore b/lua/andr3/langs/.gitignore new file mode 100644 index 0000000..56179cd --- /dev/null +++ b/lua/andr3/langs/.gitignore @@ -0,0 +1 @@ +ltex-key diff --git a/lua/andr3/langs/ltex-key-bak b/lua/andr3/langs/ltex-key-bak new file mode 100644 index 0000000..9fec824 --- /dev/null +++ b/lua/andr3/langs/ltex-key-bak @@ -0,0 +1,3 @@ +http://api.languagetoolplus.com/ +andr3h3nriqu3s@gmail.com +pit-Z31pae3YaG1c diff --git a/lua/andr3/langs/ocaml.lua b/lua/andr3/langs/ocaml.lua new file mode 100644 index 0000000..2e53acd --- /dev/null +++ b/lua/andr3/langs/ocaml.lua @@ -0,0 +1,12 @@ +local O = {}; +local lspConfig = require('lspconfig') + +function O.setup(on_attach, lsp_flags, capabilities) + lspConfig['ocamllsp'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } +end + +return O diff --git a/lua/andr3/langs/tex.lua b/lua/andr3/langs/tex.lua index f1faa76..3d1144e 100644 --- a/lua/andr3/langs/tex.lua +++ b/lua/andr3/langs/tex.lua @@ -2,10 +2,50 @@ local O = {}; local lspConfig = require('lspconfig') function O.setup(on_attach, lsp_flags, capabilities) + local path = debug.getinfo(1).source + local acpath = path:sub(2, #path - 7).."ltex-key" + + local f = io.open(acpath, "r") + + if f == nil then + lspConfig['ltex'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } + return + end + + io.input(f) + local url = io.read("*line") + local user = io.read("*line") + local key = io.read("*line") + io.close(f) + + if user == nil or key == nil or url == nil then + lspConfig['ltex'].setup{ + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, + } + return + end + lspConfig['ltex'].setup{ on_attach = on_attach, flags = lsp_flags, capabilities = capabilities, + settings = { + ltex = { + language = "en-GB", + languageToolHttpServerUri = url, + languageToolOrg = { + username = user, + apiKey = file + }, + + }, + }, } end diff --git a/lua/andr3/lsp.lua b/lua/andr3/lsp.lua index d0bb206..8d5dbf6 100644 --- a/lua/andr3/lsp.lua +++ b/lua/andr3/lsp.lua @@ -64,6 +64,7 @@ saga.setup{ enable_in_insert = true, cache_code_action = true, sign = true, + icon = signs.CodeAction, update_time = 150, sign_priority = 20, virtual_text = true, @@ -114,6 +115,9 @@ saga.setup{ }, custom_kind = {}, server_filetype_map = {}, + ui = { + code_action = signs.CodeAction, + } } keymap("n", "sf", "Lspsaga lsp_finder", { silent = true }) @@ -265,4 +269,5 @@ require 'andr3.langs.python'.setup(on_attach, lsp_flags, capabilities) 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) diff --git a/lua/andr3/packer.lua b/lua/andr3/packer.lua index e6c498a..b020b12 100644 --- a/lua/andr3/packer.lua +++ b/lua/andr3/packer.lua @@ -15,6 +15,7 @@ return require('packer').startup(function() use 'NLKNguyen/papercolor-theme' -- use 'baskerville/bubblegum' use 'git@git.andr3h3nriqu3s.com:andr3/bubblegum-theme.git' + use 'xiyaowong/transparent.nvim' -- other stuff @@ -55,9 +56,6 @@ return require('packer').startup(function() -- If you want to have icons in your statusline choose one of these use 'nvim-tree/nvim-web-devicons' - --use 'vim-airline/vim-airline' - --use 'vim-airline/vim-airline-themes' - use 'airblade/vim-gitgutter' use 'mbbill/undotree' From e35cdd8c8a0512386bfd0a503e848fd5fbbd9a33 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Tue, 26 Sep 2023 14:08:09 +0100 Subject: [PATCH 2/2] 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'