diff --git a/after/ftplugin/typescript.lua b/after/ftplugin/typescript.lua index 32e9eb2..bc3858d 100644 --- a/after/ftplugin/typescript.lua +++ b/after/ftplugin/typescript.lua @@ -1,18 +1,8 @@ vim.o.textwidth = 120 -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", "o", function() + vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } }) +end, { desc = "Organize imports" }) vim.keymap.set("n", "s", function() require("nvim-quick-switcher").toggle("tsx", "scss") end, { buffer = true }) diff --git a/init.lua b/init.lua index 538d96f..1817189 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,3 @@ -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() @@ -93,6 +91,7 @@ vim.opt.suffixes = { } vim.opt.completeopt = "menu,menuone,noselect" +vim.opt.mouse = "" vim.opt.shortmess = vim.o.shortmess .. "c" vim.opt.cursorline = true @@ -152,7 +151,3 @@ 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") diff --git a/lua/plugins/tree.lua b/lua/plugins/tree.lua deleted file mode 100644 index 5d7ae95..0000000 --- a/lua/plugins/tree.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = true -}