From 50b968ed9d8aac55cb26de6b52299fd8ae351fd0 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Tue, 2 Jan 2024 00:38:36 +0100 Subject: [PATCH] feat(lsp-config.lua): add configuration for dockerls, jsonls, volar, rust_analyzer, cssls, htmx, docker_compose_language_service, and eslint servers to enhance language support in the editor fix(remap.lua): add key mappings for moving selected lines or blocks of text up and down in visual mode, moving half page up and down, and adjusting cursor position after using 'n' and 'N' commands --- lua/absolute/after/lsp-config.lua | 52 +++++++++++++++++++++++++++++++ lua/absolute/remap.lua | 11 +++++++ 2 files changed, 63 insertions(+) diff --git a/lua/absolute/after/lsp-config.lua b/lua/absolute/after/lsp-config.lua index 5cca81f..6a3c5e3 100644 --- a/lua/absolute/after/lsp-config.lua +++ b/lua/absolute/after/lsp-config.lua @@ -117,6 +117,27 @@ lspconfig["pyright"].setup({ on_attach = on_attach, }) +-- configure docker server +lspconfig["dockerls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure json server +lspconfig["jsonls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + + +-- configure vue server +lspconfig["volar"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "vue" }, +}) + +-- configure rust server lspconfig.rust_analyzer.setup({ -- Server-specific settings. See `:help lspconfig-setup` on_attach = on_attach, @@ -148,3 +169,34 @@ lspconfig["lua_ls"].setup({ }, }, }) + + +-- configure css server +lspconfig["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure htmx server +lspconfig["htmx"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +--configure docker file server +lspconfig["dockerls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure docker compose server +lspconfig["docker_compose_language_service"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure eslint server +lspconfig["eslint"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) diff --git a/lua/absolute/remap.lua b/lua/absolute/remap.lua index e85dd68..7026717 100644 --- a/lua/absolute/remap.lua +++ b/lua/absolute/remap.lua @@ -2,12 +2,23 @@ vim.g.mapleader = " " vim.keymap.set("n", "\\", "NvimTreeToggle") -- toggle file explorer + +-- Move selected line / block of text in visual mode up vim.keymap.set("v", "J", ":m '>+1gv=gv") + +-- Move selected line / block of text in visual mode down vim.keymap.set("v", "K", ":m '<-2gv=gv") + vim.keymap.set("n", "J", "mzJ`z") + +-- Move half page down vim.keymap.set("n", "", "zz") + +-- Move half page up vim.keymap.set("n", "", "zz") + + vim.keymap.set("n", "n", "nzzzv") vim.keymap.set("n", "N", "Nzzzv")