add neogit and venn diagram config

This commit is contained in:
Vladan Popovic 2024-01-03 01:24:21 +01:00
parent 8437ec67c1
commit 062d618a21
3 changed files with 41 additions and 5 deletions

View file

@ -8,7 +8,10 @@ require('packer').startup(function()
-- Fuzzy finder -- Fuzzy finder
use { use {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}} requires = {
{'nvim-lua/popup.nvim'},
{'nvim-lua/plenary.nvim'},
}
} }
-- Autocomplete and snippets -- Autocomplete and snippets
@ -42,19 +45,26 @@ require('packer').startup(function()
use { 'tjdevries/nlua.nvim' } use { 'tjdevries/nlua.nvim' }
-- Git -- Git
use { 'NeogitOrg/neogit' } use {
'NeogitOrg/neogit',
requires = {
{ "nvim-lua/plenary.nvim" },
{ "sindrets/diffview.nvim" },
},
}
-- Filesystem in a nvim buffer -- Filesystem in a nvim buffer
use { 'stevearc/oil.nvim' } use { 'stevearc/oil.nvim' }
-- Misc -- Misc
use { 'RRethy/vim-illuminate' } -- highlight all words same as the one under cursor use { 'jbyuki/venn.nvim' } -- ascii diagrams
use { 'vim-scripts/DrawIt' } -- ascii diagrams
use { 'nathom/filetype.nvim' } use { 'nathom/filetype.nvim' }
end) end)
require('plugins.cmp') require('plugins.cmp')
require('plugins.neogit')
require('plugins.oil')
require('plugins.treesitter') require('plugins.treesitter')
require('plugins.telescope') require('plugins.telescope')
require('plugins.oil') require('plugins.venn')

5
lua/plugins/neogit.lua Normal file
View file

@ -0,0 +1,5 @@
local neogit = require('neogit')
neogit.setup { }
vim.keymap.set('n', '<C-x><C-g>', neogit.open, {})

21
lua/plugins/venn.lua Normal file
View file

@ -0,0 +1,21 @@
-- venn.nvim: enable or disable keymappings
function _G.Toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
if venn_enabled == "nil" then
vim.b.venn_enabled = true
vim.cmd[[setlocal ve=all]]
-- draw a line on HJKL keystokes
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true})
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true})
-- draw a box by pressing "f" with visual selection
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true})
else
vim.cmd[[setlocal ve=]]
vim.cmd[[mapclear <buffer>]]
vim.b.venn_enabled = nil
end
end
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true})