From 480d1536f5492cb101d2e220dea73fc42f20a26a Mon Sep 17 00:00:00 2001 From: "Gustavo Silva (es00679121_prosegur)" Date: Wed, 12 Jul 2023 22:53:47 +0200 Subject: [PATCH] Add new keymaps and plugins --- lua/custom/configs/settings.lua | 14 +-- lua/custom/plugins/debug.lua | 72 ++-------------- lua/custom/plugins/go.lua | 4 - lua/custom/plugins/null_ls.lua | 4 +- lua/custom/plugins/rest.lua | 146 ++++++++++---------------------- spell/en.utf-8.add | 26 ++++++ spell/en.utf-8.add.spl | Bin 1783 -> 2226 bytes 7 files changed, 81 insertions(+), 185 deletions(-) diff --git a/lua/custom/configs/settings.lua b/lua/custom/configs/settings.lua index fd0d34e9..c7393d9a 100644 --- a/lua/custom/configs/settings.lua +++ b/lua/custom/configs/settings.lua @@ -36,7 +36,7 @@ o.swapfile = false -- Scrolling settings o.scrolloff = 8 -o.colorcolumn = '120' +o.colorcolumn = '80' o.timeoutlen = 500 @@ -49,13 +49,5 @@ global.mkdp_browser = '/usr/bin/firefox' -- Fold --o.foldmethod = 'syntax' --- o.foldmethod = 'expr' --- o.foldexpr = 'nvim_treesitter#foldexpr()' --- o.foldlevel = 1 --- o.foldnestmax = 1 --- o.nofoldenable = false -opt.foldmethod = 'indent' -opt.foldenable = false -opt.foldlevel = 99 -global.markdown_folding = 1 - +o.foldmethod = 'expr' +o.foldexpr = 'nvim_treesitter#foldexpr()' diff --git a/lua/custom/plugins/debug.lua b/lua/custom/plugins/debug.lua index 1abd8f53..6cdbdecd 100644 --- a/lua/custom/plugins/debug.lua +++ b/lua/custom/plugins/debug.lua @@ -33,40 +33,10 @@ return { local dap_go = require 'dap-go' -- Install golang specific config - dap_go.setup { - -- Additional dap configurations can be added. - -- dap_configurations accepts a list of tables where each entry - -- represents a dap configuration. For more details do: - -- :help dap-configuration - dap_configurations = { - { - -- Must be "go" or it will be ignored by the plugin - type = "go", - name = "Attach remote", - mode = "remote", - request = "attach", - }, - }, - -- delve configurations - delve = { - -- the path to the executable dlv which will be used for debugging. - -- by default, this is the "dlv" executable on your PATH. - path = "dlv", - -- time to wait for delve to initialize the debug session. - -- default to 20 seconds - initialize_timeout_sec = 20, - -- a string that defines the port to start delve debugger. - -- default to string "${port}" which instructs nvim-dap - -- to start the process in a random available port - port = "2345", - -- additional args to pass to dlv - args = {} - }, - } + dap_go.setup() -- Dap UI setup -- For more information, see |:help nvim-dap-ui| - -- dapui.setup() dapui.setup { -- Set icons to characters that are more likely to work in every terminal. -- Feel free to remove or use ones that you like more! :) @@ -85,37 +55,9 @@ return { disconnect = "⏏", }, }, - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", - "watches", - }, - size = 40, -- 40 columns - position = "left", - }, - { - elements = { - "repl", - -- "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, } - -- require('nvim-dap-virtual-text').setup() + require('nvim-dap-virtual-text').setup() require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations @@ -148,12 +90,10 @@ return { end, { desc = 'dap breakpoint condition' }) -- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception. - vim.keymap.set("n", "tt", dapui.toggle) - vim.keymap.set('n', 'tr', function() - dapui.open({ reset = true }) - end, { desc = 'dap reset ui' }) + vim.keymap.set("n", "", dapui.toggle) dap.listeners.after.event_initialized['dapui_config'] = dapui.open - -- dap.listeners.before.event_terminated['dapui_config'] = dapui.close - -- dap.listeners.before.event_exited['dapui_config'] = dapui.close + dap.listeners.before.event_terminated['dapui_config'] = dapui.close + dap.listeners.before.event_exited['dapui_config'] = dapui.close + end, } diff --git a/lua/custom/plugins/go.lua b/lua/custom/plugins/go.lua index fd7dffe7..fc75c8dd 100644 --- a/lua/custom/plugins/go.lua +++ b/lua/custom/plugins/go.lua @@ -10,10 +10,6 @@ return { }, config = function() require("go").setup() - - local gofmt = require("go.format") - - vim.keymap.set('n', 'gF', gofmt.goimport, { desc = 'Go Import' }) end, event = { "CmdlineEnter" }, ft = { "go", 'gomod' }, diff --git a/lua/custom/plugins/null_ls.lua b/lua/custom/plugins/null_ls.lua index 815251e6..356bd399 100644 --- a/lua/custom/plugins/null_ls.lua +++ b/lua/custom/plugins/null_ls.lua @@ -7,8 +7,8 @@ return { null_ls.setup { sources = { - -- null_ls.builtins.formatting.goimports_reviser, - null_ls.builtins.formatting.gofumpt, + null_ls.builtins.formatting.goimports_reviser, + -- null_ls.builtins.formatting.gofumpt, -- null_ls.builtins.formatting.golines, }, on_attach = function(client, bufnr) diff --git a/lua/custom/plugins/rest.lua b/lua/custom/plugins/rest.lua index fd2debf9..75e1e253 100644 --- a/lua/custom/plugins/rest.lua +++ b/lua/custom/plugins/rest.lua @@ -1,106 +1,48 @@ return { - "rest-nvim/rest.nvim", - -- enabled = false, - dependencies = { "nvim-lua/plenary.nvim" }, - ft = "http", - config = function() - local rest_nvim = require "rest-nvim" + "rest-nvim/rest.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local rest_client = require("rest-nvim") - rest_nvim.setup { - -- Open request results in a horizontal split - result_split_horizontal = false, - -- Skip SSL verification, useful for unknown certificates - skip_ssl_verification = true, - encode_url = false, - -- Highlight request on run - highlight = { - enabled = true, - timeout = 150, - }, - result = { - -- toggle showing URL, HTTP info, headers at top the of result window - show_url = true, - show_http_info = true, - show_headers = true, - }, - -- Jump to request line on run - jump_to_request = false, - env_file = ".env", - custom_dynamic_variables = {}, - yank_dry_run = true, - } + rest_client.setup { + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Encode URL before making request + encode_url = true, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + -- show the generated curl command in case you want to launch + -- the same request via the terminal (can be verbose) + show_curl_command = false, + show_http_info = true, + show_headers = true, + -- executables or functions for formatting response body [optional] + -- set them to false if you want to disable them + formatters = { + json = "jq", + html = function(body) + return vim.fn.system({ "tidy", "-i", "-q", "-" }, body) + end + }, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = '.env', + custom_dynamic_variables = {}, + yank_dry_run = true, + } - vim.api.nvim_create_autocmd("FileType", { - pattern = "http", - callback = function() - local buff = tonumber(vim.fn.expand "", 10) - vim.keymap.set( - "n", - "rc", - rest_nvim.run, - { noremap = true, buffer = buff, desc = "Run near http request" } - ) - vim.keymap.set( - "n", - "rl", - rest_nvim.last, - { noremap = true, buffer = buff, desc = "Run last http resquest" } - ) - vim.keymap.set("n", "rp", function() - rest_nvim.run(true) - end, { noremap = true, buffer = buff, desc = "Preview http curl" }) - end, - }) - end, + vim.keymap.set('n', 'rc', rest_client.run, { desc = '[R]un rest [Client]' }) + vim.keymap.set('n', 'rl', rest_client.last, { desc = '[R]un rest [Last] request' }) + end } --- return { --- 'BlackLight/nvim-http' --- } --- return { --- "rest-nvim/rest.nvim", --- dependencies = { "nvim-lua/plenary.nvim" }, --- config = function() --- local rest_client = require("rest-nvim") --- --- rest_client.setup { --- -- Open request results in a horizontal split --- result_split_horizontal = false, --- -- Keep the http file buffer above|left when split horizontal|vertical --- result_split_in_place = false, --- -- Skip SSL verification, useful for unknown certificates --- skip_ssl_verification = false, --- -- Encode URL before making request --- encode_url = true, --- -- Highlight request on run --- highlight = { --- enabled = true, --- timeout = 150, --- }, --- result = { --- -- toggle showing URL, HTTP info, headers at top the of result window --- show_url = true, --- -- show the generated curl command in case you want to launch --- -- the same request via the terminal (can be verbose) --- show_curl_command = false, --- show_http_info = true, --- show_headers = true, --- -- executables or functions for formatting response body [optional] --- -- set them to false if you want to disable them --- formatters = { --- json = "jq", --- html = function(body) --- return vim.fn.system({ "tidy", "-i", "-q", "-" }, body) --- end --- }, --- }, --- -- Jump to request line on run --- jump_to_request = false, --- env_file = '.env', --- custom_dynamic_variables = {}, --- yank_dry_run = true, --- } --- --- vim.keymap.set('n', 'rc', rest_client.run, { desc = '[R]un rest [Client]' }) --- vim.keymap.set('n', 'rl', rest_client.last, { desc = '[R]un rest [Last] request' }) --- end --- } diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 35a99995..38f500c8 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -124,3 +124,29 @@ AccountNumber UCode ParentUUID ContentData +api +v2 +serviceOrders +CRM +PT2300000321 +ucode +ucodes +uCode +systemCode +apiVersion +serviceOrder +serviceOrderData +ServiceOrder +UUID +PT0200008165 +f2d7bf7 +b191 +a2a +a05f +de09d4ea0e +ca5ded76a9d +d34 +a893 +b1177a +dataItem +CountryCode diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 41f733138436289302484bf14ac695586cbd1223..16749ba2e2fba1d49d29257a378ffd73d8b8cccc 100644 GIT binary patch literal 2226 zcmZ`)J#QRk5Z;+Ri%`(GprOnvF1EQlJH&3l_8G~Rv-Tl7DG&ww@t$vU`^A3Q=K@*o zs8fSP6}d=30}UlV0J%cqC!|S73D3-~F_GX-dUxM>=i`}Y=AC_h;8lf5lJQ@bHJE?s z2VrDpXY=^QB1yBnD66_@mk);H&2Uka4LznASwxoQ__U?ZbqXn`hBB&oo{=G+BCI9x z6{M-?d>T+iJfN7ZR*x!*VS|%NMrUddYn)^%tMQ)0B8001nxezJGV&$tS=I1pi=K$) zBVC;lhY2mzJYq|fDp+Q)H=^Z~T`VVq&m{%@?&5(TcPSz%K^(#9$1v>Dim->VSLzy5 zWb?rP8a^TXqDE#Cp$58IB$FkJax6<~Ct1@4xoLPNIuJW&3b5t~o2@y_JHyUR31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