-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazy load all the plugins. Set keymaps with lazy.nvim
- Loading branch information
Showing
12 changed files
with
307 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
local setup_dap = function() | ||
local dap = require 'dap' | ||
dap.adapters.lldb = { | ||
type = 'executable', | ||
command = '/opt/homebrew/opt/llvm@18/bin/lldb-dap', | ||
name = 'lldb', | ||
} | ||
|
||
dap.configurations.cpp = { | ||
{ | ||
name = 'Launch', | ||
type = 'lldb', | ||
request = 'launch', | ||
program = function() | ||
return vim.fn.input( | ||
'Path to executable: ', | ||
vim.fn.getcwd() .. '/', | ||
'file' | ||
) | ||
end, | ||
cwd = '${workspaceFolder}', | ||
stopOnEntry = false, | ||
args = function() | ||
return vim.split(vim.fn.input 'Input args: ', ' ') | ||
end, | ||
initCommands = { 'command source ~/.lldbinit' }, | ||
}, | ||
{ | ||
-- If you get an "Operation not permitted" error using this, try disabling YAMA: | ||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | ||
name = 'Attach to process', | ||
type = 'lldb', -- Adjust this to match your adapter name (`dap.adapters.<name>`) | ||
request = 'attach', | ||
pid = require('dap.utils').pick_process, | ||
args = {}, | ||
}, | ||
{ | ||
name = 'Load core file', | ||
type = 'lldb', | ||
request = 'attach', | ||
program = function() | ||
return vim.fn.input( | ||
'Path to executable: ', | ||
vim.fn.getcwd() .. '/', | ||
'file' | ||
) | ||
end, | ||
cwd = '${workspaceFolder}', | ||
stopOnEntry = false, | ||
coreFile = function() | ||
return vim.fn.input('Corefile: ', vim.fn.getcwd() .. '/', 'file') | ||
end, | ||
}, | ||
} | ||
dap.configurations.c = dap.configurations.cpp | ||
end | ||
|
||
return { | ||
{ | ||
'mfussenegger/nvim-dap', | ||
dependencies = { | ||
'rcarriga/nvim-dap-ui', | ||
'nvim-telescope/telescope-dap.nvim', | ||
'nvim-neotest/nvim-nio', | ||
}, | ||
lazy = true, | ||
config = function() | ||
local dap, dapui = require 'dap', require 'dapui' | ||
dapui.setup() | ||
dap.listeners.after.event_initialized['dapui_config'] = function() | ||
dapui.open() | ||
end | ||
dap.listeners.before.event_exited['dapui_config'] = function() | ||
dapui.close() | ||
end | ||
setup_dap() | ||
vim.api.nvim_create_user_command('DapUiToggle', function() | ||
dapui.toggle() | ||
end, {}) | ||
end, | ||
keys = { | ||
{ | ||
'<F10>', | ||
function() | ||
require('dap').continue() | ||
end, | ||
}, | ||
{ | ||
'<F11>', | ||
function() | ||
require('dap').step_over() | ||
end, | ||
}, | ||
{ | ||
'<F12>', | ||
function() | ||
require('dap').step_into() | ||
end, | ||
}, | ||
{ | ||
'<leader>db', | ||
function() | ||
require('dap').toggle_breakpoint() | ||
end, | ||
}, | ||
}, | ||
cmd = { | ||
'DapUiToggle', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
return { | ||
{ | ||
'sindrets/diffview.nvim', | ||
dependencies = { 'nvim-lua/plenary.nvim' }, | ||
keys = { | ||
{ | ||
'<leader>gd', | ||
function() | ||
require('diffview').open() | ||
end, | ||
}, | ||
}, | ||
cmd = 'DiffviewOpen', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
return { | ||
{ | ||
'lewis6991/gitsigns.nvim', | ||
config = true, | ||
dependencies = { 'nvim-lua/plenary.nvim' }, | ||
event = { 'BufReadPre', 'BufNewFile' }, | ||
keys = { | ||
{ | ||
']c', | ||
function() | ||
require('gitsigns').next_hunk() | ||
end, | ||
}, | ||
{ | ||
'[c', | ||
function() | ||
require('gitsigns').prev_hunk() | ||
end, | ||
}, | ||
{ | ||
'<leader>gp', | ||
function() | ||
require('gitsigns').preview_hunk() | ||
end, | ||
}, | ||
{ | ||
'<leader>gr', | ||
function() | ||
require('gitsigns').reset_hunk() | ||
end, | ||
}, | ||
{ | ||
'<leader>ga', | ||
function() | ||
require('gitsigns').stage_hunk() | ||
end, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
return { | ||
{ | ||
'ziontee113/icon-picker.nvim', | ||
config = true, | ||
cmd = { 'IconPickerNormal', 'IconPickerInsert', 'IconPickerYank' }, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
return { | ||
{ | ||
'folke/lazydev.nvim', | ||
ft = 'lua', -- only load on lua files | ||
opts = { | ||
library = { | ||
-- See the configuration section for more details | ||
-- Load luvit types when the `vim.uv` word is found | ||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } }, | ||
}, | ||
}, | ||
}, | ||
{ 'Bilal2453/luvit-meta', lazy = true }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
return { | ||
{ | ||
'NeogitOrg/neogit', | ||
dependencies = { | ||
'nvim-lua/plenary.nvim', -- required | ||
'nvim-telescope/telescope.nvim', -- optional | ||
'sindrets/diffview.nvim', -- optional | ||
}, | ||
config = function() | ||
require('neogit').setup { | ||
commit_editor = { | ||
kind = 'split', | ||
}, | ||
console_timeout = 10000, | ||
} | ||
end, | ||
keys = { | ||
{ | ||
'<leader>gg', | ||
function() | ||
require('neogit').open { kind = 'split' } | ||
end, | ||
}, | ||
}, | ||
cmd = 'Neogit', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
local nvim_tree_toggle = function() | ||
require('nvim-tree.api').tree.toggle { find_file = true, update_root = true } | ||
end | ||
|
||
return { | ||
'kyazdani42/nvim-tree.lua', | ||
config = true, | ||
keys = { | ||
{ '<F2>', nvim_tree_toggle, mode = 'n' }, | ||
{ | ||
'<F2>', | ||
function() | ||
vim.cmd.stopinsert() | ||
nvim_tree_toggle() | ||
end, | ||
mode = 'i', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
return { | ||
{ | ||
'pwntester/octo.nvim', | ||
dependencies = { | ||
'nvim-lua/plenary.nvim', | ||
'nvim-telescope/telescope.nvim', | ||
'nvim-tree/nvim-web-devicons', | ||
}, | ||
config = true, | ||
cmd = 'Octo', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
return { | ||
{ | ||
'Almo7aya/openingh.nvim', | ||
config = true, | ||
cmd = { 'OpenInGHFile', 'OpenInGHFileLines', 'OpenInGHRepo' }, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
'neovim/nvim-lspconfig' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
return { | ||
'hiphish/rainbow-delimiters.nvim', | ||
event = { 'BufReadPre', 'BufNewFile' }, | ||
config = function() | ||
vim.g.rainbow_delimiters = { | ||
highlight = { | ||
'RainbowDelimiterGreen', | ||
'RainbowDelimiterYellow', | ||
'RainbowDelimiterOrange', | ||
'RainbowDelimiterViolet', | ||
'RainbowDelimiterCyan', | ||
'RainbowDelimiterBlue', | ||
'RainbowDelimiterRed', | ||
}, | ||
} | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
return { | ||
'akinsho/toggleterm.nvim', | ||
version = '*', | ||
config = true, | ||
keys = { | ||
{ | ||
'<C-t>', | ||
function() | ||
require('toggleterm').toggle() | ||
end, | ||
mode = 'n', | ||
}, | ||
{ | ||
'<C-t>', | ||
function() | ||
-- vim.cmd '1ToggleTerm' | ||
require('toggleterm').toggle(1) | ||
end, | ||
mode = 't', | ||
}, | ||
{ | ||
'<A-t>', | ||
function() | ||
local pathStr = vim.api.nvim_buf_get_name(0) | ||
local path = require('plenary.path'):new(pathStr) | ||
if not path:is_path() then | ||
vim.notify('Current buffer is not a file', vim.log.levels.WARN) | ||
return | ||
end | ||
vim.cmd.ToggleTerm('dir=' .. path:parent():expand()) | ||
end, | ||
mode = 'n', | ||
}, | ||
}, | ||
} |