diff --git a/lazy-lock.json b/lazy-lock.json index 5f7ad537..664127b3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -8,18 +8,21 @@ "fidget.nvim": { "branch": "main", "commit": "7b9c383438a2e490e37d57b07ddeae3ab4f4cf69" }, "friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" }, "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "indent-blankline.nvim": { "branch": "master", "commit": "7206c77cb931f79885fc47f88ae18f99148392eb" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "neodev.nvim": { "branch": "main", "commit": "ef351fae5df2559956398923c5d38c9b64e7d898" }, + "nvim-autopairs": { "branch": "master", "commit": "096d0baecc34f6c5d8a6dd25851e9d5ad338209b" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, "nvim-lspconfig": { "branch": "master", "commit": "84f2dd42efffa20d505ac44c78568d778ca7e0a1" }, "nvim-treesitter": { "branch": "master", "commit": "ab818bf5a2ee21515ade9afcf428e98056b6197b" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ec1c5bdb3d87ac971749fa6c7dbc2b14884f1f6a" }, "oil.nvim": { "branch": "master", "commit": "24027ed8d7f3ee5c38cfd713915e2e16d89e79b3" }, - "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, @@ -27,5 +30,6 @@ "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/lua/plugins/autocompletion.lua b/lua/plugins/autocompletion.lua index d14bdfa6..f46633fe 100644 --- a/lua/plugins/autocompletion.lua +++ b/lua/plugins/autocompletion.lua @@ -12,38 +12,49 @@ return { -- Adds a number of user-friendly snippets 'rafamadriz/friendly-snippets', + + -- Auto-closing brackets, quotes, etc. + 'windwp/nvim-autopairs', }, config = function() + local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp = require 'cmp' local luasnip = require 'luasnip' + + require('nvim-autopairs').setup(); + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { - completeopt = 'menu,menuone,noinsert', - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, }, - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - }, + completion = { + completeopt = 'menu,menuone,noinsert', + }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + }, + experimental = { + ghost_text = true, + } } end } diff --git a/lua/plugins/catpuccin.lua b/lua/plugins/catpuccin.lua index ade84e6c..4e7767b5 100644 --- a/lua/plugins/catpuccin.lua +++ b/lua/plugins/catpuccin.lua @@ -1,4 +1,8 @@ -return { 'catppuccin/nvim', name='catppuccin', priority = 1000, +-- Default theme +return { + 'catppuccin/nvim', + name = 'catppuccin', + priority = 1000, config = function() require('catppuccin').setup({ flavour = "macchiato", @@ -8,6 +12,11 @@ return { 'catppuccin/nvim', name='catppuccin', priority = 1000, conditionals = { 'italic' }, }, integrations = { + cmp = true, + gitsigns = true, + harpoon = true, + mason = true, + telescope = true, treesitter = true, } }) diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index af264934..de7b9232 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,3 +1,4 @@ +-- UI for git commands return { 'tpope/vim-fugitive', config = function() vim.keymap.set('n', 'gs', 'Git', { desc = '[G]it [S]tatus' }); diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 9865461d..50f9d251 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,3 +1,4 @@ +-- Displays git changes in gutter return { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 00000000..38a16cfc --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,52 @@ +-- tag and quickly switch between buffers +return { + 'thePrimeagen/harpoon', + config = function() + local harpoon_mark = require('harpoon.mark') + local harpoon_ui = require("harpoon.ui") + + vim.keymap.set('n', 'ho', function() + harpoon_ui.toggle_quick_menu() + end, { desc = '[O]pen [H]arpoon' }) + + vim.keymap.set('n', 'ha', function() + harpoon_mark.add_file() + end, { desc = '[A]dd [H]arpoon file' }) + + vim.keymap.set('n', 'hr', function() + harpoon_mark.rm_file() + end, { desc = '[R]emove [H]arpoon file' }) + + vim.keymap.set('n', 'hc', function() + harpoon_mark.clear_all() + end, { desc = '[C]lear [H]arpoon files' }) + + vim.keymap.set('n', 'hl', function() + harpoon_ui.nav_next() + end, { desc = 'Next [H]arpoon file' }) + + vim.keymap.set('n', 'hh', function() + harpoon_ui.nav_prev() + end, { desc = 'Previous [H]arpoon file' }) + + vim.keymap.set('n', '1', function() + harpoon_ui.nav_file(1) + end, { desc = 'Navigate to file [1]' }) + + vim.keymap.set('n', '2', function() + harpoon_ui.nav_file(2) + end, { desc = 'Navigate to file [2]' }) + + vim.keymap.set('n', '3', function() + harpoon_ui.nav_file(3) + end, { desc = 'Navigate to file [3]' }) + + vim.keymap.set('n', '4', function() + harpoon_ui.nav_file(4) + end, { desc = 'Navigate to file [4]' }) + + vim.keymap.set('n', '5', function() + harpoon_ui.nav_file(5) + end, { desc = 'Navigate to file [5]' }) + end +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 7535e7a7..95b3ffa5 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -1,3 +1,4 @@ +-- Configuration for language servers local function keymaps(bufnr) local keymap = function(keys, func, desc) if desc then diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 074ea501..ef96d38b 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,12 +1,16 @@ +-- Informational status line at bottom of screen return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - opts = { - options = { - icons_enabled = false, - theme = 'onedark', + 'nvim-lualine/lualine.nvim', + opts = { + options = { + theme = 'catppuccin', component_separators = '|', section_separators = '', + }, + sections = { + lualine_c = { + { "filename", path = 1 } + } } } } diff --git a/lua/plugins/markdownpreview.lua b/lua/plugins/markdownpreview.lua new file mode 100644 index 00000000..5ea063bf --- /dev/null +++ b/lua/plugins/markdownpreview.lua @@ -0,0 +1,12 @@ +return { + 'iamcco/markdown-preview.nvim', + ft = 'markdown', + build = function() + vim.fn['mkdp#util#install']() + end, + cmd = { + 'MarkdownPreviewToggle', + 'MarkdownPreview', + 'MarkdownStop', + }, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 36593445..fe5a871d 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,6 +1,8 @@ -return { 'stevearc/oil.nvim', +-- file browser +return { + 'stevearc/oil.nvim', config = function() - require("oil").setup(); + require('oil').setup() vim.keymap.set('n', '-', 'Oil --float', { desc = 'Open current directory' }) end }; diff --git a/lua/plugins/rust.lua b/lua/plugins/rust.lua index e2a56aec..9fec3d2f 100644 --- a/lua/plugins/rust.lua +++ b/lua/plugins/rust.lua @@ -1,3 +1,4 @@ +-- rust language integrations return { 'rust-lang/rust.vim', ft = "rust", diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index aa12e1ca..c77ae8b6 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,3 +1,4 @@ +-- Fuzzy finder local function telescope_live_grep_open_files() require('telescope.builtin').live_grep { grep_open_files = true, diff --git a/lua/plugins/todocomments.lua b/lua/plugins/todocomments.lua index 2797ff53..e4ef92f9 100644 --- a/lua/plugins/todocomments.lua +++ b/lua/plugins/todocomments.lua @@ -1,3 +1,4 @@ +-- Comment highlighting for specific comment types (TODO, NOTE, HACK, FIX) return { 'folke/todo-comments.nvim', dependencies = { 'nvim-lua//plenary.nvim' }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 962f6466..246f6d4b 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,3 +1,4 @@ +-- code token highlighting local text_objects = { select = { enable = true, diff --git a/lua/plugins/vimsurround.lua b/lua/plugins/vimsurround.lua new file mode 100644 index 00000000..4f101a3a --- /dev/null +++ b/lua/plugins/vimsurround.lua @@ -0,0 +1,5 @@ +return { + { + 'tpope/vim-surround' + } +} diff --git a/lua/plugins/whichkey.lua b/lua/plugins/whichkey.lua index 2e7edbc9..f0a90b20 100644 --- a/lua/plugins/whichkey.lua +++ b/lua/plugins/whichkey.lua @@ -1,3 +1,4 @@ +-- displays command and key chain options and help return { 'folke/which-key.nvim', opts = {}, config = function() -- document existing key chains @@ -6,6 +7,7 @@ return { 'folke/which-key.nvim', opts = {}, ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, ['gh'] = { name = '[G]it [H]unk', _ = 'which_key_ignore' }, + ['h'] = { name = '[H]arpoon'}, ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, diff --git a/lua/settings.lua b/lua/settings.lua index d793e745..43f38458 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -9,9 +9,11 @@ vim.opt.incsearch = true -- Enable mouse mode vim.opt.mouse = '' --- FIX: shared clipboard not working -- Sync clipboard between OS and Neovim. -vim.opt.clipboard = 'unnamedplus' +vim.opt.clipboard = 'unnamed,unnamedplus' + +-- Enables cursor-line highlighting +vim.opt.cursorline = true -- Enable spell check vim.opt.spell = true