enc: add config rest client

This commit is contained in:
asep.komarudin 2024-06-14 22:21:19 +07:00
parent 61b4120e30
commit 8c91594e60
4 changed files with 95 additions and 11 deletions

View file

@ -15,9 +15,10 @@
-- darcula-dark
-- juliana
pcode.colorscheme = "darcula-dark"
-- 0 =off 1= on
pcode.transparent_mode = 0
-- https://github.com/nvim-lualine/lualine.nvim
-- rounded
-- roundedall
-- square
@ -30,7 +31,6 @@ pcode.lualinetheme = "roundedall"
-- 1 lualine lsp progress
-- 2 fidget progress
pcode.progress = 1
-- 0 = on full text mode info,
-- 1 = on initial mode + logo
-- 2 = logo only
@ -61,11 +61,6 @@ pcode.lspghost_text = false
pcode.mason_ensure_installed = { -- sebelumnya register_lsp
-- "yamlls",
-- "intelephense",
-- "marksman",
-- "csharp_ls",
-- "clangd",
-- "dartls",
-- "kotlin_language_server",
-- tambahkan di bawah sini setelah melakukan :masoninstall
}
pcode.unregister_lsp = {
@ -104,28 +99,39 @@ pcode.coderunner = {
html = "live-server $dir/$fileName",
}
-- https://github.com/nvim-tree/nvim-tree.lua
-- 0 = normal
-- 1 = float
pcode.nvimtree_isfloat = 0
-- https://github.com/roobert/tailwindcss-colorizer-cmp.nvim
pcode.tailwindcolorizer = false
-- https://github.com/Exafunction/codeium.vim
pcode.codeium = false
-- https://github.com/Exafunction/codeium.nvim
pcode.codeium_nvim = true
-- https://github.com/kevinhwang91/nvim-ufo
pcode.nvimufo = false
-- https://github.com/echasnovski/mini.indentscope
pcode.indentscope = true
-- https://github.com/echasnovski/mini.animate
pcode.minianimate = false
-- https://github.com/hrsh7th/nvim-cmp
pcode.disable_cmpdoc = false
-- https://github.com/rachartier/tiny-devicons-auto-colors.nvim
pcode.adaptive_color_icon = true
-- https://github.com/lukas-reineke/virt-column.nvim
pcode.columnline = true
-- https://github.com/nvim-telescope/telescope.nvim
---@alias telescope_themes
---| "cursor" # see `telescope.themes.get_cursor()`
---| "dropdown" # see `telescope.themes.get_dropdown()`
@ -133,6 +139,7 @@ pcode.columnline = true
---| "center" # retain the default telescope theme
pcode.telescope_theme_find_file = "center"
pcode.telescope_theme_live_grep = "dropdown"
-- https://github.com/kristijanhusak/vim-dadbod-ui
pcode.database = false
@ -140,5 +147,9 @@ pcode.database = false
pcode.jest = false
pcode.jest_command = "npm test -- "
pcode.jest_config = "jest.config.mjs"
-- https://github.com/rest-nvim/rest.nvim
pcode.rest_client = true
-- https://github.com/ThePrimeagen/refactoring.nvim
pcode.refactoring = false

28
lua/plugins/rest-nvim.lua Normal file
View file

@ -0,0 +1,28 @@
local map_opts = { silent = true, noremap = true }
local merge = function(tableA, tableB, ...)
return vim.tbl_deep_extend("force", tableA, tableB, ...)
end
local nmap = function(lhs, rhs, opts)
opts = opts or {}
vim.keymap.set("n", lhs, rhs, merge(map_opts, opts))
end
local M = {}
if pcode.rest_client then
M = {
"rest-nvim/rest.nvim",
-- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306
commit = "91badd46c60df6bd9800c809056af2d80d33da4c",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local rest_nvim = require("rest-nvim")
rest_nvim.setup()
nmap("<Leader>rh", rest_nvim.run, { desc = "Run http request under cursor" })
nmap("<Leader>rH", rest_nvim.last, { desc = "Run last http request" })
end,
ft = "http",
}
end
return M

View file

@ -65,8 +65,52 @@ keymap("v", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.f
keymap("v", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr><right>i", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr><right>i", opts)
-- case spesial file
vim.api.nvim_create_autocmd("FileType", {
pattern = { "javascript", "typescript" },
callback = function()
keymap(
"i",
"<C-_>",
"<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i<right><right><Space>",
opts
)
keymap(
"i",
"<C-/>",
"<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i<right><right><Space>",
opts
)
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "lua", "html", "javascriptreact" },
callback = function()
keymap(
"i",
"<C-_>",
"<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr><right>i<right><right><right><Space>",
opts
)
keymap(
"i",
"<C-/>",
"<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr><right>i<right><right><right><Space>",
opts
)
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "javascriptreact" },
callback = function()
keymap("i", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("i", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
end,
})
keymap("n", "<C-_>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
keymap("n", "<C-/>", "<esc><cmd>lua require('Comment.api').toggle.linewise.current()<cr>i", opts)
-- keymap("n", "<C-l>", "<esc><cmd>lua _LIVE_SERVER()<cr>", opts)