From c43196a300c77491ded16111edbaa4386b8a3ae7 Mon Sep 17 00:00:00 2001 From: Alexander Roso Date: Mon, 9 Feb 2026 09:07:19 +0100 Subject: [PATCH 1/3] create "organize imports" mapping for TS on lsp attach --- after/ftplugin/typescript.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua index bc3858d..32e9eb2 100644 --- a/after/ftplugin/typescript.lua +++ b/after/ftplugin/typescript.lua @@ -1,8 +1,18 @@ vim.o.textwidth = 120 -vim.keymap.set("n", "o", function() - vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) -end, { desc = "Organize imports" }) +local function on_ts_ls_attach(ev) + vim.keymap.set("n", "o", function() + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if not client then return end + return client:exec_cmd({ + title = "Organize imports", + command = "_typescript.organizeImports", + arguments = { vim.api.nvim_buf_get_name(ev.buf) } + }, { bufnr = ev.buf }) + end, { noremap = true, silent = true, buffer = ev.buf }) +end +vim.api.nvim_create_autocmd("LspAttach", { callback = on_ts_ls_attach }) + vim.keymap.set("n", "s", function() require("nvim-quick-switcher").toggle("tsx", "scss") end, { buffer = true }) From d3a56f651319a2ff0f0f5a38240eaae9ad7aed39 Mon Sep 17 00:00:00 2001 From: Alexander Roso Date: Mon, 9 Feb 2026 09:08:13 +0100 Subject: [PATCH 2/3] Add nvim-tree --- init.lua | 2 ++ lua/plugins/tree.lua | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 lua/plugins/tree.lua diff --git a/init.lua b/init.lua index 1817189..c4db6e5 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,5 @@ +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 local should_profile = os.getenv("NVIM_PROFILE") if should_profile then require("profile").instrument_autocmds() diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua new file mode 100644 index 0000000..5d7ae95 --- /dev/null +++ b/lua/plugins/tree.lua @@ -0,0 +1,5 @@ +return { + "nvim-tree/nvim-tree.lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = true +} From 30ef275312eefbf67a2cae750c2fb5f37545d687 Mon Sep 17 00:00:00 2001 From: Alexander Roso Date: Mon, 9 Feb 2026 09:10:45 +0100 Subject: [PATCH 3/3] enable mouse and map visual selection to clipboard --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c4db6e5..538d96f 100644 --- a/init.lua +++ b/init.lua @@ -93,7 +93,6 @@ vim.opt.suffixes = { } vim.opt.completeopt = "menu,menuone,noselect" -vim.opt.mouse = "" vim.opt.shortmess = vim.o.shortmess .. "c" vim.opt.cursorline = true @@ -153,3 +152,7 @@ key("v", "gs", "'<,'>sort", { desc = "sort selection" }) key("n", "", "bnext", { desc = "next buffer" }) key("n", "", "bprevious", { desc = "previous buffer" }) + +key("v", "", "\"*ygv") +key("v", "<2-LeftRelease>", "\"*ygv") +key("v", "<3-LeftRelease>", "\"*ygv")