Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"permissions": {
"allow": [
"Bash(poetry env info:*)",
"Bash(poetry env list:*)",
"Bash(uvx --help:*)",
"WebFetch(domain:github.com)",
"Bash(nvim:*)",
"Bash(git add:*)",
"Bash(git push)",
"Read(//Users/andrewpatterson/.local/share/nvim/lazy/nvim-treesitter/**)",
"Bash(ls -la queries/python/)",
"Bash(grep -l \"conceal\" queries/python/*.scm)",
"Read(//opt/homebrew/Cellar/neovim/**)",
"Read(//opt/homebrew/Cellar/neovim/0.12.2/bin/**)",
"Bash(brew info *)",
"WebFetch(domain:api.github.com)"
],
"deny": [],
"ask": []
}
}
2 changes: 2 additions & 0 deletions ftplugin/markdown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Activate quarto for markdown files to enable code cell execution
require("quarto").activate()
Empty file added ftplugin/python.lua
Empty file.
8 changes: 8 additions & 0 deletions ftplugin/stim.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Comment configuration for .stim files
vim.bo.commentstring = "# %s"

-- Enable treesitter syntax highlighting.
-- vim.treesitter.start() bypasses nvim-treesitter's highlight module (which
-- only activates parsers it knew about at startup) and directly starts the
-- built-in highlighter for this buffer.
pcall(vim.treesitter.start)
5 changes: 5 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ dofile(vim.g.base46_cache .. "statusline")
require "options"
require "autocmds"

-- Re-enable Python provider after NvChad options (NvChad disables it, but we need it for Molten)
vim.g.loaded_python3_provider = nil
vim.g.python3_host_prog = vim.fn.exepath('python3') or vim.fn.exepath('python')

vim.schedule(function()
require "mappings"
end)
require 'myinit'
55 changes: 55 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"CopilotChat.nvim": { "branch": "main", "commit": "f0c2a23ab79dc295f5e0eef0d8b587a39020c852" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
"NvChad": { "branch": "v2.5", "commit": "d042cc975247c2aa55fcb228e5d146dc1dc6c648" },
"avante.nvim": { "branch": "main", "commit": "90a0e77c63251c367935caeaa0070670522c960b" },
"base46": { "branch": "v3.0", "commit": "884b990dcdbe07520a0892da6ba3e8d202b46337" },
"better-escape.nvim": { "branch": "master", "commit": "3f4bc0b326606264ff75967f59091b5ddada0554" },
"cmp-async-path": { "branch": "main", "commit": "98185a91d49ff5dd249aebf2f7456e18063fa2a0" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-nvim-lua": { "branch": "main", "commit": "e3a22cb071eb9d6508a156306b102c45cd2d573d" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
"copilot.vim": { "branch": "release", "commit": "a12fd5672110c8aa7e3c8419e28c96943ca179be" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" },
"hererocks": { "branch": "master", "commit": "3db37265c3839cbd4d27fc73f92fa7b58bc3a76f" },
"image.nvim": { "branch": "master", "commit": "88351f1f7d9dbae286e671ce3690a49660dd8a5c" },
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"mcphub.nvim": { "branch": "main", "commit": "7cd5db330f41b7bae02b2d6202218a061c3ebc1f" },
"menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" },
"minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" },
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
"neogen": { "branch": "main", "commit": "23e7e9f883d01289ebd90e98025acc860ea26366" },
"neotest": { "branch": "master", "commit": "ad991822b7076b1d940b33a9d6d0d30416d5df81" },
"neotest-python": { "branch": "master", "commit": "e6df4f1892f6137f58135917db24d1655937d831" },
"none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" },
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
"nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" },
"nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" },
"nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" },
"nvim-lint": { "branch": "master", "commit": "01c9842c089069ab497430159312b2c8868a4590" },
"nvim-lspconfig": { "branch": "master", "commit": "bfcc0171a43f22afa61d927ffe9fcb6cb85dc99e" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-tree.lua": { "branch": "master", "commit": "8e8be709c9a93e1ebefde7964884a8b564bfd3e0" },
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
"nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" },
"otter.nvim": { "branch": "main", "commit": "d781eda3bc18dbc8677f9a24abdc705fb74e4428" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"quarto-nvim": { "branch": "main", "commit": "17f1e5d664bc615478230dc0240666329efacf9b" },
"snippet-converter.nvim": { "branch": "main", "commit": "d7e783618f02541641980ebd823e439bdef64a4f" },
"stim-treesitter-parser": { "branch": "main", "commit": "3c84d6ab09bc364ed712329cd4f9fb113e489aad" },
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
"ui": { "branch": "v3.0", "commit": "3e67e9d5325fd47fdbc90ca00a147db2f3525754" },
"vim-markdown": { "branch": "master", "commit": "1bc9d0cd8e1cc3e901b0a49c2b50a843f1c89397" },
"vimtex": { "branch": "master", "commit": "63745fa542346e0f09a496d440645ef6ff75b62c" },
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}
25 changes: 7 additions & 18 deletions lua/chadrc.lua
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :(

---@type ChadrcConfig
local M = {}

M.base46 = {
theme = "onedark",
-- Path to overriding theme and highlights files
local highlights = require "highlights"

-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
M.base46 = {
theme = "catppuccin",
transparency = true,
hl_override = highlights.override,
hl_add = highlights.add
}

-- M.nvdash = { load_on_startup = true }
-- M.ui = {
-- tabufline = {
-- lazyload = false
-- }
-- }

return M
52 changes: 52 additions & 0 deletions lua/configs/cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
end
local cmp = require "cmp"
local options = {

mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
-- ["<CR>"] = cmp.mapping.confirm {
-- behavior = cmp.ConfirmBehavior.Insert,
-- select = true,
-- },
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end, {
"i",
"s",
}),
},
}

return options
38 changes: 38 additions & 0 deletions lua/configs/dapui.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local dap = require "dap"
local dapui = require "dapui"

-- First, set up dap-ui
dapui.setup {
-- Optional: configure layouts
layouts = {
{
elements = {
-- Elements can be strings or table with id and size keys.
{id = "scopes", size = 1.0},
},
size = 40, -- 40 columns
position = "left",
},
{
elements = {
-- { id = "scopes", size = 0.3 },
{id = "repl", size = 1.0},
},
size = 0.25, -- 25% of total lines
position = "bottom",
},
},
}

-- Automatically open UI when debugging starts
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

-- Add some keymaps for debug terminal
93 changes: 93 additions & 0 deletions lua/configs/lint.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
local M = {}

M.setup = function()
local lint = require "lint"

-- local root = vim.fn.getcwd()
-- local pyproject_path = root .. "/pyproject.toml"
--
-- if vim.fn.filereadable(pyproject_path) == 1 then
-- lint.linters.mypy.args = vim.list_extend(
-- lint.linters.mypy.args or {},
-- { "--config-file", pyproject_path }
-- )
-- else
-- lint.linters.mypy.args = vim.list_extend(
-- lint.linters.mypy.args or {},
-- { "--config-file", "pyproject.toml" }
-- )
-- end

lint.linters.mypy = vim.tbl_deep_extend("force", lint.linters.mypy, {
cmd = "python",
args = vim.list_extend({ "-m", "mypy" }, lint.linters.mypy.args)
})

lint.linters.pylint = vim.tbl_deep_extend("force", lint.linters.pylint, {
cmd = "python",
args = vim.list_extend({ "-m", "pylint" }, lint.linters.pylint.args)
})


lint.linters_by_ft = {
python = { "ruff", "mypy", "pylint" },
cpp = { "cpplint", "cppcheck" },
}

local signs = {
Error = " ",
Warn = " ",
Hint = " ",
Info = " ",
}

vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
float = {
source = true,
border = "rounded",
header = "",
prefix = "",
format = function(diagnostic)
return string.format("%s: %s", diagnostic.source or "LSP", diagnostic.message)
end,
},
signs = {
text = signs,
linehl = {},
numhl = {},
},
severity_sort = true,
})

local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })

vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})

-- Highlight configurations
vim.api.nvim_command "highlight DiagnosticUnderlineError gui=underline guisp=#FF0000"
vim.api.nvim_command "highlight DiagnosticUnderlineWarn gui=underline guisp=#FF9900"
vim.api.nvim_command "highlight DiagnosticUnderlineInfo gui=underline guisp=#0000FF"
vim.api.nvim_command "highlight DiagnosticUnderlineHint gui=underline guisp=#00FF00"

vim.api.nvim_create_autocmd("CursorHold", {
group = lint_augroup,
callback = function()
vim.diagnostic.open_float(nil, {
focusable = false,
scope = "line",
border = "single",
})
end,
})
end

return M
Loading