begin refresh
This commit is contained in:
parent
32744c3f66
commit
c6629b47ff
2 changed files with 50 additions and 68 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ test.sh
|
||||||
.luarc.json
|
.luarc.json
|
||||||
nvim
|
nvim
|
||||||
plugin/packer_compiled.lua
|
plugin/packer_compiled.lua
|
||||||
|
lazy-lock.json
|
||||||
|
|
117
init.lua
117
init.lua
|
@ -1,19 +1,24 @@
|
||||||
-- Install packer
|
-- Install package manager
|
||||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
-- https://github.com/folke/lazy.nvim
|
||||||
local is_bootstrap = false
|
-- `:help lazy.nvim.txt` for more info
|
||||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
is_bootstrap = true
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
|
vim.fn.system {
|
||||||
vim.cmd [[packadd packer.nvim]]
|
'git',
|
||||||
|
'clone',
|
||||||
|
'--filter=blob:none',
|
||||||
|
'https://github.com/folke/lazy.nvim.git',
|
||||||
|
'--branch=stable', -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require('packer').startup(function(use)
|
require('lazy').setup({
|
||||||
-- Package manager
|
---@diagnostic disable-next-line: assign-type-mismatch
|
||||||
use 'wbthomason/packer.nvim'
|
{ -- LSP Configuration & Plugins
|
||||||
|
|
||||||
use { -- LSP Configuration & Plugins
|
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
requires = {
|
dependencies = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
-- Automatically install LSPs to stdpath for neovim
|
||||||
'williamboman/mason.nvim',
|
'williamboman/mason.nvim',
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
@ -24,73 +29,49 @@ require('packer').startup(function(use)
|
||||||
-- Additional lua configuration, makes nvim stuff amazing
|
-- Additional lua configuration, makes nvim stuff amazing
|
||||||
'folke/neodev.nvim',
|
'folke/neodev.nvim',
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
{ -- Autocompletion
|
||||||
use { -- Autocompletion
|
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
|
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
|
||||||
}
|
},
|
||||||
|
|
||||||
use { -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = function()
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
pcall(require('nvim-treesitter.install').update { with_sync = true })
|
pcall(require('nvim-treesitter.install').update { with_sync = true })
|
||||||
end,
|
end,
|
||||||
}
|
},
|
||||||
|
|
||||||
use { -- Additional text objects via treesitter
|
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
|
||||||
after = 'nvim-treesitter',
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Git related plugins
|
-- Git related plugins
|
||||||
use 'tpope/vim-fugitive'
|
'tpope/vim-fugitive',
|
||||||
use 'tpope/vim-rhubarb'
|
'tpope/vim-rhubarb',
|
||||||
use 'lewis6991/gitsigns.nvim'
|
'lewis6991/gitsigns.nvim',
|
||||||
|
|
||||||
use 'navarasu/onedark.nvim' -- Theme inspired by Atom
|
'navarasu/onedark.nvim', -- Theme inspired by Atom
|
||||||
use 'nvim-lualine/lualine.nvim' -- Fancier statusline
|
'nvim-lualine/lualine.nvim', -- Fancier statusline
|
||||||
use 'lukas-reineke/indent-blankline.nvim' -- Add indentation guides even on blank lines
|
'lukas-reineke/indent-blankline.nvim', -- Add indentation guides even on blank lines
|
||||||
use 'numToStr/Comment.nvim' -- "gc" to comment visual regions/lines
|
'numToStr/Comment.nvim', -- "gc" to comment visual regions/lines
|
||||||
use 'tpope/vim-sleuth' -- Detect tabstop and shiftwidth automatically
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||||
|
|
||||||
-- Fuzzy Finder (files, lsp, etc)
|
-- Fuzzy Finder (files, lsp, etc)
|
||||||
use { 'nvim-telescope/telescope.nvim', branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
|
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
|
||||||
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 }
|
{
|
||||||
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
|
build = 'make',
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable 'make' == 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- Add custom plugins to packer from ~/.config/nvim/lua/custom/plugins.lua
|
-- TODO:
|
||||||
local has_plugins, plugins = pcall(require, 'custom.plugins')
|
-- { import = 'kickstart' },
|
||||||
if has_plugins then
|
-- { import = 'custom.plugins' },
|
||||||
plugins(use)
|
}, {})
|
||||||
end
|
|
||||||
|
|
||||||
if is_bootstrap then
|
|
||||||
require('packer').sync()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- When we are bootstrapping a configuration, it doesn't
|
|
||||||
-- make sense to execute the rest of the init.lua.
|
|
||||||
--
|
|
||||||
-- You'll need to restart nvim, and then it will work.
|
|
||||||
if is_bootstrap then
|
|
||||||
print '=================================='
|
|
||||||
print ' Plugins are being installed'
|
|
||||||
print ' Wait until Packer completes,'
|
|
||||||
print ' then restart nvim'
|
|
||||||
print '=================================='
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Automatically source and re-compile packer whenever you save this init.lua
|
|
||||||
local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
|
||||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
|
||||||
command = 'source <afile> | silent! LspStop | silent! LspStart | PackerCompile',
|
|
||||||
group = packer_group,
|
|
||||||
pattern = vim.fn.expand '$MYVIMRC',
|
|
||||||
})
|
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.o`
|
-- See `:help vim.o`
|
||||||
|
@ -343,7 +324,7 @@ local servers = {
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- tsserver = {},
|
-- tsserver = {},
|
||||||
|
|
||||||
sumneko_lua = {
|
lua_ls = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
|
|
Loading…
Reference in a new issue