From 1e094abc6c4c6866b0abad198b1785d2da3d327c Mon Sep 17 00:00:00 2001 From: kkard2 Date: Sat, 2 Dec 2023 12:45:06 +0100 Subject: i couldn't help it --- nvim/lua/kkard2/lazy/lsp.lua | 72 -------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 nvim/lua/kkard2/lazy/lsp.lua (limited to 'nvim/lua/kkard2/lazy/lsp.lua') diff --git a/nvim/lua/kkard2/lazy/lsp.lua b/nvim/lua/kkard2/lazy/lsp.lua deleted file mode 100644 index a4d24ad..0000000 --- a/nvim/lua/kkard2/lazy/lsp.lua +++ /dev/null @@ -1,72 +0,0 @@ --- WARNING: BAD CODE AHEAD --- look at your own risk -local function rename_file() - local source_file, target_file - - vim.ui.input({ - prompt = "Source : ", - completion = "file", - default = vim.api.nvim_buf_get_name(0) - }, - function(input) - source_file = input - end - ) - vim.ui.input({ - prompt = "Target : ", - completion = "file", - default = source_file - }, - function(input) - target_file = input - end - ) - - local params = { - command = "_typescript.applyRenameFile", - arguments = { - { - sourceUri = source_file, - targetUri = target_file, - }, - }, - title = "" - } - - vim.lsp.util.rename(source_file, target_file) - vim.lsp.buf.execute_command(params) -end --- END OF WARNING - -return function() - local lsp = require("lsp-zero").preset({}) - - lsp.on_attach(function(_, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp.default_keymaps({ buffer = bufnr }) - end) - - -- (Optional) Configure lua language server for neovim - require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) - - lsp.setup() - - vim.keymap.set("n", "gh", vim.diagnostic.open_float) - vim.keymap.set("n", "lr", vim.lsp.buf.rename) - vim.keymap.set("n", "", vim.lsp.buf.code_action) - vim.keymap.set("n", "lf", vim.lsp.buf.format) - - - - -- temp - require("lspconfig").tsserver.setup({ - commands = { - RenameFile = { - rename_file, - description = "Rename File" - }, - } - }) - -- end temp -end -- cgit v1.3.1