Skip to content

Commit

Permalink
Merge pull request #21 from speshak/lazy
Browse files Browse the repository at this point in the history
Replace packer.nvim with lazy.nvim
  • Loading branch information
speshak authored Feb 21, 2024
2 parents 2004d25 + 319650e commit 97cc386
Show file tree
Hide file tree
Showing 17 changed files with 409 additions and 194 deletions.
13 changes: 13 additions & 0 deletions dot_config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Safely require files
local function safe_require(module)
local success, loaded_module = pcall(require, module)
if success then
return loaded_module
end
vim.cmd.echo('Error loading ' .. module)
end

safe_require('core.options')
safe_require('core.keymaps')
safe_require('core.autocommands')
safe_require('core.bootstrap')
12 changes: 0 additions & 12 deletions dot_config/nvim/init.vim

This file was deleted.

2 changes: 2 additions & 0 deletions dot_config/nvim/lua/core/autocommands.lua.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

-- vim:ft=lua
43 changes: 43 additions & 0 deletions dot_config/nvim/lua/core/bootstrap.lua.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
-- Bootstrap Lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)

local opts = {
git = {
log = { '--since=3 days ago' },
timeout = 60,
},
ui = { custom_keys = { false } },
install = { colorscheme = { 'tokyonight' } },
checker = { enabled = true },
performance = {
rtp = {
disabled_plugins = {
'gzip',
'netrwPlugin',
'tarPlugin',
'tohtml',
'tutor',
'zipPlugin',
'rplugin',
'matchparen',
'matchit',
},
},
},
}

-- Load the plugins and options
require('lazy').setup('plugins', opts)

-- vim:ft=lua
4 changes: 4 additions & 0 deletions dot_config/nvim/lua/core/keymaps.lua.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
local cmd = vim.cmd
local g = vim.g

-- vim:ft=lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
local cmd = vim.cmd
local opt = vim.opt
local g = vim.g

-- Language providers
g.python3_host_prog = '~/.pyenv/versions/py3nvim/bin/python'
-- Disable these so they don't show up in :checkhealth
g.loaded_perl_provider = 0
g.loaded_ruby_provider = 0

-- Configure fonts
g.guifont = "Sauce_Code_Pro_ExtraLight_Nerd_Font_Complete:h12"


-- TODO: refactor this into Lua
local cmd = vim.cmd
cmd([[
set fo=tcqln scs sm tm=200 bs=2 ai bg=dark title
set ignorecase nohlsearch number showcmd
Expand All @@ -16,6 +28,4 @@ cmd([[
set completeopt=menu
filetype on
]])

-- Configure fonts
g.guifont = "Sauce_Code_Pro_ExtraLight_Nerd_Font_Complete:h12"
-- vim:ft=lua
147 changes: 0 additions & 147 deletions dot_config/nvim/lua/plugins.lua.tmpl

This file was deleted.

58 changes: 58 additions & 0 deletions dot_config/nvim/lua/plugins/code.lua.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
-- Programming specific plugins
return {
-- Skeletons and snippets
{'pgilad/vim-skeletons',
dependencies = {'SirVer/ultisnips'},
config = function(plugin)
vim.cmd("let skeletons#autoRegister = 1")
end
},
{'SirVer/ultisnips',
dependencies = {'honza/vim-snippets'}
},

'github/copilot.vim',

-- Python
'majutsushi/tagbar',
'psf/black',

-- (Java|Type)Script
'Quramy/tsuquyomi',
'Quramy/vim-js-pretty-template',
'leafgarland/typescript-vim',

-- Dev Ops stuff
'digitalrounin/vim-yaml-folds',
{'hashivim/vim-terraform',
config = function(plugin)
vim.cmd([[silent! autocmd! filetypedetect BufRead,BufNewFile *.tf]])
vim.cmd([[autocmd BufRead,BufNewFile *.hcl set filetype=hcl]])
vim.cmd([[autocmd BufRead,BufNewFile .terraformrc,terraform.rc set filetype=hcl]])
vim.cmd([[autocmd BufRead,BufNewFile *.tf,*.tfvars set filetype=terraform]])
vim.cmd([[autocmd BufRead,BufNewFile *.tfstate,*.tfstate.backup set filetype=json]])

vim.g.terraform_fmt_on_save = 1
vim.g.terraform_align = 1
end
},
'juliosueiras/vim-terraform-completion',
'speshak/vim-cfn',
'hashicorp/sentinel.vim',

'ynkdir/vim-vimlparser',
'syngan/vim-vimlint',

-- Speed up loading/set custom filetypes
-- See https://github.com/nathom/filetype.nvim#customization for info on
-- setting custom types
'nathom/filetype.nvim',

'ryanoasis/vim-devicons',
'rhysd/committia.vim',

-- Optimiser
"lewis6991/impatient.nvim",
}

-- vim:ft=lua
Loading

0 comments on commit 97cc386

Please sign in to comment.