Major nvim changes, Colorscheme and dap mostly

This commit is contained in:
Daniel Weber 2024-12-19 22:34:53 -05:00
parent 6ee3d5f407
commit dcda42d32e
5 changed files with 235 additions and 69 deletions

View File

@ -1,65 +1,83 @@
-- My initial attempt to trying to use catppuccin...may revisit later so keeping it -- My initial attempt to trying to use catppuccin...may revisit later so keeping it
-- require("catppuccin").setup({ require("catppuccin").setup({
-- flavour = "mocha", -- latte, frappe, macchiato, mocha flavour = "mocha", -- latte, frappe, macchiato, mocha
-- background = { -- :h background background = { -- :h background
-- light = "latte", light = "latte",
-- dark = "mocha", dark = "mocha",
-- }, },
-- transparent_background = false, -- disables setting the background color. transparent_background = false, -- disables setting the background color.
-- show_end_of_buffer = false, -- shows the '~' characters after the end of buffers show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
-- term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`) term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
-- dim_inactive = { dim_inactive = {
-- enabled = false, -- dims the background color of inactive window enabled = true, -- dims the background color of inactive window
-- shade = "dark", shade = "light",
-- percentage = 0.15, -- percentage of the shade to apply to the inactive window percentage = 0.15, -- percentage of the shade to apply to the inactive window
-- }, },
-- no_italic = false, -- Force no italic no_italic = false, -- Force no italic
-- no_bold = false, -- Force no bold no_bold = false, -- Force no bold
-- no_underline = false, -- Force no underline no_underline = false, -- Force no underline
-- styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
-- comments = { "italic" }, -- Change the style of comments comments = { "italic" }, -- Change the style of comments
-- conditionals = { "italic" }, conditionals = { "italic" },
-- loops = {}, loops = {},
-- functions = {}, functions = {},
-- keywords = {}, keywords = {},
-- strings = {}, strings = {},
-- variables = {}, variables = {},
-- numbers = {}, numbers = {},
-- booleans = {}, booleans = {},
-- properties = {}, properties = {},
-- types = {}, types = {},
-- operators = {}, operators = {},
-- }, },
-- color_overrides = {}, color_overrides = {
-- custom_highlights = {}, mocha = {
-- integrations = { base = "#000000",
-- cmp = true, mantle = "#000000",
-- gitsigns = true, crust = "#000000",
-- nvimtree = true, },
-- treesitter = true, },
-- notify = false, custom_highlights = {
-- mini = { -- ["@keyword"] = {fg = '${green}'},
-- enabled = true, -- ["@string"] = {fg = '#ff9900'},
-- indentscope_color = "", -- ["@function"] = {fg = '#00ccff', italic=true, underline=true},
-- }, -- ["@function.builtin"] = {fg = '#0059ff'},
-- -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) -- ["@variable"] = {fg = '#00FF88'},
-- }, },
-- }) integrations = {
-- cmp = true,
-- -- setup must be called before loading gitsigns = true,
nvimtree = true,
neotree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
})
-- setup must be called before loading
-- vim.cmd.colorscheme "catppuccin" -- vim.cmd.colorscheme "catppuccin"
require('onedark').setup { require('onedarkpro').setup {
style = 'deep', -- colors = {
colors = { -- green = '#00ffaa', -- redefine an existing color
green = '#00ffaa', -- redefine an existing color -- },
},
highlights = { highlights = {
["@keyword"] = {fg = '$green'}, SpellBad = { sp = "${red}", undercurl = true },
SpellCap = { sp = "${red}", undercurl = true },
SpellRare = { sp = "${red}", undercurl = true },
SpellLocal = { sp = "${red}", undercurl = true },
["@keyword"] = {fg = '${green}'},
["@string"] = {fg = '#ff9900'}, ["@string"] = {fg = '#ff9900'},
["@function"] = {fg = '#00ccff', sp = '$cyan', fmt = 'underline,italic'}, ["@function"] = {fg = '#00ccff', italic=true, underline=true},
["@function.builtin"] = {fg = '#0059ff'}, ["@function.builtin"] = {fg = '#0059ff'},
["@variable"] = {fg = '#00FF88'}, ["@variable"] = {fg = '#00FF88'},
} }
} }
require('onedark').load()
-- vim.cmd("colorscheme onedark_dark")
vim.cmd("colorscheme wildcharm")

134
after/plugin/dap.lua Normal file
View File

@ -0,0 +1,134 @@
-- local dap = require('dap')
-- dap.adapters.python = function(cb, config)
-- if config.request == 'attach' then
-- ---@diagnostic disable-next-line: undefined-field
-- local port = (config.connect or config).port
-- ---@diagnostic disable-next-line: undefined-field
-- local host = (config.connect or config).host or '127.0.0.1'
-- cb({
-- type = 'server',
-- port = assert(port, '`connect.port` is required for a python `attach` configuration'),
-- host = host,
-- options = {
-- source_filetype = 'python',
-- },
-- })
-- else
-- cb({
-- type = 'executable',
-- command = 'path/to/virtualenvs/debugpy/bin/python',
-- args = { '-m', 'debugpy.adapter' },
-- options = {
-- source_filetype = 'python',
-- },
-- })
-- end
-- end
local dap = require("dap")
dap.adapters.lldb = {
type = "executable",
command = "lldb-dap",
name = 'lldb',
-- args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = './venv/bin/python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
end
dap.configurations.python = {
{
-- The first three options are required by nvim-dap
type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
request = 'launch';
name = "Launch file";
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}"; -- This configuration will launch the current file if used.
pythonPath = function()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/usr/bin/python'
end
end;
},
}
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 = true,
args = {},
},
}
require("nvim-dap-virtual-text").setup()
local dap = require("dap")
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
require("dapui").setup()
local dapui = require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.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
vim.keymap.set("n", "<leader>tb", "<cmd>DapToggleBreakpoint<CR>",{ desc = '[t]oggle [b]reakpoint' })
vim.keymap.set("n", "<leader>dn", "<cmd>DapNew<CR>",{ desc = '[d]ebugger [n]ew' })
vim.keymap.set("n", "<F1>", "<cmd>DapContinue<CR>",{ desc = 'continuej:Da' })
vim.keymap.set("n", "<F2>", "<cmd>DapStepInto<CR>",{ desc = 'step into' })
vim.keymap.set("n", "<F3>", "<cmd>DapStepOver<CR>",{ desc = 'step over' })
vim.keymap.set("n", "<F4>", "<cmd>DapStepOut<CR>",{ desc = 'step out' })
-- vim.keymap.set("n", "<F5>", "<cmd>DapStepOut<CR>",{ desc = 'step out' })
vim.keymap.set("n", "<F6>", "<cmd>DapDisconnect<CR>",{ desc = 'disconnect' })

View File

@ -1 +1,4 @@
vim.cmd("set termguicolors")
require('colorizer').setup()
vim.keymap.set("n", "<leader>tu", vim.cmd.UndotreeToggle, { desc = 'Toggle undo tree' }) vim.keymap.set("n", "<leader>tu", vim.cmd.UndotreeToggle, { desc = 'Toggle undo tree' })

View File

@ -1,6 +1,7 @@
require('nvim-treesitter.configs').setup({ require('nvim-treesitter.configs').setup({
modules = {},
-- A list of parser names, or "all" (the five listed parsers should always be installed) -- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "cpp", "cuda", "lua", "python", "vim", "vimdoc", "query", "javascript" }, ensure_installed = { "bash", "c", "cpp", "cuda", "lua", "python", "vim", "vimdoc", "query", "javascript" },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
@ -11,6 +12,7 @@ require('nvim-treesitter.configs').setup({
---- If you need to change the installation directory of the parsers (see -> Advanced Setup) ---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
ignore_install = {},
highlight = { highlight = {
enable = true, enable = true,
@ -34,4 +36,4 @@ require('nvim-treesitter.configs').setup({
-- Adding spell check to other treesitter query groups. Only comments are spell checked by default -- Adding spell check to other treesitter query groups. Only comments are spell checked by default
-- vim.treesitter.query.set("python", "highlights", "(string) @string @spell") -- vim.treesitter.query.set("python", "highlights", "(string) @string @spell")
vim.treesitter.query.set("lua", "highlights", "(string) @string @spell") -- vim.treesitter.query.set("lua", "highlights", "(string) @string @spell")

View File

@ -12,9 +12,9 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
"folke/which-key.nvim", {"folke/which-key.nvim"},
{"nvim-treesitter/nvim-treesitter", build = ':TSUpdate'}, {"nvim-treesitter/nvim-treesitter", build = ':TSUpdate'},
"nvim-treesitter/playground", {"nvim-treesitter/playground"},
{ {
"nvim-neo-tree/neo-tree.nvim", "nvim-neo-tree/neo-tree.nvim",
branch = "v3.x", branch = "v3.x",
@ -24,16 +24,25 @@ require("lazy").setup({
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
} }
}, },
"navarasu/onedark.nvim",
"mbbill/undotree", { "catppuccin/nvim", name = "catppuccin", priority = 1000 },
"tpope/vim-fugitive", { "olimorris/onedarkpro.nvim", priority = 1000}, -- Ensure it loads first
{'norcalli/nvim-colorizer.lua'},
{
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
"theHamsta/nvim-dap-virtual-text",
},
},
{"mbbill/undotree"},
{"tpope/vim-fugitive"},
{ 'nvim-lualine/lualine.nvim', requires = { 'nvim-tree/nvim-web-devicons', opt = true } }, { 'nvim-lualine/lualine.nvim', requires = { 'nvim-tree/nvim-web-devicons', opt = true } },
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
tag = '0.1.3', tag = '0.1.8',
dependencies = { dependencies = { 'nvim-lua/plenary.nvim' },
'nvim-lua/plenary.nvim'
},
}, },
{"danymat/neogen", dependencies = "nvim-treesitter/nvim-treesitter", config = true}, {"danymat/neogen", dependencies = "nvim-treesitter/nvim-treesitter", config = true},
{'williamboman/mason.nvim'}, {'williamboman/mason.nvim'},
@ -46,8 +55,8 @@ require("lazy").setup({
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
}}, }},
{'windwp/nvim-autopairs', event = "InsertEnter", config = true}, {'windwp/nvim-autopairs', event = "InsertEnter", config = true},
'm4xshen/autoclose.nvim', {'m4xshen/autoclose.nvim'},
'lewis6991/gitsigns.nvim', {'lewis6991/gitsigns.nvim'},
{'xiyaowong/transparent.nvim'}, {'xiyaowong/transparent.nvim'},
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
{ 'mg979/vim-visual-multi' }, { 'mg979/vim-visual-multi' },