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