diff --git a/.DS_Store b/.DS_Store index f7962fe..08fd697 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/lazy-lock.json b/lazy-lock.json index d4edc82..84a192f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,29 +1,38 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" }, + "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, "barbar.nvim": { "branch": "master", "commit": "fb4369940a07dda35fa4d7f54cf4a36aa00440e6" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "dropbar.nvim": { "branch": "master", "commit": "ce202248134e3949aac375fd66c28e5207785b10" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "hover.nvim": { "branch": "main", "commit": "3b49066e09e03e63be6d6f43ae2b8bcd58301f63" }, "image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" }, - "lazy.nvim": { "branch": "main", "commit": "ed4dc336a73c18da6fea6e1cf7ad6e1b76d281eb" }, + "inc-rename.nvim": { "branch": "main", "commit": "2597bccb57d1b570fbdbd4adf88b955f7ade715b" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "35ec9e1425c2f9a36f556893336af4f302c63214" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, - "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, - "mini.nvim": { "branch": "main", "commit": "d1a91582bf2d16026ae84292874c70fb2d0ffe42" }, - "neo-tree.nvim": { "branch": "main", "commit": "fa61e064895d6eff509f5fcb7b2b77b195c4291f" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, + "mdx.nvim": { "branch": "main", "commit": "464a74be368dce212cff02f6305845dc7f209ab3" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.nvim": { "branch": "main", "commit": "b409fd1d8b9ea7ec7c0923eb2562b52ed5d1ab0a" }, + "neo-tree.nvim": { "branch": "main", "commit": "0bf326c601063a6518aa9a039b71351debb83d2f" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nord.nvim": { "branch": "main", "commit": "07647ad23e5b7fc1599a841dcd8f173b9aeb0419" }, - "notes.nvim": { "branch": "main", "commit": "d525da711fcf19461a6930d467782e5d26d7932b" }, + "notes.nvim": { "branch": "main", "commit": "bd5dcb67227bc2102887c3285cd3c0f27f1b20fe" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, - "nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" }, - "nvim-lspconfig": { "branch": "master", "commit": "2b52bc2190c8efde2e4de02d829a138666774c7c" }, + "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lspconfig": { "branch": "master", "commit": "b7c48a7111534b66bee077da8035ac7208a294ff" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, @@ -31,11 +40,12 @@ "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "presenting.nvim": { "branch": "main", "commit": "e78245995a09233e243bf48169b2f00dc76341f7" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "render-markdown.nvim": { "branch": "main", "commit": "bfd67f1402b97ac619cb538f4bbaed12a7fa89aa" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope.nvim": { "branch": "master", "commit": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "universal-clipboard.nvim": { "branch": "main", "commit": "48a625ab592633a05446ef66031611593a5b55d9" }, "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, - "vim-table-mode": { "branch": "master", "commit": "e156dbbedce0bbf61c0919db7678fa246fabd616" } + "vim-table-mode": { "branch": "master", "commit": "e156dbbedce0bbf61c0919db7678fa246fabd616" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 1165f8b..df403e2 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -13,20 +13,71 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then os.exit(1) end end +_G.vim = _G.vim or {} vim.opt.rtp:prepend(lazypath) -- Make sure to setup `mapleader` and `maplocalleader` before -- loading lazy.nvim so that mappings are correct. -- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Line numbers +vim.opt.number = true vim.opt.relativenumber = true -vim.opt.clipboard = "unnamedplus" +vim.opt.signcolumn = "yes" + +-- Tabs and indentation vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" +vim.opt.autoindent = true +vim.opt.smartindent = true + +-- Line wrapping +vim.opt.wrap = false +vim.opt.linebreak = true + +-- Search settings +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.hlsearch = true +vim.opt.incsearch = true + +-- Appearance +vim.opt.termguicolors = true +vim.opt.background = "dark" +vim.opt.cursorline = true +vim.opt.showmode = false + +-- Backspace +vim.opt.backspace = "indent,eol,start" + +-- Clipboard +vim.opt.clipboard = "unnamedplus" + +-- Split windows +vim.opt.splitright = true +vim.opt.splitbelow = true + +-- Folding vim.o.foldenable = true +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +vim.opt.foldlevelstart = 99 + +-- Better performance +vim.opt.updatetime = 250 +vim.opt.timeoutlen = 300 +vim.opt.undofile = true + +-- Completion +vim.opt.completeopt = "menu,menuone,noselect" + +-- Scrolling +vim.opt.scrolloff = 8 +vim.opt.sidescrolloff = 8 -- Setup lazy.nvim require("lazy").setup({ diff --git a/lua/config/plugin/comment.lua b/lua/config/plugin/comment.lua deleted file mode 100644 index e15de49..0000000 --- a/lua/config/plugin/comment.lua +++ /dev/null @@ -1,29 +0,0 @@ -require("Comment").setup({ - -- Add a space b/w comment and the line - padding = true, - -- Whether the cursor should stay at its position - sticky = true, - -- Lines to be ignored while (un)comment - ignore = nil, - -- LHS of toggle mappings in NORMAL mode - toggler = { - line = 'gcc', -- Line-comment toggle keymap - block = 'gbc', -- Block-comment toggle keymap - }, - -- LHS of operator-pending mappings in NORMAL and VISUAL mode - opleader = { - line = 'gc', -- Line-comment keymap - block = 'gb', -- Block-comment keymap - }, - -- LHS of extra mappings - extra = { - above = 'gcO', -- Add comment on the line above - below = 'gco', -- Add comment on the line below - eol = 'gcA', -- Add comment at the end of line - }, - -- Enable keybindings - mappings = { - basic = true, -- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` - extra = true, -- Extra mapping; `gco`, `gcO`, `gcA` - }, -}) diff --git a/lua/config/plugin/neo-tree.lua b/lua/config/plugin/neo-tree.lua deleted file mode 100644 index 1f2fa16..0000000 --- a/lua/config/plugin/neo-tree.lua +++ /dev/null @@ -1,27 +0,0 @@ -require("neo-tree").setup({ - close_if_last_window = true, - hijack_netrw_behavior = "disabled", - filesystem = { - filtered_items = { - hide_gitignored = true, - hide_hidden = true, - }, - follow_current_file = { enabled = true }, - }, - git_status = { - enable = true, - }, - window = { - position = "left", - auto_expand_width = false, - hijack_netrw_behavior = "disabled", - width = 35, - mappings = { - [""] = "toggle_node", - ["<2-LeftMouse>"] = "open", - ["e"] = function() vim.api.nvim_exec("Neotree focus filesystem", true) end, - ["g"] = function() vim.api.nvim_exec("Neotree focus git_status", true) end, - }, - }, -}) - diff --git a/lua/config/plugin/oil.lua b/lua/config/plugin/oil.lua deleted file mode 100644 index 718fce0..0000000 --- a/lua/config/plugin/oil.lua +++ /dev/null @@ -1,10 +0,0 @@ -require("oil").setup({ - default_file_explorer = true, - columns = { - "icon", - }, - keymaps = { - ["g."] = { "actions.toggle_hidden", mode = "n"} - } - -}) diff --git a/lua/config/plugin/render-markdown.lua b/lua/config/plugin/render-markdown.lua deleted file mode 100644 index caf2435..0000000 --- a/lua/config/plugin/render-markdown.lua +++ /dev/null @@ -1,73 +0,0 @@ -require("render-markdown").setup({ - completions = { lsp = { enabled = true } }, - - heading = { - enabled = true, - sign = false, - icons = { "󰲡 ", "󰲣 ", "󰲥 ", "󰲧 ", "󰲩 ", "󰲫 " }, - signs = { "▶"}, - left_pad = 0, - right_pad = 0, - width = "full", - min_width = 0, - border = true, - border_virtual = true, - above = "▄", - below = "▀", - }, - - code = { - enabled = true, - sign = true, - style = "full", - position = "left", - language_pad = 2, - disable_background = { "diff" }, - width = "full", - left_pad = 0, - right_pad = 0, - min_width = 0, - border = "thin", - above = "▄", - below = "▀", - highlight = "RenderMarkdownCode", - highlight_inline = "RenderMarkdownCodeInline", - }, - - win_options = { - conceallevel = { - default = vim.o.conceallevel, - rendered = 3, - }, - concealcursor = { - default = vim.o.concealcursor, - rendered = "n", - }, - }, -}) - --- Fix tab behavior in markdown files -vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - -- Override tab mapping in markdown files - vim.keymap.set("i", "", function() - -- Check if we're in a code block - local line = vim.api.nvim_get_current_line() - local col = vim.api.nvim_win_get_cursor(0)[2] - - -- If we're at the beginning of a line or after whitespace, insert tab - if col == 0 or line:sub(1, col):match("^%s*$") then - return "" - else - -- Otherwise, let completion handle it if available - if vim.fn.pumvisible() == 1 then - return "" - else - return "" - end - end - end, { expr = true, buffer = true }) - end, -}) - diff --git a/lua/config/plugin/statusbar.lua b/lua/config/plugin/statusbar.lua deleted file mode 100644 index 896d264..0000000 --- a/lua/config/plugin/statusbar.lua +++ /dev/null @@ -1,49 +0,0 @@ -require("lualine").setup { - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = { "NvimTree", "neo-tree", "alpha", "dashboard" }, - winbar = { "NvimTree", "neo-tree", "alpha", "dashboard" }, - }, - ignore_focus = { "NvimTree", "neo-tree" }, - always_divide_middle = true, - globalstatus = true, -- This makes lualine span the entire bottom - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = { "mode" }, -- Shows full text like "NORMAL", "INSERT", "VISUAL" - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { - "filename", - { - function() - return vim.b.table_mode_active == 1 and "[TABLE]" or "" - end, - color = { fg = "#98c379" }, -- Green color - }, - }, - 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 = { "nvim-tree", "neo-tree" } -} - diff --git a/lua/config/plugin/telescope.lua b/lua/config/plugin/telescope.lua deleted file mode 100644 index 4b107cc..0000000 --- a/lua/config/plugin/telescope.lua +++ /dev/null @@ -1,5 +0,0 @@ -require("telescope").setup({ - defaults = { - file_ignore_patterns = { "node_modules", ".git/" }, - }, -}) diff --git a/lua/config/plugin/treesitter.lua b/lua/config/plugin/treesitter.lua deleted file mode 100644 index 60d2b90..0000000 --- a/lua/config/plugin/treesitter.lua +++ /dev/null @@ -1,27 +0,0 @@ -require("nvim-treesitter.configs").setup({ - ensure_installed = { - "markdown", - "markdown_inline", - "lua", - "python", - "javascript", - "typescript", - "html", - "css", - "json", - "yaml", - "bash", - "vim", - "c", - "cpp", - "lua", - "go", - }, - highlight = { - enable = true, - additional_vim_regex_highlighting = { "markdown" }, - }, - indent = { - enable = true, - }, -}) diff --git a/lua/config/plugin/ufo.lua b/lua/config/plugin/ufo.lua deleted file mode 100644 index f517995..0000000 --- a/lua/config/plugin/ufo.lua +++ /dev/null @@ -1,22 +0,0 @@ --- Basic fold UI -vim.o.foldcolumn = '1' -vim.o.foldlevel = 99 -vim.o.foldlevelstart = 99 -vim.o.foldenable = true - --- Triangles for folds -vim.opt.fillchars = { - foldopen = "▼", - foldclose = "▶", - foldsep = " ", -} - -require("ufo").setup({ - provider_selector = function(bufnr, filetype, buftype) - if filetype == "markdown" then - return { "treesitter", "indent" } - end - return { "lsp", "indent" } - end, -}) - diff --git a/lua/plugins/autopairs.lua b/lua/plugins/autopairs.lua index ec37f18..350dd56 100644 --- a/lua/plugins/autopairs.lua +++ b/lua/plugins/autopairs.lua @@ -1,7 +1,80 @@ return { - "windwp/nvim-autopairs", - lazy = false, - priority = 1000, - event = "InsertEnter", - config = true, + 'windwp/nvim-autopairs', + event = "InsertEnter", + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + config = function() + local npairs = require('nvim-autopairs') + local Rule = require('nvim-autopairs.rule') + local cond = require('nvim-autopairs.conds') + + npairs.setup({ + check_ts = true, -- Enable treesitter integration + ts_config = { + lua = {'string', 'source'}, + kotlin = {'string', 'comment'}, + java = {'string', 'comment'}, + }, + disable_filetype = { "TelescopePrompt", "spectre_panel" }, + disable_in_macro = false, + disable_in_visualblock = false, + disable_in_replace_mode = true, + ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=], + enable_moveright = true, + enable_afterquote = true, + enable_check_bracket_line = false, + enable_bracket_in_quote = true, + enable_abbr = false, + break_undo = true, + map_cr = true, + map_bs = true, + map_c_h = false, + map_c_w = false, + + -- Fast wrap feature - press Alt+e to wrap selection + fast_wrap = { + map = '', + chars = { '{', '[', '(', '"', "'" }, + pattern = [=[[%'%"%>%]%)%}%,]]=], + offset = 0, + end_key = '$', + keys = 'qwertyuiopzxcvbnmasdfghjkl', + check_comma = true, + highlight = 'PmenuSel', + highlight_grey = 'LineNr' + }, + }) + + -- Custom rules for better Kotlin support + npairs.add_rules({ + -- Add spaces inside brackets for function calls + Rule(' ', ' ') + :with_pair(function(opts) + local pair = opts.line:sub(opts.col - 1, opts.col) + return vim.tbl_contains({ '()', '[]', '{}' }, pair) + end), + + -- Don't pair quotes after backslash + Rule('"', '"', 'kotlin') + :with_pair(cond.not_before_regex('\\', 1)), + + -- Smart pairing for lambda expressions + Rule('{', '}', 'kotlin') + :with_pair(function(opts) + -- Don't autopair if we're after forEach, let, etc. + local line = opts.line:sub(1, opts.col - 1) + if line:match('forEach%s*$') or line:match('let%s*$') or line:match('run%s*$') then + return false + end + return true + end), + }) + + -- Integration with nvim-cmp if you have it + local cmp_status_ok, cmp = pcall(require, "cmp") + if cmp_status_ok then + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end + end } + diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index b9cc79c..07610b9 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -2,6 +2,34 @@ return { "numToStr/Comment.nvim", event = { "BufReadPre", "BufNewFile" }, config = function() - require("config.plugin.comment") + require("Comment").setup({ + -- Add a space b/w comment and the line + padding = true, + -- Whether the cursor should stay at its position + sticky = true, + -- Lines to be ignored while (un)comment + ignore = nil, + -- LHS of toggle mappings in NORMAL mode + toggler = { + line = 'gcc', -- Line-comment toggle keymap + block = 'gbc', -- Block-comment toggle keymap + }, + -- LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + line = 'gc', -- Line-comment keymap + block = 'gb', -- Block-comment keymap + }, + -- LHS of extra mappings + extra = { + above = 'gcO', -- Add comment on the line above + below = 'gco', -- Add comment on the line below + eol = 'gcA', -- Add comment at the end of line + }, + -- Enable keybindings + mappings = { + basic = true, -- Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + extra = true, -- Extra mapping; `gco`, `gcO`, `gcA` + }, + }) end, } diff --git a/lua/plugins/css-colors.lua b/lua/plugins/css-colors.lua new file mode 100644 index 0000000..fb60742 --- /dev/null +++ b/lua/plugins/css-colors.lua @@ -0,0 +1,20 @@ +return { + "norcalli/nvim-colorizer.lua", + event = { "BufReadPost", "BufNewFile" }, -- load on file open + config = function() + require("colorizer").setup( + { "*" }, -- highlight colors in all files + { + RGB = true, -- #RGB + RRGGBB = true, -- #RRGGBB + names = true, -- CSS color names + RRGGBBAA = true, -- #RRGGBBAA + rgb_fn = true, -- css rgb() functions + hsl_fn = true, -- css hsl() functions + css = true, -- enable all css features + css_fn = true, -- enable all css functions + } + ) + end, +} + diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..8a3b72f --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,67 @@ +return { + "stevearc/dressing.nvim", + event = "VeryLazy", + config = function() + require("dressing").setup({ + input = { + enabled = true, + default_prompt = "Input:", + prompt_align = "left", + insert_only = true, + start_in_insert = true, + border = "rounded", + relative = "cursor", + prefer_width = 40, + width = nil, + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + win_options = { + winblend = 0, + wrap = false, + }, + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + }, + select = { + enabled = true, + backend = { "telescope", "builtin", "nui" }, + trim_prompt = true, + telescope = require("telescope.themes").get_dropdown({ + borderchars = { + prompt = { "─", "│", " ", "│", "╭", "╮", "│", "│" }, + results = { "─", "│", "─", "│", "├", "┤", "╯", "╰" }, + preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + }, + width = 0.8, + previewer = false, + prompt_title = false, + }), + builtin = { + border = "rounded", + relative = "editor", + win_options = { + winblend = 0, + cursorline = true, + cursorlineopt = "both", + }, + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + }, + }, + }) + end, +} diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua new file mode 100644 index 0000000..8c78af7 --- /dev/null +++ b/lua/plugins/flash.lua @@ -0,0 +1,46 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + opts = { + labels = "asdfghjklqwertyuiopzxcvbnm", + search = { + multi_window = true, + forward = true, + wrap = true, + mode = "exact", + incremental = false, + }, + jump = { + jumplist = true, + pos = "start", + history = false, + register = false, + nohlsearch = false, + autojump = false, + }, + label = { + uppercase = true, + rainbow = { + enabled = false, + shade = 5, + }, + }, + modes = { + search = { + enabled = true, + }, + char = { + enabled = true, + jump_labels = true, + multi_line = true, + }, + }, + }, + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/plugins/hover.lua b/lua/plugins/hover.lua new file mode 100644 index 0000000..29466a7 --- /dev/null +++ b/lua/plugins/hover.lua @@ -0,0 +1,28 @@ +return { + "lewis6991/hover.nvim", + config = function() + require("hover").setup { + init = function() + require("hover.providers.lsp") + require('hover.providers.diagnostic') + end, + preview_opts = { + border = 'rounded' + }, + preview_window = false, + title = true, + mouse_providers = { + 'LSP' + }, + mouse_delay = 1000 + } + + -- Setup the hover on keyboard + vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"}) + vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"}) + + -- Mouse hover + vim.keymap.set('n', '', require('hover').hover_mouse, { desc = "hover.nvim (mouse)" }) + vim.o.mousemoveevent = true + end +} diff --git a/lua/plugins/inc-rename.lua b/lua/plugins/inc-rename.lua new file mode 100644 index 0000000..4d3b090 --- /dev/null +++ b/lua/plugins/inc-rename.lua @@ -0,0 +1,9 @@ +return { + "smjonas/inc-rename.nvim", + cmd = "IncRename", + config = function() + require("inc_rename").setup({ + input_buffer_type = "dressing", + }) + end, +} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..de970f0 --- /dev/null +++ b/lua/plugins/indent-blankline.lua @@ -0,0 +1,36 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + event = { "BufReadPost", "BufNewFile" }, + config = function() + require("ibl").setup({ + indent = { + char = "│", + tab_char = "│", + }, + scope = { + enabled = true, + show_start = true, + show_end = false, + injected_languages = true, + highlight = { "Function", "Label" }, + priority = 500, + }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + }) + end, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 44db688..d75ca11 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -16,6 +16,7 @@ return { "pyright", "lua_ls", "ts_ls", + -- "kotlin_lsp", }, automatic_installation = true, }) @@ -23,22 +24,73 @@ return { }, { "neovim/nvim-lspconfig", - dependencies = { + dependencies = { "mason-org/mason-lspconfig.nvim", "hrsh7th/cmp-nvim-lsp", }, config = function() - local lspconfig = require("lspconfig") local cmp_nvim_lsp = require("cmp_nvim_lsp") + -- Enable mouse support + vim.o.mouse = 'a' + vim.o.mousemoveevent = true + local capabilities = cmp_nvim_lsp.default_capabilities() - -- Setup each server - vim.lsp.enable("gopls") - vim.lsp.enable("clangd") - vim.lsp.enable("pyright") - vim.lsp.enable("lua_ls") - vim.lsp.enable("ts_ls") + -- LSP keybindings and settings + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + local opts = { buffer = ev.buf } + + -- Navigation + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'rn', ':IncRename ', opts) + vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, opts) + end, + }) + + -- Configure diagnostic display + vim.diagnostic.config({ + virtual_text = true, + signs = false, -- Disable icons in sign column + underline = true, + update_in_insert = false, + severity_sort = true, + float = { + border = 'rounded', + source = 'always', + header = '', + prefix = '', + }, + }) + + -- Set up line number highlighting for diagnostics (no icons) + local signs = { Error = "", Warn = "", Hint = "", Info = "" } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = "", numhl = hl }) + end + + -- Setup each server using vim.lsp.config (new API in 0.11+) + local servers = { + "gopls", + "clangd", + "pyright", + "lua_ls", + "ts_ls", + -- "kotlin_lsp", + } + + for _, server in ipairs(servers) do + vim.lsp.config(server, { + capabilities = capabilities, + }) + vim.lsp.enable(server) + end end, }, } diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index e78d35d..f441b61 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -6,15 +6,81 @@ return { "nvim-mini/mini.nvim", }, config = function() - require("config.plugin.render-markdown") + require("render-markdown").setup({ + completions = { lsp = { enabled = true } }, + + heading = { + enabled = true, + sign = false, + icons = { "󰲡 ", "󰲣 ", "󰲥 ", "󰲧 ", "󰲩 ", "󰲫 " }, + signs = { "▶"}, + left_pad = 0, + right_pad = 0, + width = "full", + min_width = 0, + border = true, + border_virtual = true, + above = "▄", + below = "▀", + }, + + code = { + enabled = true, + sign = true, + style = "full", + position = "left", + language_pad = 2, + disable_background = { "diff" }, + width = "full", + left_pad = 0, + right_pad = 0, + min_width = 0, + border = "thin", + above = "▄", + below = "▀", + highlight = "RenderMarkdownCode", + highlight_inline = "RenderMarkdownCodeInline", + }, + + win_options = { + conceallevel = { + default = vim.o.conceallevel, + rendered = 3, + }, + concealcursor = { + default = vim.o.concealcursor, + rendered = "n", + }, + }, + }) + + -- Fix tab behavior in markdown files vim.api.nvim_create_autocmd("FileType", { pattern = "markdown", callback = function() vim.opt_local.spell = true vim.opt_local.spelllang = "en_us" + + -- Override tab mapping in markdown files + vim.keymap.set("i", "", function() + -- Check if we're in a code block + local line = vim.api.nvim_get_current_line() + local col = vim.api.nvim_win_get_cursor(0)[2] + + -- If we're at the beginning of a line or after whitespace, insert tab + if col == 0 or line:sub(1, col):match("^%s*$") then + return "" + else + -- Otherwise, let completion handle it if available + if vim.fn.pumvisible() == 1 then + return "" + else + return "" + end + end + end, { expr = true, buffer = true }) end, }) - end, }, { diff --git a/lua/plugins/mdx.lua b/lua/plugins/mdx.lua new file mode 100644 index 0000000..e0f4f63 --- /dev/null +++ b/lua/plugins/mdx.lua @@ -0,0 +1,6 @@ +return { + 'davidmh/mdx.nvim', + config = function() + require('mdx').setup() + end +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..7575579 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,73 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + hover = { + enabled = false, -- We're using hover.nvim + }, + signature = { + enabled = true, + auto_open = { + enabled = true, + trigger = true, + luasnip = true, + throttle = 50, + }, + }, + }, + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + views = { + cmdline_popup = { + position = { + row = "50%", + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + }, + popupmenu = { + relative = "editor", + position = { + row = "55%", + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + }) + end, +} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua new file mode 100644 index 0000000..9e2f21d --- /dev/null +++ b/lua/plugins/notify.lua @@ -0,0 +1,27 @@ +return { + "rcarriga/nvim-notify", + event = "VeryLazy", + config = function() + local notify = require("notify") + notify.setup({ + background_colour = "#000000", + fps = 60, + icons = { + DEBUG = "", + ERROR = "", + INFO = "", + TRACE = "✎", + WARN = "" + }, + level = 2, + minimum_width = 50, + render = "compact", + stages = "fade_in_slide_out", + timeout = 3000, + top_down = true, + }) + + -- Set nvim-notify as the default notification handler + vim.notify = notify + end, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 4f3c47b..e0020b3 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -2,10 +2,17 @@ return { "stevearc/oil.nvim", ---@module "oil" ---@module oil.setupOpts - opts = {}, dependencies = { "nvim-mini/mini.icons" }, lazy = false, config = function() - require("config.plugin.oil") + require("oil").setup({ + default_file_explorer = true, + columns = { + "icon", + }, + keymaps = { + ["g."] = { "actions.toggle_hidden", mode = "n"} + } + }) end, } diff --git a/lua/plugins/statusbar.lua b/lua/plugins/statusbar.lua index d23caa0..43d5ca4 100644 --- a/lua/plugins/statusbar.lua +++ b/lua/plugins/statusbar.lua @@ -2,6 +2,53 @@ return { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() - require("config.plugin.statusbar") + require("lualine").setup { + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = { "NvimTree", "neo-tree", "alpha", "dashboard" }, + winbar = { "NvimTree", "neo-tree", "alpha", "dashboard" }, + }, + ignore_focus = { "NvimTree", "neo-tree" }, + always_divide_middle = true, + globalstatus = true, -- This makes lualine span the entire bottom + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + sections = { + lualine_a = { "mode" }, -- Shows full text like "NORMAL", "INSERT", "VISUAL" + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { + "filename", + { + function() + return vim.b.table_mode_active == 1 and "[TABLE]" or "" + end, + color = { fg = "#98c379" }, -- Green color + }, + }, + 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 = { "nvim-tree", "neo-tree" } + } end, } diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 4141811..5916d93 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -2,6 +2,10 @@ return { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" }, config = function() - require("config.plugin.telescope") + require("telescope").setup({ + defaults = { + file_ignore_patterns = { "node_modules", ".git/" }, + }, + }) end, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 933481e..c251bc0 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -2,6 +2,34 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() - require("config.plugin.treesitter") + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "markdown", + "markdown_inline", + "lua", + "python", + "javascript", + "typescript", + "html", + "css", + "json", + "yaml", + "bash", + "vim", + "c", + "cpp", + "lua", + "go", + "kotlin", + "java" + }, + highlight = { + enable = true, + additional_vim_regex_highlighting = { "markdown", "mdx" }, + }, + indent = { + enable = true, + }, + }) end, } diff --git a/lua/plugins/ufo.lua b/lua/plugins/ufo.lua index e763080..605e7e0 100644 --- a/lua/plugins/ufo.lua +++ b/lua/plugins/ufo.lua @@ -3,6 +3,26 @@ return { dependencies = "kevinhwang91/promise-async", lazy = false, config = function() - require("config.plugin.ufo") + -- Basic fold UI + vim.o.foldcolumn = '1' + vim.o.foldlevel = 99 + vim.o.foldlevelstart = 99 + vim.o.foldenable = true + + -- Triangles for folds + vim.opt.fillchars = { + foldopen = "▼", + foldclose = "▶", + foldsep = " ", + } + + require("ufo").setup({ + provider_selector = function(bufnr, filetype, buftype) + if filetype == "markdown" then + return { "treesitter", "indent" } + end + return { "lsp", "indent" } + end, + }) end } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 816c956..c17a2c9 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -9,7 +9,32 @@ return { "MunifTanjim/nui.nvim", }, config = function() - require("config.plugin.neo-tree") + require("neo-tree").setup({ + close_if_last_window = true, + hijack_netrw_behavior = "disabled", + filesystem = { + filtered_items = { + hide_gitignored = true, + hide_hidden = true, + }, + follow_current_file = { enabled = true }, + }, + git_status = { + enable = true, + }, + window = { + position = "left", + auto_expand_width = false, + hijack_netrw_behavior = "disabled", + width = 35, + mappings = { + [""] = "toggle_node", + ["<2-LeftMouse>"] = "open", + ["e"] = function() vim.api.nvim_exec("Neotree focus filesystem", true) end, + ["g"] = function() vim.api.nvim_exec("Neotree focus git_status", true) end, + }, + }, + }) end, }, } diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..1b8b520 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,25 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + preset = "modern", + delay = 300, + win = { + border = "rounded", + padding = { 1, 2 }, + }, + layout = { + spacing = 3, + }, + spec = { + { "c", group = "code" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "r", group = "rename" }, + { "t", group = "toggle/table" }, + { "g", group = "goto" }, + { "[", group = "prev" }, + { "]", group = "next" }, + }, + }, +}