From 24108cae78bbacc18a0d1d9ca69d4907858f4a6f Mon Sep 17 00:00:00 2001 From: shadow cat Date: Sun, 15 Dec 2024 12:05:09 -0500 Subject: [PATCH] terminal & stuff --- lua/config/mappings.lua | 7 +++++-- lua/plugins/lspconfig.lua | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index aa966b9..dcfd548 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -22,7 +22,7 @@ m.nmap("tm", m.fcmds({ "setlocal scl=no", })) local prev_buf = "" -m.nmap("tn", function() +m.nmap("i", function() if(vim.fn.bufname("terminal") == "") then prev_buf = vim.fn.getreg("#") vim.cmd("term") @@ -33,10 +33,13 @@ m.nmap("tn", function() else if(vim.fn.bufname() == "terminal") then vim.cmd("b #") - vim.fn.setreg("#", prev_buf) + if (string.len(prev_buf) ~= 0) then + vim.fn.setreg("#", prev_buf) + end else prev_buf = vim.fn.getreg("#") vim.cmd("b terminal") + vim.fn.feedkeys("A") end end end) diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index e6e8d44..1e3e980 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -24,14 +24,11 @@ local config = function() c.denols.setup { root_dir = c.util.root_pattern("deno.json", "deno.jsonc"), } - c.tsserver.setup { + c.ts_ls.setup { root_dir = c.util.root_pattern("package.json", "tsconfig.json", "jsconfig.json"), single_file_support = false, } c.csharp_ls.setup {} - c.typst_lsp.setup { - cmd = { "/home/bryan/repos/typst-lsp/target/release/typst-lsp" }, - } c.angularls.setup {} c.clangd.setup {} @@ -52,6 +49,9 @@ local config = function() c.hls.setup {} c.slint_lsp.setup {} + require('mason').setup() + require('mason-lspconfig').setup() + require 'config.lsp-settings' end