master
blob42 1 year ago
parent 5216048827
commit 33aa97c9e0

@ -1 +1 @@
require 'spike.diagnostics'.set_diagnostics_level(vim.diagnostic.severity.WARN)
require 'spike.diagnostics'.set_diagnostics_level(vim.diagnostic.severity.ERROR)

@ -84,6 +84,9 @@ M.general = { --{{{
-- Just in case you need to go to the very beginning of a line
["^"] = { "0" },
-- delete all empty lines
["<BS><BS>"] = { "<cmd> .,/\\S\\|\\%$/g/^\\s*$/d <CR><cmd>noh<CR>", "delete empty next contiguous empty lines" },
["<leader>ww"] = { "<cmd> set wrap! <CR><cmd> echo 'wrap = '.&wrap <CR>" },
@ -218,6 +221,7 @@ M.general = { --{{{
["<leader>tf"] = { "<cmd> set foldmethod=expr<CR>|<cmd> set foldexpr=nvim_treesitter#foldexpr()<CR>",
"enable Treesitter folding" },
["<leader>tp"] = {
function()
vim.cmd("TSPlaygroundToggle")
@ -927,7 +931,7 @@ M.iron = { -- {{{{{{
M.ccc = {
plugin = true,
n = {
["<leader>cp"] = { "<cmd>CccPick<CR>", "color picker" }
["<leader>clp"] = { "<cmd>CccPick<CR>", "color picker" }
},
}
-- }}}
@ -1006,44 +1010,32 @@ M.gitsigns = {
}
-- selects a grapple key given a scope and resets
-- the `git` scope
local function grapple_scope_select(scope, key)
local grapple = require("grapple")
grapple.setup({scope = scope })
grapple.select({key=key})
grapple.setup({scope = "git"})
end
local function grapple_scope_tag(scope, key)
local grapple = require("grapple")
grapple.setup({scope = scope})
grapple.tag({key=key})
grapple.setup({scope = "git"})
end
M.grapple = {
plugin = true,
n = {
["<leader>J"] = { "<cmd> lua require'grapple'.cycle_forward()<CR>" },
["<leader>K"] = { "<cmd> lua require'grapple'.cycle_backward()<CR>" },
["<leader>T"] = { "<cmd> GrappleTag<CR>"},
["<leader>GT"] = { function()
vim.ui.input({ prompt = "tag: " }, function(input)
require("grapple").tag({scope="global"})
end)
end, "grapple global tag" },
["<leader>N"] = { function()
vim.ui.input({ prompt = "tag: " }, function(input)
require("grapple").tag({ key = input })
end)
end, "grapple tag with name" },
["<leader>GN"] = { function()
local grapple = require("grapple")
vim.ui.input({ prompt = "tag: " }, function(input)
grapple_scope_tag("global", input)
require("grapple").tag({scope="global", key = input})
end)
end, "grapple global tag with name" },
--TODO: keybind for popup select names
-- ["<leader><leader>m"] = { "<cmd> lua require'grapple'.scope_select('global', 'mappings')<CR>" },
["<leader><leader>m"] = { function() grapple_scope_select("global", "mappings") end},
["<leader><leader>p"] = { function() grapple_scope_select("global", "plugins") end },
["<leader><leader>b"] = { function() grapple_scope_select("global", "bonzai") end },
["<leader><leader>m"] = { "<cmd> lua require'grapple'.select {key='mappings', scope='global'}<CR>" },
["<leader><leader>p"] = { "<cmd> lua require'grapple'.select {key='plugins', scope='global'}<CR>" },
["<leader><leader>b"] = { "<cmd> lua require'grapple'.select {key='bonzai', scope='global'}<CR>" },
["<leader><leader>P"] = { "<cmd> lua require'grapple'.select({key='Plugins'})<CR>" },
["<leader><leader>o"] = { "<cmd> lua require'grapple'.select({key='options'})<CR>" },
["<leader><leader>g"] = { "<cmd> lua require'grapple'.popup_tags()<CR>" },
@ -1101,15 +1093,18 @@ M.copilot = {
plugin = true,
n = {
-- copilot options here
["<leader>cpn"] = { "<cmd> lua require'copilot.panel'.open()<CR>", "copilot panel" },
["]p"] = { "<cmd> lua require'copilot.panel'.jump_next()<CR> ", "copilot panel next" },
["[p"] = { "<cmd> lua require'copilot.panel'.jump_prev()<CR> ", "copilot panel prev" },
}
}
M.navigator = {
plugin = true,
n = {
["<leader>gt"] = { function() require('navigator.treesitter').buf_ts() end, 'TS buf symbols'},
["<leader>gT"] = { function() require('navigator.treesitter').bufs_ts() end, 'TS bufs symbols'},
['<Leader>ct'] = { function() require('navigator.ctags').ctags() end, 'lsp ctags' },
["<leader>gt"] = { function() require("navigator.treesitter").buf_ts() end, "TS buf symbols"},
["<leader>gT"] = { function() require("navigator.treesitter").bufs_ts() end, "TS bufs symbols"},
["<Leader>ct"] = { function() require("navigator.ctags").ctags() end, "lsp ctags" },
}
}
@ -1137,5 +1132,4 @@ M.null_ls = {
}
}
return M

@ -17,7 +17,8 @@ local highlights = require "custom.highlights"
M.ui = {
-- theme = "gruvbox_material",
theme = "ayu-dark",
-- theme = "ayu-dark",
theme = "catppuccin",
theme_toggle = { "gruvbox_material", "gruvbox_light" },
transparency = true,
hl_override = highlights.override,

@ -0,0 +1,58 @@
local ok, copilot = pcall(require, 'copilot')
if not ok then
vim.notify("missing module copilot", vim.log.levels.WARN)
return
end
local M = {}
local config = {
panel = {
enabled = true,
auto_refresh = false,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>"
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4
},
},
suggestion = {
enabled = true,
auto_trigger = false,
debounce = 75,
keymap = {
accept = "<M-l>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = 'node', -- Node.js version must be > 16.x
server_opts_overrides = {},
}
M.setup = function()
copilot.setup(config)
end
return M

@ -12,7 +12,7 @@ local opts = {
},
},
debug = true,
debug = false,
commands = {
Norm = { cmd = "norm" },
Reg = {

@ -167,12 +167,17 @@ local opts = {
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "lldb-vscode",
name = "rt_lldb",
console = "integratedTerminal",
},
-- adapter = {
-- type = "executable",
-- command = "lldb-vscode",
-- -- command = "/home/spike/.local/share/nvim/mason/bin/codelldb",
-- name = "rt_lldb",
-- console = "integratedTerminal",
-- },
adapter = require('rust-tools.dap').get_codelldb_adapter(
"/home/spike/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb",
"/home/spike/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
)
},
}

@ -119,8 +119,11 @@ return {
end
}, -- }}}
["hrsh7th/cmp-copilot"] = {
after = "copilot.vim"
["zbirenbaum/copilot-cmp"] = {
after = {"copilot.lua"},
config = function()
require("copilot_cmp").setup()
end
},
@ -141,13 +144,27 @@ return {
-- AI/Deep Learning Helpers
-- Github Copilot
["github/copilot.vim"] = {
["zbirenbaum/copilot.lua"] = {
opt = true,
cmd = "Copilot",
keys = {"<leader>ghp"},
setup= function()
setup = function()
require("core.utils").load_mappings "copilot"
end
end,
config = function()
require("custom.plugins.configs.copilot").setup()
end,
},
-- ["github/copilot.vim"] = {
-- opt = true,
-- keys = {"<leader>ghp"},
-- setup= function()
-- require("core.utils").load_mappings "copilot"
-- end
-- },
["MunifTanjim/nui.nvim"] = {
module = {"nui.layout", "nui.popup"},
module_pattern = {"nui.*"}
@ -348,6 +365,7 @@ return {
}, -- }}}
-- Theme customization
-- Color picker
["uga-rosa/ccc.nvim"] = { -- {{{{{{
-- commit = "427471b",
cmd = { "Ccc*", "<Plug>(ccc-insert)" },
@ -743,7 +761,7 @@ return {
-- Rust dev
["simrat39/rust-tools.nvim"] = { -- {{{
lock = true,
lock = false,
ft = { "rust" },
opt = true,
config = function()
@ -806,7 +824,7 @@ return {
-- jupyter notebook
-- dependencies: jupyter jupytext
["luk400/vim-jukit"] = {
lock = true,
lock = false,
keys = '<leader>jup',
setup = function()
patterns = {

@ -21,7 +21,8 @@ return {
-- function node
s("pwd", f(function()
return vim.fn.getcwd()
end))
end)),
}, { --autosnippets
-- s("uuid#", f(gen_uuid))
}

@ -15,14 +15,14 @@ return M
-- repeat nodes
-- TODO: split dot and pull last name
-- local require
s("lreq", fmt("local {} = require('{}')", {
s("lreq", fmt("local {} = require(\"{}\")", {
i(1, "default"),
rep(1)
}) ),
-- if require
s("ifreq", fmt([[
local ok, {} = pcall(require, '{}')
local ok, {} = pcall(require, "{}")
if not ok then
vim.notify("missing module {}", vim.log.levels.WARN)
return
@ -38,12 +38,12 @@ return M
),
-- add a custom mapping
s({ trig = 'map', dscr = 'add custom mapping'}, fmt([[
['{}'] = {{ {}, '{}' }},
s({ trig = "map", dscr = "add custom mapping"}, fmt([[
["{}"] = {{ {}, "{}" }},
]], {
i(1, 'from'),
c(3, {
sn(nil, fmt([['{}']], {i(1)})),
sn(nil, fmt([["{}"]], {i(1)})),
sn(nil, fmt([[function() {} end]], {i(1)})),
sn(nil, fmt([[{}]], {i(1)})),
}),

@ -0,0 +1,25 @@
return {
-- AGPL3
s("AGPL3", fmt([[
# The AGPLv3 License (AGPLv3)
#
# Copyright (c) 2023 {}
#
# {} is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
]], {
i(1), i(0)
}))
}, { --autosnippets
-- s("uuid#", f(gen_uuid))
}
Loading…
Cancel
Save