use lazy.nvim to add plugins
vim-fugitive, telescope and nvim-lspconfig plugins added
This commit is contained in:
1
nvim/.gitignore
vendored
Normal file
1
nvim/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
lazy-lock.json
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
package.path = package.path .. ";/home/dhanus/.config/nvim/?.lua"
|
package.path = package.path .. ";/home/dhanus/.config/nvim/?.lua"
|
||||||
|
|
||||||
require('settings')
|
require('settings')
|
||||||
require('bindings')
|
require('bindings')
|
||||||
|
require('packconf.lazy')
|
||||||
|
|
||||||
|
|||||||
23
nvim/lua/plugins/init.lua
Normal file
23
nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
config = function()
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
vim.keymap.set('n', '<leader>tf', builtin.find_files, { desc = 'Telescope find files' })
|
||||||
|
vim.keymap.set('n', '<leader>gr', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||||
|
vim.keymap.set('n', '<leader>tb', builtin.buffers, { desc = 'Telescope buffers' })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
vim.lsp.enable('rust_analyzer')
|
||||||
|
vim.lsp.enable('clangd')
|
||||||
|
vim.lsp.enable('lua_ls')
|
||||||
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
25
nvim/packconf/lazy.lua
Normal file
25
nvim/packconf/lazy.lua
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
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)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
{import = "plugins"}
|
||||||
|
},
|
||||||
|
install = { colorscheme = { "habamax" } },
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user