1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
jdhao
6c1dbdf8fc update spell 2022-10-16 10:26:41 +08:00
jdhao
202a9a088d remove vim-json
rarely used and it changes the conceal settings
2022-10-16 10:24:53 +08:00
jdhao
d939cc75c6 refactor: make packer installation a function 2022-10-16 10:23:40 +08:00
2 changed files with 23 additions and 13 deletions

View File

@ -4,24 +4,31 @@ local fn = vim.fn
-- The root dir to install all plugins. Plugins are under opt/ or start/ sub-directory.
vim.g.plugin_home = fn.stdpath("data") .. "/site/pack/packer"
-- Where to install packer.nvim -- the package manager (we make it opt)
local packer_dir = vim.g.plugin_home .. "/opt/packer.nvim"
--- Install packer if it has not been installed.
--- Return:
--- true: if this is a fresh install of packer
--- false: if packer has been installed
local function packer_ensure_install()
-- Where to install packer.nvim -- the package manager (we make it opt)
local packer_dir = vim.g.plugin_home .. "/opt/packer.nvim"
-- Whether this is a fresh install, i.e., packer itself and plugins have not been installed.
local fresh_install = false
if fn.glob(packer_dir) ~= "" then
return false
end
-- Auto-install packer in case it hasn't been installed.
if fn.glob(packer_dir) == "" then
fresh_install = true
-- Auto-install packer in case it hasn't been installed.
vim.api.nvim_echo({ { "Installing packer.nvim", "Type" } }, true, {})
-- Now we need to install packer.nvim first.
local packer_repo = "https://github.com/wbthomason/packer.nvim"
local install_cmd = string.format("!git clone --depth=1 %s %s", packer_repo, packer_dir)
vim.api.nvim_echo({ { "Installing packer.nvim", "Type" } }, true, {})
vim.cmd(install_cmd)
return true
end
local fresh_install = packer_ensure_install()
-- Load packer.nvim
vim.cmd("packadd packer.nvim")
@ -252,9 +259,6 @@ packer.startup {
-- Vim tabular plugin for manipulate tabular, required by markdown plugins
use { "godlygeek/tabular", cmd = { "Tabularize" } }
-- Markdown JSON header highlight plugin
use { "elzr/vim-json", ft = { "json", "markdown" } }
-- Markdown previewing (only for Mac and Windows)
if vim.g.is_win or vim.g.is_mac then
use {

View File

@ -446,3 +446,9 @@ shada
async
localhost
JetBrains
localhost
MariaDB
SQLite
Pgadmin
Datagrip
mysql