Compare commits

..

2 Commits

Author SHA1 Message Date
76bdd7b9fe use lazy.nvim to add plugins
vim-fugitive, telescope and nvim-lspconfig plugins added
2026-03-29 19:58:15 +05:30
a24380f314 add yaml, toml to batch comment rule 2026-03-07 15:17:26 +05:30
5 changed files with 53 additions and 2 deletions

1
nvim/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lazy-lock.json

View File

@@ -43,7 +43,7 @@ local common_group = vim.api.nvim_create_augroup('common', {clear = true})
local spec_group = vim.api.nvim_create_augroup('lang_spec', {clear = true}) local spec_group = vim.api.nvim_create_augroup('lang_spec', {clear = true})
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "python", "make", "sh", "cmake" }, pattern = { "python", "make", "sh", "cmake", "yaml", "toml" },
callback = function(args) callback = function(args)
vim.keymap.set('v', '<leader>#', ':normal 0i#<esc>', { buffer = args.buf }) vim.keymap.set('v', '<leader>#', ':normal 0i#<esc>', { buffer = args.buf })
end, end,
@@ -70,7 +70,7 @@ vim.api.nvim_create_autocmd("FileType", {
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { 'c', 'cpp' }, pattern = { 'c', 'cpp', 'rust' },
callback = function(args) callback = function(args)
vim.keymap.set('v', '<leader>/*', '<esc>`<i/*<esc>`>i*/<esc>', { buffer = args.buf }) vim.keymap.set('v', '<leader>/*', '<esc>`<i/*<esc>`>i*/<esc>', { buffer = args.buf })
end, end,

View File

@@ -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
View 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
View 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 },
})