diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 358ca3a..56b9858 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -6,6 +6,9 @@ set-option -sg escape-time 10 set -g destroy-unattached +# should fix cursor shapes in ssh +set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' + # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a diff --git a/configs/nvim/lua/configs/lsp.lua b/configs/nvim/lua/configs/lsp.lua index a274a9c..5d49fb0 100644 --- a/configs/nvim/lua/configs/lsp.lua +++ b/configs/nvim/lua/configs/lsp.lua @@ -11,11 +11,29 @@ table.insert(runtime_path, "lua/?/init.lua") local function on_attach(client, bufnr) local cap = client.server_capabilities + + vim.notify(client.name) + if (cap.documentFormattingProvider) then vim.api.nvim_create_autocmd("BufWritePre", { buffer = bufnr, callback = function() vim.lsp.buf.format(); + + if client.name == 'tsserver' or client.name == "svelte" then + -- params for the request + local params = { + command = "_typescript.organizeImports", + arguments = { vim.api.nvim_buf_get_name(bufnr) }, + title = "" + } + + -- perform a syncronous request + -- 500ms timeout depending on the size of file a bigger timeout may be needed + vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500) + + end + end }) else diff --git a/configs/nvim/lua/core/options.lua b/configs/nvim/lua/core/options.lua index b3497df..b339883 100644 --- a/configs/nvim/lua/core/options.lua +++ b/configs/nvim/lua/core/options.lua @@ -25,7 +25,6 @@ vim.cmd [[set nocompatible]] -- Disable compatibility to old-time vi set.mouse = 'a' -- Enable mouse support set.foldmethod = "expr" set.foldexpr = "nvim_treesitter#foldexpr()" -- use treesitter for folding -vim.wo.foldcolumn = '1' vim.wo.foldlevel = 99 -- feel free to decrease the value vim.wo.foldenable = true