mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-07-14 03:14:27 +02:00
enc: add neocodeium config for replace codeium.vim
This commit is contained in:
parent
64e62e59ba
commit
38bf58ad63
61 changed files with 2942 additions and 1051 deletions
|
@ -1,7 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
event = { "VeryLazy", "BufReadPre", "BufNewFile", "BufRead" },
|
||||
event = { "CmdlineEnter", "BufReadPre", "BufNewFile", "BufRead" },
|
||||
dependencies = {
|
||||
{ "pojokcodeid/auto-lsp.nvim", lazy = true },
|
||||
{
|
||||
|
|
|
@ -1,47 +1,50 @@
|
|||
return {
|
||||
{ "nvim-lua/plenary.nvim", event = "VeryLazy" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufRead", "VeryLazy" },
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"TSInstall",
|
||||
"TSInstallInfo",
|
||||
"TSInstallSync",
|
||||
"TSUpdate",
|
||||
"TSUpdateSync",
|
||||
"TSUninstall",
|
||||
"TSUninstallInfo",
|
||||
"TSInstallFromGrammar",
|
||||
},
|
||||
opts = function()
|
||||
return {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
---@type table<string, boolean>
|
||||
local added = {}
|
||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||
if added[lang] then
|
||||
return false
|
||||
end
|
||||
added[lang] = true
|
||||
return true
|
||||
end, opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
{ "nvim-lua/plenary.nvim", event = "VeryLazy" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufRead", "VeryLazy" },
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"TSInstall",
|
||||
-- "TSInstallInfo",
|
||||
"TSInstallSync",
|
||||
"TSUpdate",
|
||||
"TSUpdateSync",
|
||||
"TSUninstall",
|
||||
"TSUninstallInfo",
|
||||
"TSInstallFromGrammar",
|
||||
},
|
||||
opts = function()
|
||||
return {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
},
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
---@type table<string, boolean>
|
||||
local added = {}
|
||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||
if added[lang] then
|
||||
return false
|
||||
end
|
||||
added[lang] = true
|
||||
return true
|
||||
end, opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
vim.api.nvim_create_user_command("TSInstallInfo", function()
|
||||
vim.cmd("Telescope treesitter_info")
|
||||
end, {})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
lazy = true,
|
||||
event = { "BufRead", "VeryLazy" },
|
||||
opts = {},
|
||||
"windwp/nvim-ts-autotag",
|
||||
lazy = true,
|
||||
event = { "BufRead", "InsertEnter" },
|
||||
opts = {},
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ return {
|
|||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
event = "InsertEnter",
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
|
|
|
@ -91,7 +91,8 @@ return {
|
|||
},
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
event = "VeryLazy",
|
||||
-- event = "VeryLazy",
|
||||
event = "CmdlineEnter",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local mapping = {
|
||||
|
|
|
@ -2,51 +2,63 @@
|
|||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
local pyrun = "python -u"
|
||||
if vim.fn.has("win32") == 0 then
|
||||
pyrun = "python3 -u"
|
||||
pyrun = "python3 -u"
|
||||
end
|
||||
local rfile = {
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = pyrun,
|
||||
typescript = "ts-node $dir/$fileName",
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
javascript = 'node "$dir/$fileName"',
|
||||
go = "go run .",
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = pyrun,
|
||||
typescript = "ts-node $dir/$fileName",
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
javascript = 'node "$dir/$fileName"',
|
||||
-- go = "go run .",
|
||||
go = "go run $fileName",
|
||||
}
|
||||
|
||||
local runProject = {}
|
||||
local cwd = vim.fn.getcwd()
|
||||
local go_mod_path = cwd .. "/go.mod"
|
||||
if vim.fn.filereadable(go_mod_path) ~= 0 then
|
||||
runProject[cwd] = {
|
||||
name = "Go Project (cwd)",
|
||||
command = "go run .",
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
"CRAG666/code_runner.nvim",
|
||||
lazy = true,
|
||||
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
|
||||
opts = {
|
||||
filetype = rfile,
|
||||
mode = "float",
|
||||
focus = true,
|
||||
startinsert = true,
|
||||
term = {
|
||||
position = "bot",
|
||||
size = 50,
|
||||
},
|
||||
float = {
|
||||
close_key = "<ESC>",
|
||||
border = "rounded",
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
border_hl = "FloatBorder",
|
||||
float_hl = "Normal",
|
||||
blend = 0,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("code_runner").setup(opts)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>r", "", desc = " Run", mode = "n" },
|
||||
{ "<leader>rr", "<cmd>RunCode<CR>", desc = "Run Code", mode = "n" },
|
||||
{ "<leader>rf", "<cmd>RunFile<CR>", desc = "Run File", mode = "n" },
|
||||
{ "<leader>rp", "<cmd>RunProject<CR>", desc = "Run Project", mode = "n" },
|
||||
},
|
||||
"CRAG666/code_runner.nvim",
|
||||
lazy = true,
|
||||
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
|
||||
opts = {
|
||||
filetype = rfile,
|
||||
project = runProject,
|
||||
mode = "float",
|
||||
focus = true,
|
||||
startinsert = true,
|
||||
term = {
|
||||
position = "bot",
|
||||
size = 50,
|
||||
},
|
||||
float = {
|
||||
close_key = "<ESC>",
|
||||
border = "rounded",
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
border_hl = "FloatBorder",
|
||||
float_hl = "Normal",
|
||||
blend = 0,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("code_runner").setup(opts)
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>r", "", desc = " Run", mode = "n" },
|
||||
{ "<leader>rr", "<cmd>RunCode<CR>", desc = "Run Code", mode = "n" },
|
||||
{ "<leader>rf", "<cmd>RunFile<CR>", desc = "Run File", mode = "n" },
|
||||
{ "<leader>rp", "<cmd>RunProject<CR>", desc = "Run Project", mode = "n" },
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
opts = function()
|
||||
return {
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>/",
|
||||
"<Plug>(comment_toggle_linewise_current)",
|
||||
desc = " Coment line",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>/",
|
||||
"<Plug>(comment_toggle_linewise_visual)",
|
||||
desc = " Coment line",
|
||||
mode = "v",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("Comment").setup(opts)
|
||||
end,
|
||||
"numToStr/Comment.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
opts = function()
|
||||
return {
|
||||
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>/",
|
||||
"<Plug>(comment_toggle_linewise_current)",
|
||||
desc = " Coment line",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>/",
|
||||
"<Plug>(comment_toggle_linewise_visual)",
|
||||
desc = " Coment line",
|
||||
mode = "v",
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("Comment").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,40 +1,43 @@
|
|||
return {
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
-- vim.list_extend(opts.ensure_installed, { "stylua" })
|
||||
opts.lang_maps = opts.lang_maps or {}
|
||||
opts.name_maps = opts.name_maps or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.format_on_save = opts.format_on_save or true
|
||||
opts.format_timeout_ms = opts.format_timeout_ms or 5000
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-conform").setup(opts)
|
||||
-- other conform config
|
||||
local conform = require("conform")
|
||||
if opts.format_on_save then
|
||||
conform.setup({
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
},
|
||||
})
|
||||
end
|
||||
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"stevearc/conform.nvim",
|
||||
},
|
||||
event = "BufRead",
|
||||
opts = function(_, opts)
|
||||
opts.formatters = opts.formatters or {}
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
-- vim.list_extend(opts.ensure_installed, { "stylua" })
|
||||
opts.lang_maps = opts.lang_maps or {}
|
||||
opts.name_maps = opts.name_maps or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.format_on_save = opts.format_on_save or true
|
||||
opts.format_timeout_ms = opts.format_timeout_ms or 5000
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-conform").setup(opts)
|
||||
-- other conform config
|
||||
local conform = require("conform")
|
||||
if opts.format_on_save then
|
||||
conform.setup({
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
},
|
||||
})
|
||||
end
|
||||
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = opts.format_timeout_ms or 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>l", "", desc = " Lsp" },
|
||||
},
|
||||
}
|
||||
|
|
73
lua/pcode/plugins/extras/cheatsheet.lua
Normal file
73
lua/pcode/plugins/extras/cheatsheet.lua
Normal file
|
@ -0,0 +1,73 @@
|
|||
return {
|
||||
"pojokcodeid/cheatsheet-nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<F1>", "<cmd>KeymapsPopup<cr>", desc = "Keymaps Popup" },
|
||||
},
|
||||
cmd = { "KeymapsPopup" },
|
||||
opts = {
|
||||
["LSP"] = {
|
||||
{ "LSP Code Action", "n", "<leader>la" },
|
||||
{ "LSP Code Format", "n", "<leader>lf" },
|
||||
{ "LSP Information", "n", "<leader>li" },
|
||||
{ "Mason Information", "n", "<leader>lI" },
|
||||
{ "LSP Next Diagnostic", "n", "<leader>lj" },
|
||||
{ "LSP Previous Diagnostic", "n", "<leader>lk" },
|
||||
{ "LSP Quickfix", "n", "<leader<lq" },
|
||||
{ "LSP Rename", "n", "<leader>lr" },
|
||||
{ "LSP Signature Help", "n", "<leader>ls" },
|
||||
{ "LSP Format On Range", "v", "<leader>lF" },
|
||||
},
|
||||
["Cmp"] = {
|
||||
{ "Scroll Next Documentation", "i", "CTRL + f" },
|
||||
{ "Scroll Previous Documentation", "i", "CTRL + b" },
|
||||
{ "Mapping Complete", "i", "CTRL + space" },
|
||||
{ "Abort Completion", "i", "CTRL + e" },
|
||||
{ "Accept Completion", "i", "↵" },
|
||||
{ "Next Autocompletion", "i", "TAB" },
|
||||
{ "Previous Autocompletion", "i", "SHIFT + TAB" },
|
||||
},
|
||||
["Terminal"] = {
|
||||
{ "Terminal Float", "n", "<leader>tf" },
|
||||
{ "Terminal Horizontal", "n", "<leader>th" },
|
||||
{ "Terminal new tab", "n", "<leader>ts" },
|
||||
{ "Terminal Vertical", "n", "<leader>tv" },
|
||||
{ "Terminal Close", "n", "<leader>tx" },
|
||||
},
|
||||
["Comment"] = {
|
||||
{ "Comment line toggle", "n/v", "gcc or CTRL + /" },
|
||||
{ "Comment block toggle", "n/v", "gbc or CTRL + /" },
|
||||
{ "Comment visual selection", "v", "gc" },
|
||||
{ "Comment visual selection using block delimiters", "v", "gb" },
|
||||
{ "Comment out text object line wise", "v", "gc<motion>" },
|
||||
{ "Comment out text object block wise", "v", "gb<motion>" },
|
||||
{ "Add comment on the line above", "n", "gcO" },
|
||||
{ "Add comment on the line below", "n", "gco" },
|
||||
{ "Add comment at the end of line", "n", "gcA" },
|
||||
},
|
||||
["Bufferline"] = {
|
||||
{ "Move Active Buffer Left", "n", "SHIFT + h/SHIFT + Left" },
|
||||
{ "Move Active Buffer Right", "n", "SHIFT + l/SHIFT + Right" },
|
||||
{ "Reorder Bufferline", "n", "SHIFT + PageUp/PageDown" },
|
||||
{ "Close Current Buffer", "n", "SHIFT + t" },
|
||||
},
|
||||
["Window"] = {
|
||||
{ "Resize Window", "n", "CTRL + Left/Right/Up/Down" },
|
||||
{ "Navigate Window", "n", "CTRL + h/l" },
|
||||
},
|
||||
["Text-Manipulation"] = {
|
||||
{ "Select Multiple Cursor Vertical", "n/i", "SHIFT + ALT + Up/Down" },
|
||||
{ "Select text", "n", "CTRL + d" },
|
||||
{ "Select Multiple Cursor", "i/n", "ALT + Left Click Mouse" },
|
||||
{ "Duplicate Row", "i/n/v", "SHIFT + ALT + Up/Down" },
|
||||
{ "Move Row", "i/n/v", "ALT + Up/Down" },
|
||||
},
|
||||
["Ai"] = {
|
||||
{ "Approve AI Sugention", "i", "CTRL + g" },
|
||||
{ "Change AI Option", "i", "CTRL + Up/Down" },
|
||||
{ "Clear AI Sugention", "i", "CTRL + x" },
|
||||
},
|
||||
},
|
||||
|
||||
config = true,
|
||||
}
|
|
@ -5,13 +5,16 @@ return {
|
|||
dependencies = {
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
"Exafunction/windsurf.nvim",
|
||||
cmd = "Codeium",
|
||||
enabled = false,
|
||||
enabled = true,
|
||||
build = ":Codeium Auth",
|
||||
opts = {
|
||||
enable_chat = true,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("codeium").setup(opts)
|
||||
end,
|
||||
},
|
||||
},
|
||||
--@param opts cmp.ConfigSchema
|
||||
|
|
35
lua/pcode/plugins/extras/dressing.lua
Normal file
35
lua/pcode/plugins/extras/dressing.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
"pojokcodeid/dressing.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.select = function(...)
|
||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
return vim.ui.select(...)
|
||||
end
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
-- vim.ui.input = function(...)
|
||||
-- require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
-- return vim.ui.input(...)
|
||||
-- end
|
||||
end,
|
||||
opts = {
|
||||
input = {
|
||||
enabled = false,
|
||||
title_pos = "center",
|
||||
relative = "editor",
|
||||
default_prompt = "➤ ",
|
||||
win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" },
|
||||
prefer_width = 30,
|
||||
max_width = { 140, 0.9 },
|
||||
min_width = { 50, 0.2 },
|
||||
},
|
||||
select = {
|
||||
backend = { "telescope", "builtin" },
|
||||
builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("dressing").setup(opts)
|
||||
end,
|
||||
}
|
14
lua/pcode/plugins/extras/fidget.lua
Normal file
14
lua/pcode/plugins/extras/fidget.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
lazy = true,
|
||||
tag = "legacy",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("fidget").setup({
|
||||
window = {
|
||||
blend = 0,
|
||||
relative = "editor",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
local M = {
|
||||
"RRethy/vim-illuminate",
|
||||
event = "VeryLazy",
|
||||
event = "BufRead",
|
||||
}
|
||||
|
||||
M.opts = {
|
||||
|
|
|
@ -23,6 +23,10 @@ return {
|
|||
"toggleterm",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"term",
|
||||
"terminal",
|
||||
"zsh",
|
||||
"keymaps_table",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local M = {
|
||||
"SmiteshP/nvim-navic",
|
||||
event = "VeryLazy",
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
"LunarVim/breadcrumbs.nvim",
|
||||
opts = {},
|
||||
|
|
20
lua/pcode/plugins/extras/neocodeium.lua
Normal file
20
lua/pcode/plugins/extras/neocodeium.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"monkoose/neocodeium",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local neocodeium = require("neocodeium")
|
||||
neocodeium.setup()
|
||||
vim.keymap.set("i", "<C-g>", function()
|
||||
neocodeium.accept()
|
||||
end)
|
||||
vim.keymap.set("i", "<c-Down>", function()
|
||||
neocodeium.cycle()
|
||||
end)
|
||||
vim.keymap.set("i", "<c-Up>", function()
|
||||
require("neocodeium").cycle(-1)
|
||||
end)
|
||||
vim.keymap.set("i", "<c-x>", function()
|
||||
require("neocodeium").clear()
|
||||
end)
|
||||
end,
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
return {
|
||||
{
|
||||
"nvchad/menu",
|
||||
"nvzone/menu",
|
||||
lazy = true,
|
||||
event = { "VeryLazy" },
|
||||
dependencies = {
|
||||
{ "nvchad/volt", lazy = true },
|
||||
{ "nvzone/volt", lazy = true },
|
||||
{ "nvzone/showkeys", cmd = "ShowkeysToggle", lazy = true },
|
||||
{
|
||||
"nvchad/minty",
|
||||
"nvzone/minty",
|
||||
cmd = { "Shades", "Huefy" },
|
||||
lazy = true,
|
||||
},
|
||||
|
@ -22,10 +23,12 @@ return {
|
|||
end, {})
|
||||
|
||||
-- mouse users + nvimtree users!
|
||||
vim.keymap.set("n", "<RightMouse>", function()
|
||||
vim.keymap.set({ "n", "v" }, "<RightMouse>", function()
|
||||
require("menu.utils").delete_old_menus()
|
||||
vim.cmd.exec('"normal! \\<RightMouse>"')
|
||||
|
||||
local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default"
|
||||
local buf = vim.api.nvim_win_get_buf(vim.fn.getmousepos().winid)
|
||||
local options = vim.bo[buf].ft == "NvimTree" and "nvimtree" or "default"
|
||||
require("menu").open(options, opts)
|
||||
end, {})
|
||||
end,
|
||||
|
|
|
@ -2,6 +2,7 @@ return {
|
|||
"hiphish/rainbow-delimiters.nvim",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
branch = "master",
|
||||
config = function()
|
||||
-- Modul ini berisi beberapa definisi default
|
||||
local rainbow_delimiters = require("rainbow-delimiters")
|
||||
|
|
26
lua/pcode/plugins/extras/telescopediff.lua
Normal file
26
lua/pcode/plugins/extras/telescopediff.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"jemag/telescope-diff.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("telescope").load_extension("diff")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>sd",
|
||||
function()
|
||||
require("telescope").extensions.diff.diff_files({ hidden = true })
|
||||
end,
|
||||
desc = "Diff 2 Files",
|
||||
},
|
||||
{
|
||||
"<leader>sD",
|
||||
function()
|
||||
require("telescope").extensions.diff.diff_current({ hidden = true })
|
||||
end,
|
||||
desc = "Diff Current File",
|
||||
},
|
||||
},
|
||||
}
|
22
lua/pcode/plugins/extras/tinydignostic.lua
Normal file
22
lua/pcode/plugins/extras/tinydignostic.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"rachartier/tiny-inline-diagnostic.nvim",
|
||||
event = "VeryLazy", -- Or `LspAttach`
|
||||
priority = 1000, -- needs to be loaded in first
|
||||
config = function()
|
||||
require("tiny-inline-diagnostic").setup({
|
||||
preset = "powerline",
|
||||
-- signs = {
|
||||
-- left = "",
|
||||
-- right = "",
|
||||
-- diag = "●",
|
||||
-- arrow = " ",
|
||||
-- up_arrow = " ",
|
||||
-- vertical = " │",
|
||||
-- vertical_end = " └",
|
||||
-- },
|
||||
blend = {
|
||||
factor = 0.22,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -21,6 +21,8 @@ return {
|
|||
"WinBar",
|
||||
"WinBarNC",
|
||||
"NotifyBackground",
|
||||
"TabLine",
|
||||
"TabLineFill",
|
||||
},
|
||||
exclude_groups = {
|
||||
-- disable active selection backgroun
|
||||
|
@ -53,6 +55,10 @@ return {
|
|||
-- create auto command to set transparent
|
||||
vim.cmd("TransparentDisable")
|
||||
vim.cmd("TransparentEnable")
|
||||
vim.api.nvim_set_hl(0, "MasonHeader", { bold = true, bg = "NONE", fg = "#838FA7" })
|
||||
vim.api.nvim_set_hl(0, "MasonMutedBlock", { bg = "NONE", fg = "#838FA7" })
|
||||
vim.api.nvim_set_hl(0, "MasonHighlightBlockBold", { bold = true, bg = "NONE", fg = "#ABB2BF" })
|
||||
vim.api.nvim_set_hl(0, "LazyH1", { bold = true, bg = "NONE", fg = "#ABB2BF" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
return {
|
||||
"mg979/vim-visual-multi",
|
||||
--[[ "mg979/vim-visual-multi",
|
||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||
branch = "master",
|
||||
lazy = true,
|
||||
init = function()
|
||||
-- Nonaktifkan mapping default jika ingin custom
|
||||
vim.g.VM_default_mappings = 0
|
||||
|
||||
vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE
|
||||
vim.g.VM_maps = {
|
||||
["Find Under"] = "<C-d>", -- equal CTRL+D on VSCODE
|
||||
|
@ -13,5 +16,49 @@ return {
|
|||
["Undo"] = "u", -- undo
|
||||
["Redo"] = "<C-r>", -- redo
|
||||
}
|
||||
end,
|
||||
end, ]]
|
||||
{
|
||||
"brenton-leighton/multiple-cursors.nvim",
|
||||
version = "*",
|
||||
opts = {},
|
||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||
keys = {
|
||||
-- 🧠 Seperti Ctrl + D di VS Code → pilih kata berikutnya yang sama
|
||||
{
|
||||
"<C-d>",
|
||||
function()
|
||||
vim.cmd("MultipleCursorsAddJumpNextMatch")
|
||||
vim.schedule(function()
|
||||
vim.notify(
|
||||
"🖊️ Multiple cursor: menambahkan seleksi berikutnya",
|
||||
vim.log.levels.INFO,
|
||||
{ title = "MultipleCursors" }
|
||||
)
|
||||
end)
|
||||
end,
|
||||
mode = { "n", "x" },
|
||||
desc = "Select next match",
|
||||
},
|
||||
|
||||
-- 👇 Menambah kursor ke bawah seperti Ctrl + Alt + ↓
|
||||
{ "<C-M-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "i", "x" }, desc = "Add cursor down" },
|
||||
|
||||
-- 👆 Menambah kursor ke atas seperti Ctrl + Alt + ↑
|
||||
{ "<C-M-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" }, desc = "Add cursor up" },
|
||||
|
||||
-- 🖱️ Tambah/hapus kursor dengan Ctrl + Klik mouse
|
||||
{
|
||||
"<M-LeftMouse>",
|
||||
"<Cmd>MultipleCursorsMouseAddDelete<CR>",
|
||||
mode = { "n", "i" },
|
||||
desc = "Add/remove cursor with mouse",
|
||||
},
|
||||
|
||||
-- 🔲 Tambah kursor ke seluruh baris visual yang dipilih (pakai Leader + m)
|
||||
{ "<Leader>m", "<Cmd>MultipleCursorsAddVisualArea<CR>", mode = { "x" }, desc = "Add cursors to visual lines" },
|
||||
|
||||
-- 🔒 Lock semua kursor supaya siap edit serentak
|
||||
{ "<Leader>L", "<Cmd>MultipleCursorsLock<CR>", mode = { "n", "x" }, desc = "Lock cursors" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,101 +1,363 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "go", "gomod", "gosum", "gotmpl", "gowork" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gopls" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local package = "gofumpt"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.gofumpt = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
vim.list_extend(opts.ensure_installed, { "ast-grep" })
|
||||
opts.linters_by_ft.php = { "ast-grep" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "go", "gomod", "gosum", "gotmpl", "gowork" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "gopls" })
|
||||
vim.api.nvim_create_user_command("GoRun", function()
|
||||
local filename = vim.fn.expand("%:p") -- path lengkap file aktif
|
||||
if not filename:match("%.go$") then
|
||||
vim.notify("current file is not a go file.", vim.log.levels.WARN, { title = "GoRun" })
|
||||
return
|
||||
end
|
||||
|
||||
"nvim-neotest/neotest-plenary",
|
||||
"nvim-neotest/neotest-vim-test",
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local go_runner = Terminal:new({
|
||||
cmd = "go run " .. filename,
|
||||
direction = "float",
|
||||
close_on_exit = false,
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
"nvim-neotest/nvim-nio",
|
||||
go_runner:toggle()
|
||||
end, {})
|
||||
vim.api.nvim_create_user_command("GoBuild", function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
local go_mod_path = cwd .. "/go.mod"
|
||||
if vim.fn.filereadable(go_mod_path) == 0 then
|
||||
vim.notify("current project is not a go project.", vim.log.levels.WARN, { title = "GoBuild" })
|
||||
return
|
||||
end
|
||||
|
||||
{
|
||||
"fredrikaverpil/neotest-golang",
|
||||
dependencies = {
|
||||
{
|
||||
"leoluz/nvim-dap-go",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
branch = "main",
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.adapters = opts.adapters or {}
|
||||
opts.adapters["neotest-golang"] = {
|
||||
go_test_args = {
|
||||
"-v",
|
||||
"-race",
|
||||
"-count=1",
|
||||
"-timeout=60s",
|
||||
"-coverprofile=" .. vim.fn.getcwd() .. "/coverage.out",
|
||||
},
|
||||
dap_go_enabled = true,
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if opts.adapters then
|
||||
local adapters = {}
|
||||
for name, config in pairs(opts.adapters or {}) do
|
||||
if type(name) == "number" then
|
||||
if type(config) == "string" then
|
||||
config = require(config)
|
||||
end
|
||||
adapters[#adapters + 1] = config
|
||||
elseif config ~= false then
|
||||
local adapter = require(name)
|
||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
||||
local meta = getmetatable(adapter)
|
||||
if adapter.setup then
|
||||
adapter.setup(config)
|
||||
elseif meta and meta.__call then
|
||||
adapter(config)
|
||||
else
|
||||
error("Adapter " .. name .. " does not support setup")
|
||||
end
|
||||
end
|
||||
adapters[#adapters + 1] = adapter
|
||||
end
|
||||
end
|
||||
opts.adapters = adapters
|
||||
end
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
-- create file exe jika os adalah windows
|
||||
local filename = "output"
|
||||
if vim.fn.has("win32") == 1 then
|
||||
filename = "output.exe"
|
||||
end
|
||||
local go_runner = Terminal:new({
|
||||
cmd = "go build -o " .. filename .. " && ./" .. filename,
|
||||
direction = "float",
|
||||
close_on_exit = false,
|
||||
hidden = true,
|
||||
})
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
go_runner:toggle()
|
||||
end, {})
|
||||
|
||||
-- Fungsi untuk membuat proyek Go
|
||||
local function go_new_project()
|
||||
local function create_notif(message, level)
|
||||
local notif_ok, notify = pcall(require, "notify")
|
||||
if notif_ok then
|
||||
notify(message, level)
|
||||
else
|
||||
print(message)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_user_input(prompt, default_value)
|
||||
vim.fn.inputsave()
|
||||
local result = vim.fn.input(prompt, default_value)
|
||||
vim.fn.inputrestore()
|
||||
|
||||
if result == "" then
|
||||
create_notif("Input canceled.", "info")
|
||||
return nil, true
|
||||
end
|
||||
return result, false
|
||||
end
|
||||
|
||||
local project_name, canceled = get_user_input("Enter project name: ", "myapp")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
local file_name, canceled = get_user_input("Enter file name (without .go): ", "main")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
local function_name, canceled = get_user_input("Enter function name: ", "main")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
local project_path = cwd .. "/" .. project_name
|
||||
if vim.fn.isdirectory(project_path) == 1 then
|
||||
create_notif("Project directory already exists: " .. project_path, "error")
|
||||
return
|
||||
end
|
||||
|
||||
local mkdir_cmd = string.format("mkdir -p '%s'", project_path)
|
||||
local gomod_cmd = string.format("cd '%s' && go mod init %s", project_path, project_name)
|
||||
local entry_file = string.format("%s/%s.go", project_path, file_name)
|
||||
local main_code = string.format(
|
||||
[[
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func %s() {
|
||||
fmt.Println("Hello, world!")
|
||||
}
|
||||
]],
|
||||
function_name
|
||||
)
|
||||
|
||||
vim.fn.system(mkdir_cmd)
|
||||
vim.fn.system(gomod_cmd)
|
||||
|
||||
local file = io.open(entry_file, "w")
|
||||
if file then
|
||||
file:write(main_code)
|
||||
file:close()
|
||||
create_notif("Go project created at " .. project_path, "info")
|
||||
vim.cmd("cd " .. project_path)
|
||||
|
||||
-- Jika ada NvimTreeOpen, jalankan lalu kembalikan fokus ke file
|
||||
if vim.fn.exists(":NvimTreeOpen") == 2 then
|
||||
vim.cmd("NvimTreeOpen")
|
||||
-- Penjadwalan agar kembali ke buffer file Go setelah NvimTree terbuka
|
||||
vim.schedule(function()
|
||||
vim.cmd("edit " .. entry_file)
|
||||
-- Cari baris function
|
||||
local lines = {}
|
||||
for line in main_code:gmatch("([^\n]*)\n?") do
|
||||
table.insert(lines, line)
|
||||
end
|
||||
local func_line = 1
|
||||
for i, line in ipairs(lines) do
|
||||
if line:find("func%s+" .. function_name .. "%s*%(") then
|
||||
func_line = i
|
||||
break
|
||||
end
|
||||
end
|
||||
local target_line = func_line + 1
|
||||
vim.api.nvim_win_set_cursor(0, { target_line, 4 })
|
||||
vim.cmd("startinsert")
|
||||
end)
|
||||
else
|
||||
vim.cmd("edit " .. entry_file)
|
||||
local lines = {}
|
||||
for line in main_code:gmatch("([^\n]*)\n?") do
|
||||
table.insert(lines, line)
|
||||
end
|
||||
local func_line = 1
|
||||
for i, line in ipairs(lines) do
|
||||
if line:find("func%s+" .. function_name .. "%s*%(") then
|
||||
func_line = i
|
||||
break
|
||||
end
|
||||
end
|
||||
local target_line = func_line + 1
|
||||
vim.api.nvim_win_set_cursor(0, { target_line, 4 })
|
||||
vim.cmd("startinsert")
|
||||
end
|
||||
else
|
||||
create_notif("Failed to create file: " .. entry_file, "error")
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("GoNewProject", go_new_project, {})
|
||||
|
||||
-- Fungsi untuk membuat file Go
|
||||
local function go_new_file()
|
||||
local function create_notif(message, level)
|
||||
local notif_ok, notify = pcall(require, "notify")
|
||||
if notif_ok then
|
||||
notify(message, level)
|
||||
else
|
||||
print(message)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_user_input(prompt, default_value)
|
||||
vim.fn.inputsave()
|
||||
local result = vim.fn.input(prompt, default_value)
|
||||
vim.fn.inputrestore()
|
||||
if result == "" then
|
||||
create_notif("Input canceled.", "info")
|
||||
return nil, true
|
||||
end
|
||||
return result, false
|
||||
end
|
||||
|
||||
-- Ambil nama folder
|
||||
local folder_name, canceled = get_user_input("Enter folder name (dot for current folder): ", ".")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
-- Ambil nama file (tanpa .go)
|
||||
local file_name, canceled = get_user_input("Enter file name (without .go): ", "newfile")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
-- Ambil nama package
|
||||
local package_name, canceled = get_user_input("Enter package name: ", "main")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
-- Ambil nama function
|
||||
local function_name, canceled = get_user_input("Enter function name: ", "main")
|
||||
if canceled then
|
||||
return
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
local folder_path = (folder_name == "." or folder_name == "") and cwd or cwd .. "/" .. folder_name
|
||||
|
||||
-- Cek dan buat folder jika perlu
|
||||
if vim.fn.isdirectory(folder_path) == 0 then
|
||||
local mkdir_cmd = string.format("mkdir -p '%s'", folder_path)
|
||||
vim.fn.system(mkdir_cmd)
|
||||
end
|
||||
|
||||
local file_path = string.format("%s/%s.go", folder_path, file_name)
|
||||
|
||||
if vim.fn.filereadable(file_path) == 1 then
|
||||
create_notif("File already exists: " .. file_path, "error")
|
||||
return
|
||||
end
|
||||
|
||||
local code = string.format(
|
||||
[[
|
||||
package %s
|
||||
|
||||
func %s() {
|
||||
|
||||
}
|
||||
]],
|
||||
package_name,
|
||||
function_name
|
||||
)
|
||||
|
||||
-- Buat file dan isi konten
|
||||
local file = io.open(file_path, "w")
|
||||
if file then
|
||||
file:write(code)
|
||||
file:close()
|
||||
create_notif("Go file created: " .. file_path, "info")
|
||||
|
||||
-- Buka file dan tempatkan kursor di bawah function, mode insert
|
||||
vim.cmd("edit " .. file_path)
|
||||
local lines = {}
|
||||
for line in code:gmatch("([^\n]*)\n?") do
|
||||
table.insert(lines, line)
|
||||
end
|
||||
local func_line = 1
|
||||
for i, line in ipairs(lines) do
|
||||
if line:find("func%s+" .. function_name .. "%s*%(") then
|
||||
func_line = i
|
||||
break
|
||||
end
|
||||
end
|
||||
local target_line = func_line + 1
|
||||
vim.api.nvim_win_set_cursor(0, { target_line, 4 })
|
||||
vim.cmd("startinsert")
|
||||
else
|
||||
create_notif("Failed to create file: " .. file_path, "error")
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("GoNewFile", go_new_file, {})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
local package = "gofumpt"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.gofumpt = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
vim.list_extend(opts.ensure_installed, { "golangci-lint" })
|
||||
opts.linters_by_ft.php = { "golangci-lint" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
event = "VeryLazy",
|
||||
ft = "go",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
"nvim-neotest/neotest-plenary",
|
||||
"nvim-neotest/neotest-vim-test",
|
||||
|
||||
"nvim-neotest/nvim-nio",
|
||||
|
||||
{
|
||||
"fredrikaverpil/neotest-golang",
|
||||
dependencies = {
|
||||
{
|
||||
"leoluz/nvim-dap-go",
|
||||
opts = {},
|
||||
},
|
||||
},
|
||||
branch = "main",
|
||||
},
|
||||
},
|
||||
opts = function(_, opts)
|
||||
opts.adapters = opts.adapters or {}
|
||||
opts.adapters["neotest-golang"] = {
|
||||
go_test_args = {
|
||||
"-v",
|
||||
"-race",
|
||||
"-count=1",
|
||||
"-timeout=60s",
|
||||
"-coverprofile=" .. vim.fn.getcwd() .. "/coverage.out",
|
||||
},
|
||||
dap_go_enabled = true,
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if opts.adapters then
|
||||
local adapters = {}
|
||||
for name, config in pairs(opts.adapters or {}) do
|
||||
if type(name) == "number" then
|
||||
if type(config) == "string" then
|
||||
config = require(config)
|
||||
end
|
||||
adapters[#adapters + 1] = config
|
||||
elseif config ~= false then
|
||||
local adapter = require(name)
|
||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
||||
local meta = getmetatable(adapter)
|
||||
if adapter.setup then
|
||||
adapter.setup(config)
|
||||
elseif meta and meta.__call then
|
||||
adapter(config)
|
||||
else
|
||||
error("Adapter " .. name .. " does not support setup")
|
||||
end
|
||||
end
|
||||
adapters[#adapters + 1] = adapter
|
||||
end
|
||||
end
|
||||
opts.adapters = adapters
|
||||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>T","",desc=" Test"},
|
||||
|
@ -111,54 +373,54 @@ return {
|
|||
{ "<leader>Tt", function() require("neotest").run.stop() end, desc = "[t]est [t]erminate" },
|
||||
{ "<leader>Td", function() require("neotest").run.run({ suite = false, strategy = "dap" }) end, desc = "Debug nearest test" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {
|
||||
virt_text_win_col = 80,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("pcode.user.dapui")
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
|
||||
config = function()
|
||||
require("mason-nvim-dap").setup({
|
||||
automatic_installation = true,
|
||||
automatic_setup = true,
|
||||
handlers = {},
|
||||
ensure_installed = { "delve" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
opts = {
|
||||
virt_text_win_col = 80,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("pcode.user.dapui")
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
|
||||
config = function()
|
||||
require("mason-nvim-dap").setup({
|
||||
automatic_installation = true,
|
||||
automatic_setup = true,
|
||||
handlers = {},
|
||||
ensure_installed = { "delve" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
local M = {}
|
||||
local is_gradle = function()
|
||||
if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
M = {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
|
@ -49,26 +42,27 @@ M = {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
"andy-bell101/neotest-java",
|
||||
},
|
||||
enabled = is_gradle(),
|
||||
-- enabled = vim.fn.findfile("build.gradle", vim.fn.getcwd()) == "build.gradle" or false,
|
||||
config = function()
|
||||
require("auto-jdtls.create_maven_project")
|
||||
require("neotest").setup({
|
||||
adapters = {
|
||||
require("neotest-java"),
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>T","",desc=" Test"},
|
||||
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
|
||||
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
|
||||
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
|
||||
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
|
||||
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
||||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>T","",desc=" Test"},
|
||||
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
|
||||
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
|
||||
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
|
||||
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
|
||||
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
|
||||
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
|
||||
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
||||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"rockerBOO/symbols-outline.nvim",
|
||||
|
@ -112,38 +106,6 @@ M = {
|
|||
{ "<leader>Js", "<cmd>SymbolsOutline<cr>", desc = "Toggle Outline" },
|
||||
},
|
||||
},
|
||||
-- project.nvim [project search + auto cd]
|
||||
-- https://github.com/ahmedkhalf/project.nvim
|
||||
{
|
||||
"zeioth/project.nvim",
|
||||
cmd = "ProjectRoot",
|
||||
ft = { "java" },
|
||||
-- enabled = vim.fn.findfile("build.gradle", vim.fn.getcwd()) == "build.gradle" or false,
|
||||
opts = {
|
||||
-- How to find root directory
|
||||
patterns = {
|
||||
"build.gradle",
|
||||
"pom.xml",
|
||||
},
|
||||
-- Don't list the next projects
|
||||
exclude_dirs = {
|
||||
"~/",
|
||||
},
|
||||
silent_chdir = true,
|
||||
manual_mode = false,
|
||||
|
||||
-- Don't chdir for certain buffers
|
||||
exclude_chdir = {
|
||||
filetype = { "", "OverseerList", "alpha" },
|
||||
buftype = { "nofile", "terminal" },
|
||||
},
|
||||
|
||||
--ignore_lsp = { "lua_ls" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("project_nvim").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
47
lua/pcode/plugins/lang/java2.lua
Normal file
47
lua/pcode/plugins/lang/java2.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
return {
|
||||
"nvim-java/nvim-java",
|
||||
-- event = "VeryLazy",
|
||||
ft = { "java" },
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap",
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("java").setup({
|
||||
notifications = {
|
||||
dap = false,
|
||||
},
|
||||
jdk = {
|
||||
auto_install = false,
|
||||
},
|
||||
})
|
||||
require("lspconfig").jdtls.setup({
|
||||
settings = {
|
||||
java = {
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = "JavaSE-17",
|
||||
path = os.getenv("JAVA_HOME") or "",
|
||||
default = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>rg", "", desc = "Gradle" },
|
||||
{ "<leader>rgp", "<cmd>JavaProfile<cr>", desc = "Java Profile" },
|
||||
{ "<leader>rgg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle" },
|
||||
{ "<leader>rgb", "<cmd>JavaBuildBuildWorkspace<cr>", desc = "Java Build Workspace" },
|
||||
{ "<leader>rgd", "<cmd>JavaDapConfig<cr>", desc = "Java Configure DAP" },
|
||||
{ "<leader>T", "", desc = "Test" },
|
||||
{ "<leader>Tc", "<cmd>JavaTestRunCurrentClass<cr>", desc = "Test Current Class" },
|
||||
{ "<leader>Tm", "<cmd>JavaTestRunCurrentMethod<cr>", desc = "Test Current Method" },
|
||||
{ "<leader>Th", "<cmd>JavaTestViewLastReport<cr>", desc = "View Test Last Report" },
|
||||
},
|
||||
}
|
32
lua/pcode/plugins/lang/java4.lua
Normal file
32
lua/pcode/plugins/lang/java4.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
"nvim-java/nvim-java",
|
||||
-- ft = { "java" },
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap",
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
opts = {
|
||||
notifications = {
|
||||
dap = false,
|
||||
},
|
||||
jdk = {
|
||||
auto_install = false,
|
||||
},
|
||||
|
||||
-- NOTE: One of these files must be in your project root directory.
|
||||
-- Otherwise the debugger will end in the wrong directory and fail.
|
||||
root_markers = {
|
||||
"settings.gradle",
|
||||
"settings.gradle.kts",
|
||||
"pom.xml",
|
||||
"build.gradle",
|
||||
"mvnw",
|
||||
"gradlew",
|
||||
"build.gradle",
|
||||
"build.gradle.kts",
|
||||
".git",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,104 +1,103 @@
|
|||
local config_file = "jest.config.ts"
|
||||
local M = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(
|
||||
opts.ensure_installed,
|
||||
{ "html", "javascript", "typescript", "tsx", "css", "json", "jsonc" }
|
||||
)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "html", "eslint", "cssls", "emmet_ls", "jsonls", "ts_ls" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
local package = "prettier"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.javascript = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-neotest/neotest-jest",
|
||||
"nvim-neotest/nvim-nio",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-jest"] = {
|
||||
jestCommand = "npm test -- ",
|
||||
jestConfigFile = function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if string.find(file, "/packages/") then
|
||||
return string.match(file, "(.-/[^/]+/)src") .. config_file
|
||||
end
|
||||
return vim.fn.getcwd() .. "/" .. config_file
|
||||
end,
|
||||
cwd = function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if string.find(file, "/packages/") then
|
||||
return string.match(file, "(.-/[^/]+/)src")
|
||||
end
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
},
|
||||
status = { virtual_text = true },
|
||||
output = { open_on_run = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
-- Replace newline and tab characters with space for more compact diagnostics
|
||||
local message =
|
||||
diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||
return message
|
||||
end,
|
||||
},
|
||||
}, neotest_ns)
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "html", "javascript", "typescript", "tsx", "css", "json", "jsonc" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "html", "eslint", "cssls", "emmet_ls", "jsonls", "ts_ls" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
local package = "prettier"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.javascript = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-neotest/neotest-jest",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"marilari88/neotest-vitest",
|
||||
},
|
||||
ft = { "javascript", "typescript", "javascriptreact", "typescriptreact" },
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-jest"] = {
|
||||
jestCommand = "npm test -- ",
|
||||
jestConfigFile = function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if string.find(file, "/packages/") then
|
||||
return string.match(file, "(.-/[^/]+/)src") .. config_file
|
||||
end
|
||||
return vim.fn.getcwd() .. "/" .. config_file
|
||||
end,
|
||||
cwd = function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
if string.find(file, "/packages/") then
|
||||
return string.match(file, "(.-/[^/]+/)src")
|
||||
end
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
["neotest-vitest"] = {},
|
||||
},
|
||||
status = { virtual_text = true },
|
||||
output = { open_on_run = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
-- Replace newline and tab characters with space for more compact diagnostics
|
||||
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||
return message
|
||||
end,
|
||||
},
|
||||
}, neotest_ns)
|
||||
|
||||
opts.consumers = opts.consumers or {}
|
||||
if opts.adapters then
|
||||
local adapters = {}
|
||||
for name, config in pairs(opts.adapters or {}) do
|
||||
if type(name) == "number" then
|
||||
if type(config) == "string" then
|
||||
config = require(config)
|
||||
end
|
||||
adapters[#adapters + 1] = config
|
||||
elseif config ~= false then
|
||||
local adapter = require(name)
|
||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
||||
local meta = getmetatable(adapter)
|
||||
if adapter.setup then
|
||||
adapter.setup(config)
|
||||
elseif meta and meta.__call then
|
||||
adapter(config)
|
||||
else
|
||||
error("Adapter " .. name .. " does not support setup")
|
||||
end
|
||||
end
|
||||
adapters[#adapters + 1] = adapter
|
||||
end
|
||||
end
|
||||
opts.adapters = adapters
|
||||
end
|
||||
opts.consumers = opts.consumers or {}
|
||||
if opts.adapters then
|
||||
local adapters = {}
|
||||
for name, config in pairs(opts.adapters or {}) do
|
||||
if type(name) == "number" then
|
||||
if type(config) == "string" then
|
||||
config = require(config)
|
||||
end
|
||||
adapters[#adapters + 1] = config
|
||||
elseif config ~= false then
|
||||
local adapter = require(name)
|
||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
||||
local meta = getmetatable(adapter)
|
||||
if adapter.setup then
|
||||
adapter.setup(config)
|
||||
elseif meta and meta.__call then
|
||||
adapter(config)
|
||||
else
|
||||
error("Adapter " .. name .. " does not support setup")
|
||||
end
|
||||
end
|
||||
adapters[#adapters + 1] = adapter
|
||||
end
|
||||
end
|
||||
opts.adapters = adapters
|
||||
end
|
||||
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
require("neotest").setup(opts)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>T","",desc=" Test"},
|
||||
|
@ -111,92 +110,126 @@ local M = {
|
|||
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
|
||||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
{
|
||||
"mxsdev/nvim-dap-vscode-js",
|
||||
dependencies = {
|
||||
"microsoft/vscode-js-debug",
|
||||
version = "1.x",
|
||||
build = "npm i && npm run compile vsDebugServerBundle && mv dist out",
|
||||
},
|
||||
config = function()
|
||||
require("dap-vscode-js").setup({
|
||||
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
|
||||
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
|
||||
-- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
|
||||
adapters = {
|
||||
"chrome",
|
||||
"pwa-node",
|
||||
"pwa-chrome",
|
||||
"pwa-msedge",
|
||||
"node-terminal",
|
||||
"pwa-extensionHost",
|
||||
"node",
|
||||
"chrome",
|
||||
}, -- which adapters to register in nvim-dap
|
||||
-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
|
||||
-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
|
||||
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("pcode.user.dapui")
|
||||
local js_based_languages = { "typescript", "javascript", "typescriptreact" }
|
||||
},
|
||||
{
|
||||
"pojokcodeid/npm-runner.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
-- your opts go here
|
||||
opts = {
|
||||
command = {
|
||||
dev = {
|
||||
start = "NpmRunDev",
|
||||
stop = "NpmStopDev",
|
||||
cmd = "npm run dev",
|
||||
},
|
||||
prod = {
|
||||
start = "NpmStart",
|
||||
stop = "NpmStop",
|
||||
cmd = "npm start",
|
||||
},
|
||||
},
|
||||
opt = {
|
||||
show_mapping = "<leader>nm",
|
||||
hide_mapping = "<leader>nh",
|
||||
width = 70,
|
||||
height = 20,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>n", "", desc = " Npm" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("npm-runner").setup(opts.command, opts.opt)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
{
|
||||
"mxsdev/nvim-dap-vscode-js",
|
||||
dependencies = {
|
||||
"microsoft/vscode-js-debug",
|
||||
version = "1.x",
|
||||
build = "npm i && npm run compile vsDebugServerBundle && mv dist out",
|
||||
},
|
||||
config = function()
|
||||
require("dap-vscode-js").setup({
|
||||
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
|
||||
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
|
||||
-- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
|
||||
adapters = {
|
||||
"chrome",
|
||||
"pwa-node",
|
||||
"pwa-chrome",
|
||||
"pwa-msedge",
|
||||
"node-terminal",
|
||||
"pwa-extensionHost",
|
||||
"node",
|
||||
"chrome",
|
||||
}, -- which adapters to register in nvim-dap
|
||||
-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
|
||||
-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
|
||||
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("pcode.user.dapui")
|
||||
local js_based_languages = { "typescript", "javascript", "typescriptreact" }
|
||||
|
||||
for _, language in ipairs(js_based_languages) do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
request = "launch",
|
||||
name = 'Start Chrome with "localhost"',
|
||||
url = "http://localhost:3000",
|
||||
webRoot = "${workspaceFolder}",
|
||||
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir",
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
},
|
||||
},
|
||||
for _, language in ipairs(js_based_languages) do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
request = "launch",
|
||||
name = 'Start Chrome with "localhost"',
|
||||
url = "http://localhost:3000",
|
||||
webRoot = "${workspaceFolder}",
|
||||
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir",
|
||||
},
|
||||
}
|
||||
end
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,168 +1,136 @@
|
|||
local function get_default_package()
|
||||
local curr_file = vim.fn.expand("%:t")
|
||||
curr_file = curr_file:gsub(".kt", "")
|
||||
local path = vim.fn.expand("%:p:h")
|
||||
local project_root = vim.fn.getcwd()
|
||||
local relative_path = path:sub(#project_root + 1)
|
||||
relative_path = relative_path:gsub("app\\src\\test\\kotlin\\", "")
|
||||
relative_path = relative_path:gsub("app/src/test/kotlin/", "")
|
||||
relative_path = relative_path:gsub("\\", ".")
|
||||
relative_path = relative_path:gsub("/", ".")
|
||||
return relative_path:sub(2) .. "." .. curr_file
|
||||
end
|
||||
|
||||
return {
|
||||
-- install treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "kotlin" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "kotlin_language_server" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
local package = "ktfmt"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.kotlin = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
vim.list_extend(opts.ensure_installed, { "ktlint" })
|
||||
opts.linters_by_ft.kotlin = { "ktlint" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "kotlin-debug-adapter" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
},
|
||||
opts = function()
|
||||
require("pcode.user.dapui")
|
||||
local dap = require("dap")
|
||||
if not dap.adapters.kotlin then
|
||||
dap.adapters.kotlin = {
|
||||
type = "executable",
|
||||
command = "kotlin-debug-adapter",
|
||||
options = { auto_continue_if_many_stopped = false },
|
||||
}
|
||||
end
|
||||
-- install treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "kotlin" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "kotlin_language_server" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-conform.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
local package = "ktfmt"
|
||||
vim.list_extend(opts.ensure_installed, { package })
|
||||
opts.formatters_by_ft.kotlin = { package }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.linters_by_ft = opts.linters_by_ft or {}
|
||||
vim.list_extend(opts.ensure_installed, { "ktlint" })
|
||||
opts.linters_by_ft.kotlin = { "ktlint" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "kotlin-debug-adapter" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
lazy = true,
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
{ "mfussenegger/nvim-dap", lazy = true },
|
||||
{ "nvim-neotest/nvim-nio", lazy = true },
|
||||
},
|
||||
opts = function()
|
||||
require("pcode.user.dapui")
|
||||
local dap = require("dap")
|
||||
if not dap.adapters.kotlin then
|
||||
dap.adapters.kotlin = {
|
||||
type = "executable",
|
||||
command = "kotlin-debug-adapter",
|
||||
options = { auto_continue_if_many_stopped = false },
|
||||
}
|
||||
end
|
||||
|
||||
dap.configurations.kotlin = {
|
||||
{
|
||||
type = "kotlin",
|
||||
request = "launch",
|
||||
name = "This file",
|
||||
-- may differ, when in doubt, whatever your project structure may be,
|
||||
-- it has to correspond to the class file located at `build/classes/`
|
||||
-- and of course you have to build before you debug
|
||||
mainClass = function()
|
||||
local root = vim.uv.cwd()
|
||||
local fname = vim.api.nvim_buf_get_name(0)
|
||||
fname = fname:gsub(root, "")
|
||||
fname = fname:gsub("/app/src/main/kotlin/", "")
|
||||
fname = fname:gsub(".kt", "Kt"):gsub("/", ".")
|
||||
-- src/main/kotlin/websearch/Main.kt -> websearch.MainKt
|
||||
return fname
|
||||
end,
|
||||
projectRoot = "${workspaceFolder}",
|
||||
jsonLogFile = "",
|
||||
enableJsonLogging = false,
|
||||
},
|
||||
{
|
||||
-- Use this for unit tests
|
||||
-- First, run
|
||||
-- ./gradlew --info cleanTest test --debug-jvm
|
||||
-- then attach the debugger to it
|
||||
type = "kotlin",
|
||||
request = "attach",
|
||||
name = "Attach to debugging session",
|
||||
port = 5005,
|
||||
args = {},
|
||||
projectRoot = vim.fn.getcwd,
|
||||
hostName = "localhost",
|
||||
timeout = 2000,
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
-- setting cek
|
||||
-- https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle
|
||||
{ "<leader>T", "", desc = " Test" },
|
||||
{ "<leader>Ta", "<cmd>terminal gradle test<cr>", desc = "Run All" },
|
||||
{
|
||||
"<leader>Tu",
|
||||
function()
|
||||
local current_word = ""
|
||||
local input = vim.fn.getline(".")
|
||||
current_word = all_trim((input:gsub("class", "")):gsub("{", "")) -- hilangkan bagian class
|
||||
current_word = current_word:gsub("fun", "")
|
||||
current_word = current_word:gsub("%(%)", "")
|
||||
current_word = current_word:gsub("{", "")
|
||||
current_word = current_word:gsub("@Test", "")
|
||||
require("notify").notify(
|
||||
'gradle test --tests "' .. get_default_package() .. "." .. all_trim(current_word) .. '"',
|
||||
"info"
|
||||
)
|
||||
vim.fn.jobstart("gradle cleanTest", {
|
||||
on_exit = function()
|
||||
vim.cmd('terminal gradle test --tests "' .. get_default_package() .. "." .. all_trim(current_word) .. '"')
|
||||
end,
|
||||
})
|
||||
end,
|
||||
desc = "Run Under Cursor",
|
||||
},
|
||||
{
|
||||
"<leader>Tf",
|
||||
function()
|
||||
require("notify").notify('gradle test --tests "' .. get_default_package() .. '"', "info")
|
||||
vim.fn.jobstart("gradle cleanTest", {
|
||||
on_exit = function()
|
||||
vim.cmd('terminal gradle test --tests "' .. get_default_package() .. '"')
|
||||
end,
|
||||
})
|
||||
end,
|
||||
desc = "Run Current File",
|
||||
},
|
||||
{ "<leader>rg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle", mode = "n" },
|
||||
},
|
||||
},
|
||||
dap.configurations.kotlin = {
|
||||
{
|
||||
type = "kotlin",
|
||||
request = "launch",
|
||||
name = "This file",
|
||||
-- may differ, when in doubt, whatever your project structure may be,
|
||||
-- it has to correspond to the class file located at `build/classes/`
|
||||
-- and of course you have to build before you debug
|
||||
mainClass = function()
|
||||
local root = vim.uv.cwd()
|
||||
local fname = vim.api.nvim_buf_get_name(0)
|
||||
fname = fname:gsub(root, "")
|
||||
fname = fname:gsub("/app/src/main/kotlin/", "")
|
||||
fname = fname:gsub(".kt", "Kt"):gsub("/", ".")
|
||||
-- src/main/kotlin/websearch/Main.kt -> websearch.MainKt
|
||||
return fname
|
||||
end,
|
||||
projectRoot = "${workspaceFolder}",
|
||||
jsonLogFile = "",
|
||||
enableJsonLogging = false,
|
||||
},
|
||||
{
|
||||
-- Use this for unit tests
|
||||
-- First, run
|
||||
-- ./gradlew --info cleanTest test --debug-jvm
|
||||
-- then attach the debugger to it
|
||||
type = "kotlin",
|
||||
request = "attach",
|
||||
name = "Attach to debugging session",
|
||||
port = 5005,
|
||||
args = {},
|
||||
projectRoot = vim.fn.getcwd,
|
||||
hostName = "localhost",
|
||||
timeout = 2000,
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>d", "", desc = " Debug" },
|
||||
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
|
||||
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
|
||||
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
|
||||
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
|
||||
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
|
||||
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
|
||||
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
|
||||
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
|
||||
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
|
||||
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
|
||||
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
|
||||
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
|
||||
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
|
||||
-- setting cek
|
||||
-- https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle
|
||||
{ "<leader>T", "", desc = " Test" },
|
||||
{ "<leader>Ta", "<cmd>terminal gradle test<cr>", desc = "Run All" },
|
||||
{
|
||||
"<leader>Tu",
|
||||
function()
|
||||
-- local current_word = vim.fn.expand("<cword>")
|
||||
local current_word = ""
|
||||
local input = vim.fn.getline(".")
|
||||
current_word = all_trim((input:gsub("class", "")):gsub("{", "")) -- hilangkan bagian class
|
||||
current_word = current_word:gsub("fun", "")
|
||||
current_word = current_word:gsub("%(%)", "")
|
||||
current_word = current_word:gsub("{", "")
|
||||
current_word = current_word:gsub("@Test", "")
|
||||
vim.cmd("terminal gradle test --tests *." .. all_trim(current_word))
|
||||
end,
|
||||
desc = "Run Under Cursor",
|
||||
},
|
||||
{ "<leader>rg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle", mode = "n" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ return {
|
|||
lazy = true,
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>u", "", desc = " Notify" },
|
||||
{
|
||||
"<leader>uN",
|
||||
function()
|
||||
|
@ -19,7 +20,7 @@ return {
|
|||
max_width = function()
|
||||
return math.floor(vim.o.columns * 0.4)
|
||||
end,
|
||||
render = "wrapped-default",
|
||||
render = "wrapped-compact",
|
||||
-- background_colour = "#00000000",
|
||||
},
|
||||
config = function(_, opts)
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
return {
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
opts.map_lang = opts.map_lang or {}
|
||||
opts.map_name = opts.map_name or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-lint").setup(opts)
|
||||
end,
|
||||
"pojokcodeid/auto-lint.nvim",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-lint",
|
||||
},
|
||||
event = "BufRead",
|
||||
opts = function(_, opts)
|
||||
opts.map_lang = opts.map_lang or {}
|
||||
opts.map_name = opts.map_name or {}
|
||||
opts.add_new = opts.add_new or {}
|
||||
opts.ignore = opts.ignore or {}
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("auto-lint").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -6,9 +6,24 @@ return {
|
|||
},
|
||||
opts = function(_, opts)
|
||||
local icons = require("pcode.user.icons")
|
||||
opts.disable_netrw = true
|
||||
opts.hijack_cursor = true
|
||||
opts.auto_reload_on_write = false
|
||||
opts.disable_netrw = false
|
||||
opts.hijack_cursor = false
|
||||
opts.hijack_netrw = true
|
||||
opts.hijack_unnamed_buffer_when_opening = false
|
||||
opts.sync_root_with_cwd = true
|
||||
opts.sort = {
|
||||
sorter = "name",
|
||||
folders_first = true,
|
||||
files_first = false,
|
||||
}
|
||||
opts.root_dirs = {}
|
||||
opts.prefer_startup_root = false
|
||||
opts.sync_root_with_cwd = true
|
||||
opts.reload_on_bufenter = false
|
||||
opts.respect_buf_cwd = false
|
||||
opts.on_attach = "default"
|
||||
opts.select_prompts = false
|
||||
opts.update_focused_file = {
|
||||
enable = true,
|
||||
update_root = false,
|
||||
|
@ -112,6 +127,44 @@ return {
|
|||
return opts
|
||||
end,
|
||||
config = function(_, opts)
|
||||
if pcode.nvimtree_float then
|
||||
-- set nvimtree float view (default left side)
|
||||
opts.view = {
|
||||
adaptive_size = false,
|
||||
centralize_selection = true,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
float = {
|
||||
enable = true,
|
||||
open_win_config = function()
|
||||
local screen_w = vim.opt.columns:get()
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
|
||||
local window_w = screen_w * 0.5
|
||||
local window_h = screen_h * 0.9
|
||||
local window_w_int = math.floor(window_w)
|
||||
local window_h_int = math.floor(window_h)
|
||||
local center_x = (screen_w - window_w) / 2
|
||||
---@diagnostic disable-next-line: undefined-field
|
||||
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
|
||||
return {
|
||||
border = "rounded",
|
||||
relative = "editor",
|
||||
row = center_y,
|
||||
col = center_x,
|
||||
width = window_w_int,
|
||||
height = window_h_int,
|
||||
}
|
||||
end,
|
||||
},
|
||||
width = function()
|
||||
return math.floor(vim.opt.columns:get() * 0.5)
|
||||
end,
|
||||
}
|
||||
end
|
||||
require("nvim-tree").setup(opts)
|
||||
local api = require("nvim-tree.api")
|
||||
api.events.subscribe(api.events.Event.FileCreated, function(file)
|
||||
|
|
|
@ -36,11 +36,15 @@ return {
|
|||
operators = {},
|
||||
-- miscs = {}, -- Uncomment to turn off hard-coded styles
|
||||
},
|
||||
color_overrides = {},
|
||||
color_overrides = {
|
||||
all = {
|
||||
mantle = "#1e1e2e",
|
||||
},
|
||||
},
|
||||
custom_highlights = function(colors)
|
||||
return {
|
||||
NvimTreeNormal = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
NvimTreeWinSeparator = { fg = colors.mantle, bg = transparent and colors.none or colors.none },
|
||||
NvimTreeWinSeparator = { fg = "#181825", bg = transparent and colors.none or colors.none },
|
||||
Pmenu = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
WhichKeyFloat = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
WhichKey = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
|
@ -48,7 +52,9 @@ return {
|
|||
NormalFloat = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
Normal = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
NormalNC = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
StatusLine = { fg = colors.text, bg = colors.none },
|
||||
TabLine = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
StatusLine = { fg = colors.text, bg = transparent and colors.none or colors.base },
|
||||
MasonBackdrop = { link = "NormalFloat" },
|
||||
}
|
||||
end,
|
||||
highlight_overrides = {
|
||||
|
@ -60,6 +66,7 @@ return {
|
|||
},
|
||||
default_integrations = true,
|
||||
integrations = {
|
||||
bufferline = true,
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
|
|
|
@ -1,62 +1,63 @@
|
|||
return {
|
||||
"Mofiqul/dracula.nvim",
|
||||
priority = 1000,
|
||||
opts=function()
|
||||
local colors = require("dracula").colors()
|
||||
return{
|
||||
colors = {
|
||||
-- purple = "#FCC76A",
|
||||
menu = colors.bg,
|
||||
selection = "#363848",
|
||||
},
|
||||
italic_comment = true,
|
||||
lualine_bg_color = colors.bg,
|
||||
overrides = {
|
||||
Keywords = { fg = colors.cyan, italic = true },
|
||||
["@keyword"] = { fg = colors.pink, italic = true },
|
||||
["@keyword.function"] = { fg = colors.cyan, italic = true },
|
||||
["@function"] = { fg = colors.green, italic = true },
|
||||
["@tag.attribute"] = { fg = colors.green, italic = true },
|
||||
["@tag.builtin.javascript"] = { fg = colors.pink },
|
||||
["@tag.delimiter.javascript"] = { fg = colors.fg },
|
||||
["@type.javascript"] = { fg = colors.fg },
|
||||
["@property.css"] = { fg = colors.cyan },
|
||||
["@type.css"] = { fg = colors.green },
|
||||
["@tag.css"] = { fg = colors.pink },
|
||||
["@keyword.css"] = { fg = colors.fg },
|
||||
["@string.css"] = { fg = colors.pink },
|
||||
NvimTreeFolderIcon = { fg = "#6776a7" },
|
||||
CmpItemAbbr = { fg = "#ABB2BF" },
|
||||
CmpItemKind = { fg = "#ABB2BF" },
|
||||
CmpItemAbbrDeprecated = { fg = "#ABB2BF" },
|
||||
CmpItemAbbrMatch = { fg = "#8BE9FD" },
|
||||
htmlLink = { fg = "#BD93F9", underline = false },
|
||||
Underlined = { fg = "#8BE9FD" },
|
||||
NvimTreeSpecialFile = { fg = "#FF79C6" },
|
||||
SpellBad = { fg = "#FF6E6E" },
|
||||
illuminatedWord = { bg = "#3b4261" },
|
||||
illuminatedCurWord = { bg = "#3b4261" },
|
||||
IlluminatedWordText = { bg = "#3b4261" },
|
||||
IlluminatedWordRead = { bg = "#3b4261" },
|
||||
IlluminatedWordWrite = { bg = "#3b4261" },
|
||||
DiffChange = { fg = colors.fg },
|
||||
StatusLine = { fg = colors.fg, bg = colors.bg },
|
||||
StatusLineTerm = { fg = colors.fg, bg = colors.bg },
|
||||
BufferLineFill = { bg = colors.bg },
|
||||
Pmenu = { fg = colors.fg, bg = colors.bg },
|
||||
LspInfoBorder = { fg = colors.fg },
|
||||
LspReferenceText = { bg = "#3b4261" },
|
||||
LspReferenceRead = { bg = "#3b4261" },
|
||||
LspReferenceWrite = { bg = "#3b4261" },
|
||||
WinBar = { bg = colors.bg },
|
||||
WinBarNC = { fg = colors.fg, bg = colors.bg },
|
||||
},
|
||||
transparent_bg = false,
|
||||
}
|
||||
end,
|
||||
config = function(_,opts)
|
||||
require("dracula").setup(opts)
|
||||
local colorscheme = pcode.themes.dracula or "dracula"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
"Mofiqul/dracula.nvim",
|
||||
priority = 1000,
|
||||
opts = function()
|
||||
local colors = require("dracula").colors()
|
||||
return {
|
||||
colors = {
|
||||
-- purple = "#FCC76A",
|
||||
menu = colors.bg,
|
||||
selection = "#363848",
|
||||
},
|
||||
italic_comment = true,
|
||||
lualine_bg_color = colors.bg,
|
||||
overrides = {
|
||||
Keywords = { fg = colors.cyan, italic = true },
|
||||
["@keyword"] = { fg = colors.pink, italic = true },
|
||||
["@keyword.function"] = { fg = colors.cyan, italic = true },
|
||||
["@function"] = { fg = colors.green, italic = true },
|
||||
["@tag.attribute"] = { fg = colors.green, italic = true },
|
||||
["@tag.builtin.javascript"] = { fg = colors.pink },
|
||||
["@tag.delimiter.javascript"] = { fg = colors.fg },
|
||||
["@type.javascript"] = { fg = colors.fg },
|
||||
["@property.css"] = { fg = colors.cyan },
|
||||
["@type.css"] = { fg = colors.green },
|
||||
["@tag.css"] = { fg = colors.pink },
|
||||
["@keyword.css"] = { fg = colors.fg },
|
||||
["@string.css"] = { fg = colors.pink },
|
||||
NvimTreeFolderIcon = { fg = "#6776a7" },
|
||||
CmpItemAbbr = { fg = "#ABB2BF" },
|
||||
CmpItemKind = { fg = "#ABB2BF" },
|
||||
CmpItemAbbrDeprecated = { fg = "#ABB2BF" },
|
||||
CmpItemAbbrMatch = { fg = "#8BE9FD" },
|
||||
htmlLink = { fg = "#BD93F9", underline = false },
|
||||
Underlined = { fg = "#8BE9FD" },
|
||||
NvimTreeSpecialFile = { fg = "#FF79C6" },
|
||||
SpellBad = { fg = "#FF6E6E" },
|
||||
illuminatedWord = { bg = "#3b4261" },
|
||||
illuminatedCurWord = { bg = "#3b4261" },
|
||||
IlluminatedWordText = { bg = "#3b4261" },
|
||||
IlluminatedWordRead = { bg = "#3b4261" },
|
||||
IlluminatedWordWrite = { bg = "#3b4261" },
|
||||
DiffChange = { fg = colors.fg },
|
||||
StatusLine = { fg = colors.fg, bg = colors.bg },
|
||||
StatusLineTerm = { fg = colors.fg, bg = colors.bg },
|
||||
BufferLineFill = { bg = colors.bg },
|
||||
Pmenu = { fg = colors.fg, bg = colors.bg },
|
||||
LspInfoBorder = { fg = colors.fg },
|
||||
LspReferenceText = { bg = "#3b4261" },
|
||||
LspReferenceRead = { bg = "#3b4261" },
|
||||
LspReferenceWrite = { bg = "#3b4261" },
|
||||
WinBar = { bg = colors.bg },
|
||||
WinBarNC = { fg = colors.fg, bg = colors.bg },
|
||||
MasonBackdrop = { link = "NormalFloat" },
|
||||
},
|
||||
transparent_bg = false,
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("dracula").setup(opts)
|
||||
local colorscheme = pcode.themes.dracula or "dracula"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -21,7 +21,9 @@ return {
|
|||
hi(0, "WinBar", { bg = color.background })
|
||||
hi(0, "WinBarNC", { bg = color.background })
|
||||
hi(0, "NormalFloat", { bg = color.background })
|
||||
hi(0, "TabLine", { bg = color.background })
|
||||
hi(0, "NormalNC", { bg = color.background })
|
||||
hi(0, "MasonBackdrop", { link = "NormalFloat" })
|
||||
hi(0, "@tag.delimiter.javascript", { fg = color.punctuation })
|
||||
hi(0, "@tag.delimiter.tsx", { fg = color.punctuation })
|
||||
-- git
|
||||
|
|
|
@ -53,6 +53,7 @@ return {
|
|||
specs = {},
|
||||
groups = {
|
||||
all = {
|
||||
MasonBackdrop = { link = "NormalFloat" },
|
||||
illuminatedWord = { bg = "#3b4261" },
|
||||
illuminatedCurWord = { bg = "#3b4261" },
|
||||
IlluminatedWordText = { bg = "#3b4261" },
|
||||
|
|
|
@ -18,6 +18,7 @@ return {
|
|||
["FoldColumn"] = { bg = "NONE" },
|
||||
["Folded"] = { bg = "NONE" },
|
||||
["SignColumn"] = { bg = "NONE" },
|
||||
["MasonBackdrop"] = { link = "NormalFloat" },
|
||||
},
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -1,41 +1,42 @@
|
|||
return {
|
||||
"pojokcodeid/darcula-dark.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("darcula").setup({
|
||||
colors = {
|
||||
lavender = "#9876AA",
|
||||
statusline = "NONE",
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
local colors = require("darcula").colors()
|
||||
local hi = vim.api.nvim_set_hl
|
||||
hi(0, "@property.json", { fg = colors.lavender })
|
||||
hi(0, "@property.jsonc", { fg = colors.lavender })
|
||||
hi(0, "LineNr", { ctermfg = 11, fg = colors._39 })
|
||||
-- hi(0, "@variable.member.sql", { fg = colors.olive_green })
|
||||
-- telescope
|
||||
hi(0, "TelescopePromptBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopeResultsBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopePreviewBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopeSelection", { bg = colors.dark_charcoal_gray })
|
||||
hi(0, "TelescopeMultiSelection", { bg = colors.dark_charcoal_gray })
|
||||
hi(0, "TelescopeNormal", { bg = colors.dark })
|
||||
hi(0, "TelescopeMatching", { fg = colors.olive_green })
|
||||
hi(0, "TelescopePromptPrefix", { fg = colors.red })
|
||||
hi(0, "TelescopeResultsDiffDelete", { fg = colors.red })
|
||||
hi(0, "TelescopeResultsDiffChange", { fg = colors.bright_cyan })
|
||||
hi(0, "TelescopeResultsDiffAdd", { fg = colors.olive_green })
|
||||
hi(0, "TelescopePromptNormal", { bg = colors.dark, fg = colors.grey })
|
||||
hi(0, "TelescopePromptPrefix", { bg = colors.dark, fg = colors.red })
|
||||
hi(0, "TelescopeResultsTitle", { bg = colors.olive_green, fg = colors.very_dark_gray })
|
||||
end,
|
||||
})
|
||||
local colorscheme = pcode.themes.jetbrains or "darcula-dark"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
"pojokcodeid/darcula-dark.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("darcula").setup({
|
||||
colors = {
|
||||
lavender = "#9876AA",
|
||||
statusline = "NONE",
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
local colors = require("darcula").colors()
|
||||
local hi = vim.api.nvim_set_hl
|
||||
hi(0, "@property.json", { fg = colors.lavender })
|
||||
hi(0, "@property.jsonc", { fg = colors.lavender })
|
||||
hi(0, "LineNr", { ctermfg = 11, fg = colors._39 })
|
||||
-- hi(0, "@variable.member.sql", { fg = colors.olive_green })
|
||||
-- telescope
|
||||
hi(0, "TelescopePromptBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopeResultsBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopePreviewBorder", { fg = colors.medium_gray })
|
||||
hi(0, "TelescopeSelection", { bg = colors.dark_charcoal_gray })
|
||||
hi(0, "TelescopeMultiSelection", { bg = colors.dark_charcoal_gray })
|
||||
hi(0, "TelescopeNormal", { bg = colors.dark })
|
||||
hi(0, "TelescopeMatching", { fg = colors.olive_green })
|
||||
hi(0, "TelescopePromptPrefix", { fg = colors.red })
|
||||
hi(0, "TelescopeResultsDiffDelete", { fg = colors.red })
|
||||
hi(0, "TelescopeResultsDiffChange", { fg = colors.bright_cyan })
|
||||
hi(0, "TelescopeResultsDiffAdd", { fg = colors.olive_green })
|
||||
hi(0, "TelescopePromptNormal", { bg = colors.dark, fg = colors.grey })
|
||||
hi(0, "TelescopePromptPrefix", { bg = colors.dark, fg = colors.red })
|
||||
hi(0, "TelescopeResultsTitle", { bg = colors.olive_green, fg = colors.very_dark_gray })
|
||||
hi(0, "MasonBackdrop", { link = "NormalFloat" })
|
||||
end,
|
||||
})
|
||||
local colorscheme = pcode.themes.jetbrains or "darcula-dark"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,124 +1,125 @@
|
|||
return {
|
||||
"olimorris/onedarkpro.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local is_transparent = false
|
||||
require("onedarkpro").setup({
|
||||
styles = {
|
||||
types = "NONE",
|
||||
methods = "NONE",
|
||||
numbers = "NONE",
|
||||
strings = "NONE",
|
||||
comments = "italic",
|
||||
keywords = "bold,italic",
|
||||
constants = "NONE",
|
||||
functions = "italic",
|
||||
operators = "NONE",
|
||||
variables = "NONE",
|
||||
parameters = "NONE",
|
||||
conditionals = "italic",
|
||||
virtual_text = "NONE",
|
||||
tags = "italic",
|
||||
},
|
||||
colors = {
|
||||
bg_statusline = "#282c34",
|
||||
onedark = {
|
||||
green = "#99c379",
|
||||
gray = "#8094b4",
|
||||
red = "#e06c75",
|
||||
purple = "#c678dd",
|
||||
yellow = "#e5c07a",
|
||||
blue = "#61afef",
|
||||
cyan = "#56b6c2",
|
||||
indentline = "#3b4261",
|
||||
float_bg = "#282c34",
|
||||
},
|
||||
onedark_dark = {
|
||||
bg_statusline = "#000",
|
||||
},
|
||||
},
|
||||
options = {
|
||||
cursorline = true,
|
||||
transparency = is_transparent,
|
||||
terminal_colors = true,
|
||||
},
|
||||
highlights = {
|
||||
-- overide cursor line fill colors
|
||||
LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
|
||||
CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
|
||||
CursorLine = { bg = "#333842" },
|
||||
Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor
|
||||
lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
|
||||
CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM|
|
||||
CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||
-- overide nvimtree folder icon fill color
|
||||
NvimTreeFolderIcon = { fg = "${gray}" },
|
||||
-- overide nvimtree text fill color folder opened
|
||||
NvimTreeOpenedFolderName = { fg = "${blue}" },
|
||||
-- overide nvimtree text fill color root folder
|
||||
NvimTreeRootFolder = { fg = "${yellow}" },
|
||||
NvimTreeSpecialFile = { fg = "${orange}" },
|
||||
NvimTreeWinSeparator = { fg = "#202329" },
|
||||
NvimTreeIndentMarker = { fg = "#3E4450" },
|
||||
-- overide nvimtree cursorline
|
||||
NvimTreeCursorLine = { bg = "#333842" },
|
||||
-- overide indenline fill color
|
||||
IblIndent = { fg = "#3E4450" },
|
||||
-- overide cmp cursorline fill color with #333842
|
||||
PmenuSel = { bg = "#333842" },
|
||||
illuminatedWord = { bg = "#3b4261" },
|
||||
illuminatedCurWord = { bg = "#3b4261" },
|
||||
IlluminatedWordText = { bg = "#3b4261" },
|
||||
IlluminatedWordRead = { bg = "#3b4261" },
|
||||
IlluminatedWordWrite = { bg = "#3b4261" },
|
||||
StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" },
|
||||
StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" },
|
||||
BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" },
|
||||
["@string.special.url.html"] = { fg = "${green}" },
|
||||
["@lsp.type.parameter"] = { fg = "${gray}" },
|
||||
-- ["@text.uri.html"] = { fg = "${green}" },
|
||||
-- ["@tag.javascript"] = { fg = "${red}" },
|
||||
-- ["@tag.attribute"] = { fg = "${orange}", style = "italic" },
|
||||
-- ["@constructor.javascript"] = { fg = "${red}" },
|
||||
-- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names
|
||||
-- ["@variable.builtin"] = { fg = "${red}", style = "NONE" },
|
||||
-- ["@variable.member"] = "${cyan}",
|
||||
-- ["@variable.parameter"] = "${red}",
|
||||
-- ["@property"] = { fg = "${cyan}" }, -- similar to `@field`
|
||||
["@property.lua"] = { fg = "${red}", bg = "NONE" },
|
||||
["@lsp.type.property.lua"] = { fg = "${cyan}", bg = "NONE" },
|
||||
["@lsp.type.variable.lua"] = { fg = "${red}", bg = "NONE" },
|
||||
NvimTreeGitDirty = { fg = "${yellow}" },
|
||||
Pmenu = { fg = "${fg}", bg = "${bg}" },
|
||||
PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar.
|
||||
-- overide lualine fill color with bg color
|
||||
LualineNormal = { bg = "${bg}" },
|
||||
-- overide lualine_c fill color with bg color
|
||||
LualineC = { bg = "${bg}" },
|
||||
-- overide lualine_x fill color with bg color
|
||||
LualineX = { bg = "${bg}" },
|
||||
-- overide which-key fill color with bg color
|
||||
-- WhichKey = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeySeperator = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyDesc = { fg = "${red}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyFloat = { bg = "${bg}" },
|
||||
WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyValue = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyBorder = { bg = "${bg}" },
|
||||
LspInfoBorder = { fg = "${fg}" },
|
||||
NormalFloat = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
Normal = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
NormalNC = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
NonText = { bg = "NONE", fg = "#3E4450" },
|
||||
},
|
||||
})
|
||||
local colorscheme = pcode.themes.onedarkpro or "onedark"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
"olimorris/onedarkpro.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local is_transparent = false
|
||||
require("onedarkpro").setup({
|
||||
styles = {
|
||||
types = "NONE",
|
||||
methods = "NONE",
|
||||
numbers = "NONE",
|
||||
strings = "NONE",
|
||||
comments = "italic",
|
||||
keywords = "bold,italic",
|
||||
constants = "NONE",
|
||||
functions = "italic",
|
||||
operators = "NONE",
|
||||
variables = "NONE",
|
||||
parameters = "NONE",
|
||||
conditionals = "italic",
|
||||
virtual_text = "NONE",
|
||||
tags = "italic",
|
||||
},
|
||||
colors = {
|
||||
bg_statusline = "#282c34",
|
||||
onedark = {
|
||||
green = "#99c379",
|
||||
gray = "#8094b4",
|
||||
red = "#e06c75",
|
||||
purple = "#c678dd",
|
||||
yellow = "#e5c07a",
|
||||
blue = "#61afef",
|
||||
cyan = "#56b6c2",
|
||||
indentline = "#3b4261",
|
||||
float_bg = "#282c34",
|
||||
},
|
||||
onedark_dark = {
|
||||
bg_statusline = "#000",
|
||||
},
|
||||
},
|
||||
options = {
|
||||
cursorline = true,
|
||||
transparency = is_transparent,
|
||||
terminal_colors = true,
|
||||
},
|
||||
highlights = {
|
||||
-- overide cursor line fill colors
|
||||
LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
|
||||
CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
|
||||
CursorLine = { bg = "#333842" },
|
||||
Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor
|
||||
lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
|
||||
CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM|
|
||||
CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||
-- overide nvimtree folder icon fill color
|
||||
NvimTreeFolderIcon = { fg = "${gray}" },
|
||||
-- overide nvimtree text fill color folder opened
|
||||
NvimTreeOpenedFolderName = { fg = "${blue}" },
|
||||
-- overide nvimtree text fill color root folder
|
||||
NvimTreeRootFolder = { fg = "${yellow}" },
|
||||
NvimTreeSpecialFile = { fg = "${orange}" },
|
||||
NvimTreeWinSeparator = { fg = "#202329" },
|
||||
NvimTreeIndentMarker = { fg = "#3E4450" },
|
||||
-- overide nvimtree cursorline
|
||||
NvimTreeCursorLine = { bg = "#333842" },
|
||||
-- overide indenline fill color
|
||||
IblIndent = { fg = "#3E4450" },
|
||||
-- overide cmp cursorline fill color with #333842
|
||||
PmenuSel = { bg = "#333842" },
|
||||
illuminatedWord = { bg = "#3b4261" },
|
||||
illuminatedCurWord = { bg = "#3b4261" },
|
||||
IlluminatedWordText = { bg = "#3b4261" },
|
||||
IlluminatedWordRead = { bg = "#3b4261" },
|
||||
IlluminatedWordWrite = { bg = "#3b4261" },
|
||||
StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" },
|
||||
StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" },
|
||||
BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" },
|
||||
["@string.special.url.html"] = { fg = "${green}" },
|
||||
["@lsp.type.parameter"] = { fg = "${gray}" },
|
||||
-- ["@text.uri.html"] = { fg = "${green}" },
|
||||
-- ["@tag.javascript"] = { fg = "${red}" },
|
||||
-- ["@tag.attribute"] = { fg = "${orange}", style = "italic" },
|
||||
-- ["@constructor.javascript"] = { fg = "${red}" },
|
||||
-- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names
|
||||
-- ["@variable.builtin"] = { fg = "${red}", style = "NONE" },
|
||||
-- ["@variable.member"] = "${cyan}",
|
||||
-- ["@variable.parameter"] = "${red}",
|
||||
-- ["@property"] = { fg = "${cyan}" }, -- similar to `@field`
|
||||
["@property.lua"] = { fg = "${red}", bg = "NONE" },
|
||||
["@lsp.type.property.lua"] = { fg = "${cyan}", bg = "NONE" },
|
||||
["@lsp.type.variable.lua"] = { fg = "${red}", bg = "NONE" },
|
||||
NvimTreeGitDirty = { fg = "${yellow}" },
|
||||
Pmenu = { fg = "${fg}", bg = "${bg}" },
|
||||
PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar.
|
||||
-- overide lualine fill color with bg color
|
||||
LualineNormal = { bg = "${bg}" },
|
||||
-- overide lualine_c fill color with bg color
|
||||
LualineC = { bg = "${bg}" },
|
||||
-- overide lualine_x fill color with bg color
|
||||
LualineX = { bg = "${bg}" },
|
||||
-- overide which-key fill color with bg color
|
||||
-- WhichKey = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeySeperator = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyDesc = { fg = "${red}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyFloat = { bg = "${bg}" },
|
||||
WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyValue = { bg = "${bg}" },
|
||||
-- -- overide which-key fill color with bg color
|
||||
-- WhichKeyBorder = { bg = "${bg}" },
|
||||
LspInfoBorder = { fg = "${fg}" },
|
||||
NormalFloat = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
Normal = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
NormalNC = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||
NonText = { bg = "NONE", fg = "#3E4450" },
|
||||
MasonBackdrop = { link = "NormalFloat" },
|
||||
},
|
||||
})
|
||||
local colorscheme = pcode.themes.onedarkpro or "onedark"
|
||||
vim.cmd("colorscheme " .. colorscheme)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ return {
|
|||
-- custom hilights
|
||||
local hi = vim.api.nvim_set_hl
|
||||
hi(0, "FoldColumn", { bg = colors.bg2 })
|
||||
hi(0, "MasonBackdrop", { link = "NormalFloat" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
@ -71,6 +71,7 @@ return {
|
|||
highlights["@tag.attribute"] = { fg = colors.green1, italic = true }
|
||||
-- highlights["@keyword.function"] = { fg = colors.blue, italic = true }
|
||||
-- highlights["@function"] = { fg = colors.blue, italic = true }
|
||||
highlights.MasonBackdrop = { link = "NormalFloat" }
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
return {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
lazy = true,
|
||||
dependencies = "pojokcodeid/nvim-material-icon",
|
||||
opts = function()
|
||||
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
|
||||
if not material_icon_ok then
|
||||
return
|
||||
end
|
||||
material_icon.setup({
|
||||
override = {},
|
||||
})
|
||||
return {
|
||||
override = material_icon.get_icons(),
|
||||
override_by_filename = {},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("nvim-web-devicons").setup(opts)
|
||||
end,
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
lazy = true,
|
||||
dependencies = "pojokcodeid/nvim-material-icon",
|
||||
opts = function()
|
||||
local material_icon_ok, material_icon = pcall(require, "nvim-material-icon")
|
||||
if not material_icon_ok then
|
||||
return
|
||||
end
|
||||
material_icon.setup({
|
||||
override = {},
|
||||
})
|
||||
return {
|
||||
override = material_icon.get_icons(),
|
||||
override_by_filename = {},
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("nvim-web-devicons").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue