mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 09:18:44 +02:00
Merge branch 'v2'
This commit is contained in:
commit
faebd74eff
14 changed files with 240 additions and 33 deletions
1
db_ui/connections.json
Normal file
1
db_ui/connections.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[{"url": "mysql://root@127.0.0.1/example", "name": "example"}]
|
|
@ -133,3 +133,5 @@ vim.g.pcode_columnline = true
|
||||||
---| "center" # retain the default telescope theme
|
---| "center" # retain the default telescope theme
|
||||||
vim.g.pcode_telescope_theme_find_file = "center"
|
vim.g.pcode_telescope_theme_find_file = "center"
|
||||||
vim.g.pcode_telescope_theme_live_grep = "dropdown"
|
vim.g.pcode_telescope_theme_live_grep = "dropdown"
|
||||||
|
-- https://github.com/kristijanhusak/vim-dadbod-ui
|
||||||
|
vim.g.pcode_database = true
|
||||||
|
|
16
lua/custom/plugins/eagle.lua
Normal file
16
lua/custom/plugins/eagle.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
-- "soulis-1256/eagle.nvim",
|
||||||
|
-- event = "BufRead",
|
||||||
|
-- config = function()
|
||||||
|
-- require("eagle").setup()
|
||||||
|
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "WinEnter" }, {
|
||||||
|
-- pattern = "*",
|
||||||
|
-- callback = function()
|
||||||
|
-- -- Aktifkan mousemoveevent untuk semua buffer kecuali NvimTree
|
||||||
|
-- if vim.fn.win_gettype() ~= "NvimTree" then
|
||||||
|
-- vim.o.mousemoveevent = true
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
}
|
60
lua/custom/plugins/filebrowser.lua
Normal file
60
lua/custom/plugins/filebrowser.lua
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
return {
|
||||||
|
-- "nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
-- dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- "sf",
|
||||||
|
-- function()
|
||||||
|
-- local telescope = require "telescope"
|
||||||
|
--
|
||||||
|
-- local function telescope_buffer_dir()
|
||||||
|
-- return vim.fn.expand "%:p:h"
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- telescope.extensions.file_browser.file_browser {
|
||||||
|
-- path = "%:p:h",
|
||||||
|
-- cwd = telescope_buffer_dir(),
|
||||||
|
-- respect_gitignore = false,
|
||||||
|
-- hidden = true,
|
||||||
|
-- grouped = true,
|
||||||
|
-- previewer = false,
|
||||||
|
-- initial_mode = "insert",
|
||||||
|
-- layout_config = { height = 40 },
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- desc = "Open File Browser with the path of the current buffer",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- config = function(_, opts)
|
||||||
|
-- local telescope = require "telescope"
|
||||||
|
-- local actions = require "telescope.actions"
|
||||||
|
-- local fb_actions = require("telescope").extensions.file_browser.actions
|
||||||
|
-- opts.extensions = {
|
||||||
|
-- file_browser = {
|
||||||
|
-- theme = "dropdown",
|
||||||
|
-- -- disables netrw and use telescope-file-browser in its place
|
||||||
|
-- hijack_netrw = true,
|
||||||
|
-- mappings = {
|
||||||
|
-- -- your custom insert mode mappings
|
||||||
|
-- ["n"] = {
|
||||||
|
-- -- your custom normal mode mappings
|
||||||
|
-- ["N"] = fb_actions.create,
|
||||||
|
-- ["h"] = fb_actions.goto_parent_dir,
|
||||||
|
-- ["<C-u>"] = function(prompt_bufnr)
|
||||||
|
-- for i = 1, 10 do
|
||||||
|
-- actions.move_selection_previous(prompt_bufnr)
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- ["<C-d>"] = function(prompt_bufnr)
|
||||||
|
-- for i = 1, 10 do
|
||||||
|
-- actions.move_selection_next(prompt_bufnr)
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- }
|
||||||
|
-- telescope.setup(opts)
|
||||||
|
-- require("telescope").load_extension "file_browser"
|
||||||
|
-- end,
|
||||||
|
}
|
40
lua/custom/plugins/refactoring.lua
Normal file
40
lua/custom/plugins/refactoring.lua
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
return {
|
||||||
|
-- Incremental rename
|
||||||
|
-- {
|
||||||
|
-- "smjonas/inc-rename.nvim",
|
||||||
|
-- cmd = "IncRename",
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- "<leader>un",
|
||||||
|
-- function()
|
||||||
|
-- return ":IncRename " .. vim.fn.expand "<cword>"
|
||||||
|
-- end,
|
||||||
|
-- desc = "Incremental rename",
|
||||||
|
-- mode = "n",
|
||||||
|
-- noremap = true,
|
||||||
|
-- expr = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- config = true,
|
||||||
|
-- },
|
||||||
|
--
|
||||||
|
-- -- Refactoring tool
|
||||||
|
-- {
|
||||||
|
-- "ThePrimeagen/refactoring.nvim",
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- "<leader>r",
|
||||||
|
-- function()
|
||||||
|
-- require("refactoring").select_refactor {
|
||||||
|
-- show_success_message = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- mode = "v",
|
||||||
|
-- noremap = true,
|
||||||
|
-- silent = true,
|
||||||
|
-- expr = false,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- opts = {},
|
||||||
|
-- },
|
||||||
|
}
|
|
@ -81,6 +81,13 @@ return {
|
||||||
text_align = "left",
|
text_align = "left",
|
||||||
padding = 1,
|
padding = 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
filetype = "dbui",
|
||||||
|
text = "",
|
||||||
|
highlight = "Directory",
|
||||||
|
text_align = "left",
|
||||||
|
padding = 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
show_buffer_close_icons = true,
|
show_buffer_close_icons = true,
|
||||||
|
|
|
@ -3,7 +3,9 @@ if vim.g.pcode_codeium then
|
||||||
M.codeium = {
|
M.codeium = {
|
||||||
"Exafunction/codeium.vim",
|
"Exafunction/codeium.vim",
|
||||||
enabled = true,
|
enabled = true,
|
||||||
version = "1.8.37",
|
-- for fix notwork new version
|
||||||
|
-- https://github.com/Exafunction/codeium.vim/issues/376#issuecomment-2159643405
|
||||||
|
-- version = "1.8.37",
|
||||||
event = "BufWinEnter",
|
event = "BufWinEnter",
|
||||||
-- event = "InsertEnter",
|
-- event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
52
lua/plugins/database.lua
Normal file
52
lua/plugins/database.lua
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
local M = {}
|
||||||
|
if vim.g.pcode_database then
|
||||||
|
return {
|
||||||
|
"kristijanhusak/vim-dadbod-ui",
|
||||||
|
dependencies = {
|
||||||
|
{ "tpope/vim-dadbod", lazy = true },
|
||||||
|
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- Your DBUI configuration
|
||||||
|
vim.g.db_ui_show_database_icon = 1
|
||||||
|
vim.g.db_ui_use_nerd_fonts = 1
|
||||||
|
vim.g.db_ui_show_help = 0
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
local function db_completion()
|
||||||
|
require("cmp").setup.buffer {
|
||||||
|
sources = { { name = "vim-dadbod-completion" } },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = {
|
||||||
|
"sql",
|
||||||
|
},
|
||||||
|
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = {
|
||||||
|
"sql",
|
||||||
|
"mysql",
|
||||||
|
"plsql",
|
||||||
|
},
|
||||||
|
callback = function()
|
||||||
|
vim.schedule(db_completion)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
cmd = {
|
||||||
|
"DBUIToggle",
|
||||||
|
"DBUI",
|
||||||
|
"DBUIAddConnection",
|
||||||
|
"DBUIFindBuffer",
|
||||||
|
"DBUIRenameBuffer",
|
||||||
|
"DBUILastQueryInfo",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
|
@ -6,7 +6,7 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>un",
|
"<leader>un",
|
||||||
function()
|
function()
|
||||||
require("notify").dismiss({ silent = true, pending = true })
|
require("notify").dismiss { silent = true, pending = true }
|
||||||
end,
|
end,
|
||||||
desc = "Delete all Notifications",
|
desc = "Delete all Notifications",
|
||||||
},
|
},
|
||||||
|
@ -22,9 +22,9 @@ return {
|
||||||
},
|
},
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
config = function()
|
config = function()
|
||||||
local notify = require("notify")
|
local notify = require "notify"
|
||||||
-- this for transparency
|
-- this for transparency
|
||||||
notify.setup({ background_colour = "#000000" })
|
notify.setup { background_colour = "#000000", render = "compact" }
|
||||||
-- this overwrites the vim notify function
|
-- this overwrites the vim notify function
|
||||||
vim.notify = notify.notify
|
vim.notify = notify.notify
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -20,6 +20,7 @@ if (color == "dracula") and true or false then
|
||||||
["@keyword"] = { fg = colors.pink, italic = true },
|
["@keyword"] = { fg = colors.pink, italic = true },
|
||||||
["@keyword.function"] = { fg = colors.cyan, italic = true },
|
["@keyword.function"] = { fg = colors.cyan, italic = true },
|
||||||
["@function"] = { fg = colors.green, italic = true },
|
["@function"] = { fg = colors.green, italic = true },
|
||||||
|
["@tag.attribute"] = { fg = colors.green, italic = true },
|
||||||
["@tag.builtin.javascript"] = { fg = colors.pink },
|
["@tag.builtin.javascript"] = { fg = colors.pink },
|
||||||
["@tag.delimiter.javascript"] = { fg = colors.fg },
|
["@tag.delimiter.javascript"] = { fg = colors.fg },
|
||||||
["@type.javascript"] = { fg = colors.fg },
|
["@type.javascript"] = { fg = colors.fg },
|
||||||
|
|
|
@ -118,6 +118,7 @@ if substring(tostring(color), "onedark") and true or false then
|
||||||
Normal = { 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}" },
|
NormalNC = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||||
FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" },
|
||||||
|
NonText = { bg = "NONE", fg = "#3E4450" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -6,7 +6,7 @@ elseif substring(tostring(colorscheme), "material") then
|
||||||
colorscheme = "material"
|
colorscheme = "material"
|
||||||
end
|
end
|
||||||
|
|
||||||
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
|
||||||
if not status_ok then
|
if not ok then
|
||||||
return
|
require "notify"("Colorscheme '" .. colorscheme .. "' not found!", "error")
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,6 +29,8 @@ M.filetype = {
|
||||||
"startuptime",
|
"startuptime",
|
||||||
"crunner",
|
"crunner",
|
||||||
"lspinfo",
|
"lspinfo",
|
||||||
|
"mysql",
|
||||||
|
"dbui",
|
||||||
}
|
}
|
||||||
|
|
||||||
M.rounded = function(colorscheme)
|
M.rounded = function(colorscheme)
|
||||||
|
|
|
@ -282,6 +282,29 @@ if vim.g.pcode_codeium then
|
||||||
table.insert(M.mappings, { ["c"] = { ":call codeium#Chat()<cr>", " Codeium Chat" } })
|
table.insert(M.mappings, { ["c"] = { ":call codeium#Chat()<cr>", " Codeium Chat" } })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if vim.g.pcode_database then
|
||||||
|
table.insert(M.mappings, {
|
||||||
|
["D"] = {
|
||||||
|
name = " DBUI",
|
||||||
|
d = { "<cmd>NvimTreeClose<cr><cmd>tabnew<cr><bar><bar><cmd>DBUI<cr>", " DBUI Toggle" },
|
||||||
|
q = {
|
||||||
|
"<cmd>DBUIClose<cr><cmd>BufferLineCloseOthers<cr><cmd>bd!<cr><cmd>lua require('user.utils.bufferline').bufremove()<cr><cmd>Alpha<cr>",
|
||||||
|
" DBUI Close",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
-- table.insert(
|
||||||
|
-- M.mappings,
|
||||||
|
-- { ["D"] = { "<cmd>NvimTreeClose<cr><cmd>tabnew<cr><bar><bar><cmd>DBUI<cr>", " DBUI Toggle" } }
|
||||||
|
-- )
|
||||||
|
-- table.insert(M.mappings, {
|
||||||
|
-- ["x"] = {
|
||||||
|
-- "<cmd>DBUIClose<cr><cmd>lua require('user.utils.bufferline').bufremove()<cr><cmd>Alpha<cr>",
|
||||||
|
-- " DBUI Toggle",
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
end
|
||||||
|
|
||||||
M.mappings2 = {
|
M.mappings2 = {
|
||||||
["/"] = { "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", " Commet Block" },
|
["/"] = { "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", " Commet Block" },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue