diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..1ad140a2 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends \ + build-essential \ + python3 \ + python3-pip + +USER vscode \ No newline at end of file diff --git a/init.lua b/init.lua index 7d180d0e..604e3052 100644 --- a/init.lua +++ b/init.lua @@ -91,9 +91,11 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- set python 3.11.9 as default python -vim.g.python2_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim2/bin/python' -vim.g.python3_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim3/bin/python' -vim.g.python_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim2/bin/python' +-- vim.g.python2_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim2/bin/python' +-- vim.g.python3_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim3/bin/python' +-- vim.g.python_host_prog = os.getenv 'PYENV_ROOT' .. '/versions/neovim2/bin/python' +-- Replace Python path configuration with: +vim.g.python3_host_prog = vim.fn.exepath('python3') -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index 2554f33c..f3819b07 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -19,9 +19,11 @@ return { }) vim.g.copilot_no_tab_map = true vim.g.copilot_filetypes = { - gitcommit = true, - markdown = true, - xml = false, + ['gitcommit'] = { + enable = true, + -- Disable using previous commit messages as suggestions + previous_commit_history = false + } } end, } diff --git a/lua/custom/plugins/dap.lua b/lua/custom/plugins/dap.lua new file mode 100644 index 00000000..b6d80a1d --- /dev/null +++ b/lua/custom/plugins/dap.lua @@ -0,0 +1,39 @@ +-- python-debugging.lua: Debugging Python code with DAP +-- + +return { + { + 'mfussenegger/nvim-dap', + dependencies = { + 'mfussenegger/nvim-dap-python', -- Python adapter + 'rcarriga/nvim-dap-ui', -- UI for DAP + 'theHamsta/nvim-dap-virtual-text' -- Inline variable text + }, + keys = { + { 'dc', function() require('dap').continue() end, desc = 'Debug: Start/Continue' }, + { 'db', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' }, + { 'dt', function() require('dap').terminate() end, desc = 'Debug: Terminate' }, + { 'di', function() require('dap').step_into() end, desc = 'Debug: Step Into' }, + { 'do', function() require('dap').step_over() end, desc = 'Debug: Step Over' }, + { 'dr', function() require('dap').repl.open() end, desc = 'Debug: Open REPL' }, + }, + config = function() + local dap = require('dap') + local dapui = require('dapui') + + -- Configure dapui + dapui.setup() + + -- Configure Python + require('dap-python').setup(vim.fn.exepath('python3')) + + -- Auto open/close dapui + dap.listeners.after.event_initialized['dapui_config'] = function() dapui.open() end + dap.listeners.before.event_terminated['dapui_config'] = function() dapui.close() end + dap.listeners.before.event_exited['dapui_config'] = function() dapui.close() end + end + } +} + +-- The line beneath this is called `modeline`. See `:help modeline` +-- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/python-debugging.lua b/lua/custom/plugins/python-debugging.lua deleted file mode 100644 index 721da151..00000000 --- a/lua/custom/plugins/python-debugging.lua +++ /dev/null @@ -1,87 +0,0 @@ --- python-debugging.lua: Debugging Python code with DAP --- - -return { - -- DEBUGGING - - -- DAP Client for nvim - -- - start the debugger with `dc` - -- - add breakpoints with `db` - -- - terminate the debugger `dt` - { - 'mfussenegger/nvim-dap', - keys = { - { - 'dc', - function() - require('dap').continue() - end, - desc = 'Start/Continue Debugger', - }, - { - 'db', - function() - require('dap').toggle_breakpoint() - end, - desc = 'Add Breakpoint', - }, - { - 'dt', - function() - require('dap').terminate() - end, - desc = 'Terminate Debugger', - }, - }, - }, - - -- UI for the debugger - -- - the debugger UI is also automatically opened when starting/stopping the debugger - -- - toggle debugger UI manually with `du` - { - 'rcarriga/nvim-dap-ui', - dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' }, - keys = { - { - 'du', - function() - require('dapui').toggle() - end, - desc = 'Toggle Debugger UI', - }, - }, - -- automatically open/close the DAP UI when starting/stopping the debugger - config = function() - local listener = require('dap').listeners - listener.after.event_initialized['dapui_config'] = function() - require('dapui').open() - end - listener.before.event_terminated['dapui_config'] = function() - require('dapui').close() - end - listener.before.event_exited['dapui_config'] = function() - require('dapui').close() - end - end, - }, - - -- Configuration for the python debugger - -- - configures debugpy for us - -- - uses the debugpy installation from mason - { - 'mfussenegger/nvim-dap-python', - dependencies = 'mfussenegger/nvim-dap', - config = function() - -- fix: E5108: Error executing lua .../Local/nvim-data/lazy/nvim-dap-ui/lua/dapui/controls.lua:14: attempt to index local 'element' (a nil value) - -- see: https://github.com/rcarriga/nvim-dap-ui/issues/279#issuecomment-1596258077 - local dap, dapui = require 'dap', require 'dapui' - dapui.setup() - -- uses the debugypy installation by mason - local debugpyPythonPath = require('mason-registry').get_package('debugpy'):get_install_path() .. '/venv/bin/python3' - require('dap-python').setup(debugpyPythonPath, {}) ---@diagnostic disable-line: missing-fields - end, - }, -} - --- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et