Advertisement
Guest User

nvim.log

a guest
Jun 5th, 2025
3
0
22 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 36.46 KB | Software | 0 0
  1.  
  2. === init.lua ===
  3. -- PACKAGE MANAGER
  4. local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
  5. if not vim.loop.fs_stat(lazypath) then
  6.   vim.fn.system({
  7.     "git",
  8.     "clone",
  9.     "--filter=blob:none",
  10.     "https://github.com/folke/lazy.nvim.git",
  11.     "--branch=stable", -- latest stable release
  12.     lazypath,
  13.   })
  14. end
  15.  
  16. vim.opt.rtp:prepend(lazypath)
  17.  
  18. require("lazy").setup("plugins")
  19. require("custom")
  20. require("config")
  21.  
  22.  
  23. === lua/plugins/gh-co.lua ===
  24. -- Github codeowners
  25. return {
  26.   "comatory/gh-co.nvim",
  27.   config = function()
  28.      vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
  29.   end
  30. }
  31.  
  32.  
  33. === lua/plugins/swapfile.lua ===
  34. -- Manage swap files automatically
  35.  
  36. return {
  37.   "gioele/vim-autoswap",
  38.   config = function()
  39.     vim.g.autoswap_detect_tmux = 1
  40.   end,
  41. }
  42.  
  43.  
  44. === lua/plugins/autoclose.lua ===
  45. -- Autocloses brackets and pairs
  46.  
  47. return {
  48.   'windwp/nvim-autopairs',
  49.   event = "InsertEnter",
  50.   config = true
  51. }
  52.  
  53.  
  54. === lua/plugins/git.lua ===
  55. -- Git related plugins
  56. return {
  57.     {
  58.         "tpope/vim-fugitive",
  59.         config = function()
  60.             vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
  61.             vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
  62.         end,
  63.     },
  64.   {
  65.     "lewis6991/gitsigns.nvim",
  66.     config = function()
  67.       require("gitsigns").setup()
  68.     end,
  69.   }
  70. }
  71.  
  72.  
  73. === lua/plugins/telescope.lua ===
  74. -- fuzzy file search / content search with UI
  75. return {
  76.   {
  77.     "nvim-telescope/telescope.nvim",
  78.     dependencies = {
  79.       "nvim-lua/plenary.nvim",
  80.       "nvim-telescope/telescope-live-grep-args.nvim",
  81.     },
  82.     config = function()
  83.       local builtin = require("telescope.builtin")
  84.       local layout = require("telescope.actions.layout")
  85.       local actions = require("telescope.actions")
  86.  
  87.       local findIgnored = function()
  88.         return builtin.find_files({
  89.           no_ignore = false,
  90.           hidden = true,
  91.         })
  92.       end
  93.  
  94.       local sortedBuffers = function()
  95.         return builtin.buffers({
  96.           sort_mru = true,
  97.         })
  98.       end
  99.  
  100.       vim.keymap.set("n", "<C-p>", builtin.find_files, {})
  101.       vim.keymap.set("n", "<C-[>", findIgnored, {})
  102.       vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
  103.       vim.keymap.set("n", "<C-x>", sortedBuffers, {})
  104.  
  105.       local telescope = require("telescope")
  106.  
  107.       local opts = {
  108.         defaults = {
  109.           mappings = {
  110.             i = {
  111.               ["<C-e>"] = layout.toggle_preview,
  112.               ["<C-j>"] = actions.move_selection_next,
  113.               ["<C-k>"] = actions.move_selection_previous,
  114.               ["<C-h>"] = actions.results_scrolling_left,
  115.               ["<C-l>"] = actions.results_scrolling_right,
  116.             },
  117.           },
  118.         },
  119.       }
  120.  
  121.       -- replace ripgrep with ag
  122.       -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
  123.       local ag = os.execute("command -v " .. "ag")
  124.       if ag == 0 then
  125.         opts.defaults.vimgrep_arguments = {
  126.           "ag",
  127.           "--nocolor",
  128.           "--noheading",
  129.           "--numbers",
  130.           "--column",
  131.           "--smart-case",
  132.           "--silent",
  133.           "--vimgrep",
  134.         }
  135.       end
  136.  
  137.       -- extension for grepping with arguments
  138.       vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
  139.  
  140.       telescope.setup(opts)
  141.  
  142.       telescope.load_extension("live_grep_args")
  143.       telescope.load_extension("ui-select")
  144.     end,
  145.   },
  146.   {
  147.     "nvim-telescope/telescope-ui-select.nvim",
  148.     config = function()
  149.       require("telescope").setup({
  150.         extensions = {
  151.           ["ui-select"] = {
  152.             require("telescope.themes").get_dropdown({}),
  153.           },
  154.         },
  155.       })
  156.       require("telescope").load_extension("ui-select")
  157.     end,
  158.   },
  159. }
  160.  
  161.  
  162. === lua/plugins/searchindex.lua ===
  163. -- adds match counter when searching a file
  164. return {
  165.   "google/vim-searchindex"
  166. }
  167.  
  168.  
  169. === lua/plugins/copilot.lua ===
  170. -- AI assistant
  171. return {
  172.   "github/copilot.vim",
  173.   config = function()
  174.     -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
  175.     -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
  176.   end
  177. }
  178.  
  179.  
  180. === lua/plugins/trouble.lua ===
  181. -- Diagnostics UI
  182. return {
  183.     "folke/trouble.nvim",
  184.   opts = {},
  185.     dependencies = { "nvim-tree/nvim-web-devicons" },
  186. }
  187.  
  188.  
  189. === lua/plugins/lualine.lua ===
  190. -- status line
  191. return {
  192.   "nvim-lualine/lualine.nvim",
  193.   dependencies = { 'nvim-tree/nvim-web-devicons' },
  194.   config = function()
  195.     require("lualine").setup({
  196.       theme = "newpaper-light",
  197.     })
  198.   end
  199. }
  200.  
  201.  
  202. === lua/plugins/newpaper.lua ===
  203. -- color scheme
  204. return {
  205.     "yorik1984/newpaper.nvim",
  206.     config = function()
  207.         require("newpaper").setup({
  208.             style = "light",
  209.         })
  210.     end,
  211. }
  212.  
  213.  
  214. === lua/plugins/lsp.lua ===
  215. -- autocomplete / LSP configurations
  216. return {
  217.   {
  218.     "williamboman/mason.nvim",
  219.     config = function()
  220.       require("mason").setup()
  221.     end,
  222.   },
  223.   {
  224.     "williamboman/mason-lspconfig.nvim",
  225.     config = function()
  226.       require("mason-lspconfig").setup({
  227.         ensure_installed = {
  228.           "cssls",
  229.           "dockerls",
  230.           "gopls",
  231.           "graphql",
  232.           "jsonls",
  233.           "ts_ls",
  234.           "eslint",
  235.           "biome",
  236.           "lua_ls",
  237.           "marksman",
  238.           "hydra_lsp",
  239.         },
  240.       })
  241.     end,
  242.   },
  243.   {
  244.     "neovim/nvim-lspconfig",
  245.     config = function()
  246.       -- local lspconfig = require("lspconfig")
  247.       -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
  248.  
  249.       -- lspconfig.cssls.setup({
  250.       --   capabilities = capabilities,
  251.       -- })
  252.       -- lspconfig.dockerls.setup({
  253.       --   capabilities = capabilities,
  254.       -- })
  255.       -- lspconfig.gopls.setup({
  256.       --   capabilities = capabilities,
  257.       -- })
  258.       -- lspconfig.graphql.setup({
  259.       --   capabilities = capabilities,
  260.       -- })
  261.       -- lspconfig.jsonls.setup({
  262.       --   capabilities = capabilities,
  263.       -- })
  264.       -- lspconfig.ts_ls.setup({
  265.       --   capabilities = capabilities,
  266.       -- })
  267.       -- lspconfig.eslint.setup({
  268.       --   capabilities = capabilities,
  269.       -- })
  270.       -- lspconfig.biome.setup({
  271.       --   capabilities = capabilities,
  272.       -- })
  273.       -- lspconfig.lua_ls.setup({
  274.       --  capabilities = capabilities,
  275.       -- })
  276.       -- lspconfig.marksman.setup({
  277.       --   capabilities = capabilities,
  278.       -- })
  279.       -- lspconfig.hydra_lsp.setup({
  280.       --   capabilities = capabilities,
  281.       -- })
  282.       -- lspconfig.pico8_ls.setup({
  283.       --   capabilities = capabilities,
  284.       -- })
  285.  
  286.       vim.api.nvim_create_autocmd("LspAttach", {
  287.         group = vim.api.nvim_create_augroup("UserLspConfig", {}),
  288.         callback = function(ev)
  289.           local opts = { buffer = ev.buf }
  290.  
  291.           vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
  292.           vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
  293.           vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
  294.           vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
  295.         end,
  296.       })
  297.     end,
  298.   },
  299. }
  300.  
  301.  
  302. === lua/plugins/octo.lua ===
  303. -- Manage Github reviews
  304. return {
  305.   'pwntester/octo.nvim',
  306.   dependencies = {
  307.     'nvim-lua/plenary.nvim',
  308.     'nvim-telescope/telescope.nvim',
  309.     'nvim-tree/nvim-web-devicons',
  310.   },
  311.   config = function ()
  312.     require("octo").setup()
  313.   end
  314. }
  315.  
  316.  
  317. === lua/plugins/rhubarb.lua ===
  318. -- Enables browsing Github with `fugitive`
  319. return {
  320.   "tpope/vim-rhubarb"
  321. }
  322.  
  323.  
  324. === lua/plugins/none-ls.lua ===
  325. -- Linting & formatting
  326. return {
  327.   "nvimtools/none-ls.nvim",
  328.   dependencies = { "nvimtools/none-ls-extras.nvim" },
  329.   config = function()
  330.     local null_ls = require("null-ls")
  331.  
  332.     null_ls.setup({
  333.         sources = {
  334.             null_ls.builtins.formatting.stylua,
  335.             null_ls.builtins.formatting.biome,
  336.             null_ls.builtins.formatting.prettier,
  337.             -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
  338.             -- null_ls.builtins.diagnostics.eslint_d,
  339.             require("none-ls.diagnostics.eslint_d"),
  340.             null_ls.builtins.diagnostics.golangci_lint,
  341.             null_ls.builtins.formatting.goimports,
  342.         },
  343.     })
  344.  
  345.     vim.diagnostic.config({
  346.       virtual_text = true
  347.     })
  348.  
  349.     vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
  350.   end
  351. }
  352.  
  353.  
  354. === lua/plugins/treesitter.lua ===
  355. -- syntax highlighting
  356. return {
  357.   "nvim-treesitter/nvim-treesitter",
  358.   build = ":TSUpdate",
  359.   config = function()
  360.     local configs = require("nvim-treesitter.configs")
  361.  
  362.     configs.setup {
  363.       ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
  364.       },
  365.       highlight = {
  366.         enable = true,
  367.       },
  368.       indent = {
  369.         enable = true,
  370.       },
  371.     }
  372.   end
  373. }
  374.  
  375.  
  376. === lua/plugins/autocomplete.lua ===
  377. -- Autocomplete & snippets
  378. return {
  379.     -- adds source from opened buffers & LSP to be provided to autocompletion
  380.     {
  381.         "hrsh7th/cmp-nvim-lsp",
  382.     },
  383.     -- adds nice snippets for autocompletion
  384.     {
  385.         "L3MON4D3/LuaSnip",
  386.         dependencies = {
  387.             "saadparwaiz1/cmp_luasnip",
  388.             "rafamadriz/friendly-snippets",
  389.         },
  390.     },
  391.     {
  392.         "hrsh7th/nvim-cmp",
  393.         config = function()
  394.             local cmp = require("cmp")
  395.  
  396.             cmp.setup({
  397.                 snippet = {
  398.                     expand = function(args)
  399.                         require("luasnip").lsp_expand(args.body)
  400.                     end,
  401.                 },
  402.  
  403.                 window = {
  404.                     completion = cmp.config.window.bordered(),
  405.                     documentation = cmp.config.window.bordered(),
  406.                 },
  407.  
  408.                 mapping = cmp.mapping.preset.insert({
  409.                     ["<C-j>"] = cmp.mapping.scroll_docs(-4),
  410.                     ["<C-k>"] = cmp.mapping.scroll_docs(4),
  411.                     ["<C-Space>"] = cmp.mapping.complete(),
  412.                     ["<C-c>"] = cmp.mapping.abort(),
  413.                     ["<Enter>"] = cmp.mapping.confirm({ select = true }),
  414.                 }),
  415.                 sources = cmp.config.sources({
  416.                     { name = "nvim_lsp" },
  417.                     { name = "luasnip" }, -- For luasnip users.
  418.                 }, {
  419.                     { name = "buffer" },
  420.                 }),
  421.             })
  422.  
  423.             require("luasnip.loaders.from_vscode").lazy_load()
  424.         end,
  425.     },
  426. }
  427.  
  428.  
  429. === lua/plugins/surround.lua ===
  430. -- transform surrounds (brackets, parentheses, quotes, etc)
  431. return {
  432.   "tpope/vim-surround"
  433. }
  434.  
  435.  
  436. === lua/plugins/neotree.lua ===
  437. -- file browser
  438. return {
  439.   "nvim-neo-tree/neo-tree.nvim",
  440.   dependencies = {
  441.     "nvim-lua/plenary.nvim",
  442.     "nvim-tree/nvim-web-devicons",
  443.     "MunifTanjim/nui.nvim",
  444.   },
  445.   config = function()
  446.     vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
  447.  
  448.     local neotree = require('neo-tree')
  449.  
  450.     neotree.setup({
  451.       use_popups_for_input = false,
  452.     })
  453.   end
  454. }
  455.  
  456.  
  457. === lua/config.lua ===
  458. -- MAIN CONFIG
  459. -- general
  460. vim.cmd("set clipboard=unnamed")
  461. vim.cmd("set mouse=a")
  462. -- line numbers
  463. vim.cmd("set number")
  464. vim.cmd("set title")
  465. vim.cmd("set cursorline")
  466. vim.cmd("set expandtab")
  467. -- indentation
  468. vim.cmd("set shiftwidth=2")
  469. vim.cmd("set softtabstop=2")
  470. vim.cmd("set tabstop=2")
  471. -- whitespace
  472. -- indicate whitespace
  473. vim.cmd("set listchars+=space:·")
  474. vim.cmd("set list")
  475. -- git
  476. -- open diff's in vertical split
  477. vim.cmd("set diffopt=vertical")
  478. -- search
  479. -- ignore case during file search
  480. vim.cmd("set ignorecase")
  481. -- style
  482. vim.cmd("set t_Co=256")
  483. -- highlights column at 80 and 120
  484. vim.cmd("set colorcolumn=80,120")
  485.  
  486.  
  487. === lua/custom/init.lua ===
  488. require("custom.filepath")
  489. require("custom.terminal")
  490. require("custom.windows")
  491. require("custom.quickfix")
  492.  
  493.  
  494. === lua/custom/terminal.lua ===
  495. -- switch to normal mode when active in terminal session
  496. vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
  497.  
  498.  
  499. === lua/custom/quickfix.lua ===
  500. -- quickfix
  501. -- next term
  502. vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
  503. -- prev term
  504. vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
  505. -- next file
  506. vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
  507. -- prev file
  508. vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
  509.  
  510.  
  511. === lua/custom/filepath.lua ===
  512. -- show full path of current buffer
  513. vim.keymap.set('n', 'F', ':echo @%<CR>', {})
  514. -- copy relative path to clipboard
  515. vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
  516. -- copy absolute path to clipboard
  517. vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
  518. -- copy filename
  519. vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
  520. -- copy directory name
  521. vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
  522.  
  523.  
  524. === lua/custom/windows.lua ===
  525. -- open new tab with current buffer
  526. vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
  527. -- open new empty tab
  528. vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
  529. -- close current tab
  530. vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
  531.  
  532.  
  533. === lua/config.lua ===
  534. -- MAIN CONFIG
  535. -- general
  536. vim.cmd("set clipboard=unnamed")
  537. vim.cmd("set mouse=a")
  538. -- line numbers
  539. vim.cmd("set number")
  540. vim.cmd("set title")
  541. vim.cmd("set cursorline")
  542. vim.cmd("set expandtab")
  543. -- indentation
  544. vim.cmd("set shiftwidth=2")
  545. vim.cmd("set softtabstop=2")
  546. vim.cmd("set tabstop=2")
  547. -- whitespace
  548. -- indicate whitespace
  549. vim.cmd("set listchars+=space:·")
  550. vim.cmd("set list")
  551. -- git
  552. -- open diff's in vertical split
  553. vim.cmd("set diffopt=vertical")
  554. -- search
  555. -- ignore case during file search
  556. vim.cmd("set ignorecase")
  557. -- style
  558. vim.cmd("set t_Co=256")
  559. -- highlights column at 80 and 120
  560. vim.cmd("set colorcolumn=80,120")
  561.  
  562.  
  563. === lua/custom/init.lua ===
  564. require("custom.filepath")
  565. require("custom.terminal")
  566. require("custom.windows")
  567. require("custom.quickfix")
  568.  
  569.  
  570. === lua/custom/terminal.lua ===
  571. -- switch to normal mode when active in terminal session
  572. vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
  573.  
  574.  
  575. === lua/custom/quickfix.lua ===
  576. -- quickfix
  577. -- next term
  578. vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
  579. -- prev term
  580. vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
  581. -- next file
  582. vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
  583. -- prev file
  584. vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
  585.  
  586.  
  587. === lua/custom/filepath.lua ===
  588. -- show full path of current buffer
  589. vim.keymap.set('n', 'F', ':echo @%<CR>', {})
  590. -- copy relative path to clipboard
  591. vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
  592. -- copy absolute path to clipboard
  593. vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
  594. -- copy filename
  595. vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
  596. -- copy directory name
  597. vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
  598.  
  599.  
  600. === lua/custom/windows.lua ===
  601. -- open new tab with current buffer
  602. vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
  603. -- open new empty tab
  604. vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
  605. -- close current tab
  606. vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
  607.  
  608.  
  609. === lua/custom/filepath.lua ===
  610. -- show full path of current buffer
  611. vim.keymap.set('n', 'F', ':echo @%<CR>', {})
  612. -- copy relative path to clipboard
  613. vim.keymap.set('n', '<leader>cF', ':let @*=expand("%")<CR>', {})
  614. -- copy absolute path to clipboard
  615. vim.keymap.set('n', '<leader>cf', ':let @*=expand("%:p")<CR>', {})
  616. -- copy filename
  617. vim.keymap.set('n', '<leader>ct', ':let @*=expand("%:t")<CR>', {})
  618. -- copy directory name
  619. vim.keymap.set('n', '<leader>ch', ':let @*=expand("%:p:h")<CR>', {})
  620.  
  621.  
  622. === lua/custom/init.lua ===
  623. require("custom.filepath")
  624. require("custom.terminal")
  625. require("custom.windows")
  626. require("custom.quickfix")
  627.  
  628.  
  629. === lua/custom/quickfix.lua ===
  630. -- quickfix
  631. -- next term
  632. vim.keymap.set("n", "<leader>]]", ":cn<CR>", { silent = true })
  633. -- prev term
  634. vim.keymap.set("n", "<leader>[[", ":cp<CR>", { silent = true })
  635. -- next file
  636. vim.keymap.set("n", "<leader>]]n", ":cnfile<CR>", { silent = true })
  637. -- prev file
  638. vim.keymap.set("n", "<leader>[[p", ":cNfile<CR>", { silent = true })
  639.  
  640.  
  641. === lua/custom/terminal.lua ===
  642. -- switch to normal mode when active in terminal session
  643. vim.keymap.set('t', '<Esc>', [[<C-\><C-n>]], { silent=true })
  644.  
  645.  
  646. === lua/custom/windows.lua ===
  647. -- open new tab with current buffer
  648. vim.keymap.set('n', '<leader>N', ':tabe %<CR>', {})
  649. -- open new empty tab
  650. vim.keymap.set('n', '<leader>n', ':tabe<CR>', {})
  651. -- close current tab
  652. vim.keymap.set('n', '<leader><Esc>', ':tabclose<CR>', {})
  653.  
  654.  
  655. === lua/plugins/gh-co.lua ===
  656. -- Github codeowners
  657. return {
  658.   "comatory/gh-co.nvim",
  659.   config = function()
  660.      vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
  661.   end
  662. }
  663.  
  664.  
  665. === lua/plugins/swapfile.lua ===
  666. -- Manage swap files automatically
  667.  
  668. return {
  669.   "gioele/vim-autoswap",
  670.   config = function()
  671.     vim.g.autoswap_detect_tmux = 1
  672.   end,
  673. }
  674.  
  675.  
  676. === lua/plugins/autoclose.lua ===
  677. -- Autocloses brackets and pairs
  678.  
  679. return {
  680.   'windwp/nvim-autopairs',
  681.   event = "InsertEnter",
  682.   config = true
  683. }
  684.  
  685.  
  686. === lua/plugins/git.lua ===
  687. -- Git related plugins
  688. return {
  689.     {
  690.         "tpope/vim-fugitive",
  691.         config = function()
  692.             vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
  693.             vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
  694.         end,
  695.     },
  696.   {
  697.     "lewis6991/gitsigns.nvim",
  698.     config = function()
  699.       require("gitsigns").setup()
  700.     end,
  701.   }
  702. }
  703.  
  704.  
  705. === lua/plugins/telescope.lua ===
  706. -- fuzzy file search / content search with UI
  707. return {
  708.   {
  709.     "nvim-telescope/telescope.nvim",
  710.     dependencies = {
  711.       "nvim-lua/plenary.nvim",
  712.       "nvim-telescope/telescope-live-grep-args.nvim",
  713.     },
  714.     config = function()
  715.       local builtin = require("telescope.builtin")
  716.       local layout = require("telescope.actions.layout")
  717.       local actions = require("telescope.actions")
  718.  
  719.       local findIgnored = function()
  720.         return builtin.find_files({
  721.           no_ignore = false,
  722.           hidden = true,
  723.         })
  724.       end
  725.  
  726.       local sortedBuffers = function()
  727.         return builtin.buffers({
  728.           sort_mru = true,
  729.         })
  730.       end
  731.  
  732.       vim.keymap.set("n", "<C-p>", builtin.find_files, {})
  733.       vim.keymap.set("n", "<C-[>", findIgnored, {})
  734.       vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
  735.       vim.keymap.set("n", "<C-x>", sortedBuffers, {})
  736.  
  737.       local telescope = require("telescope")
  738.  
  739.       local opts = {
  740.         defaults = {
  741.           mappings = {
  742.             i = {
  743.               ["<C-e>"] = layout.toggle_preview,
  744.               ["<C-j>"] = actions.move_selection_next,
  745.               ["<C-k>"] = actions.move_selection_previous,
  746.               ["<C-h>"] = actions.results_scrolling_left,
  747.               ["<C-l>"] = actions.results_scrolling_right,
  748.             },
  749.           },
  750.         },
  751.       }
  752.  
  753.       -- replace ripgrep with ag
  754.       -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
  755.       local ag = os.execute("command -v " .. "ag")
  756.       if ag == 0 then
  757.         opts.defaults.vimgrep_arguments = {
  758.           "ag",
  759.           "--nocolor",
  760.           "--noheading",
  761.           "--numbers",
  762.           "--column",
  763.           "--smart-case",
  764.           "--silent",
  765.           "--vimgrep",
  766.         }
  767.       end
  768.  
  769.       -- extension for grepping with arguments
  770.       vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
  771.  
  772.       telescope.setup(opts)
  773.  
  774.       telescope.load_extension("live_grep_args")
  775.       telescope.load_extension("ui-select")
  776.     end,
  777.   },
  778.   {
  779.     "nvim-telescope/telescope-ui-select.nvim",
  780.     config = function()
  781.       require("telescope").setup({
  782.         extensions = {
  783.           ["ui-select"] = {
  784.             require("telescope.themes").get_dropdown({}),
  785.           },
  786.         },
  787.       })
  788.       require("telescope").load_extension("ui-select")
  789.     end,
  790.   },
  791. }
  792.  
  793.  
  794. === lua/plugins/searchindex.lua ===
  795. -- adds match counter when searching a file
  796. return {
  797.   "google/vim-searchindex"
  798. }
  799.  
  800.  
  801. === lua/plugins/copilot.lua ===
  802. -- AI assistant
  803. return {
  804.   "github/copilot.vim",
  805.   config = function()
  806.     -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
  807.     -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
  808.   end
  809. }
  810.  
  811.  
  812. === lua/plugins/trouble.lua ===
  813. -- Diagnostics UI
  814. return {
  815.     "folke/trouble.nvim",
  816.   opts = {},
  817.     dependencies = { "nvim-tree/nvim-web-devicons" },
  818. }
  819.  
  820.  
  821. === lua/plugins/lualine.lua ===
  822. -- status line
  823. return {
  824.   "nvim-lualine/lualine.nvim",
  825.   dependencies = { 'nvim-tree/nvim-web-devicons' },
  826.   config = function()
  827.     require("lualine").setup({
  828.       theme = "newpaper-light",
  829.     })
  830.   end
  831. }
  832.  
  833.  
  834. === lua/plugins/newpaper.lua ===
  835. -- color scheme
  836. return {
  837.     "yorik1984/newpaper.nvim",
  838.     config = function()
  839.         require("newpaper").setup({
  840.             style = "light",
  841.         })
  842.     end,
  843. }
  844.  
  845.  
  846. === lua/plugins/lsp.lua ===
  847. -- autocomplete / LSP configurations
  848. return {
  849.   {
  850.     "williamboman/mason.nvim",
  851.     config = function()
  852.       require("mason").setup()
  853.     end,
  854.   },
  855.   {
  856.     "williamboman/mason-lspconfig.nvim",
  857.     config = function()
  858.       require("mason-lspconfig").setup({
  859.         ensure_installed = {
  860.           "cssls",
  861.           "dockerls",
  862.           "gopls",
  863.           "graphql",
  864.           "jsonls",
  865.           "ts_ls",
  866.           "eslint",
  867.           "biome",
  868.           "lua_ls",
  869.           "marksman",
  870.           "hydra_lsp",
  871.         },
  872.       })
  873.     end,
  874.   },
  875.   {
  876.     "neovim/nvim-lspconfig",
  877.     config = function()
  878.       -- local lspconfig = require("lspconfig")
  879.       -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
  880.  
  881.       -- lspconfig.cssls.setup({
  882.       --   capabilities = capabilities,
  883.       -- })
  884.       -- lspconfig.dockerls.setup({
  885.       --   capabilities = capabilities,
  886.       -- })
  887.       -- lspconfig.gopls.setup({
  888.       --   capabilities = capabilities,
  889.       -- })
  890.       -- lspconfig.graphql.setup({
  891.       --   capabilities = capabilities,
  892.       -- })
  893.       -- lspconfig.jsonls.setup({
  894.       --   capabilities = capabilities,
  895.       -- })
  896.       -- lspconfig.ts_ls.setup({
  897.       --   capabilities = capabilities,
  898.       -- })
  899.       -- lspconfig.eslint.setup({
  900.       --   capabilities = capabilities,
  901.       -- })
  902.       -- lspconfig.biome.setup({
  903.       --   capabilities = capabilities,
  904.       -- })
  905.       -- lspconfig.lua_ls.setup({
  906.       --  capabilities = capabilities,
  907.       -- })
  908.       -- lspconfig.marksman.setup({
  909.       --   capabilities = capabilities,
  910.       -- })
  911.       -- lspconfig.hydra_lsp.setup({
  912.       --   capabilities = capabilities,
  913.       -- })
  914.       -- lspconfig.pico8_ls.setup({
  915.       --   capabilities = capabilities,
  916.       -- })
  917.  
  918.       vim.api.nvim_create_autocmd("LspAttach", {
  919.         group = vim.api.nvim_create_augroup("UserLspConfig", {}),
  920.         callback = function(ev)
  921.           local opts = { buffer = ev.buf }
  922.  
  923.           vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
  924.           vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
  925.           vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
  926.           vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
  927.         end,
  928.       })
  929.     end,
  930.   },
  931. }
  932.  
  933.  
  934. === lua/plugins/octo.lua ===
  935. -- Manage Github reviews
  936. return {
  937.   'pwntester/octo.nvim',
  938.   dependencies = {
  939.     'nvim-lua/plenary.nvim',
  940.     'nvim-telescope/telescope.nvim',
  941.     'nvim-tree/nvim-web-devicons',
  942.   },
  943.   config = function ()
  944.     require("octo").setup()
  945.   end
  946. }
  947.  
  948.  
  949. === lua/plugins/rhubarb.lua ===
  950. -- Enables browsing Github with `fugitive`
  951. return {
  952.   "tpope/vim-rhubarb"
  953. }
  954.  
  955.  
  956. === lua/plugins/none-ls.lua ===
  957. -- Linting & formatting
  958. return {
  959.   "nvimtools/none-ls.nvim",
  960.   dependencies = { "nvimtools/none-ls-extras.nvim" },
  961.   config = function()
  962.     local null_ls = require("null-ls")
  963.  
  964.     null_ls.setup({
  965.         sources = {
  966.             null_ls.builtins.formatting.stylua,
  967.             null_ls.builtins.formatting.biome,
  968.             null_ls.builtins.formatting.prettier,
  969.             -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
  970.             -- null_ls.builtins.diagnostics.eslint_d,
  971.             require("none-ls.diagnostics.eslint_d"),
  972.             null_ls.builtins.diagnostics.golangci_lint,
  973.             null_ls.builtins.formatting.goimports,
  974.         },
  975.     })
  976.  
  977.     vim.diagnostic.config({
  978.       virtual_text = true
  979.     })
  980.  
  981.     vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
  982.   end
  983. }
  984.  
  985.  
  986. === lua/plugins/treesitter.lua ===
  987. -- syntax highlighting
  988. return {
  989.   "nvim-treesitter/nvim-treesitter",
  990.   build = ":TSUpdate",
  991.   config = function()
  992.     local configs = require("nvim-treesitter.configs")
  993.  
  994.     configs.setup {
  995.       ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
  996.       },
  997.       highlight = {
  998.         enable = true,
  999.       },
  1000.       indent = {
  1001.         enable = true,
  1002.       },
  1003.     }
  1004.   end
  1005. }
  1006.  
  1007.  
  1008. === lua/plugins/autocomplete.lua ===
  1009. -- Autocomplete & snippets
  1010. return {
  1011.     -- adds source from opened buffers & LSP to be provided to autocompletion
  1012.     {
  1013.         "hrsh7th/cmp-nvim-lsp",
  1014.     },
  1015.     -- adds nice snippets for autocompletion
  1016.     {
  1017.         "L3MON4D3/LuaSnip",
  1018.         dependencies = {
  1019.             "saadparwaiz1/cmp_luasnip",
  1020.             "rafamadriz/friendly-snippets",
  1021.         },
  1022.     },
  1023.     {
  1024.         "hrsh7th/nvim-cmp",
  1025.         config = function()
  1026.             local cmp = require("cmp")
  1027.  
  1028.             cmp.setup({
  1029.                 snippet = {
  1030.                     expand = function(args)
  1031.                         require("luasnip").lsp_expand(args.body)
  1032.                     end,
  1033.                 },
  1034.  
  1035.                 window = {
  1036.                     completion = cmp.config.window.bordered(),
  1037.                     documentation = cmp.config.window.bordered(),
  1038.                 },
  1039.  
  1040.                 mapping = cmp.mapping.preset.insert({
  1041.                     ["<C-j>"] = cmp.mapping.scroll_docs(-4),
  1042.                     ["<C-k>"] = cmp.mapping.scroll_docs(4),
  1043.                     ["<C-Space>"] = cmp.mapping.complete(),
  1044.                     ["<C-c>"] = cmp.mapping.abort(),
  1045.                     ["<Enter>"] = cmp.mapping.confirm({ select = true }),
  1046.                 }),
  1047.                 sources = cmp.config.sources({
  1048.                     { name = "nvim_lsp" },
  1049.                     { name = "luasnip" }, -- For luasnip users.
  1050.                 }, {
  1051.                     { name = "buffer" },
  1052.                 }),
  1053.             })
  1054.  
  1055.             require("luasnip.loaders.from_vscode").lazy_load()
  1056.         end,
  1057.     },
  1058. }
  1059.  
  1060.  
  1061. === lua/plugins/surround.lua ===
  1062. -- transform surrounds (brackets, parentheses, quotes, etc)
  1063. return {
  1064.   "tpope/vim-surround"
  1065. }
  1066.  
  1067.  
  1068. === lua/plugins/neotree.lua ===
  1069. -- file browser
  1070. return {
  1071.   "nvim-neo-tree/neo-tree.nvim",
  1072.   dependencies = {
  1073.     "nvim-lua/plenary.nvim",
  1074.     "nvim-tree/nvim-web-devicons",
  1075.     "MunifTanjim/nui.nvim",
  1076.   },
  1077.   config = function()
  1078.     vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
  1079.  
  1080.     local neotree = require('neo-tree')
  1081.  
  1082.     neotree.setup({
  1083.       use_popups_for_input = false,
  1084.     })
  1085.   end
  1086. }
  1087.  
  1088.  
  1089. === lua/plugins/autoclose.lua ===
  1090. -- Autocloses brackets and pairs
  1091.  
  1092. return {
  1093.   'windwp/nvim-autopairs',
  1094.   event = "InsertEnter",
  1095.   config = true
  1096. }
  1097.  
  1098.  
  1099. === lua/plugins/autocomplete.lua ===
  1100. -- Autocomplete & snippets
  1101. return {
  1102.     -- adds source from opened buffers & LSP to be provided to autocompletion
  1103.     {
  1104.         "hrsh7th/cmp-nvim-lsp",
  1105.     },
  1106.     -- adds nice snippets for autocompletion
  1107.     {
  1108.         "L3MON4D3/LuaSnip",
  1109.         dependencies = {
  1110.             "saadparwaiz1/cmp_luasnip",
  1111.             "rafamadriz/friendly-snippets",
  1112.         },
  1113.     },
  1114.     {
  1115.         "hrsh7th/nvim-cmp",
  1116.         config = function()
  1117.             local cmp = require("cmp")
  1118.  
  1119.             cmp.setup({
  1120.                 snippet = {
  1121.                     expand = function(args)
  1122.                         require("luasnip").lsp_expand(args.body)
  1123.                     end,
  1124.                 },
  1125.  
  1126.                 window = {
  1127.                     completion = cmp.config.window.bordered(),
  1128.                     documentation = cmp.config.window.bordered(),
  1129.                 },
  1130.  
  1131.                 mapping = cmp.mapping.preset.insert({
  1132.                     ["<C-j>"] = cmp.mapping.scroll_docs(-4),
  1133.                     ["<C-k>"] = cmp.mapping.scroll_docs(4),
  1134.                     ["<C-Space>"] = cmp.mapping.complete(),
  1135.                     ["<C-c>"] = cmp.mapping.abort(),
  1136.                     ["<Enter>"] = cmp.mapping.confirm({ select = true }),
  1137.                 }),
  1138.                 sources = cmp.config.sources({
  1139.                     { name = "nvim_lsp" },
  1140.                     { name = "luasnip" }, -- For luasnip users.
  1141.                 }, {
  1142.                     { name = "buffer" },
  1143.                 }),
  1144.             })
  1145.  
  1146.             require("luasnip.loaders.from_vscode").lazy_load()
  1147.         end,
  1148.     },
  1149. }
  1150.  
  1151.  
  1152. === lua/plugins/copilot.lua ===
  1153. -- AI assistant
  1154. return {
  1155.   "github/copilot.vim",
  1156.   config = function()
  1157.     -- vim.keymap.set("n", "<C-j>", "<Plug>(copilot-next)", {})
  1158.     -- vim.keymap.set("n", "<C-k>", "<Plug>(copilot-previous)", {})
  1159.   end
  1160. }
  1161.  
  1162.  
  1163. === lua/plugins/gh-co.lua ===
  1164. -- Github codeowners
  1165. return {
  1166.   "comatory/gh-co.nvim",
  1167.   config = function()
  1168.      vim.keymap.set("n", "<leader>gg", ":GhCoWho<CR>", {})
  1169.   end
  1170. }
  1171.  
  1172.  
  1173. === lua/plugins/git.lua ===
  1174. -- Git related plugins
  1175. return {
  1176.     {
  1177.         "tpope/vim-fugitive",
  1178.         config = function()
  1179.             vim.keymap.set("n", "<leader>gs", ":Gdiffsplit HEAD<CR>", {})
  1180.             vim.keymap.set("n", "<leader>gl", " :Gllog<CR>", {})
  1181.         end,
  1182.     },
  1183.   {
  1184.     "lewis6991/gitsigns.nvim",
  1185.     config = function()
  1186.       require("gitsigns").setup()
  1187.     end,
  1188.   }
  1189. }
  1190.  
  1191.  
  1192. === lua/plugins/lsp.lua ===
  1193. -- autocomplete / LSP configurations
  1194. return {
  1195.   {
  1196.     "williamboman/mason.nvim",
  1197.     config = function()
  1198.       require("mason").setup()
  1199.     end,
  1200.   },
  1201.   {
  1202.     "williamboman/mason-lspconfig.nvim",
  1203.     config = function()
  1204.       require("mason-lspconfig").setup({
  1205.         ensure_installed = {
  1206.           "cssls",
  1207.           "dockerls",
  1208.           "gopls",
  1209.           "graphql",
  1210.           "jsonls",
  1211.           "ts_ls",
  1212.           "eslint",
  1213.           "biome",
  1214.           "lua_ls",
  1215.           "marksman",
  1216.           "hydra_lsp",
  1217.         },
  1218.       })
  1219.     end,
  1220.   },
  1221.   {
  1222.     "neovim/nvim-lspconfig",
  1223.     config = function()
  1224.       -- local lspconfig = require("lspconfig")
  1225.       -- local capabilities = require("cmp_nvim_lsp").default_capabilities()
  1226.  
  1227.       -- lspconfig.cssls.setup({
  1228.       --   capabilities = capabilities,
  1229.       -- })
  1230.       -- lspconfig.dockerls.setup({
  1231.       --   capabilities = capabilities,
  1232.       -- })
  1233.       -- lspconfig.gopls.setup({
  1234.       --   capabilities = capabilities,
  1235.       -- })
  1236.       -- lspconfig.graphql.setup({
  1237.       --   capabilities = capabilities,
  1238.       -- })
  1239.       -- lspconfig.jsonls.setup({
  1240.       --   capabilities = capabilities,
  1241.       -- })
  1242.       -- lspconfig.ts_ls.setup({
  1243.       --   capabilities = capabilities,
  1244.       -- })
  1245.       -- lspconfig.eslint.setup({
  1246.       --   capabilities = capabilities,
  1247.       -- })
  1248.       -- lspconfig.biome.setup({
  1249.       --   capabilities = capabilities,
  1250.       -- })
  1251.       -- lspconfig.lua_ls.setup({
  1252.       --  capabilities = capabilities,
  1253.       -- })
  1254.       -- lspconfig.marksman.setup({
  1255.       --   capabilities = capabilities,
  1256.       -- })
  1257.       -- lspconfig.hydra_lsp.setup({
  1258.       --   capabilities = capabilities,
  1259.       -- })
  1260.       -- lspconfig.pico8_ls.setup({
  1261.       --   capabilities = capabilities,
  1262.       -- })
  1263.  
  1264.       vim.api.nvim_create_autocmd("LspAttach", {
  1265.         group = vim.api.nvim_create_augroup("UserLspConfig", {}),
  1266.         callback = function(ev)
  1267.           local opts = { buffer = ev.buf }
  1268.  
  1269.           vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
  1270.           vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
  1271.           vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
  1272.           vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
  1273.         end,
  1274.       })
  1275.     end,
  1276.   },
  1277. }
  1278.  
  1279.  
  1280. === lua/plugins/lualine.lua ===
  1281. -- status line
  1282. return {
  1283.   "nvim-lualine/lualine.nvim",
  1284.   dependencies = { 'nvim-tree/nvim-web-devicons' },
  1285.   config = function()
  1286.     require("lualine").setup({
  1287.       theme = "newpaper-light",
  1288.     })
  1289.   end
  1290. }
  1291.  
  1292.  
  1293. === lua/plugins/neotree.lua ===
  1294. -- file browser
  1295. return {
  1296.   "nvim-neo-tree/neo-tree.nvim",
  1297.   dependencies = {
  1298.     "nvim-lua/plenary.nvim",
  1299.     "nvim-tree/nvim-web-devicons",
  1300.     "MunifTanjim/nui.nvim",
  1301.   },
  1302.   config = function()
  1303.     vim.keymap.set('n', '<C-n>', ':Neotree reveal toggle left<CR>', {})
  1304.  
  1305.     local neotree = require('neo-tree')
  1306.  
  1307.     neotree.setup({
  1308.       use_popups_for_input = false,
  1309.     })
  1310.   end
  1311. }
  1312.  
  1313.  
  1314. === lua/plugins/newpaper.lua ===
  1315. -- color scheme
  1316. return {
  1317.     "yorik1984/newpaper.nvim",
  1318.     config = function()
  1319.         require("newpaper").setup({
  1320.             style = "light",
  1321.         })
  1322.     end,
  1323. }
  1324.  
  1325.  
  1326. === lua/plugins/none-ls.lua ===
  1327. -- Linting & formatting
  1328. return {
  1329.   "nvimtools/none-ls.nvim",
  1330.   dependencies = { "nvimtools/none-ls-extras.nvim" },
  1331.   config = function()
  1332.     local null_ls = require("null-ls")
  1333.  
  1334.     null_ls.setup({
  1335.         sources = {
  1336.             null_ls.builtins.formatting.stylua,
  1337.             null_ls.builtins.formatting.biome,
  1338.             null_ls.builtins.formatting.prettier,
  1339.             -- using instead of built-in: https://github.com/nvimtools/none-ls.nvim/discussions/81
  1340.             -- null_ls.builtins.diagnostics.eslint_d,
  1341.             require("none-ls.diagnostics.eslint_d"),
  1342.             null_ls.builtins.diagnostics.golangci_lint,
  1343.             null_ls.builtins.formatting.goimports,
  1344.         },
  1345.     })
  1346.  
  1347.     vim.diagnostic.config({
  1348.       virtual_text = true
  1349.     })
  1350.  
  1351.     vim.api.nvim_create_user_command("Format", ':lua vim.lsp.buf.format()' ,{})
  1352.   end
  1353. }
  1354.  
  1355.  
  1356. === lua/plugins/octo.lua ===
  1357. -- Manage Github reviews
  1358. return {
  1359.   'pwntester/octo.nvim',
  1360.   dependencies = {
  1361.     'nvim-lua/plenary.nvim',
  1362.     'nvim-telescope/telescope.nvim',
  1363.     'nvim-tree/nvim-web-devicons',
  1364.   },
  1365.   config = function ()
  1366.     require("octo").setup()
  1367.   end
  1368. }
  1369.  
  1370.  
  1371. === lua/plugins/rhubarb.lua ===
  1372. -- Enables browsing Github with `fugitive`
  1373. return {
  1374.   "tpope/vim-rhubarb"
  1375. }
  1376.  
  1377.  
  1378. === lua/plugins/searchindex.lua ===
  1379. -- adds match counter when searching a file
  1380. return {
  1381.   "google/vim-searchindex"
  1382. }
  1383.  
  1384.  
  1385. === lua/plugins/surround.lua ===
  1386. -- transform surrounds (brackets, parentheses, quotes, etc)
  1387. return {
  1388.   "tpope/vim-surround"
  1389. }
  1390.  
  1391.  
  1392. === lua/plugins/swapfile.lua ===
  1393. -- Manage swap files automatically
  1394.  
  1395. return {
  1396.   "gioele/vim-autoswap",
  1397.   config = function()
  1398.     vim.g.autoswap_detect_tmux = 1
  1399.   end,
  1400. }
  1401.  
  1402.  
  1403. === lua/plugins/telescope.lua ===
  1404. -- fuzzy file search / content search with UI
  1405. return {
  1406.   {
  1407.     "nvim-telescope/telescope.nvim",
  1408.     dependencies = {
  1409.       "nvim-lua/plenary.nvim",
  1410.       "nvim-telescope/telescope-live-grep-args.nvim",
  1411.     },
  1412.     config = function()
  1413.       local builtin = require("telescope.builtin")
  1414.       local layout = require("telescope.actions.layout")
  1415.       local actions = require("telescope.actions")
  1416.  
  1417.       local findIgnored = function()
  1418.         return builtin.find_files({
  1419.           no_ignore = false,
  1420.           hidden = true,
  1421.         })
  1422.       end
  1423.  
  1424.       local sortedBuffers = function()
  1425.         return builtin.buffers({
  1426.           sort_mru = true,
  1427.         })
  1428.       end
  1429.  
  1430.       vim.keymap.set("n", "<C-p>", builtin.find_files, {})
  1431.       vim.keymap.set("n", "<C-[>", findIgnored, {})
  1432.       vim.keymap.set("n", "<C-l>", builtin.live_grep, {})
  1433.       vim.keymap.set("n", "<C-x>", sortedBuffers, {})
  1434.  
  1435.       local telescope = require("telescope")
  1436.  
  1437.       local opts = {
  1438.         defaults = {
  1439.           mappings = {
  1440.             i = {
  1441.               ["<C-e>"] = layout.toggle_preview,
  1442.               ["<C-j>"] = actions.move_selection_next,
  1443.               ["<C-k>"] = actions.move_selection_previous,
  1444.               ["<C-h>"] = actions.results_scrolling_left,
  1445.               ["<C-l>"] = actions.results_scrolling_right,
  1446.             },
  1447.           },
  1448.         },
  1449.       }
  1450.  
  1451.       -- replace ripgrep with ag
  1452.       -- https://github.com/nvim-telescope/telescope.nvim/issues/2083
  1453.       local ag = os.execute("command -v " .. "ag")
  1454.       if ag == 0 then
  1455.         opts.defaults.vimgrep_arguments = {
  1456.           "ag",
  1457.           "--nocolor",
  1458.           "--noheading",
  1459.           "--numbers",
  1460.           "--column",
  1461.           "--smart-case",
  1462.           "--silent",
  1463.           "--vimgrep",
  1464.         }
  1465.       end
  1466.  
  1467.       -- extension for grepping with arguments
  1468.       vim.keymap.set("n", "<C-k>", ":lua require('telescope').extensions.live_grep_args.live_grep_args()<CR>", {})
  1469.  
  1470.       telescope.setup(opts)
  1471.  
  1472.       telescope.load_extension("live_grep_args")
  1473.       telescope.load_extension("ui-select")
  1474.     end,
  1475.   },
  1476.   {
  1477.     "nvim-telescope/telescope-ui-select.nvim",
  1478.     config = function()
  1479.       require("telescope").setup({
  1480.         extensions = {
  1481.           ["ui-select"] = {
  1482.             require("telescope.themes").get_dropdown({}),
  1483.           },
  1484.         },
  1485.       })
  1486.       require("telescope").load_extension("ui-select")
  1487.     end,
  1488.   },
  1489. }
  1490.  
  1491.  
  1492. === lua/plugins/treesitter.lua ===
  1493. -- syntax highlighting
  1494. return {
  1495.   "nvim-treesitter/nvim-treesitter",
  1496.   build = ":TSUpdate",
  1497.   config = function()
  1498.     local configs = require("nvim-treesitter.configs")
  1499.  
  1500.     configs.setup {
  1501.       ensure_installed = { "go", "javascript", "typescript", "json", "yaml", "html", "css", "lua", "bash"
  1502.       },
  1503.       highlight = {
  1504.         enable = true,
  1505.       },
  1506.       indent = {
  1507.         enable = true,
  1508.       },
  1509.     }
  1510.   end
  1511. }
  1512.  
  1513.  
  1514. === lua/plugins/trouble.lua ===
  1515. -- Diagnostics UI
  1516. return {
  1517.     "folke/trouble.nvim",
  1518.   opts = {},
  1519.     dependencies = { "nvim-tree/nvim-web-devicons" },
  1520. }
  1521.  
  1522.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement