plugins.lua (2488B) - raw


      1 local ret = require("paq") {
      2     "sheerun/vim-polyglot",           -- languages syntax
      3     "tpope/vim-fugitive",             -- git wrapper
      4     "tpope/vim-surround",             -- add surrounding as objects
      5         "tpope/vim-repeat",           -- dependency of vim-surround
      6     "tpope/vim-commentary",           -- easily comment code
      7     "tpope/vim-eunuch",               -- helpers for UNIX shell commands
      8     "nvim-telescope/telescope.nvim",  -- fuzzy finding
      9         "nvim-lua/plenary.nvim",      -- dependency of telescope
     10     "vimwiki/vimwiki",                -- create a wiki with vim!
     11     { url="https://dev.sanctum.geek.nz/code/vim-redact-pass.git", shallow=false }, -- disable leaky options when editing passwords with pass
     12 }
     13 
     14 -- don't run the package configs if we are doing the initial bootstrap
     15 if vim.g.headless_bootstrap then
     16     return ret
     17 end
     18 
     19 
     20 do -- vim-commentary
     21     vim.cmd [[
     22         augroup paq_vimcommentary
     23             autocmd!
     24             autocmd FileType apache,crontab setlocal commentstring=#\ %s
     25         augroup END
     26     ]]
     27 end
     28 
     29 
     30 do -- vim-eunuch
     31     vim.cmd "command! W SudoWrite"
     32 end
     33 
     34 
     35 do -- telescope
     36     vim.cmd "nnoremap <Leader>f <Cmd>Telescope find_files<CR>"
     37     vim.cmd "nnoremap <Leader>g <Cmd>Telescope git_files<CR>"
     38     vim.cmd "nnoremap <Leader>b <Cmd>Telescope buffers<CR>"
     39     vim.cmd "nnoremap <Leader>h <Cmd>Telescope help_tags<CR>"
     40     require("telescope-pickers")
     41 end
     42 
     43 
     44 do -- vimwiki
     45     vim.g.vimwiki_global_ext = 0
     46     vim.g.vimwiki_folding = "custom"
     47 
     48     -- first category is used for important meta files to be shown on root,
     49     -- last category is used for uncategorized files
     50     vim.g.vw_categories = { "Arrel", "Notes", "Temporal", "Receptes", "Blog", "Projectes", "Tecnologia", "Programari", "Altres", "Arxiu", "Sense categoria" }
     51 
     52     local vw_categories_str = ""
     53     for _, c in pairs(vim.g.vw_categories) do
     54         vw_categories_str = vw_categories_str .. " " .. string.gsub(c, " ", "\\ ")
     55     end
     56     vim.g.vimwiki_list = {{
     57         ["path"] = "~/Documents/wiki",
     58         ["path_html"] = "~/.cache/vimwiki/html",
     59         ["custom_wiki2html"] = "~/.local/share/vimwiki/wiki2html.py",
     60         ["syntax"] = "markdown",
     61         ["ext"] = ".md",
     62         ["template_path"] = "~/.local/share/vimwiki/",
     63         ["template_default"] = "template",
     64         ["template_ext"] = ".html",
     65         ["custom_wiki2html_args"] = "toc.md " .. vw_categories_str -- first argument is TOC file, then all the categories
     66     }}
     67 end
     68 
     69 
     70 return ret