2023-10-01 23:39:11 +00:00
|
|
|
-- You can add your own plugins here or in other files in this directory!
|
|
|
|
-- I promise not to create any merge conflicts in this directory :)
|
|
|
|
--
|
|
|
|
-- See the kickstart.nvim README for more information
|
|
|
|
return {
|
|
|
|
{
|
|
|
|
'joaodubas/gitlinker.nvim',
|
|
|
|
config = function ()
|
|
|
|
local actions = require('gitlinker.actions')
|
|
|
|
local hosts = require('gitlinker.hosts')
|
|
|
|
require('gitlinker').setup({
|
|
|
|
opts = {
|
|
|
|
remote = "origin",
|
|
|
|
add_current_line_on_normal_mode = true,
|
|
|
|
action_callback = actions.copy_to_clipboard,
|
|
|
|
print_url = true,
|
|
|
|
},
|
|
|
|
callbacks = {
|
|
|
|
["github.com"] = hosts.get_github_type_url,
|
|
|
|
["bitbucket.org"] = hosts.get_bitbucket_type_url,
|
|
|
|
["gitea.dubas.dev"] = hosts.get_gitea_type_url,
|
|
|
|
},
|
|
|
|
mappings = "<leader>gy"
|
|
|
|
})
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'rest-nvim/rest.nvim',
|
|
|
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
|
|
ft = {
|
|
|
|
'http',
|
|
|
|
'rest'
|
|
|
|
},
|
|
|
|
opts = {
|
|
|
|
result_split_horizontal = false,
|
|
|
|
result_split_in_place = false,
|
|
|
|
skip_ssl_verification = false,
|
|
|
|
encode_url = true,
|
|
|
|
highlight = {
|
|
|
|
enabled = true,
|
|
|
|
timeout = 15
|
|
|
|
},
|
|
|
|
result = {
|
|
|
|
show_url = true,
|
|
|
|
show_curl_command = true,
|
|
|
|
show_http_info = true,
|
|
|
|
show_headers = true,
|
|
|
|
formatters = {
|
|
|
|
json = 'jq',
|
|
|
|
html = false
|
|
|
|
},
|
|
|
|
jump_to_request = true,
|
|
|
|
env_file = '.env',
|
|
|
|
custom_dynamic_variables = { },
|
|
|
|
yank_dry_run = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
keys = function ()
|
2023-10-02 00:53:09 +00:00
|
|
|
local status_ok, which_key = pcall(require, 'which-key')
|
|
|
|
if status_ok then
|
|
|
|
which_key.register({
|
|
|
|
['<leader>t'] = { name = 'Res[t]', _ = 'which_key_ignore' }
|
|
|
|
})
|
|
|
|
end
|
2023-10-01 23:39:11 +00:00
|
|
|
return {
|
|
|
|
{ '<leader>tr', '<Plug>RestNvim', desc = 'Run the request under cursor' },
|
|
|
|
{ '<leader>tp', '<Plug>RestNvimPreview', desc = 'Preview the curl command for the request under cursor' },
|
|
|
|
{ '<leader>tl', '<Plug>RestNvimLast', desc = 'Re-run the last request' }
|
|
|
|
}
|
|
|
|
end
|
|
|
|
},
|
2023-10-29 20:46:14 +00:00
|
|
|
'nvim-treesitter/nvim-treesitter-context',
|
2023-10-01 23:39:11 +00:00
|
|
|
{
|
2023-10-29 20:46:14 +00:00
|
|
|
'akinsho/toggleterm.nvim',
|
|
|
|
opts = {
|
|
|
|
size = vim.o.lines * 0.3,
|
|
|
|
open_mapping = [[<c-\>]],
|
|
|
|
hide_numbers = true,
|
|
|
|
shade_filetypes = { },
|
|
|
|
shade_terminals = true,
|
|
|
|
shading_factor = 2,
|
|
|
|
direction = 'horizontal',
|
|
|
|
shell = vim.o.shell,
|
|
|
|
},
|
|
|
|
keys = function ()
|
2023-10-29 21:06:30 +00:00
|
|
|
local status_ok, which_key = pcall(require, 'which-key')
|
2023-10-29 20:46:14 +00:00
|
|
|
if status_ok then
|
|
|
|
which_key.register({
|
2023-11-10 15:07:53 +00:00
|
|
|
['<leader>m'] = { name = 'Toggle ter[m]inal', _ = 'which_key_ignore' }
|
2023-10-29 20:46:14 +00:00
|
|
|
})
|
|
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd('TermOpen', {
|
|
|
|
group = vim.api.nvim_create_augroup('kickstart-custom-term-open-mapping', { clear = true }),
|
|
|
|
callback = function (args)
|
|
|
|
local bufnr = args.buf
|
|
|
|
local opts = { buffer = bufnr }
|
|
|
|
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
|
|
|
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
|
|
|
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
|
|
|
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
|
|
|
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
|
|
|
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
|
|
|
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
|
|
|
end
|
2023-10-01 23:39:11 +00:00
|
|
|
})
|
2023-10-29 20:46:14 +00:00
|
|
|
return {
|
2023-11-10 15:07:53 +00:00
|
|
|
{ '<leader>mh', '<cmd>ToggleTerm direction=horizontal size=' .. tostring(vim.o.lines * 0.4) .. '<cr>', desc = 'Open ter[m]inal [h]orizontally', noremap = true },
|
|
|
|
{ '<leader>mc', '<cmd>ToggleTermSendCurrentLine<cr>', desc = 'Send [c]urrent line under the cursor', noremap = true }
|
2023-10-29 20:46:14 +00:00
|
|
|
}
|
2023-10-01 23:39:11 +00:00
|
|
|
end
|
2023-10-29 20:46:14 +00:00
|
|
|
}
|
2023-10-01 23:39:11 +00:00
|
|
|
}
|