added more plugins

This commit is contained in:
Brij Kishore Sharma 2024-07-01 17:02:59 +01:00
parent 5aeddfdd5d
commit f50ff82f33
5 changed files with 243 additions and 4 deletions

View file

@ -0,0 +1,40 @@
return {
'ThePrimeagen/harpoon',
branch = 'harpoon2',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local harpoon = require 'harpoon'
-- REQUIRED
harpoon:setup()
-- REQUIRED
vim.keymap.set('n', '<leader>a', function()
harpoon:list():add()
end)
vim.keymap.set('n', '<C-e>', function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set('n', '<leader>1', function()
harpoon:list():select(1)
end)
vim.keymap.set('n', '<leader>2', function()
harpoon:list():select(2)
end)
vim.keymap.set('n', '<leader>3', function()
harpoon:list():select(3)
end)
vim.keymap.set('n', '<leader>4', function()
harpoon:list():select(4)
end)
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set('n', '<C-S-P>', function()
harpoon:list():prev()
end)
vim.keymap.set('n', '<C-S-N>', function()
harpoon:list():next()
end)
end,
}

View file

@ -2,4 +2,59 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
'nvim-tree/nvim-tree.lua',
version = '*',
lazy = false,
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
require('nvim-tree').setup {}
--
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- empty setup using defaults
local nvim_tree_api = require 'nvim-tree.api'
local function open_nvim_tree(data)
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
if directory then
-- change to the directory
vim.cmd.cd(data.file)
-- open the tree
nvim_tree_api.tree.open()
return
end
-- buffer is a real file on the disk
local real_file = vim.fn.filereadable(data.file) == 1
-- buffer is a [No Name]
local no_name = data.file == '' and vim.bo[data.buf].buftype == ''
if not real_file and not no_name then
return
end
-- open the tree, find the file but don't focus it
nvim_tree_api.tree.toggle { focus = false, find_file = true }
end
vim.api.nvim_create_autocmd({ 'VimEnter' }, { callback = open_nvim_tree })
vim.keymap.set('n', '<leader>x', function()
nvim_tree_api.tree.open()
end)
vim.api.nvim_create_autocmd('BufEnter', {
group = vim.api.nvim_create_augroup('NvimTreeClose', { clear = true }),
pattern = 'NvimTree_*',
callback = function()
local layout = vim.api.nvim_call_function('winlayout', {})
if layout[1] == 'leaf' and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), 'filetype') == 'NvimTree' and layout[3] == nil then
vim.cmd 'confirm quit'
end
end,
})
end,
}

View file

@ -0,0 +1,6 @@
return {
'ggandor/leap.nvim',
config = function()
require('leap').create_default_mappings()
end,
}