mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
No commits in common. "6c1dbdf8fce1d7ed78c5f6a47935117a4abea966" and "26921309ec003a2f829a6ff4efd152c7725069bf" have entirely different histories.
6c1dbdf8fc
...
26921309ec
@ -4,31 +4,24 @@ local fn = vim.fn
|
|||||||
-- The root dir to install all plugins. Plugins are under opt/ or start/ sub-directory.
|
-- 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"
|
vim.g.plugin_home = fn.stdpath("data") .. "/site/pack/packer"
|
||||||
|
|
||||||
--- Install packer if it has not been installed.
|
-- Where to install packer.nvim -- the package manager (we make it opt)
|
||||||
--- Return:
|
local packer_dir = vim.g.plugin_home .. "/opt/packer.nvim"
|
||||||
--- 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"
|
|
||||||
|
|
||||||
if fn.glob(packer_dir) ~= "" then
|
-- Whether this is a fresh install, i.e., packer itself and plugins have not been installed.
|
||||||
return false
|
local fresh_install = false
|
||||||
end
|
|
||||||
|
|
||||||
-- Auto-install packer in case it hasn't been installed.
|
-- Auto-install packer in case it hasn't been installed.
|
||||||
vim.api.nvim_echo({ { "Installing packer.nvim", "Type" } }, true, {})
|
if fn.glob(packer_dir) == "" then
|
||||||
|
fresh_install = true
|
||||||
|
|
||||||
|
-- Now we need to install packer.nvim first.
|
||||||
local packer_repo = "https://github.com/wbthomason/packer.nvim"
|
local packer_repo = "https://github.com/wbthomason/packer.nvim"
|
||||||
local install_cmd = string.format("!git clone --depth=1 %s %s", packer_repo, packer_dir)
|
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)
|
vim.cmd(install_cmd)
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local fresh_install = packer_ensure_install()
|
|
||||||
|
|
||||||
-- Load packer.nvim
|
-- Load packer.nvim
|
||||||
vim.cmd("packadd packer.nvim")
|
vim.cmd("packadd packer.nvim")
|
||||||
|
|
||||||
@ -259,6 +252,9 @@ packer.startup {
|
|||||||
-- Vim tabular plugin for manipulate tabular, required by markdown plugins
|
-- Vim tabular plugin for manipulate tabular, required by markdown plugins
|
||||||
use { "godlygeek/tabular", cmd = { "Tabularize" } }
|
use { "godlygeek/tabular", cmd = { "Tabularize" } }
|
||||||
|
|
||||||
|
-- Markdown JSON header highlight plugin
|
||||||
|
use { "elzr/vim-json", ft = { "json", "markdown" } }
|
||||||
|
|
||||||
-- Markdown previewing (only for Mac and Windows)
|
-- Markdown previewing (only for Mac and Windows)
|
||||||
if vim.g.is_win or vim.g.is_mac then
|
if vim.g.is_win or vim.g.is_mac then
|
||||||
use {
|
use {
|
||||||
|
|||||||
@ -446,9 +446,3 @@ shada
|
|||||||
async
|
async
|
||||||
localhost
|
localhost
|
||||||
JetBrains
|
JetBrains
|
||||||
localhost
|
|
||||||
MariaDB
|
|
||||||
SQLite
|
|
||||||
Pgadmin
|
|
||||||
Datagrip
|
|
||||||
mysql
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user