revamped nvim config with lazy.nvim
This commit is contained in:
parent
7ecd56df02
commit
bc3d990481
13 changed files with 217 additions and 313 deletions
37
.config/nvim/lua/config/lazy.lua
Normal file
37
.config/nvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ "folke/which-key.nvim", lazy = true },
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equivalent to setup({}) function
|
||||
},
|
||||
{ "christoomey/vim-tmux-navigator" },
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "tokyonight" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
32
.config/nvim/lua/config/options.lua
Normal file
32
.config/nvim/lua/config/options.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.breakindentopt = {'shift:2', 'sbr'}
|
||||
vim.opt.showbreak = ' >'
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.encoding = "utf-8"
|
||||
|
||||
-- search
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- indentation
|
||||
vim.opt.smarttab = true
|
||||
vim.opt.expandtab = false
|
||||
vim.opt.copyindent = true
|
||||
vim.opt.preserveindent = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.softtabstop = 0
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { "*.py" },
|
||||
callback = function()
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
end
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue