mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-08-05 10:24:38 +02:00
Merge branch 'dev'
This commit is contained in:
commit
3f9b73de6a
19 changed files with 505 additions and 174 deletions
|
@ -31,9 +31,11 @@ Map("n", "zy", Toggle_breakpoint)
|
|||
Map("n", "yr", Copy_relative_path)
|
||||
Map("n", "yR", Copy_path)
|
||||
Map({ "n", "i", "v", "x" }, "<C-a>", Select_all)
|
||||
Map({ "n", "v", "x" }, "y", Copy_clipboard)
|
||||
Map({ "n", "v", "x" }, "p", Paste_clipboard)
|
||||
Map({ "n", "v", "x" }, "<C-s>", Save)
|
||||
Map({ "n", "v", "x", "i" }, "y", Copy_clipboard)
|
||||
Map({ "n", "v", "x", "i" }, "<C-c>", Copy_clipboard)
|
||||
Map({ "n", "v", "x", "i" }, "p", Paste_clipboard)
|
||||
Map({ "n", "v", "x", "i" }, "<C-v>", Paste_clipboard)
|
||||
Map({ "n", "v", "x", "i" }, "<C-s>", Save)
|
||||
Map({ "n" }, "q", Close)
|
||||
|
||||
Map("v", "gs", Codesnap)
|
||||
|
|
|
@ -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,6 +1,6 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
lazy = true,
|
||||
event = { "BufRead", "VeryLazy" },
|
||||
event = { "BufRead", "InsertEnter" },
|
||||
opts = {},
|
||||
}
|
||||
|
|
|
@ -91,7 +91,8 @@ return {
|
|||
},
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
event = "VeryLazy",
|
||||
-- event = "VeryLazy",
|
||||
event = "CmdlineEnter",
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local mapping = {
|
||||
|
|
|
@ -2,18 +2,30 @@ return {
|
|||
-- codeium cmp source
|
||||
{
|
||||
"nvim-cmp",
|
||||
event = "BufReadPre",
|
||||
dependencies = {
|
||||
-- codeium
|
||||
{
|
||||
"Exafunction/codeium.nvim",
|
||||
"Exafunction/windsurf.nvim",
|
||||
cmd = "Codeium",
|
||||
enabled = false,
|
||||
build = ":Codeium Auth",
|
||||
enabled = true,
|
||||
opts = {
|
||||
enable_chat = true,
|
||||
enable_cmp_source = true,
|
||||
virtual_text = {
|
||||
enabled = true,
|
||||
key_bindings = {
|
||||
accept = "<c-g>",
|
||||
next = "<c-Down>",
|
||||
prev = "<c-Up>",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("codeium").setup(opts)
|
||||
end,
|
||||
},
|
||||
},
|
||||
--@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, 1, {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local M = {
|
||||
"RRethy/vim-illuminate",
|
||||
event = "VeryLazy",
|
||||
event = "BufRead",
|
||||
}
|
||||
|
||||
M.opts = {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local M = {
|
||||
"SmiteshP/nvim-navic",
|
||||
event = "VeryLazy",
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
"LunarVim/breadcrumbs.nvim",
|
||||
opts = {},
|
||||
|
|
72
lua/pcode/plugins/extras/neocodeium.lua
Normal file
72
lua/pcode/plugins/extras/neocodeium.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
return {
|
||||
"monkoose/neocodeium",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local uv = vim.uv
|
||||
local fn = vim.fn
|
||||
local pummenu_timer = assert(uv.new_timer())
|
||||
local cmp = require("cmp")
|
||||
local neocodeium = require("neocodeium")
|
||||
local renderer = require("neocodeium.renderer")
|
||||
local completer = require("neocodeium.completer")
|
||||
local function is_noselect()
|
||||
local completeopt = vim.o.completeopt
|
||||
return completeopt:find("noselect") and -1 or 0
|
||||
end
|
||||
|
||||
local default_selected_compl = is_noselect()
|
||||
local selected_compl = default_selected_compl
|
||||
|
||||
-- if cmp menu_opened then neocodeium clear
|
||||
cmp.event:on("menu_opened", function()
|
||||
neocodeium.clear()
|
||||
end)
|
||||
neocodeium.setup({
|
||||
filter = function()
|
||||
return not cmp.visible()
|
||||
end,
|
||||
})
|
||||
|
||||
-- if cmp menu_is_closed then neocodeium activate
|
||||
cmp.event:on("menu_closed", function()
|
||||
local cur_selected = fn.complete_info({ "selected" }).selected
|
||||
if selected_compl == cur_selected then
|
||||
completer:initiate()
|
||||
else
|
||||
selected_compl = cur_selected
|
||||
completer:clear(true)
|
||||
renderer:display_label()
|
||||
pummenu_timer:stop()
|
||||
pummenu_timer:start(
|
||||
400,
|
||||
0,
|
||||
vim.schedule_wrap(function()
|
||||
if fn.pumvisible() == 1 then
|
||||
completer:initiate()
|
||||
end
|
||||
end)
|
||||
)
|
||||
end
|
||||
end)
|
||||
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)
|
||||
-- create user command CodeiumDiasable
|
||||
vim.api.nvim_create_user_command("CodeiumDisable", function()
|
||||
require("neocodeium.commands").disable(true)
|
||||
end, {})
|
||||
-- create user command CodeiumEnable
|
||||
vim.api.nvim_create_user_command("CodeiumEnable", function()
|
||||
require("neocodeium.commands").enable()
|
||||
end, {})
|
||||
end,
|
||||
}
|
1
lua/pcode/plugins/extras/showkeys.lua
Normal file
1
lua/pcode/plugins/extras/showkeys.lua
Normal file
|
@ -0,0 +1 @@
|
|||
return { "nvzone/showkeys", cmd = "ShowkeysToggle" }
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
--[[ "lukas-reineke/indent-blankline.nvim",
|
||||
-- version = "3.5.4",
|
||||
event = { "BufRead", "InsertEnter", "BufNewFile" },
|
||||
lazy = true,
|
||||
|
@ -35,5 +35,5 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
main = "ibl",
|
||||
main = "ibl", ]]
|
||||
}
|
||||
|
|
22
lua/pcode/plugins/indentline.lua
Normal file
22
lua/pcode/plugins/indentline.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"shellRaining/hlchunk.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("hlchunk").setup({
|
||||
chunk = {
|
||||
enable = true,
|
||||
-- ...
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
-- ...
|
||||
},
|
||||
exclude_filetypes = {
|
||||
aerial = true,
|
||||
dashboard = true,
|
||||
alpha = true,
|
||||
-- some other filetypes
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
149
lua/pcode/plugins/lang/kotlin_backup.lua
Normal file
149
lua/pcode/plugins/lang/kotlin_backup.lua
Normal file
|
@ -0,0 +1,149 @@
|
|||
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
|
||||
|
||||
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 function get_default_package()
|
||||
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)
|
||||
end
|
||||
local curr_file = vim.fn.expand("%:t")
|
||||
curr_file = curr_file:gsub("kt", "")
|
||||
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 " .. get_default_package() .. "." .. curr_file .. all_trim(current_word)
|
||||
)
|
||||
end,
|
||||
desc = "Run Under Cursor",
|
||||
},
|
||||
{ "<leader>rg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle", mode = "n" },
|
||||
},
|
||||
},
|
||||
}
|
13
lua/pcode/plugins/lspsignature.lua
Normal file
13
lua/pcode/plugins/lspsignature.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
bind = true,
|
||||
handler_opts = {
|
||||
border = "rounded",
|
||||
},
|
||||
hint_prefix = " ",
|
||||
},
|
||||
-- or use config
|
||||
-- config = function(_, opts) require'lsp_signature'.setup({you options}) end
|
||||
}
|
|
@ -2,9 +2,8 @@ return {
|
|||
"pojokcodeid/auto-lint.nvim",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
event = "BufRead",
|
||||
opts = function(_, opts)
|
||||
opts.map_lang = opts.map_lang or {}
|
||||
opts.map_name = opts.map_name or {}
|
||||
|
|
|
@ -49,7 +49,7 @@ return {
|
|||
filetypes = { "TelescopePrompt" },
|
||||
},
|
||||
---@type false | "classic" | "modern" | "helix"
|
||||
preset = "classic",
|
||||
preset = "modern",
|
||||
mappings = {
|
||||
{ "<leader>S", "", desc = " Plugins(Lazy)", mode = "n" },
|
||||
{ "<leader>Si", "<cmd>Lazy install<cr>", desc = "Install", mode = "n" },
|
||||
|
|
|
@ -18,7 +18,7 @@ return {
|
|||
opts = {
|
||||
-- for more options check out https://github.com/pojokcodeid/auto-lualine.nvim
|
||||
setColor = "auto",
|
||||
setOption = "roundedall",
|
||||
setOption = "parallelogram",
|
||||
setMode = 5,
|
||||
},
|
||||
},
|
||||
|
@ -40,7 +40,7 @@ return {
|
|||
-- install mason (lsp, dap, linters, formatters)
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = { ensure_installed = { "stylua" } },
|
||||
-- opts = { ensure_installed = { "stylua" } },
|
||||
},
|
||||
-- overide lsp config
|
||||
{
|
||||
|
@ -102,9 +102,9 @@ return {
|
|||
end,
|
||||
},
|
||||
-- custem nvimtree
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = function(_, opts)
|
||||
-- {
|
||||
-- "nvim-tree/nvim-tree.lua",
|
||||
-- opts = function(_, opts)
|
||||
-- set nvimtree float view (default left side)
|
||||
-- opts.view = {
|
||||
-- adaptive_size = false,
|
||||
|
@ -139,7 +139,7 @@ return {
|
|||
-- return math.floor(vim.opt.columns:get() * 0.5)
|
||||
-- end,
|
||||
-- }
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
-- return opts
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
|
|
@ -2,7 +2,8 @@ return {
|
|||
kind = {
|
||||
Boolean = "",
|
||||
Color = "",
|
||||
Codeium = "",
|
||||
-- Codeium = "",
|
||||
Codeium = "",
|
||||
Control = "",
|
||||
Collapsed = " ",
|
||||
Component = "",
|
||||
|
@ -43,6 +44,57 @@ return {
|
|||
Operator = "",
|
||||
TypeParameter = "",
|
||||
},
|
||||
kind2 = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Codeium = " ",
|
||||
Color = " ",
|
||||
Control = " ",
|
||||
Collapsed = " > ",
|
||||
-- Constant = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Copilot = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
-- Function = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
-- Keyword = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
-- Module = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = " ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
-- Snippet = " ",
|
||||
-- Snippet = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
TabNine = " ",
|
||||
-- Text = " ",
|
||||
-- Text = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
-- Variable = " ",
|
||||
Variable = " ",
|
||||
-- Variable = " ",
|
||||
},
|
||||
git = {
|
||||
LineAdded = "",
|
||||
LineModified = "",
|
||||
|
|
|
@ -71,3 +71,11 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
})
|
||||
|
||||
vim.opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20"
|
||||
|
||||
local uname = vim.loop.os_uname()
|
||||
if uname.sysname == "Windows_NT" then
|
||||
vim.opt.shell = "pwsh"
|
||||
vim.opt.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command"
|
||||
vim.opt.shellquote = ""
|
||||
vim.opt.shellxquote = ""
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue