From aecda184accb02f62e38235ce4ed431387bca114 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 13 Aug 2024 21:37:51 +0545 Subject: [PATCH] many updates --- lua/plugins/barbar.lua | 9 +++++- lua/plugins/codeium.lua | 2 +- lua/plugins/colorschemes.lua | 2 +- lua/plugins/completions.lua | 20 +++++++++++- lua/plugins/dashboard.lua | 54 +++++++++++++++++++++++++++++++-- lua/plugins/dbee.lua | 32 +++++++++++++++++++ lua/plugins/lspconfig.lua | 39 ++++++++++++++++++++++-- lua/plugins/lualine.lua | 49 +++++++++++++++++++++++++++--- lua/plugins/markdown.lua | 12 -------- lua/plugins/none-ls.lua | 3 +- lua/plugins/notify.lua | 2 +- lua/plugins/nvim-surround.lua | 2 +- lua/plugins/nvim-treesitter.lua | 9 ++++-- 13 files changed, 203 insertions(+), 32 deletions(-) create mode 100644 lua/plugins/dbee.lua delete mode 100644 lua/plugins/markdown.lua diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua index 598eba3..7737d97 100644 --- a/lua/plugins/barbar.lua +++ b/lua/plugins/barbar.lua @@ -1,3 +1,10 @@ return { - "romgrk/barbar.nvim", + 'romgrk/barbar.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + 'lewis6991/gitsigns.nvim', + }, + config = function() + require('barbar').setup() + end, } diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua index 6ebd18b..0a490b9 100644 --- a/lua/plugins/codeium.lua +++ b/lua/plugins/codeium.lua @@ -1,6 +1,6 @@ return { 'Exafunction/codeium.vim', - event = 'BufEnter', + event = 'InsertEnter', cmd = 'Codeium', build = 'Codeium Auth:', dependencies = { diff --git a/lua/plugins/colorschemes.lua b/lua/plugins/colorschemes.lua index 23bfb0c..93ea128 100644 --- a/lua/plugins/colorschemes.lua +++ b/lua/plugins/colorschemes.lua @@ -1,6 +1,6 @@ return { 'navarasu/onedark.nvim', - + lazy = false, config = function() require('onedark').setup({ style = 'deep', diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index 094d769..d2af186 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -7,11 +7,12 @@ return { dependencies = { 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-cmdline', 'L3MON4D3/LuaSnip', 'rafamadriz/friendly-snippets', 'onsails/lspkind.nvim', }, - + event = 'InsertEnter', config = function() local cmp = require('cmp') local lspkind = require('lspkind') @@ -58,6 +59,23 @@ return { }), }, }) + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' }, + }, + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' }, + }, { + { name = 'cmdline' }, + }), + matching = { disallow_symbol_nonprefix_matching = false }, + }) end, }, } diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index 1059a66..054e1fe 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -1,10 +1,60 @@ return { 'nvimdev/dashboard-nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, event = 'VimEnter', config = function() require('dashboard').setup({ - -- config + theme = 'hyper', + disable_move = false, + shortcut_type = 'letter', + change_to_vcs_root = true, + hide = { + statusline = true, + tabline = false, + winbar = false, + }, + config = { + header = { + '', + + ' ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ', + ' ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ', + ' ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ', + ' ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ', + ' ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ', + ' ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ', + '', + }, + weak_header = { + enable = false, + append = { ' Learn, Make, Explore! ' }, + }, + packages = { enable = true }, + project = { enable = true, limit = 8 }, + mru = { limit = 8 }, + shortcut ={ + { + desc = ' Recent files', + group = 'Label', + action = 'Telescope oldfiles', + key = 'r', + }, + { + desc = ' Find file', + group = 'Label', + action = 'Telescope find_files', + key = 'f', + }, + { + desc = ' Find text', + group = 'Label', + action = 'Telescope live_grep', + key = 't', + }, + }, + }, }) end, - dependencies = { { 'nvim-tree/nvim-web-devicons' } }, } diff --git a/lua/plugins/dbee.lua b/lua/plugins/dbee.lua new file mode 100644 index 0000000..ebda5f1 --- /dev/null +++ b/lua/plugins/dbee.lua @@ -0,0 +1,32 @@ +return { + 'kndndrj/nvim-dbee', + dependencies = { + 'MunifTanjim/nui.nvim', + }, + build = function() + -- "curl", "wget", "bitsadmin", "go" + require('dbee').install(curl) + end, + cmd = 'DBToggle', + enabled = false, + + config = function() + require('dbee').setup({ + sources = { + require('dbee.sources').EnvSource:new('NVIM_DB'), + -- require("dbee.sources").MemorySource:new({ + -- { + -- name = "dbname", + -- type = "postgres", + -- url = "postgres://pguser:pguser@localhost:5602/dbname?sslmode=disable" + -- }, + -- }), + -- require("dbee.sources").FileSource:new(vim.fn.stdpath("cache") .. "/dbee/config.json"), + }, + }) + + vim.api.nvim_create_user_command('DBToggle', function() + require('dbee').toggle() + end, {}) + end, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 93b55b8..eac5a41 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -1,17 +1,52 @@ return { { 'williamboman/mason.nvim', - + cmd = 'Mason', + dependencies = { + 'williamboman/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + }, config = function() require('mason').setup() + require('mason-lspconfig').setup({ + ensure_installed = { + 'lua_ls', + 'clangd', + 'pylsp', + 'bashls', + 'jsonls', + 'vimls', + 'jdtls', + 'html', + 'cssls', + 'tailwindcss', + 'tsserver', + }, + }) + + require('mason-tool-installer').setup({ + ensure_installed = { + 'prettier', + 'stylua', + 'clang-format', + 'black', + 'gdformat', + 'djhtml', + }, + }) end, }, { 'neovim/nvim-lspconfig', + event = { 'BufReadPre', 'BufNewFile' }, config = function() local lspconfig = require('lspconfig') + local handlers = { + ['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'rounded' }), + ['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = 'rounded' }), + } local capabilities = require('cmp_nvim_lsp').default_capabilities() lspconfig.lua_ls.setup({ @@ -37,7 +72,7 @@ return { capabilities = capabilities, handlers = handlers, }) - lspconfig.biome.setup({ + lspconfig.tsserver.setup({ capabilities = capabilities, handlers = handlers, }) diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index ad65e37..fcf8a75 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,7 +1,46 @@ return { - 'nvim-lualine/lualine.nvim', - - config = function() - require('lualine').setup() - end, + 'nvim-lualine/lualine.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + config = function() + require('lualine').setup({ + options = { + icons_enabled = true, + theme = 'auto', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { 'filename' }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { 'filename' }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + }) + end, } diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua deleted file mode 100644 index 98cd7ab..0000000 --- a/lua/plugins/markdown.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "iamcco/markdown-preview.nvim", - ft = "markdown", - build = function() - vim.fn["mkdp#util#install"]() - end, - cmd = { - "MarkdownPreviewToggle", - "MarkdownPreview", - "MarkdownPreviewStop", - }, -} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index f17fb80..a5396e2 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -1,6 +1,6 @@ return { 'nvimtools/none-ls.nvim', - + event = { 'BufReadPre', 'BufNewFile' }, config = function() local null_ls = require('null-ls') @@ -12,7 +12,6 @@ return { null_ls.builtins.formatting.black, null_ls.builtins.formatting.gdformat, null_ls.builtins.formatting.djhtml, - null_ls.builtins.formatting.biome, }, }) end, diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index e19eb04..d7b98ee 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -1,6 +1,6 @@ return { 'rcarriga/nvim-notify', - + event = 'VeryLazy', config = function() vim.notify = require('notify') diff --git a/lua/plugins/nvim-surround.lua b/lua/plugins/nvim-surround.lua index d8014a7..29a6fa6 100644 --- a/lua/plugins/nvim-surround.lua +++ b/lua/plugins/nvim-surround.lua @@ -1,6 +1,6 @@ return { "kylechui/nvim-surround", - + event = { 'BufReadPre', 'BufNewFile' }, config = function() require("nvim-surround").setup() end, diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index 75601ba..6238aad 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -1,13 +1,16 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", - + dependencies = { + 'windwp/nvim-ts-autotag', + }, + event = { 'BufReadPre', 'BufNewFile' }, config = function() local configs = require("nvim-treesitter.configs") configs.setup({ - ensure_installed = { "c", "lua", "vim", "vimdoc", "python", "cpp", "html", "css", "javascript", "typescript", "json", "php" }, - sync_install = false, + ensure_installed = { "c", "lua", "vim", "vimdoc", "python", "cpp", "html", "css", "javascript", "typescript", "json", "php", "gdscript", 'markdown', 'markdown_inline', 'bash','java' }, + sync_install = true, highlight = { enable = true }, indent = { enable = true }, })