[
  {
    "path": "01 - Introduction/01 - Introduction.md",
    "content": "# Introduction to Neovim\n\n## Why Do I Use Neovim?\n\n## Why Do I Use Neovim?\n\n- I find it very satisfying to make things just the way I like\n- It makes my day more fun - both hacking on it and eliminating frustrations\n- I like modal editing - it clicks with my brain.\n\n## How to Use Neovim?\n\n- Download and/or Package Manager:\n    - https://neovim.io/doc/\n- Build From Source:\n    - https://github.com/neovim/neovim/blob/master/BUILD.md\n\n## First Configuration:\n\n- Open `$HOME/.config/nvim/init.lua`\n- `print(\"Hello World\")` in `init.lua`\n- Re-open Neovim, check `:messages`\n\n## Reload Configuration:\n\n- `:source %`\n- `:lua ...` or `:'<,'>lua`\n"
  },
  {
    "path": "02 - Tutor and Modal Editing/02 - Tutor and Modal Editing.md",
    "content": "# Vim Tutor: Explained\n\n## First\n\n- You have to actually practice\n- Don't just listen to me\n\n## How to practice?\n\nOpen Neovim.\n\n`:Tutor`\n\n## How to practice?\n\n> But it's confusing?!\n\nOk, I will do it with you :)\n"
  },
  {
    "path": "03 - Lua Crash Course/03 - Lua Crash Course.md",
    "content": "# Lua Crash Course\n\n## Table of Contents\n\n- Comments\n- Variables\n- Control Flow\n- Modules\n- Functions\n- Metatables\n- Bonus :)\n\n## Background Info\n\nLua is elegant\n\n- Lua uses \"Mechanisms over Policies\"\n- Lua is designed to be embedded\n- Lua is cool\n\n## Comments\n\n```lua\n-- This is a comment. It starts with two dashes\n\n--[[ This is also\n     a comment.\n\n     But it spans multiple lines!\n--]]\n```\n\n## Variables: Simple Literals\n\n```lua\nlocal number = 5\n\nlocal string = \"hello, world\"\nlocal single = 'also works'\nlocal crazy = [[ This\n is multi line and literal ]]\n\nlocal truth, lies = true, false\n\nlocal nothing = nil\n```\n\n## Variables: Functions\n\n```lua\nlocal function hello(name)\n  print(\"Hello!\", name)\nend\n\nlocal greet = function(name)\n  -- .. is string concatenation\n  print(\"Greetings, \" .. name .. \"!\")\nend\n```\n\n## Variables: Functions\n\n```lua\nlocal higher_order = function(value)\n  return function(another)\n    return value + another\n  end\nend\n\nlocal add_one = higher_order(1)\nprint(\"add_one(2) -> \", add_one(2))\n```\n\n## Variables: Tables\n\nEffectively, Lua's only data structure.\n- Same structure is used for maps & lists\n\n## Variables: Tables\n\nAs a list...\n\n```lua\nlocal list = { \"first\", 2, false, function() print(\"Fourth!\") end }\nprint(\"Yup, 1-indexed:\", list[1])\nprint(\"Fourth is 4...:\", list[4]())\n```\n## Variables: Tables\n\nAs a map...\n\n```lua\nlocal t = {\n  literal_key = \"a string\",\n  [\"an expression\"] = \"also works\",\n  [function() end] = true\n}\n\nprint(\"literal_key   : \", t.literal_key)\nprint(\"an expression : \", t[\"an expression\"])\nprint(\"function() end: \", t[function() end])\n```\n\n## Variables: Not Covered\n\n- Thread\n- Userdata\n\n## Control Flow: `for`\n\n```lua\nlocal favorite_accounts = { \"teej_dv\", \"ThePrimeagen\", \"terminaldotshop\" }\nfor index = 1, #favorite_accounts do\n  print(index, favorite_accounts[index])\nend\n\nfor index, value in ipairs(favorite_accounts) do\n  print(index, value)\nend\n```\n\n## Control Flow: `for`\n\n```lua\nlocal reading_scores = { teej_dv = 10, ThePrimeagen = \"N/A\" }\nfor index = 1, #reading_scores do\n  print(reading_scores[index])\nend\n```\n\nDoesn't Print Anything - the \"length\" of the array is 0.\n\nWe aren't using it as an array, we're using it as a map!\n\n\n## Control Flow: `for`\n\n```lua\nlocal reading_scores = { teej_dv = 9.5, ThePrimeagen = \"N/A\" }\nfor key, value in pairs(reading_scores) do\n  print(key, value)\nend\n```\n\n## Control Flow: `if`\n\n```lua\nlocal function action(loves_coffee)\n  if loves_coffee then\n    print(\"Check out `ssh terminal.shop` - it's cool!\")\n  else\n    print(\"Check out `ssh terminal.shop` - it's still cool!\")\n  end\nend\n\n-- \"falsey\": nil, false\naction() -- Same as: action(nil)\naction(false)\n\n-- Everything else is \"truthy\"\naction(true)\naction(0)\naction({})\n```\n\n## Modules\n\nThere isn't anything special about modules.\nModules are just files!\n\n```lua\n-- foo.lua\nlocal M = {}\nM.cool_function = function() end\nreturn M\n```\n\n```lua\n-- bar.lua\nlocal foo = require('foo')\nfoo.cool_function()\n```\n\n## Functions: Multiple Returns\n\n```lua\nlocal returns_four_values = function()\n  return 1, 2, 3, 4\nend\n\nfirst, second, last = returns_four_values()\n\nprint(\"first: \", first)\nprint(\"second:\", second)\nprint(\"last:  \", last)\n-- the `4` is discarded :'(\n```\n\n## Functions: Multiple Returns\n\n```lua\nlocal variable_arguments = function(...)\n  local arguments = { ... }\n  for i, v in ipairs({...}) do print(i, v) end\n  return unpack(arguments)\nend\n\nprint(\"===================\")\nprint(\"1:\", variable_arguments(\"hello\", \"world\", \"!\"))\nprint(\"===================\")\nprint(\"2:\", variable_arguments(\"hello\", \"world\", \"!\"), \"<lost>\")\n```\n\n## Functions: Calling\n\nString Shorthand\n\n```lua\nlocal single_string = function(s)\n  return s .. \" - WOW!\"\nend\n\nlocal x = single_string(\"hi\")\nlocal y = single_string \"hi\"\nprint(x, y)\n```\n\n## Functions: Calling\n\nTable Shorthand\n\n```lua\nlocal setup = function(opts)\n  if opts.default == nil then\n    opts.default = 17\n  end\n\n  print(opts.default, opts.other)\nend\n\nsetup { default = 12, other = false}\nsetup { other = true}\n```\n\n## Functions: Colon Functions\n\n```lua\nlocal MyTable = {}\n\nfunction MyTable.something(self, ...) end\nfunction MyTable:something(...) end\n```\n\n## Metatables\n\n```lua\nlocal vector_mt = {}\nvector_mt.__add = function(left, right)\n  return setmetatable({\n    left[1] + right[1],\n    left[2] + right[2],\n    left[3] + right[3],\n  }, vector_mt)\nend\n\nlocal v1 = setmetatable({ 3, 1, 5 }, vector_mt)\nlocal v2 = setmetatable({ -3, 2, 2 }, vector_mt)\nlocal v3 = v1 + v2\nvim.print(v3[1], v3[2], v3[3])\nvim.print(v3 + v3)\n```\n\n## Metatables\n\n```lua\nlocal fib_mt = {\n  __index = function(self, key)\n    if key < 2 then return 1 end\n    -- Update the table, to save the intermediate results\n    self[key] = self[key - 2] + self[key - 1]\n    -- Return the result\n    return self[key]\n  end\n}\n\nlocal fib = setmetatable({}, fib_mt)\n\nprint(fib[5])\nprint(fib[1000])\n```\n\n## Metatables\n\nOther notable fields:\n\n- `__newindex(self, key, value)`\n- `__call(self, ...)`\n\n## Quick Neovim Goodies\n\n```lua\nvim.keymap.set(\"n\", \"<space><space>x\", \"<cmd>source %<CR>\")\nvim.keymap.set(\"n\", \"<space>x\", \":.lua<CR>\")\nvim.keymap.set(\"v\", \"<space>x\", \":lua<CR>\")\n```\n\n## Quick Neovim Goodies\n\n```lua\n-- Highlight when yanking (copying) text\n--  Try it with `yap` in normal mode\n--  See `:help vim.highlight.on_yank()`\nvim.api.nvim_create_autocmd('TextYankPost', {\n  desc = 'Highlight when yanking (copying) text',\n  group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),\n  callback = function()\n    vim.highlight.on_yank()\n  end,\n})\n```\n"
  },
  {
    "path": "03 - Lua Crash Course/init.lua",
    "content": "-- Day 3\nprint(\"advent of neovim\")\n\nvim.keymap.set(\"n\", \"<space><space>x\", \"<cmd>source %<CR>\")\nvim.keymap.set(\"n\", \"<space>x\", \":.lua<CR>\")\nvim.keymap.set(\"v\", \"<space>x\", \":lua<CR>\")\n\n-- Highlight when yanking (copying) text\n--  Try it with `yap` in normal mode\n--  See `:help vim.highlight.on_yank()`\nvim.api.nvim_create_autocmd(\"TextYankPost\", {\n\tdesc = \"Highlight when yanking (copying) text\",\n\tgroup = vim.api.nvim_create_augroup(\"kickstart-highlight-yank\", { clear = true }),\n\tcallback = function()\n\t\tvim.highlight.on_yank()\n\tend,\n})\n"
  },
  {
    "path": "04 - Package Manager/Package Manager.md",
    "content": "# Package Manager\n\n## Package Manager\n\nGoing to use `lazy.nvim`\n- https://lazy.folke.io/installation\n\nNOTE: which is different from LazyVim\n\n## Install\n\n(follow instructions)\n\n`:checkhealth lazy`\n\n## Install a colorscheme\n\n- Tokyo Night Color Scheme\n    - https://github.com/folke/tokyonight.nvim\n\n```lua\n{ \"folke/tokyonight.nvim\", config = function() vim.cmd.colorscheme \"tokyonight\" end }\n```\n\n## Install `mini`\n\n- Mini.nvim\n    - https://github.com/echasnovski/mini.nvim\n\n- Setup statusline\n\n```lua\n-- lua/custom/plugins/mini.lua\nreturn {\n    {\n        'echasnovski/mini.nvim',\n        config = function()\n            local statusline = require 'mini.statusline'\n            statusline.setup { use_icons = true }\n        end\n    }\n}\n```\n"
  },
  {
    "path": "04 - Package Manager/init.lua",
    "content": "print(\"advent of neovim\")\nprint(\"advent of neovim\")\n\n\nvim.keymap.set(\"n\", \"<space><space>x\", \"<cmd>source %<CR>\")\nvim.keymap.set(\"n\", \"<space>x\", \":.lua<CR>\")\nvim.keymap.set(\"v\", \"<space>x\", \":lua<CR>\")\n\n-- Highlight when yanking (copying) text\n--  Try it with `yap` in normal mode\n--  See `:help vim.highlight.on_yank()`\nvim.api.nvim_create_autocmd('TextYankPost', {\n  desc = 'Highlight when yanking (copying) text',\n  group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),\n  callback = function()\n    vim.highlight.on_yank()\n  end,\n})\n"
  },
  {
    "path": "Makefile",
    "content": "update:\n\trm -rf ./nvim\n\tmkdir nvim\n\tcp -rf ~/.config/nvimexample/* ./nvim/\n\n"
  },
  {
    "path": "README.md",
    "content": "# Advent of `nvim`\n\nCheck the config in: `./nvim/`\n- This should be versioned roughly by day, so you can go back and check how each day was made.\n- You likely could copy this into `~/.config/` to get the same config as in the video, but I make no guarantees about that.\n\n\n25 Mini Lessons to get started with Neovim.\n- We'll build a working configuration that resembles kickstart.nvim, but we'll do it completely from scratch.\n\n- [x] Install Neovim and Open (with some reasons why)\n- [x] Tutor / Modal Editing\n- [x] Lua Configuration (Options / Keymaps)\n- [x] Plugin Manager\n- [x] Filetype configuration\n- `tree-sitter`\n- [x] LSP (Keymaps and Settings)\n- [x] Autoformat\n- [x] Telescope\n- [x] Advanced Telescope: multi-ripgrep\n- [x] Window Navigation\n- [x] Quickfix: `:cdo` and others\n- [x] Terminal (Escape, Floating, Usages)\n- [x] Autocomplete\n- [x] Oil.nvim\n    - Longer video: https://youtu.be/218PFRsvu2o?si=l8UFf2Z7YdUKU0KJ\n- [x] Mouse Menu LOL\n- LSP Installation / Management\n- Snippets\n- text-objects: `mini.*`\n- Tree-sitter: text-objects\n- Language Configuration\n- Clipboard\n"
  },
  {
    "path": "XX - oil/Oil.md",
    "content": ""
  },
  {
    "path": "XX - oil/config/init.lua",
    "content": "print(\"advent of neovim\")\n\nrequire(\"config.lazy\")\n\nvim.keymap.set(\"n\", \"<space><space>x\", \"<cmd>source %<CR>\")\nvim.keymap.set(\"n\", \"<space>x\", \":.lua<CR>\")\nvim.keymap.set(\"v\", \"<space>x\", \":lua<CR>\")\n\n-- Highlight when yanking (copying) text\n--  Try it with `yap` in normal mode\n--  See `:help vim.highlight.on_yank()`\nvim.api.nvim_create_autocmd('TextYankPost', {\n  desc = 'Highlight when yanking (copying) text',\n  group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),\n  callback = function()\n    vim.highlight.on_yank()\n  end,\n})\n"
  },
  {
    "path": "XX - oil/config/lazy-lock.json",
    "content": "{\n  \"lazy.nvim\": { \"branch\": \"main\", \"commit\": \"7967abe55752aa90532e6bb4bd4663fe27a264cb\" },\n  \"mini.nvim\": { \"branch\": \"main\", \"commit\": \"690a3b4c78c4956f7ecf770124b522d32084b872\" },\n  \"tokyonight.nvim\": { \"branch\": \"main\", \"commit\": \"15d83cda572d7498b43bbdaa223bc75bf341183e\" }\n}\n"
  },
  {
    "path": "XX - oil/config/lua/config/lazy.lua",
    "content": "-- Bootstrap lazy.nvim\nlocal lazypath = vim.fn.stdpath(\"data\") .. \"/lazy/lazy.nvim\"\nif not (vim.uv or vim.loop).fs_stat(lazypath) then\n  local lazyrepo = \"https://github.com/folke/lazy.nvim.git\"\n  local out = vim.fn.system({ \"git\", \"clone\", \"--filter=blob:none\", \"--branch=stable\", lazyrepo, lazypath })\n  if vim.v.shell_error ~= 0 then\n    vim.api.nvim_echo({\n      { \"Failed to clone lazy.nvim:\\n\", \"ErrorMsg\" },\n      { out, \"WarningMsg\" },\n      { \"\\nPress any key to exit...\" },\n    }, true, {})\n    vim.fn.getchar()\n    os.exit(1)\n  end\nend\n\n-- Hey! Put lazy into the runtimepath for neovim!\nvim.opt.runtimepath:prepend(lazypath)\n\n-- Make sure to setup `mapleader` and `maplocalleader` before\n-- loading lazy.nvim so that mappings are correct.\n-- This is also a good place to setup other settings (vim.opt)\nvim.g.mapleader = \" \"\nvim.g.maplocalleader = \"\\\\\"\n\n-- Setup lazy.nvim\nrequire(\"lazy\").setup({\n  spec = {\n    { \"folke/tokyonight.nvim\", config = function() vim.cmd.colorscheme \"tokyonight\" end },\n    { import = \"config.plugins\" },\n  },\n})\n"
  },
  {
    "path": "XX - oil/config/lua/config/plugins/mini.lua",
    "content": "-- lua/custom/plugins/mini.lua\nreturn {\n    {\n        'echasnovski/mini.nvim',\n\tenabled = true,\n        config = function()\n            local statusline = require 'mini.statusline'\n            statusline.setup { use_icons = true }\n        end\n    },\n}\n"
  },
  {
    "path": "XX - oil/config/lua/config/plugins/oil.lua",
    "content": "return {\n\t{\n\t\t\"stevearc/oil.nvim\",\n\t\tdependencies = { \"nvim-tree/nvim-web-devicons\" },\n\t\tconfig = function()\n\t\t\trequire(\"oil\").setup({\n\t\t\t\tcolumns = { \"icon\" },\n\t\t\t\tkeymaps = {\n\t\t\t\t\t[\"<C-h>\"] = false,\n\t\t\t\t\t[\"<C-l>\"] = false,\n\t\t\t\t\t[\"<C-k>\"] = false,\n\t\t\t\t\t[\"<C-j>\"] = false,\n\t\t\t\t\t[\"<M-h>\"] = \"actions.select_split\",\n\t\t\t\t},\n\t\t\t\tview_options = { show_hidden = true },\n\t\t\t})\n\n\t\t\t-- Open parent directory in current window\n\t\t\tvim.keymap.set(\"n\", \"-\", \"<CMD>Oil<CR>\", { desc = \"Open parent directory\" })\n\t\tend,\n\t},\n}\n"
  },
  {
    "path": "nvim/after/ftplugin/lua.lua",
    "content": "local set = vim.opt_local\n\nset.shiftwidth = 2\nset.number = true\nset.relativenumber = true\n"
  },
  {
    "path": "nvim/init.lua",
    "content": "print(\"advent of neovim\")\n\nrequire(\"config.lazy\")\n\nvim.opt.shiftwidth = 4\nvim.opt.clipboard = \"unnamedplus\"\nvim.opt.number = true\nvim.opt.relativenumber = true\n\nvim.keymap.set(\"n\", \"<space><space>x\", \"<cmd>source %<CR>\")\nvim.keymap.set(\"n\", \"<space>x\", \":.lua<CR>\")\nvim.keymap.set(\"v\", \"<space>x\", \":lua<CR>\")\n\nvim.keymap.set(\"n\", \"<M-j>\", \"<cmd>cnext<CR>\")\nvim.keymap.set(\"n\", \"<M-k>\", \"<cmd>cprev<CR>\")\n\n-- Highlight when yanking (copying) text\n--  Try it with `yap` in normal mode\n--  See `:help vim.highlight.on_yank()`\nvim.api.nvim_create_autocmd(\"TextYankPost\", {\n  desc = \"Highlight when yanking (copying) text\",\n  group = vim.api.nvim_create_augroup(\"kickstart-highlight-yank\", { clear = true }),\n  callback = function()\n    vim.highlight.on_yank()\n  end,\n})\n\nvim.api.nvim_create_autocmd(\"TermOpen\", {\n  group = vim.api.nvim_create_augroup(\"custom-term-open\", { clear = true }),\n  callback = function()\n    vim.opt.number = false\n    vim.opt.relativenumber = false\n  end,\n})\n\nlocal job_id = 0\nvim.keymap.set(\"n\", \"<space>to\", function()\n  vim.cmd.vnew()\n  vim.cmd.term()\n  vim.cmd.wincmd(\"J\")\n  vim.api.nvim_win_set_height(0, 5)\n\n  job_id = vim.bo.channel\nend)\n\nlocal current_command = \"\"\nvim.keymap.set(\"n\", \"<space>te\", function()\n  current_command = vim.fn.input(\"Command: \")\nend)\n\nvim.keymap.set(\"n\", \"<space>tr\", function()\n  if current_command == \"\" then\n    current_command = vim.fn.input(\"Command: \")\n  end\n\n  vim.fn.chansend(job_id, { current_command .. \"\\r\\n\" })\nend)\n\nvim.keymap.set(\"n\", \"-\", \"<cmd>Oil<CR>\")\n"
  },
  {
    "path": "nvim/lazy-lock.json",
    "content": "{\n  \"blink.cmp\": { \"branch\": \"main\", \"commit\": \"ae5a4ce8f7e519e49de7ae6fcadd74547f820a52\" },\n  \"friendly-snippets\": { \"branch\": \"main\", \"commit\": \"efff286dd74c22f731cdec26a70b46e5b203c619\" },\n  \"lazy.nvim\": { \"branch\": \"main\", \"commit\": \"7e6c863bc7563efbdd757a310d17ebc95166cef3\" },\n  \"lazydev.nvim\": { \"branch\": \"main\", \"commit\": \"f59bd14a852ca43db38e3662395354cb2a9b13e0\" },\n  \"mini.icons\": { \"branch\": \"main\", \"commit\": \"44c0160526f7ae17ca8e8eab9ab235d047fcf7a6\" },\n  \"mini.nvim\": { \"branch\": \"main\", \"commit\": \"7ebfab26d77a4b9b05aaae565907e7fa4b2ee154\" },\n  \"nvim-lspconfig\": { \"branch\": \"master\", \"commit\": \"9f2c279cf9abe584f03bfeb37c6658d68e3ff49d\" },\n  \"nvim-treesitter\": { \"branch\": \"master\", \"commit\": \"981ca7e353da6ea69eaafe4348fda5e800f9e1d8\" },\n  \"oil.nvim\": { \"branch\": \"master\", \"commit\": \"dba037598843973b8c54bc5ce0318db4a0da439d\" },\n  \"plenary.nvim\": { \"branch\": \"master\", \"commit\": \"2d9b06177a975543726ce5c73fca176cedbffe9d\" },\n  \"telescope-fzf-native.nvim\": { \"branch\": \"main\", \"commit\": \"dae2eac9d91464448b584c7949a31df8faefec56\" },\n  \"telescope.nvim\": { \"branch\": \"master\", \"commit\": \"a0bbec21143c7bc5f8bb02e0005fa0b982edc026\" },\n  \"tokyonight.nvim\": { \"branch\": \"main\", \"commit\": \"45d22cf0e1b93476d3b6d362d720412b3d34465c\" }\n}\n"
  },
  {
    "path": "nvim/lua/config/lazy.lua",
    "content": "-- Bootstrap lazy.nvim\nlocal lazypath = vim.fn.stdpath(\"data\") .. \"/lazy/lazy.nvim\"\nif not (vim.uv or vim.loop).fs_stat(lazypath) then\n\tlocal lazyrepo = \"https://github.com/folke/lazy.nvim.git\"\n\tlocal out = vim.fn.system({ \"git\", \"clone\", \"--filter=blob:none\", \"--branch=stable\", lazyrepo, lazypath })\n\tif vim.v.shell_error ~= 0 then\n\t\tvim.api.nvim_echo({\n\t\t\t{ \"Failed to clone lazy.nvim:\\n\", \"ErrorMsg\" },\n\t\t\t{ out,                            \"WarningMsg\" },\n\t\t\t{ \"\\nPress any key to exit...\" },\n\t\t}, true, {})\n\t\tvim.fn.getchar()\n\t\tos.exit(1)\n\tend\nend\n\n-- Hey! Put lazy into the runtimepath for neovim!\nvim.opt.runtimepath:prepend(lazypath)\n\n-- Make sure to setup `mapleader` and `maplocalleader` before\n-- loading lazy.nvim so that mappings are correct.\n-- This is also a good place to setup other settings (vim.opt)\nvim.g.mapleader = \" \"\nvim.g.maplocalleader = \"\\\\\"\n\n-- Setup lazy.nvim\nrequire(\"lazy\").setup({\n\tspec = {\n\t\t{ \"folke/tokyonight.nvim\",  config = function() vim.cmd.colorscheme \"tokyonight\" end },\n\t\t{ import = \"config.plugins\" },\n\t},\n\tchange_detection = {\n\t\t-- automatically check for config file changes and reload the ui\n\t\tenabled = false,\n\t\tnotify = false, -- get a notification when changes are found\n\t},\n})\n"
  },
  {
    "path": "nvim/lua/config/plugins/completion.lua",
    "content": "return {\n  {\n    'saghen/blink.cmp',\n    dependencies = 'rafamadriz/friendly-snippets',\n\n    version = 'v0.*',\n\n    opts = {\n      keymap = { preset = 'default' },\n\n      appearance = {\n        use_nvim_cmp_as_default = true,\n        nerd_font_variant = 'mono'\n      },\n\n      signature = { enabled = true }\n    },\n  },\n}\n"
  },
  {
    "path": "nvim/lua/config/plugins/lsp.lua",
    "content": "return {\n  {\n    \"neovim/nvim-lspconfig\",\n    dependencies = {\n      'saghen/blink.cmp',\n      {\n        \"folke/lazydev.nvim\",\n        opts = {\n          library = {\n            { path = \"${3rd}/luv/library\", words = { \"vim%.uv\" } },\n          },\n        },\n      },\n    },\n    config = function()\n      local capabilities = require('blink.cmp').get_lsp_capabilities()\n      require(\"lspconfig\").lua_ls.setup { capabilites = capabilities }\n\n      vim.api.nvim_create_autocmd('LspAttach', {\n        callback = function(args)\n          local c = vim.lsp.get_client_by_id(args.data.client_id)\n          if not c then return end\n\n          if vim.bo.filetype == \"lua\" then\n            -- Format the current buffer on save\n            vim.api.nvim_create_autocmd('BufWritePre', {\n              buffer = args.buf,\n              callback = function()\n                vim.lsp.buf.format({ bufnr = args.buf, id = c.id })\n              end,\n            })\n          end\n        end,\n      })\n    end,\n  }\n}\n"
  },
  {
    "path": "nvim/lua/config/plugins/mini.lua",
    "content": "-- lua/custom/plugins/mini.lua\nreturn {\n\t{\n\t\t'echasnovski/mini.nvim',\n\t\tenabled = true,\n\t\tconfig = function()\n\t\t\tlocal statusline = require 'mini.statusline'\n\t\t\tstatusline.setup { use_icons = true }\n\t\tend\n\t},\n}\n"
  },
  {
    "path": "nvim/lua/config/plugins/oil.lua",
    "content": "return {\n  {\n    'stevearc/oil.nvim',\n    ---@module 'oil'\n    ---@type oil.SetupOpts\n    opts = {},\n    -- Optional dependencies\n    dependencies = { { \"echasnovski/mini.icons\", opts = {} } },\n    -- dependencies = { \"nvim-tree/nvim-web-devicons\" }, -- use if prefer nvim-web-devicons\n  }\n}\n"
  },
  {
    "path": "nvim/lua/config/plugins/telescope.lua",
    "content": "return {\n  {\n    'nvim-telescope/telescope.nvim',\n    tag = '0.1.8',\n    dependencies = {\n      'nvim-lua/plenary.nvim',\n      { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }\n    },\n    config = function()\n      require('telescope').setup {\n        pickers = {\n          find_files = {\n            theme = \"ivy\"\n          }\n        },\n        extensions = {\n          fzf = {}\n        }\n      }\n\n      require('telescope').load_extension('fzf')\n\n      vim.keymap.set(\"n\", \"<space>fh\", require('telescope.builtin').help_tags)\n      vim.keymap.set(\"n\", \"<space>fd\", require('telescope.builtin').find_files)\n      vim.keymap.set(\"n\", \"<space>en\", function()\n        require('telescope.builtin').find_files {\n          cwd = vim.fn.stdpath(\"config\")\n        }\n      end)\n      vim.keymap.set(\"n\", \"<space>ep\", function()\n        require('telescope.builtin').find_files {\n          cwd = vim.fs.joinpath(vim.fn.stdpath(\"data\"), \"lazy\")\n        }\n      end)\n\n      require \"config.telescope.multigrep\".setup()\n    end\n  }\n}\n"
  },
  {
    "path": "nvim/lua/config/plugins/treesitter.lua",
    "content": "return {\n  {\n    \"nvim-treesitter/nvim-treesitter\",\n    build = \":TSUpdate\",\n    config = function()\n      require'nvim-treesitter.configs'.setup {\n\tensure_installed = { \"c\", \"lua\", \"vim\", \"vimdoc\", \"query\", \"markdown\", \"markdown_inline\" },\n\tauto_install = false,\n\thighlight = {\n\t  enable = true,\n\t  disable = function(lang, buf)\n\t    local max_filesize = 100 * 1024 -- 100 KB\n\t    local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))\n\t    if ok and stats and stats.size > max_filesize then\n\t      return true\n\t    end\n\t  end,\n\t  additional_vim_regex_highlighting = false,\n\t},\n      }\n    end,\n  }\n}\n"
  },
  {
    "path": "nvim/lua/config/telescope/multigrep.lua",
    "content": "local pickers = require \"telescope.pickers\"\nlocal finders = require \"telescope.finders\"\nlocal make_entry = require \"telescope.make_entry\"\nlocal conf = require \"telescope.config\".values\n\nlocal M = {}\n\nlocal live_multigrep = function(opts)\n  opts = opts or {}\n  opts.cwd = opts.cwd or vim.uv.cwd()\n\n  local finder = finders.new_async_job {\n    command_generator = function(prompt)\n      if not prompt or prompt == \"\" then\n        return nil\n      end\n\n      local pieces = vim.split(prompt, \"  \")\n      local args = { \"rg\" }\n      if pieces[1] then\n        table.insert(args, \"-e\")\n        table.insert(args, pieces[1])\n      end\n\n      if pieces[2] then\n        table.insert(args, \"-g\")\n        table.insert(args, pieces[2])\n      end\n\n      ---@diagnostic disable-next-line: deprecated\n      return vim.tbl_flatten {\n        args,\n        { \"--color=never\", \"--no-heading\", \"--with-filename\", \"--line-number\", \"--column\", \"--smart-case\" },\n      }\n    end,\n    entry_maker = make_entry.gen_from_vimgrep(opts),\n    cwd = opts.cwd,\n  }\n\n  pickers.new(opts, {\n    debounce = 100,\n    prompt_title = \"Multi Grep\",\n    finder = finder,\n    previewer = conf.grep_previewer(opts),\n    sorter = require(\"telescope.sorters\").empty(),\n  }):find()\nend\n\nM.setup = function()\n  vim.keymap.set(\"n\", \"<leader>fg\", live_multigrep)\nend\n\nreturn M\n"
  },
  {
    "path": "nvim/plugin/floaterminal.lua",
    "content": "vim.keymap.set(\"t\", \"<esc><esc>\", \"<c-\\\\><c-n>\")\n\nlocal state = {\n  floating = {\n    buf = -1,\n    win = -1,\n  }\n}\n\nlocal function create_floating_window(opts)\n  opts = opts or {}\n  local width = opts.width or math.floor(vim.o.columns * 0.8)\n  local height = opts.height or math.floor(vim.o.lines * 0.8)\n\n  -- Calculate the position to center the window\n  local col = math.floor((vim.o.columns - width) / 2)\n  local row = math.floor((vim.o.lines - height) / 2)\n\n  -- Create a buffer\n  local buf = nil\n  if vim.api.nvim_buf_is_valid(opts.buf) then\n    buf = opts.buf\n  else\n    buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer\n  end\n\n  -- Define window configuration\n  local win_config = {\n    relative = \"editor\",\n    width = width,\n    height = height,\n    col = col,\n    row = row,\n    style = \"minimal\", -- No borders or extra UI elements\n    border = \"rounded\",\n  }\n\n  -- Create the floating window\n  local win = vim.api.nvim_open_win(buf, true, win_config)\n\n  return { buf = buf, win = win }\nend\n\nlocal toggle_terminal = function()\n  if not vim.api.nvim_win_is_valid(state.floating.win) then\n    state.floating = create_floating_window { buf = state.floating.buf }\n    if vim.bo[state.floating.buf].buftype ~= \"terminal\" then\n      vim.cmd.terminal()\n    end\n  else\n    vim.api.nvim_win_hide(state.floating.win)\n  end\nend\n\n-- Example usage:\n-- Create a floating window with default dimensions\nvim.api.nvim_create_user_command(\"Floaterminal\", toggle_terminal, {})\n"
  },
  {
    "path": "nvim/plugin/menu.lua",
    "content": "vim.cmd [[\n  aunmenu PopUp\n  anoremenu PopUp.Inspect     <cmd>Inspect<CR>\n  amenu PopUp.-1-             <NOP>\n  anoremenu PopUp.Definition  <cmd>lua vim.lsp.buf.definition()<CR>\n  anoremenu PopUp.References  <cmd>Telescope lsp_references<CR>\n  nnoremenu PopUp.Back        <C-t>\n  amenu PopUp.-2-             <NOP>\n  amenu     PopUp.URL         gx\n]]\n\nlocal group = vim.api.nvim_create_augroup(\"nvim_popupmenu\", { clear = true })\nvim.api.nvim_create_autocmd(\"MenuPopup\", {\n  pattern = \"*\",\n  group = group,\n  desc = \"Custom PopUp Setup\",\n  callback = function()\n    vim.cmd [[\n      amenu disable PopUp.Definition\n      amenu disable PopUp.References\n      amenu disable PopUp.URL\n    ]]\n\n    if vim.lsp.get_clients({ bufnr = 0 })[1] then\n      vim.cmd [[\n        amenu enable PopUp.Definition\n        amenu enable PopUp.References\n      ]]\n    end\n\n    local urls = require(\"vim.ui\")._get_urls()\n    if vim.startswith(urls[1], \"http\") then\n      vim.cmd [[amenu enable PopUp.URL]]\n    end\n  end,\n})\n-- TODO: Add autocoommand\n"
  }
]