Merge pull request #165 from Akianonymus/main

Even faster startup time | Fix formatting | Misc
This commit is contained in:
siduck76 2021-07-19 08:54:01 +05:30 committed by GitHub
commit 3669af3517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 29 deletions

View File

@ -153,11 +153,7 @@ main() {
if _NVIM="$(command -v nvim)"; then
if _check_nvim_version; then
printf "\n%s\n" "=> Neovim will now open." && sleep 1
if [ "${_UPDATE}" = "false" ]; then
"${_NVIM}" +":lua require 'pluginList' vim.cmd('PackerSync')"
else
"${_NVIM}"
fi
"${_NVIM}" +":lua require 'pluginList' vim.cmd('PackerSync')"
else
printf "Error: Neovim is installed, but version is lower than 0.5.x, install Neovim >= 5.x and then run nvim & do :PackerSync\n."
fi

View File

@ -1,6 +1,13 @@
local opt = vim.opt
local g = vim.g
-- Turn these off at startup, will be enabled later just before loading the theme
vim.cmd([[
syntax off
filetype off
filetype plugin indent off
]])
opt.ruler = false
opt.hidden = true
opt.ignorecase = true
@ -19,7 +26,7 @@ opt.clipboard = "unnamedplus"
opt.shortmess:append("sI")
-- disable tilde on end of buffer: https://github.com/ neovim/neovim/pull/8546#issuecomment-643643758
vim.cmd [[let &fcs='eob: ']]
vim.cmd("let &fcs='eob: '")
-- Numbers
opt.number = true

View File

@ -1,7 +1,9 @@
vim.cmd("packadd packer.nvim")
local present, packer = pcall(require, "packer")
if not present then
local packer_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
local packer_path = vim.fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim"
print("Cloning packer..")
-- remove the dir before cloning
@ -17,6 +19,7 @@ if not present then
}
)
vim.cmd("packadd packer.nvim")
present, packer = pcall(require, "packer")
if present then

View File

@ -1,6 +1,5 @@
vim.cmd [[packadd packer.nvim]]
local present, _ = pcall(require, "packerInit")
local packer
if present then
packer = require "packer"
@ -12,9 +11,15 @@ local use = packer.use
return packer.startup(
function()
use {"wbthomason/packer.nvim", event = "VimEnter"}
use {
"wbthomason/packer.nvim",
event = "VimEnter"
}
use {"akinsho/nvim-bufferline.lua", after = "nvim-base16.lua"}
use {
"akinsho/nvim-bufferline.lua",
after = "nvim-base16.lua"
}
use {
"glepnir/galaxyline.nvim",
@ -78,7 +83,7 @@ return packer.startup(
config = function()
require "plugins.compe"
end,
wants = {"LuaSnip"},
wants = "LuaSnip",
requires = {
{
"L3MON4D3/LuaSnip",
@ -95,7 +100,10 @@ return packer.startup(
}
}
use {"sbdchd/neoformat", cmd = "Neoformat"}
use {
"sbdchd/neoformat",
cmd = "Neoformat"
}
-- file managing , picker etc
use {
@ -114,8 +122,14 @@ return packer.startup(
end
}
use {"nvim-lua/plenary.nvim", event = "BufRead"}
use {"nvim-lua/popup.nvim", after = "plenary.nvim"}
use {
"nvim-lua/plenary.nvim",
event = "BufRead"
}
use {
"nvim-lua/popup.nvim",
after = "plenary.nvim"
}
use {
"nvim-telescope/telescope.nvim",
@ -125,7 +139,11 @@ return packer.startup(
end
}
use {"nvim-telescope/telescope-fzf-native.nvim", run = "make", cmd = "Telescope"}
use {
"nvim-telescope/telescope-fzf-native.nvim",
run = "make",
cmd = "Telescope"
}
use {
"nvim-telescope/telescope-media-files.nvim",
cmd = "Telescope"
@ -149,7 +167,10 @@ return packer.startup(
end
}
use {"andymass/vim-matchup", event = "CursorMoved"}
use {
"andymass/vim-matchup",
event = "CursorMoved"
}
use {
"terrortylor/nvim-comment",
@ -173,7 +194,10 @@ return packer.startup(
end
}
use {"tweekmonster/startuptime.vim", cmd = "StartupTime"}
use {
"tweekmonster/startuptime.vim",
cmd = "StartupTime"
}
-- load autosave only if its globally enabled
use {
@ -197,7 +221,11 @@ return packer.startup(
use {
"Pocco81/TrueZen.nvim",
cmd = {"TZAtaraxis", "TZMinimalist", "TZFocus"},
cmd = {
"TZAtaraxis",
"TZMinimalist",
"TZFocus"
},
config = function()
require "plugins.zenmode"
end

View File

@ -1,11 +1,5 @@
local luasnip
if
not pcall(
function()
luasnip = require "luasnip"
end
)
then
local present, luasnip = pcall(require, "luasnip")
if not present then
return
end

View File

@ -76,5 +76,8 @@ if
)
then
-- This should only trigger when in need of PackerSync, so better do it
vim.cmd("PackerSync")
print("After completion of PackerSync, restart neovim.")
require("packer").sync("telescope-fzf-native.nvim", "telescope-media-files.nvim")
-- why compile too ? well, packer is supposed to compile with sync only, but sometimes it doesn't work
vim.cmd("PackerCompile")
end

View File

@ -3,8 +3,15 @@ vim.g.nvchad_theme = "onedark"
local present, base16 = pcall(require, "base16")
if present then
-- enabled these options, was disabled in options.lua
vim.cmd([[
syntax on
filetype on
filetype plugin indent on
]])
base16(base16.themes["onedark"], true)
pcall(require, "highlights")
require "highlights"
return true
else
return false