diff --git a/lazy-lock.json b/lazy-lock.json index 29bb773..f3b8fc2 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -15,6 +15,7 @@ "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, "friendly-snippets": { "branch": "main", "commit": "700c4a25caacbb4648c9a27972c2fe203948e0c2" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, + "inc-rename.nvim": { "branch": "main", "commit": "535b508c0cb14d00c1836ad901b3c531cb1152bb" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "lazy.nvim": { "branch": "main", "commit": "fafe1f7c640aed75e70a10e6649612cd96f39149" }, "lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" }, @@ -24,7 +25,7 @@ "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, "neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" }, - "noice.nvim": { "branch": "main", "commit": "29c7f030b0920e2f17263a9ab8742cde144b9140" }, + "noice.nvim": { "branch": "main", "commit": "b828b575805f1b303c2f4b768744609835140739" }, "none-ls-extras.nvim": { "branch": "main", "commit": "336e84b9e43c0effb735b08798ffac382920053b" }, "none-ls.nvim": { "branch": "main", "commit": "8691504118b252d64fc5023a104aedd100ab754a" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, @@ -37,18 +38,23 @@ "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, "nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" }, - "nvim-treesitter": { "branch": "master", "commit": "9a7ad2ff7a7ea81016aca2fc89c9b2c1a5365421" }, + "nvim-treesitter": { "branch": "master", "commit": "26171d8f105d97746371d1b6c07c8d88bf13fec2" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, - "nvim-ts-autotag": { "branch": "main", "commit": "2692808eca8a4ac3311516a1c4a14bb97ecc6482" }, + "nvim-ts-autotag": { "branch": "main", "commit": "06fe07d7523ba8c755fac7c913fceba43b1720ee" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, "playground": { "branch": "master", "commit": "bcfab84f98a33f2ad34dda6c842046dca70aabf6" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "12b1a1e095d968887a17ef791c2edb78d7595d46" }, + "refactoring.nvim": { "branch": "master", "commit": "d2786877c91aa409c824f27b4ce8a9f560dda60a" }, "smart-splits.nvim": { "branch": "master", "commit": "66fda3a601a5b4c679656f15eb6ddd613c8d3216" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "a7ab9a957b17199183388c6f357d614fcaa508e5" }, "telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "f3f136fd82eded0bd1e1870cf7dfab7e8c36801e" }, "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, + "vim-dadbod": { "branch": "master", "commit": "6f8b99868fd5560d6eb47f82ca76ec62e3d5ae78" }, + "vim-dadbod-completion": { "branch": "master", "commit": "5d5ad196fcde223509d7dabbade0148f7884c5e3" }, + "vim-dadbod-ui": { "branch": "master", "commit": "0dc68d9225a70d42f8645049482e090c1a8dce25" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" }, "vim-visual-multi": { "branch": "master", "commit": "b84a6d42c1c10678928b0bf8327f378c8bc8af5a" }, diff --git a/lua/custom/default.lua b/lua/custom/default.lua index 0e36729..fbd66f7 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -133,3 +133,5 @@ vim.g.pcode_columnline = true ---| "center" # retain the default telescope theme vim.g.pcode_telescope_theme_find_file = "center" vim.g.pcode_telescope_theme_live_grep = "dropdown" +-- https://github.com/kristijanhusak/vim-dadbod-ui +vim.g.pcode_database = true diff --git a/lua/custom/plugins/database.lua b/lua/custom/plugins/database.lua deleted file mode 100644 index e83e3ac..0000000 --- a/lua/custom/plugins/database.lua +++ /dev/null @@ -1,47 +0,0 @@ -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", - -- }, -} diff --git a/lua/custom/plugins/filebrowser.lua b/lua/custom/plugins/filebrowser.lua new file mode 100644 index 0000000..e494f25 --- /dev/null +++ b/lua/custom/plugins/filebrowser.lua @@ -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, + -- [""] = function(prompt_bufnr) + -- for i = 1, 10 do + -- actions.move_selection_previous(prompt_bufnr) + -- end + -- end, + -- [""] = 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, +} diff --git a/lua/custom/plugins/refactoring.lua b/lua/custom/plugins/refactoring.lua new file mode 100644 index 0000000..5eb54cb --- /dev/null +++ b/lua/custom/plugins/refactoring.lua @@ -0,0 +1,40 @@ +return { + -- Incremental rename + -- { + -- "smjonas/inc-rename.nvim", + -- cmd = "IncRename", + -- keys = { + -- { + -- "un", + -- function() + -- return ":IncRename " .. vim.fn.expand "" + -- end, + -- desc = "Incremental rename", + -- mode = "n", + -- noremap = true, + -- expr = true, + -- }, + -- }, + -- config = true, + -- }, + -- + -- -- Refactoring tool + -- { + -- "ThePrimeagen/refactoring.nvim", + -- keys = { + -- { + -- "r", + -- function() + -- require("refactoring").select_refactor { + -- show_success_message = true, + -- } + -- end, + -- mode = "v", + -- noremap = true, + -- silent = true, + -- expr = false, + -- }, + -- }, + -- opts = {}, + -- }, +} diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua new file mode 100644 index 0000000..b7562c7 --- /dev/null +++ b/lua/plugins/database.lua @@ -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 diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index 6677b57..2dfeeb1 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -1,31 +1,31 @@ return { - "rcarriga/nvim-notify", - lazy = true, - event = "VeryLazy", - keys = { - { - "un", - function() - require("notify").dismiss({ silent = true, pending = true }) - end, - desc = "Delete all Notifications", - }, - }, - opts = { - timeout = 3000, - max_height = function() - return math.floor(vim.o.lines * 0.75) - end, - max_width = function() - return math.floor(vim.o.columns * 0.75) - end, - }, - -- event = "BufWinEnter", - config = function() - local notify = require("notify") - -- this for transparency - notify.setup({ background_colour = "#000000" }) - -- this overwrites the vim notify function - vim.notify = notify.notify - end, + "rcarriga/nvim-notify", + lazy = true, + event = "VeryLazy", + keys = { + { + "un", + function() + require("notify").dismiss { silent = true, pending = true } + end, + desc = "Delete all Notifications", + }, + }, + opts = { + timeout = 3000, + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.75) + end, + }, + -- event = "BufWinEnter", + config = function() + local notify = require "notify" + -- this for transparency + notify.setup { background_colour = "#000000", render = "compact" } + -- this overwrites the vim notify function + vim.notify = notify.notify + end, } diff --git a/lua/user/colorscheme.lua b/lua/user/colorscheme.lua index 68091a2..8d4ac4e 100644 --- a/lua/user/colorscheme.lua +++ b/lua/user/colorscheme.lua @@ -6,7 +6,7 @@ elseif substring(tostring(colorscheme), "material") then colorscheme = "material" end -local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) -if not status_ok then - return +local ok, _ = pcall(vim.cmd.colorscheme, colorscheme) +if not ok then + require "notify"("Colorscheme '" .. colorscheme .. "' not found!", "error") end diff --git a/lua/user/utils/whichkey.lua b/lua/user/utils/whichkey.lua index 9ec37b4..b1b3414 100644 --- a/lua/user/utils/whichkey.lua +++ b/lua/user/utils/whichkey.lua @@ -282,6 +282,29 @@ if vim.g.pcode_codeium then table.insert(M.mappings, { ["c"] = { ":call codeium#Chat()", "󰭹 Codeium Chat" } }) end +if vim.g.pcode_database then + table.insert(M.mappings, { + ["D"] = { + name = " 󰆼 DBUI", + d = { "NvimTreeClosetabnewDBUI", "󰆼 DBUI Toggle" }, + q = { + "DBUICloseBufferLineCloseOthersbd!lua require('user.utils.bufferline').bufremove()Alpha", + "󰅙 DBUI Close", + }, + }, + }) + -- table.insert( + -- M.mappings, + -- { ["D"] = { "NvimTreeClosetabnewDBUI", "󰆼 DBUI Toggle" } } + -- ) + -- table.insert(M.mappings, { + -- ["x"] = { + -- "DBUICloselua require('user.utils.bufferline').bufremove()Alpha", + -- "󰆼 DBUI Toggle", + -- }, + -- }) +end + M.mappings2 = { ["/"] = { "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", " 󰆈 Commet Block" }, }