|
| 1 | +local fn = vim.fn |
| 2 | + |
| 3 | +-- Automatically install packer |
| 4 | +local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" |
| 5 | +if fn.empty(fn.glob(install_path)) > 0 then |
| 6 | + PACKER_BOOTSTRAP = fn.system({ |
| 7 | + "git", |
| 8 | + "clone", |
| 9 | + "--depth", |
| 10 | + "1", |
| 11 | + "https://github.com/wbthomason/packer.nvim", |
| 12 | + install_path, |
| 13 | + }) |
| 14 | + print("Installing packer close and reopen Neovim...") |
| 15 | + vim.cmd([[packadd packer.nvim]]) |
| 16 | +end |
| 17 | + |
| 18 | +-- Autocommand that reloads neovim whenever you save the plugins.lua file |
| 19 | +vim.cmd([[ |
| 20 | + augroup packer_user_config |
| 21 | + autocmd! |
| 22 | + autocmd BufWritePost plugins.lua source <afile> | PackerSync |
| 23 | + augroup end |
| 24 | +]]) |
| 25 | + |
| 26 | +-- Use a protected call so we don't error out on first use |
| 27 | +local status_ok, packer = pcall(require, "packer") |
| 28 | +if not status_ok then |
| 29 | + return |
| 30 | +end |
| 31 | + |
| 32 | +-- Have packer use a popup window |
| 33 | +packer.init({ |
| 34 | + display = { |
| 35 | + open_fn = function() |
| 36 | + return require("packer.util").float({ border = "rounded" }) |
| 37 | + end, |
| 38 | + }, |
| 39 | +}) |
| 40 | + |
| 41 | +-- Install your plugins here |
| 42 | +return packer.startup(function(use) |
| 43 | + -- My plugins here |
| 44 | + use({ "wbthomason/packer.nvim" }) |
| 45 | + use({ "nvim-lua/plenary.nvim" }) -- Common utilities |
| 46 | + |
| 47 | + -- Colorschemes |
| 48 | + use({ "EdenEast/nightfox.nvim" }) |
| 49 | + |
| 50 | + -- 括弧 |
| 51 | + use { |
| 52 | + "windwp/nvim-autopairs", |
| 53 | + config = function() require("nvim-autopairs").setup {} end |
| 54 | + } |
| 55 | + use { |
| 56 | + 'andymass/vim-matchup', |
| 57 | + setup = function() |
| 58 | + -- may set any options here |
| 59 | + vim.g.matchup_matchparen_offscreen = { method = "popup" } |
| 60 | + end |
| 61 | + } |
| 62 | + |
| 63 | + -- 補完 |
| 64 | + use({ "hrsh7th/cmp-nvim-lsp" }) -- lsp 用の補完ソース。 |
| 65 | + use({ "hrsh7th/cmp-buffer" }) -- buffer completions |
| 66 | + use({ "hrsh7th/cmp-path" }) -- path completions |
| 67 | + use({ "hrsh7th/cmp-cmdline" }) -- cmdline completions |
| 68 | + use({ "hrsh7th/nvim-cmp" }) -- The completion plugin |
| 69 | + -- use({ "hrsh7th/cmp-nvim-lua" }) -- lua用の補完ソース |
| 70 | + |
| 71 | + -- snippets (luasnip) |
| 72 | + -- use({ "L3MON4D3/LuaSnip" }) |
| 73 | + -- use({ "saadparwaiz1/cmp_luasnip"}) |
| 74 | + |
| 75 | + -- LSP(メジャーな言語のLSPはこれで対応可能) |
| 76 | + use({ "williamboman/mason.nvim" }) |
| 77 | + use({ "williamboman/mason-lspconfig.nvim" }) |
| 78 | + use({ "neovim/nvim-lspconfig" }) |
| 79 | + |
| 80 | + use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters |
| 81 | + |
| 82 | + -- Telescope |
| 83 | + use({ "nvim-telescope/telescope.nvim" }) |
| 84 | + use({ "nvim-telescope/telescope-file-browser.nvim" }) |
| 85 | + -- use({ |
| 86 | + -- "nvim-telescope/telescope-frecency.nvim", |
| 87 | + -- config = function() |
| 88 | + -- require"telescope".load_extension("frecency") |
| 89 | + -- end, |
| 90 | + -- requires = {"kkharji/sqlite.lua"} |
| 91 | + -- }) |
| 92 | + |
| 93 | + -- Treesitter |
| 94 | + use { |
| 95 | + 'nvim-treesitter/nvim-treesitter', |
| 96 | + run = function() |
| 97 | + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) |
| 98 | + ts_update() |
| 99 | + end, |
| 100 | + } |
| 101 | + |
| 102 | + -- markdown preview |
| 103 | + use({ |
| 104 | + "iamcco/markdown-preview.nvim", |
| 105 | + run = function() vim.fn["mkdp#util#install"]() end, |
| 106 | + }) |
| 107 | + -- use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, }) |
| 108 | + |
| 109 | + -- 見た目 |
| 110 | + use { |
| 111 | + 'nvim-lualine/lualine.nvim', |
| 112 | + requires = { 'kyazdani42/nvim-web-devicons', opt = true } |
| 113 | + } |
| 114 | + use({ "kyazdani42/nvim-web-devicons" }) -- File icons |
| 115 | + use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'} |
| 116 | + use({ 'mvllow/modes.nvim', tag = 'v0.2.0' }) -- 行の色でモードが分かる |
| 117 | + use({ "petertriho/nvim-scrollbar"} ) -- スクロールバーを表示 |
| 118 | + -- 検索したワードの場所がわかりやすくなる |
| 119 | + -- use { |
| 120 | + -- "kevinhwang91/nvim-hlslens", |
| 121 | + -- config = function() |
| 122 | + -- require("scrollbar.handlers.search").setup({ |
| 123 | + -- }) |
| 124 | + -- end, |
| 125 | + -- } |
| 126 | + -- gitのsignが出る |
| 127 | + -- use { |
| 128 | + -- "lewis6991/gitsigns.nvim", |
| 129 | + -- config = function() |
| 130 | + -- require('gitsigns').setup() |
| 131 | + -- require("scrollbar.handlers.gitsigns").setup() |
| 132 | + -- end |
| 133 | + -- } |
| 134 | + |
| 135 | + -- Automatically set up your configuration after cloning packer.nvim |
| 136 | + -- Put this at the end after all plugins |
| 137 | + if PACKER_BOOTSTRAP then |
| 138 | + require("packer").sync() |
| 139 | + end |
| 140 | +end) |
| 141 | + |
0 commit comments