Add new keymaps and plugins

This commit is contained in:
Gustavo Silva (es00679121_prosegur) 2023-07-12 22:53:47 +02:00
parent 36f8d7f240
commit 480d1536f5
7 changed files with 81 additions and 185 deletions

View File

@ -36,7 +36,7 @@ o.swapfile = false
-- Scrolling settings -- Scrolling settings
o.scrolloff = 8 o.scrolloff = 8
o.colorcolumn = '120' o.colorcolumn = '80'
o.timeoutlen = 500 o.timeoutlen = 500
@ -49,13 +49,5 @@ global.mkdp_browser = '/usr/bin/firefox'
-- Fold -- Fold
--o.foldmethod = 'syntax' --o.foldmethod = 'syntax'
-- o.foldmethod = 'expr' o.foldmethod = 'expr'
-- o.foldexpr = 'nvim_treesitter#foldexpr()' 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

View File

@ -33,40 +33,10 @@ return {
local dap_go = require 'dap-go' local dap_go = require 'dap-go'
-- Install golang specific config -- Install golang specific config
dap_go.setup { 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 UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
-- dapui.setup()
dapui.setup { dapui.setup {
-- Set icons to characters that are more likely to work in every terminal. -- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :) -- Feel free to remove or use ones that you like more! :)
@ -85,37 +55,9 @@ return {
disconnect = "", 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 { require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with -- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations -- reasonable debug configurations
@ -148,12 +90,10 @@ return {
end, { desc = 'dap breakpoint condition' }) end, { desc = 'dap breakpoint condition' })
-- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception. -- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception.
vim.keymap.set("n", "<leader>tt", dapui.toggle) vim.keymap.set("n", "<F7>", dapui.toggle)
vim.keymap.set('n', '<leader>tr', function()
dapui.open({ reset = true })
end, { desc = 'dap reset ui' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
-- dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
-- dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close
end, end,
} }

View File

@ -10,10 +10,6 @@ return {
}, },
config = function() config = function()
require("go").setup() require("go").setup()
local gofmt = require("go.format")
vim.keymap.set('n', 'gF', gofmt.goimport, { desc = 'Go Import' })
end, end,
event = { "CmdlineEnter" }, event = { "CmdlineEnter" },
ft = { "go", 'gomod' }, ft = { "go", 'gomod' },

View File

@ -7,8 +7,8 @@ return {
null_ls.setup { null_ls.setup {
sources = { sources = {
-- null_ls.builtins.formatting.goimports_reviser, null_ls.builtins.formatting.goimports_reviser,
null_ls.builtins.formatting.gofumpt, -- null_ls.builtins.formatting.gofumpt,
-- null_ls.builtins.formatting.golines, -- null_ls.builtins.formatting.golines,
}, },
on_attach = function(client, bufnr) on_attach = function(client, bufnr)

View File

@ -1,17 +1,18 @@
return { return {
"rest-nvim/rest.nvim", "rest-nvim/rest.nvim",
-- enabled = false,
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
ft = "http",
config = function() config = function()
local rest_nvim = require "rest-nvim" local rest_client = require("rest-nvim")
rest_nvim.setup { rest_client.setup {
-- Open request results in a horizontal split -- Open request results in a horizontal split
result_split_horizontal = false, 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, useful for unknown certificates
skip_ssl_verification = true, skip_ssl_verification = false,
encode_url = false, -- Encode URL before making request
encode_url = true,
-- Highlight request on run -- Highlight request on run
highlight = { highlight = {
enabled = true, enabled = true,
@ -20,87 +21,28 @@ return {
result = { result = {
-- toggle showing URL, HTTP info, headers at top the of result window -- toggle showing URL, HTTP info, headers at top the of result window
show_url = true, 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_http_info = true,
show_headers = 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 line on run
jump_to_request = false, jump_to_request = false,
env_file = ".env", env_file = '.env',
custom_dynamic_variables = {}, custom_dynamic_variables = {},
yank_dry_run = true, yank_dry_run = true,
} }
vim.api.nvim_create_autocmd("FileType", { vim.keymap.set('n', '<leader>rc', rest_client.run, { desc = '[R]un rest [Client]' })
pattern = "http", vim.keymap.set('n', '<leader>rl', rest_client.last, { desc = '[R]un rest [Last] request' })
callback = function() end
local buff = tonumber(vim.fn.expand "<abuf>", 10)
vim.keymap.set(
"n",
"<leader>rc",
rest_nvim.run,
{ noremap = true, buffer = buff, desc = "Run near http request" }
)
vim.keymap.set(
"n",
"<leader>rl",
rest_nvim.last,
{ noremap = true, buffer = buff, desc = "Run last http resquest" }
)
vim.keymap.set("n", "<leader>rp", function()
rest_nvim.run(true)
end, { noremap = true, buffer = buff, desc = "Preview http curl" })
end,
})
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', '<leader>rc', rest_client.run, { desc = '[R]un rest [Client]' })
-- vim.keymap.set('n', '<leader>rl', rest_client.last, { desc = '[R]un rest [Last] request' })
-- end
-- }

View File

@ -124,3 +124,29 @@ AccountNumber
UCode UCode
ParentUUID ParentUUID
ContentData 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

Binary file not shown.