Fix Clojure Lsp Mappings syntax

This commit is contained in:
Proctor
2021-08-23 14:46:32 -05:00
parent 190bdab715
commit 0ccd0bf6f7

View File

@@ -29,12 +29,6 @@
(define-sign :Hint "🔎") (define-sign :Hint "🔎")
(define-sign :Information "") (define-sign :Information "")
; -- function LspExecuteCommand(cmd, ...)
; -- arguments = {vim.uri_from_bufnr(0), vim.api.nvim_win_get_cursor(0)[1] - 1, vim.api.nvim_win_get_cursor(0)[2] -1}
; -- for _,a in pairs({...}) do table.insert(arguments, a) end
; -- vim.lsp.buf.execute_command({command = cmd, arguments = arguments})
; -- end
(defn lsp-execute-command [cmd ...] (defn lsp-execute-command [cmd ...]
(let [buf-uri (vim.uri_from_bufnr 0) (let [buf-uri (vim.uri_from_bufnr 0)
cursor (vim.api.nvim_win_get_cursor 0) cursor (vim.api.nvim_win_get_cursor 0)
@@ -70,11 +64,11 @@
(def client-nmappings (def client-nmappings
{:clojure {:clojure
{ {
:<leader>cn "lua LspExecuteCommand('clean-ns)'" :<leader>cn "lua LspExecuteCommand('clean-ns')"
:<leader>ref "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\"))'" :<leader>ref "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')"
:<leader>id "lua LspExecuteCommand('clean-ns)'" :<leader>id "lua LspExecuteCommand('inline-symbol')"
:<leader>il "lua LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\"))'" :<leader>il "lua LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
:<leader>m2l "lua LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\"))'" :<leader>m2l "lua LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
} }
}) })
@@ -132,12 +126,6 @@
; -- local nvim_lsp = require('lspconfig') ; -- local nvim_lsp = require('lspconfig')
; -- ; --
; -- function LspExecuteCommand(cmd, ...)
; -- arguments = {vim.uri_from_bufnr(0), vim.api.nvim_win_get_cursor(0)[1] - 1, vim.api.nvim_win_get_cursor(0)[2] -1}
; -- for _,a in pairs({...}) do table.insert(arguments, a) end
; -- vim.lsp.buf.execute_command({command = cmd, arguments = arguments})
; -- end
; --
; -- -- Use an on_attach function to only map the following keys ; -- -- Use an on_attach function to only map the following keys
; -- -- after the language server attaches to the current buffer ; -- -- after the language server attaches to the current buffer
; -- local on_attach = function(client, bufnr) ; -- local on_attach = function(client, bufnr)