diff --git a/lua/plugins/auto-pairs.lua b/lua/plugins/auto-pairs.lua new file mode 100644 index 0000000..4a30ea8 --- /dev/null +++ b/lua/plugins/auto-pairs.lua @@ -0,0 +1,6 @@ +return { + 'altermo/ultimate-autopair.nvim', + event = { 'InsertEnter', 'CmdlineEnter' }, + branch = 'v0.6', + opts = {}, +} diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua new file mode 100644 index 0000000..598eba3 --- /dev/null +++ b/lua/plugins/barbar.lua @@ -0,0 +1,3 @@ +return { + "romgrk/barbar.nvim", +} diff --git a/lua/plugins/codeium.lua b/lua/plugins/codeium.lua new file mode 100644 index 0000000..6ebd18b --- /dev/null +++ b/lua/plugins/codeium.lua @@ -0,0 +1,25 @@ +return { + 'Exafunction/codeium.vim', + event = 'BufEnter', + cmd = 'Codeium', + build = 'Codeium Auth:', + dependencies = { + 'nvim-lua/plenary.nvim', + 'hrsh7th/nvim-cmp', + }, + + config = function() + vim.keymap.set('i', '', function() + return vim.fn['codeium#Accept']() + end, { expr = true, silent = true }) + vim.keymap.set('i', '', function() + return vim.fn['codeium#CycleCompletions'](1) + end, { expr = true, silent = true }) + vim.keymap.set('i', '', function() + return vim.fn['codeium#CycleCompletions'](-1) + end, { expr = true, silent = true }) + vim.keymap.set('i', '', function() + return vim.fn['codeium#Clear']() + end, { expr = true, silent = true }) + end, +} diff --git a/lua/plugins/colorschemes.lua b/lua/plugins/colorschemes.lua new file mode 100644 index 0000000..23bfb0c --- /dev/null +++ b/lua/plugins/colorschemes.lua @@ -0,0 +1,27 @@ +return { + 'navarasu/onedark.nvim', + + config = function() + require('onedark').setup({ + style = 'deep', + transparent = true, + term_colors = false, + ending_tildes = false, + cmp_itemkind_reverse = false, + -- toggle_style_key = 'ot', + -- toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' }, + + -- Options are italic, bold, underline, none and combos 'italic,bold' + code_style = { + comments = 'italic', + keywords = 'none', + functions = 'none', + strings = 'none', + variables = 'none', + }, + + lualine = { transparent = true }, + diagnostics = { darker = true, undercurl = true, background = false }, + }) + end, +} diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua new file mode 100644 index 0000000..094d769 --- /dev/null +++ b/lua/plugins/completions.lua @@ -0,0 +1,63 @@ +return { + { + 'hrsh7th/cmp-nvim-lsp', + }, + { + 'hrsh7th/nvim-cmp', + + dependencies = { + 'saadparwaiz1/cmp_luasnip', + 'L3MON4D3/LuaSnip', + 'rafamadriz/friendly-snippets', + 'onsails/lspkind.nvim', + }, + + config = function() + local cmp = require('cmp') + local lspkind = require('lspkind') + + cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + { name = 'codeium' }, + }, { + { name = 'buffer' }, + }), + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol', -- show only symbol annotations + maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) + -- can also be a function to dynamically calculate max width such as + -- maxwidth = function() return math.floor(0.45 * vim.o.columns) end, + ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) + show_labelDetails = true, -- show labelDetails in menu. Disabled by default + + -- The function below will be called before any actual modifications from lspkind + -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) + before = function(entry, vim_item) + return vim_item + end, + }), + }, + }) + end, + }, +} diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua new file mode 100644 index 0000000..1059a66 --- /dev/null +++ b/lua/plugins/dashboard.lua @@ -0,0 +1,10 @@ +return { + 'nvimdev/dashboard-nvim', + event = 'VimEnter', + config = function() + require('dashboard').setup({ + -- config + }) + end, + dependencies = { { 'nvim-tree/nvim-web-devicons' } }, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..e8e10be --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,6 @@ +return { + { + 'ThePrimeagen/harpoon', + lazy = true, + }, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..93b55b8 --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,46 @@ +return { + { + 'williamboman/mason.nvim', + + config = function() + require('mason').setup() + end, + }, + + { + 'neovim/nvim-lspconfig', + + config = function() + local lspconfig = require('lspconfig') + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + lspconfig.lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + globals = { 'vim' }, + }, + }, + }, + capabilities = capabilities, + handlers = handlers, + }) + + lspconfig.clangd.setup({ + capabilities = capabilities, + handlers = handlers, + }) + lspconfig.gdscript.setup({ + capabilities = capabilities, + }) + lspconfig.pyright.setup({ + capabilities = capabilities, + handlers = handlers, + }) + lspconfig.biome.setup({ + capabilities = capabilities, + handlers = handlers, + }) + end, + }, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..ad65e37 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + 'nvim-lualine/lualine.nvim', + + config = function() + require('lualine').setup() + end, +} diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua new file mode 100644 index 0000000..98cd7ab --- /dev/null +++ b/lua/plugins/markdown.lua @@ -0,0 +1,12 @@ +return { + "iamcco/markdown-preview.nvim", + ft = "markdown", + build = function() + vim.fn["mkdp#util#install"]() + end, + cmd = { + "MarkdownPreviewToggle", + "MarkdownPreview", + "MarkdownPreviewStop", + }, +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..2f59b44 --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -0,0 +1,9 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, +} diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua new file mode 100644 index 0000000..f17fb80 --- /dev/null +++ b/lua/plugins/none-ls.lua @@ -0,0 +1,19 @@ +return { + 'nvimtools/none-ls.nvim', + + config = function() + local null_ls = require('null-ls') + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.clang_format, + 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 new file mode 100644 index 0000000..e19eb04 --- /dev/null +++ b/lua/plugins/notify.lua @@ -0,0 +1,26 @@ +return { + 'rcarriga/nvim-notify', + + config = function() + vim.notify = require('notify') + + require('notify')('Welcome Back!') + require('notify').setup({ + background_colour = 'Normal', + fps = 30, + icons = { + DEBUG = ' ', + ERROR = ' ', + INFO = ' ', + TRACE = '✎', + WARN = ' ', + }, + level = 2, + minimum_width = 40, + maximum_width = 40, + render = 'wrapped-compact', + stages = 'slide', + timeout = 2000, + }) + end, +} diff --git a/lua/plugins/nvim-surround.lua b/lua/plugins/nvim-surround.lua new file mode 100644 index 0000000..d8014a7 --- /dev/null +++ b/lua/plugins/nvim-surround.lua @@ -0,0 +1,7 @@ +return { + "kylechui/nvim-surround", + + config = function() + require("nvim-surround").setup() + end, +} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..75601ba --- /dev/null +++ b/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,15 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + + 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, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..1c12961 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,40 @@ +vim.api.nvim_create_autocmd('FileType', { + pattern = 'oil', + callback = function() + vim.opt_local.colorcolumn = '' + end, +}) + +return { + { + 'stevearc/oil.nvim', + opts = {}, + -- Optional dependencies + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('oil').setup({ + use_default_keymaps = false, + keymaps = { + ['g?'] = 'actions.show_help', + [''] = 'actions.select', + [''] = 'actions.select_split', + [''] = 'actions.select_vsplit', -- this is used to navigate left + [''] = 'actions.select_tab', + [''] = 'actions.preview', + [''] = 'actions.close', + [''] = 'actions.refresh', + ['-'] = 'actions.parent', + ['_'] = 'actions.open_cwd', + ['`'] = 'actions.cd', + ['~'] = 'actions.tcd', + ['gs'] = 'actions.change_sort', + ['gx'] = 'actions.open_external', + ['g.'] = 'actions.toggle_hidden', + }, + view_options = { + show_hidden = false, + }, + }) + end, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..1527a6e --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,30 @@ +return { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build', + cond = vim.fn.executable('cmake') == 1, + }, + + config = function() + require('telescope').setup({ + pickers = { + colorscheme = { + enable_preview = true, + }, + }, + + defaults = { + layout_config = { + horizontal = { + preview_cutoff = 0, + }, + }, + }, + }) + -- Enable telescope fzf native, if installed + pcall(require('telescope').load_extension, 'fzf') + end, +} diff --git a/lua/plugins/toggle-term.lua b/lua/plugins/toggle-term.lua new file mode 100644 index 0000000..3714f51 --- /dev/null +++ b/lua/plugins/toggle-term.lua @@ -0,0 +1,9 @@ +return { + "akinsho/toggleterm.nvim", + + config = function () + require("toggleterm").setup({ + shade_terminals = false, + }) + end +} diff --git a/lua/plugins/wilder.lua b/lua/plugins/wilder.lua new file mode 100644 index 0000000..07aed5e --- /dev/null +++ b/lua/plugins/wilder.lua @@ -0,0 +1,42 @@ +return { + { + 'gelguy/wilder.nvim', + keys = { + ':', + '/', + '?', + }, + dependencies = { + 'catppuccin/nvim', + }, + config = function() + local wilder = require('wilder') + + -- Enable wilder when pressing :, / or ? + wilder.setup({ modes = { ':', '/', '?' } }) + + -- Enable fuzzy matching for commands and buffers + wilder.set_option('pipeline', { + wilder.branch( + wilder.cmdline_pipeline({ + fuzzy = 1, + }), + wilder.vim_search_pipeline({ + fuzzy = 1, + }) + ), + }) + + wilder.set_option( + 'renderer', + wilder.popupmenu_renderer(wilder.popupmenu_palette_theme({ + border = 'rounded', + max_height = '75%', + min_height = 0, + prompt_position = 'top', + reverse = 0, + })) + ) + end, + }, +} diff --git a/lua/preferences.lua b/lua/preferences.lua new file mode 100644 index 0000000..cf2c71a --- /dev/null +++ b/lua/preferences.lua @@ -0,0 +1,61 @@ +-- This file is automatically loaded by plugins.core +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +local opt = vim.opt +opt.number = true +opt.relativenumber = true +opt.expandtab = false +opt.tabstop = 6 +opt.shiftwidth = 6 +opt.wrap = false + +-- netrw file explorer settings +vim.g.netrw_winsize = 20 +vim.g.netrw_banner = 0 +vim.g.netrw_liststyle = 1 + +opt.cursorline = true -- Enable highlighting of the current line +opt.expandtab = true -- Use spaces instead of tabs +opt.breakindent = true +opt.clipboard = 'unnamedplus' -- allows neovim to access the system clipboard +opt.cmdheight = 1 -- more space in the neovim command line for displaying messages +opt.conceallevel = 0 -- so that `` is visible in markdown files +opt.hlsearch = true -- highlight all matches on previous search pattern +opt.ignorecase = true -- ignore case in search patterns +opt.inccommand = 'split' -- preview incremental substitute +opt.mouse = 'a' -- allow the mouse to be used in neovim +opt.numberwidth = 4 -- set number column width to 2 {default 4} +opt.scrolloff = 10 +opt.shiftround = true -- round indent +opt.shiftwidth = 4 -- the number of spaces inserted for each indentation +opt.showcmd = false +opt.showmode = false -- we don't need to see things like -- INSERT -- anymore +opt.showtabline = 0 -- always show tabs +opt.signcolumn = 'yes' -- always show the sign column, otherwise it would shift the text each timeout +opt.smartcase = true -- smart case +opt.smartindent = true -- make indenting smarter again +opt.smarttab = true +opt.splitbelow = true -- force all horizontal splits to go below current window +opt.splitright = true -- force all vertical splits to go right of the current window +opt.swapfile = false -- creastes a swapfile +opt.tabstop = 4 -- insert 2 spaces for a tab +opt.undofile = true -- enable persistent undofile +opt.undolevels = 10000 +opt.updatetime = 50 -- faster completion (4000ms default) +opt.writebackup = false -- donot edit backups +opt.backup = false -- creates a backup file +opt.autowrite = true +opt.autoindent = true +opt.ai = true + +-- Fix markdown indentation settings +vim.g.markdown_recommended_style = 0 + +vim.opt.path:append({ '**' }) +vim.opt.shortmess:append({ W = true, I = true, c = true }) + +-- hides `~` at the end of buffer +vim.cmd([[set fillchars+=eob:\ ]]) + +vim.cmd([[autocmd FileType * set formatoptions-=ro]])