diff options
| author | kkard2 <[email protected]> | 2023-12-02 12:45:06 +0100 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2023-12-02 12:45:06 +0100 |
| commit | 1e094abc6c4c6866b0abad198b1785d2da3d327c (patch) | |
| tree | b448c85510b88da34cfe06469f5a976fbed889ae /nvim/lua/kkard2/lazy/lsp.lua | |
| parent | bd2a637b4593d8a64010a0438ce1c9b57a9436a5 (diff) | |
i couldn't help it
Diffstat (limited to 'nvim/lua/kkard2/lazy/lsp.lua')
| -rw-r--r-- | nvim/lua/kkard2/lazy/lsp.lua | 72 |
1 files changed, 0 insertions, 72 deletions
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", "<leader>lr", vim.lsp.buf.rename) - vim.keymap.set("n", "<leader><CR>", vim.lsp.buf.code_action) - vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format) - - - - -- temp - require("lspconfig").tsserver.setup({ - commands = { - RenameFile = { - rename_file, - description = "Rename File" - }, - } - }) - -- end temp -end |
