You've already forked dotfiles
Compare commits
3 Commits
main
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
| 377aaf83cf | |||
| e6e0ca0cca | |||
| 9f5007cbc3 |
@@ -1,6 +1,7 @@
|
|||||||
-- Load the following plugins eagerly to prevent visual oddities
|
-- Load the following plugins eagerly to prevent visual oddities
|
||||||
require('plugins.gruvbox') -- Colorscheme setup
|
require('plugins.gruvbox') -- Colorscheme setup
|
||||||
require('plugins.lualine') -- Status line plugin
|
require('plugins.lualine') -- Status line plugin
|
||||||
|
-- require('statusline')
|
||||||
|
|
||||||
-- vim.schedule defers plugin loading for after the main loop starts
|
-- vim.schedule defers plugin loading for after the main loop starts
|
||||||
-- Startup is cleaner and faster than ever
|
-- Startup is cleaner and faster than ever
|
||||||
@@ -24,8 +25,8 @@ vim.schedule(function()
|
|||||||
})
|
})
|
||||||
|
|
||||||
require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc.
|
require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc.
|
||||||
require('plugins.dap') -- DAP debugging plugin
|
require('plugins.dap') -- DAP debugging plugin TODO: cleanup
|
||||||
require('plugins.dap-python') -- Debug plugin settings specifically for python
|
require('plugins.dap-python') -- Debug plugin settings specifically for python TODO: cleanup
|
||||||
|
|
||||||
-- Experimental
|
-- Experimental
|
||||||
-- require('plugins.note_taking') -- In house note taking plugin (TODO: rename once the plugin name is solidified)
|
-- require('plugins.note_taking') -- In house note taking plugin (TODO: rename once the plugin name is solidified)
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ vim.pack.add({
|
|||||||
'https://github.com/theHamsta/nvim-dap-virtual-text',
|
'https://github.com/theHamsta/nvim-dap-virtual-text',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- TODO: Needs a pass to remove hardcoding, potentially cut out mason completely and general cleanup
|
||||||
|
|
||||||
require('dapui').setup({
|
require('dapui').setup({
|
||||||
mappings = {
|
mappings = {
|
||||||
open = 'o',
|
open = 'o',
|
||||||
@@ -49,90 +51,90 @@ require('dapui').setup({
|
|||||||
})
|
})
|
||||||
|
|
||||||
require('nvim-dap-virtual-text').setup()
|
require('nvim-dap-virtual-text').setup()
|
||||||
-- local mason_dap = require('mason-nvim-dap')
|
-- local mason_dap = require('mason-nvim-dap')
|
||||||
local dap, dapui = require('dap'), require('dapui')
|
local dap, dapui = require('dap'), require('dapui')
|
||||||
|
|
||||||
-- mason_dap.setup({
|
-- mason_dap.setup({
|
||||||
-- ensure_installed = {
|
-- ensure_installed = {
|
||||||
-- 'codelldb',
|
-- 'codelldb',
|
||||||
-- 'debugpy',
|
-- 'debugpy',
|
||||||
-- },
|
-- },
|
||||||
-- automatic_installation = true,
|
-- automatic_installation = true,
|
||||||
-- handlers = {
|
-- handlers = {
|
||||||
-- function(config)
|
-- function(config)
|
||||||
-- require('mason-nvim-dap').default_setup(config)
|
-- require('mason-nvim-dap').default_setup(config)
|
||||||
-- end,
|
-- end,
|
||||||
-- }
|
-- }
|
||||||
-- })
|
-- })
|
||||||
|
|
||||||
dap.listeners.before.attach.dapui_config = function()
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.before.launch.dapui_config = function()
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
dapui.open()
|
dapui.open()
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
||||||
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
|
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
|
||||||
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
||||||
vim.fn.sign_define('DapStopped', { text = '▶️' })
|
vim.fn.sign_define('DapStopped', { text = '▶️' })
|
||||||
|
|
||||||
dap.adapters.gdb = {
|
dap.adapters.gdb = {
|
||||||
type = 'executable',
|
type = 'executable',
|
||||||
command = 'gdb',
|
command = 'gdb',
|
||||||
args = { '-i', 'dap' },
|
args = { '-i', 'dap' },
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.adapters.lldb = {
|
||||||
|
command = 'lldb',
|
||||||
|
type = 'executable',
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.adapters.debugpy = {
|
||||||
|
command = 'debugpy',
|
||||||
|
type = 'executable',
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations = {
|
||||||
|
rust = {
|
||||||
|
{
|
||||||
|
type = 'lldb',
|
||||||
|
name = 'Debug',
|
||||||
|
request = 'launch',
|
||||||
|
program = function()
|
||||||
|
return vim.fn.getcwd() .. '/target/debug/faultybranches' -- TODO: remove the testing hardcoded path
|
||||||
|
end,
|
||||||
|
stopAtBeginningOfMainSubprogram = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
python = {
|
||||||
|
{
|
||||||
|
type = 'python',
|
||||||
|
name = 'Launch current file',
|
||||||
|
request = 'launch',
|
||||||
|
program = '${file}',
|
||||||
|
pythonPath = function()
|
||||||
|
if vim.env.VIRTUAL_ENV then
|
||||||
|
return vim.env.VIRTUAL_ENV .. '/bin/python'
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dap.adapters.lldb = {
|
vim.keymap.set('n', '<leader>b', function()
|
||||||
command = 'lldb',
|
|
||||||
type = 'executable',
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.adapters.debugpy = {
|
|
||||||
command = 'debugpy',
|
|
||||||
type = 'executable',
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations = {
|
|
||||||
rust = {
|
|
||||||
{
|
|
||||||
type = 'lldb',
|
|
||||||
name = 'Debug',
|
|
||||||
request = 'launch',
|
|
||||||
program = function()
|
|
||||||
return vim.fn.getcwd() .. '/target/debug/faultybranches'
|
|
||||||
end,
|
|
||||||
stopAtBeginningOfMainSubprogram = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
python = {
|
|
||||||
{
|
|
||||||
type = 'python',
|
|
||||||
name = 'Launch current file',
|
|
||||||
request = 'launch',
|
|
||||||
program = '${file}',
|
|
||||||
pythonPath = function()
|
|
||||||
if vim.env.VIRTUAL_ENV then
|
|
||||||
return vim.env.VIRTUAL_ENV .. '/bin/python'
|
|
||||||
end
|
|
||||||
|
|
||||||
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>b', function ()
|
|
||||||
require('dap').toggle_breakpoint()
|
require('dap').toggle_breakpoint()
|
||||||
end)
|
end)
|
||||||
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
|
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
|
||||||
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end)
|
vim.keymap.set({ 'n', 'v' }, '<leader>dh', function() require('dap.ui.widgets').hover() end)
|
||||||
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
||||||
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
|
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
|
||||||
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)
|
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)
|
||||||
|
|||||||
6
nvim/lua/plugins/note_taking.lua
Normal file
6
nvim/lua/plugins/note_taking.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
vim.pack.add({
|
||||||
|
-- 'https://git.faultybranches.dev/FaultyBranches_Public/faultynotes.git'
|
||||||
|
'~/repos/code/faultynotes'
|
||||||
|
})
|
||||||
|
|
||||||
|
require('faultynotes').setup()
|
||||||
26
nvim/lua/statusline.lua
Normal file
26
nvim/lua/statusline.lua
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
local function lsp_status()
|
||||||
|
local attached_clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||||
|
if #attached_clients == 0 then
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
local names = vim.iter(attached_clients)
|
||||||
|
:map(function (client)
|
||||||
|
local name = client.name:gsub('language.server', 'ls')
|
||||||
|
return name
|
||||||
|
end)
|
||||||
|
:totable()
|
||||||
|
return '[' .. table.concat(names, ', ') .. ']'
|
||||||
|
end
|
||||||
|
|
||||||
|
function _G.statusline()
|
||||||
|
return table.concat({
|
||||||
|
'%f',
|
||||||
|
'%h%w%m%r',
|
||||||
|
'%=',
|
||||||
|
lsp_status(),
|
||||||
|
' %-14(%l,%c%V%)',
|
||||||
|
'%P',
|
||||||
|
}, ' ')
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.o.statusline = '%{%v:lua._G.statusline()%}'
|
||||||
Reference in New Issue
Block a user