initial commit
This commit is contained in:
commit
50da7ffff8
68 changed files with 3086 additions and 0 deletions
80
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/avante.lua
Normal file
80
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/avante.lua
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
return {
|
||||
-- {
|
||||
-- "MeanderingProgrammer/render-markdown.nvim",
|
||||
-- opts = {
|
||||
-- file_types = { "markdown", "Avante" },
|
||||
-- },
|
||||
-- ft = { "markdown", "Avante" },
|
||||
-- },
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
opts = {
|
||||
provider = "copilot",
|
||||
mappings = {
|
||||
diff = {
|
||||
ours = "<leader>co",
|
||||
theirs = "<leader>ct",
|
||||
all_theirs = "<leader>ca",
|
||||
both = "<leader>cb",
|
||||
cursor = "<leader>cc",
|
||||
next = "]x",
|
||||
prev = "[x",
|
||||
},
|
||||
ask = "<leader>Aa",
|
||||
edit = "<leader>Ae",
|
||||
refresh = "<leader>Ar",
|
||||
toggle = {
|
||||
default = "<leader>At",
|
||||
debug = "<leader>Ad",
|
||||
hint = "<leader>Ah",
|
||||
suggestion = "<leader>As",
|
||||
},
|
||||
},
|
||||
behaviour = {
|
||||
auto_suggestions = false,
|
||||
},
|
||||
hints = { enabled = false },
|
||||
},
|
||||
branch = "main",
|
||||
-- commit = "ff316f91101fcc328d1e7879ab1bf26a055c2745",
|
||||
-- if you want to download pre-built binary, then pass source=false. Make sure to follow instruction above.
|
||||
-- Also note that downloading prebuilt binary is a lot faster comparing to compiling from source.
|
||||
build = ":AvanteBuild source=false",
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below dependencies are optional,
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
-- "zbirenbaum/copilot.lua", -- for providers='copilot'
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- recommended settings
|
||||
default = {
|
||||
embed_image_as_base64 = false,
|
||||
prompt_for_file_name = false,
|
||||
drag_and_drop = {
|
||||
insert_mode = true,
|
||||
},
|
||||
-- required for Windows users
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Make sure to setup it properly if you have lazy=true
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
84
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/blink.lua
Normal file
84
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/blink.lua
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
version = "1.*",
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "default" },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
|
||||
-- {
|
||||
-- 'neovim/nvim-lspconfig',
|
||||
-- dependencies = {
|
||||
-- 'saghen/blink.cmp',
|
||||
-- 'williamboman/mason.nvim',
|
||||
-- 'mason-org/mason-registry',
|
||||
-- 'williamboman/mason-lspconfig.nvim',
|
||||
-- 'L3MON4D3/LuaSnip',
|
||||
-- 'saadparwaiz1/cmp_luasnip',
|
||||
-- 'j-hui/fidget.nvim',
|
||||
-- },
|
||||
--
|
||||
-- -- example using `opts` for defining servers
|
||||
-- opts = {
|
||||
-- servers = {
|
||||
-- lua_ls = {}
|
||||
-- }
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require("fidget").setup({})
|
||||
-- require("mason").setup()
|
||||
--
|
||||
-- local lspconfig = require('mason-lspconfig')
|
||||
-- for server, config in pairs(opts.servers) do
|
||||
-- -- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- -- `opts[server].capabilities, if you've defined it
|
||||
-- print('configuring server:', server)
|
||||
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
-- require("lspconfig")[server].setup(config)
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- example calling setup directly for each LSP
|
||||
-- config = function()
|
||||
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
-- local lspconfig = require('lspconfig')
|
||||
--
|
||||
-- lspconfig['lua_ls'].setup({ capabilities = capabilities })
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
134
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/colors.lua
Normal file
134
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/colors.lua
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
function ColorMyPencils(color)
|
||||
-- color = color or "rose-pine"
|
||||
color = color or "tokyonight-storm" or "rose-pine" or "tokyonight-night"
|
||||
vim.cmd.colorscheme(color)
|
||||
|
||||
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
|
||||
-- Shift+k, supposedly
|
||||
-- we don't need er
|
||||
-- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
-- vim.lsp.handlers.hover, {
|
||||
-- border = "single", -- Use a sharp border with `FloatBorder` highlights
|
||||
-- max_width = 50,
|
||||
-- }
|
||||
-- )
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("tokyonight").setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
|
||||
transparent = true, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
-- Style to be applied to different syntax groups
|
||||
-- Value is any valid attr-list value for `:help nvim_set_hl`
|
||||
comments = { italic = false },
|
||||
keywords = { italic = false },
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = "dark", -- style for sidebars, see below
|
||||
floats = "dark", -- style for floating windows
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
--[[ require('rose-pine').setup({
|
||||
disable_background = true,
|
||||
styles = {
|
||||
italic = false,
|
||||
},
|
||||
}) ]]
|
||||
|
||||
require("rose-pine").setup({
|
||||
variant = "auto", -- auto, main, moon, or dawn
|
||||
dark_variant = "main", -- main, moon, or dawn
|
||||
dim_inactive_windows = false,
|
||||
extend_background_behind_borders = true,
|
||||
|
||||
enable = {
|
||||
terminal = true,
|
||||
legacy_highlights = true, -- Improve compatibility for previous versions of Neovim
|
||||
migrations = true, -- Handle deprecated options automatically
|
||||
},
|
||||
|
||||
styles = {
|
||||
bold = true,
|
||||
italic = false,
|
||||
transparency = false,
|
||||
},
|
||||
|
||||
groups = {
|
||||
border = "muted",
|
||||
link = "iris",
|
||||
panel = "surface",
|
||||
|
||||
error = "love",
|
||||
hint = "iris",
|
||||
info = "foam",
|
||||
note = "pine",
|
||||
todo = "rose",
|
||||
warn = "gold",
|
||||
|
||||
git_add = "foam",
|
||||
git_change = "rose",
|
||||
git_delete = "love",
|
||||
git_dirty = "rose",
|
||||
git_ignore = "muted",
|
||||
git_merge = "iris",
|
||||
git_rename = "pine",
|
||||
git_stage = "iris",
|
||||
git_text = "rose",
|
||||
git_untracked = "subtle",
|
||||
|
||||
h1 = "iris",
|
||||
h2 = "foam",
|
||||
h3 = "rose",
|
||||
h4 = "gold",
|
||||
h5 = "pine",
|
||||
h6 = "foam",
|
||||
},
|
||||
|
||||
highlight_groups = {
|
||||
-- Comment = { fg = "foam" },
|
||||
-- VertSplit = { fg = "muted", bg = "muted" },
|
||||
},
|
||||
|
||||
before_highlight = function(group, highlight, palette)
|
||||
-- Disable all undercurls
|
||||
-- if highlight.undercurl then
|
||||
-- highlight.undercurl = false
|
||||
-- end
|
||||
--
|
||||
-- Change palette colour
|
||||
-- if highlight.fg == palette.pine then
|
||||
-- highlight.fg = palette.foam
|
||||
-- end
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim.cmd("colorscheme rose-pine")
|
||||
-- vim.cmd("colorscheme rose-pine-main")
|
||||
-- vim.cmd("colorscheme rose-pine-moon")
|
||||
-- vim.cmd("colorscheme rose-pine-dawn")
|
||||
|
||||
ColorMyPencils()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"VonHeikemen/fine-cmdline.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
215
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/dap.lua
Normal file
215
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/dap.lua
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
return
|
||||
{
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"mfussenegger/nvim-dap-python",
|
||||
"abayomi185/nvim-dap-probe-rs",
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local ui = require("dapui")
|
||||
|
||||
require("dapui").setup()
|
||||
require("nvim-dap-virtual-text").setup({})
|
||||
require('dap-probe-rs').setup()
|
||||
|
||||
-- Adapters
|
||||
dap.adapters.cppdbg = {
|
||||
id = "cppdbg",
|
||||
type = "executable",
|
||||
command = "/home/thegeneralist/.cpptools/extension/debugAdapters/bin/OpenDebugAD7",
|
||||
}
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
id = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
||||
}
|
||||
dap.adapters["probe-rs-debug"] = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = vim.fn.expand "$HOME/.cargo/bin/probe-rs",
|
||||
args = { "dap-server", "--port", "${port}" },
|
||||
},
|
||||
}
|
||||
|
||||
-- RUST
|
||||
dap.adapters["probe-rs-debug"] = {
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = vim.fn.expand "$HOME/.cargo/bin/probe-rs",
|
||||
args = { "dap-server", "--port", "${port}" },
|
||||
},
|
||||
}
|
||||
-- Connect the probe-rs-debug with rust files. Configuration of the debugger is done via project_folder/.vscode/launch.json
|
||||
require("dap.ext.vscode").type_to_filetypes["probe-rs-debug"] = { "rust" }
|
||||
-- Set up of handlers for RTT and probe-rs messages.
|
||||
-- In addition to nvim-dap-ui I write messages to a probe-rs.log in project folder
|
||||
-- If RTT is enabled, probe-rs sends an event after init of a channel. This has to be confirmed or otherwise probe-rs wont sent the rtt data.
|
||||
dap.listeners.before["event_probe-rs-rtt-channel-config"]["plugins.nvim-dap-probe-rs"] = function(session, body)
|
||||
local utils = require "dap.utils"
|
||||
utils.notify(
|
||||
string.format('probe-rs: Opening RTT channel %d with name "%s"!', body.channelNumber, body.channelName)
|
||||
)
|
||||
local file = io.open("probe-rs.log", "a")
|
||||
if file then
|
||||
file:write(
|
||||
string.format(
|
||||
'%s: Opening RTT channel %d with name "%s"!\n',
|
||||
os.date "%Y-%m-%d-T%H:%M:%S",
|
||||
body.channelNumber,
|
||||
body.channelName
|
||||
)
|
||||
)
|
||||
end
|
||||
if file then file:close() end
|
||||
session:request("rttWindowOpened", { body.channelNumber, true })
|
||||
end
|
||||
-- After confirming RTT window is open, we will get rtt-data-events.
|
||||
-- I print them to the dap-repl, which is one way and not separated.
|
||||
-- If you have better ideas, let me know.
|
||||
dap.listeners.before["event_probe-rs-rtt-data"]["plugins.nvim-dap-probe-rs"] = function(_, body)
|
||||
local message =
|
||||
string.format("%s: RTT-Channel %d - Message: %s", os.date "%Y-%m-%d-T%H:%M:%S", body.channelNumber, body
|
||||
.data)
|
||||
local repl = require "dap.repl"
|
||||
repl.append(message)
|
||||
local file = io.open("probe-rs.log", "a")
|
||||
if file then file:write(message) end
|
||||
if file then file:close() end
|
||||
end
|
||||
-- Probe-rs can send messages, which are handled with this listener.
|
||||
dap.listeners.before["event_probe-rs-show-message"]["plugins.nvim-dap-probe-rs"] = function(_, body)
|
||||
local message = string.format("%s: probe-rs message: %s", os.date "%Y-%m-%d-T%H:%M:%S", body.message)
|
||||
local repl = require "dap.repl"
|
||||
repl.append(message)
|
||||
local file = io.open("probe-rs.log", "a")
|
||||
if file then file:write(message) end
|
||||
if file then file:close() end
|
||||
end
|
||||
-- RUST END
|
||||
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input('Executable name (filter): ')
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = 'Attach to gdbserver :1234',
|
||||
type = 'gdb',
|
||||
request = 'attach',
|
||||
target = 'localhost:1234',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- Configurations
|
||||
-- dap.configurations.cpp = {
|
||||
-- {
|
||||
-- name = "Launch file",
|
||||
-- type = "cppdbg",
|
||||
-- request = "launch",
|
||||
-- program = function()
|
||||
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
-- end,
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- stopAtEntry = true,
|
||||
-- setupCommands = {
|
||||
-- {
|
||||
-- text = "-enable-pretty-printing",
|
||||
-- description = "enable pretty printing",
|
||||
-- ignoreFailures = false,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- name = "Attach to gdbserver :1234",
|
||||
-- type = "cppdbg",
|
||||
-- request = "launch",
|
||||
-- MIMode = "gdb",
|
||||
-- miDebuggerServerAddress = "localhost:1234",
|
||||
-- miDebuggerPath = "/usr/bin/gdb",
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- program = function()
|
||||
-- return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
-- end,
|
||||
-- setupCommands = {
|
||||
-- {
|
||||
-- text = "-enable-pretty-printing",
|
||||
-- description = "enable pretty printing",
|
||||
-- ignoreFailures = false,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
||||
|
||||
|
||||
dap.configurations.cpp = dap.configurations.c
|
||||
require("dap-python").setup("python")
|
||||
|
||||
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint)
|
||||
vim.keymap.set("n", "<leader>gb", dap.run_to_cursor)
|
||||
vim.keymap.set("n", "<leader>guo", ui.open)
|
||||
vim.keymap.set("n", "<leader>guc", ui.close)
|
||||
|
||||
-- Eval var under cursor
|
||||
vim.keymap.set("n", "<leader>?", function()
|
||||
ui.eval(nil, { enter = true })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<F1>", dap.continue)
|
||||
vim.keymap.set("n", "<F2>", dap.step_into)
|
||||
vim.keymap.set("n", "<F3>", dap.step_over)
|
||||
vim.keymap.set("n", "<F4>", dap.step_out)
|
||||
vim.keymap.set("n", "<F5>", dap.step_back)
|
||||
vim.keymap.set("n", "<F6>", dap.restart)
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
-- dap.listeners.before.event_terminated.dapui_config = function()
|
||||
-- ui.close()
|
||||
-- end
|
||||
-- dap.listeners.before.event_exited.dapui_config = function()
|
||||
-- -- ui.close()
|
||||
-- end
|
||||
end,
|
||||
},
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = '^5', -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"tpope/vim-fugitive",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
end
|
||||
}
|
||||
52
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/gh.lua
Normal file
52
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/gh.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
return {
|
||||
'ldelossa/gh.nvim',
|
||||
dependencies = {
|
||||
"ldelossa/litee.nvim"
|
||||
},
|
||||
config = function()
|
||||
require('litee.lib').setup()
|
||||
require('litee.gh').setup({
|
||||
-- deprecated, around for compatability for now.
|
||||
jump_mode = "invoking",
|
||||
-- remap the arrow keys to resize any litee.nvim windows.
|
||||
map_resize_keys = false,
|
||||
-- do not map any keys inside any gh.nvim buffers.
|
||||
disable_keymaps = false,
|
||||
-- the icon set to use.
|
||||
icon_set = "default",
|
||||
-- any custom icons to use.
|
||||
icon_set_custom = nil,
|
||||
-- whether to register the @username and #issue_number omnifunc completion
|
||||
-- in buffers which start with .git/
|
||||
git_buffer_completion = true,
|
||||
-- defines keymaps in gh.nvim buffers.
|
||||
keymaps = {
|
||||
-- when inside a gh.nvim panel, this key will open a node if it has
|
||||
-- any futher functionality. for example, hitting <CR> on a commit node
|
||||
-- will open the commit's changed files in a new gh.nvim panel.
|
||||
open = "<CR>",
|
||||
-- when inside a gh.nvim panel, expand a collapsed node
|
||||
expand = "zo",
|
||||
-- when inside a gh.nvim panel, collpased and expanded node
|
||||
collapse = "zc",
|
||||
-- when cursor is over a "#1234" formatted issue or PR, open its details
|
||||
-- and comments in a new tab.
|
||||
goto_issue = "gd",
|
||||
-- show any details about a node, typically, this reveals commit messages
|
||||
-- and submitted review bodys.
|
||||
details = "d",
|
||||
-- inside a convo buffer, submit a comment
|
||||
submit_comment = "<C-s>",
|
||||
-- inside a convo buffer, when your cursor is ontop of a comment, open
|
||||
-- up a set of actions that can be performed.
|
||||
actions = "<C-a>",
|
||||
-- inside a thread convo buffer, resolve the thread.
|
||||
resolve_thread = "<C-r>",
|
||||
-- inside a gh.nvim panel, if possible, open the node's web URL in your
|
||||
-- browser. useful particularily for digging into external failed CI
|
||||
-- checks.
|
||||
goto_web = "gx"
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
return {
|
||||
"theprimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
-- Add and list
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>a",
|
||||
function() harpoon:list():add() end,
|
||||
{ desc = '[Harpoon] Add file' }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-e>",
|
||||
function() harpoon.ui:toggle_quick_menu(harpoon:list()) end,
|
||||
{ desc = '[Harpoon] Toggle quick menu' }
|
||||
)
|
||||
|
||||
-- Navigate
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end, { desc = '[Harpoon] First file' })
|
||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end, { desc = '[Harpoon] Second file' })
|
||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end, { desc = '[Harpoon] Third file' })
|
||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end, { desc = '[Harpoon] Fourth file' })
|
||||
vim.keymap.set("n", "<C-]>", function()
|
||||
local input = vim.fn.input("File number > ")
|
||||
local file_number = tonumber(input, 10)
|
||||
if not file_number then return print(input .. " is not a valid number") end
|
||||
harpoon:list():select(file_number)
|
||||
end, { desc = '[Harpoon] File by number' })
|
||||
|
||||
-- Set
|
||||
vim.keymap.set("n", "<leader><C-h>", function() harpoon:list():replace_at(1) end,
|
||||
{ desc = '[Harpoon] Replace first file' })
|
||||
vim.keymap.set("n", "<leader><C-j>", function() harpoon:list():replace_at(2) end,
|
||||
{ desc = '[Harpoon] Replace second file' })
|
||||
vim.keymap.set("n", "<leader><C-k>", function() harpoon:list():replace_at(3) end,
|
||||
{ desc = '[Harpoon] Replace third file' })
|
||||
vim.keymap.set("n", "<leader><C-l>", function() harpoon:list():replace_at(4) end,
|
||||
{ desc = '[Harpoon] Replace fourth file' })
|
||||
vim.keymap.set("n",
|
||||
"<leader><C-]>",
|
||||
function()
|
||||
local file_number = tonumber(vim.fn.input("File number > "), 10)
|
||||
if not file_number then return end
|
||||
harpoon:list():select(file_number)
|
||||
end,
|
||||
{ desc = '[Harpoon] File by number' }
|
||||
)
|
||||
end
|
||||
}
|
||||
101
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/init.lua
Normal file
101
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/init.lua
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
return {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
--[[ {
|
||||
'boganworld/crackboard.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {
|
||||
session_key = 'redacted',
|
||||
},
|
||||
}, ]]
|
||||
{
|
||||
"onsails/lspkind-nvim",
|
||||
},
|
||||
-- {
|
||||
-- "ziglang/zig.vim",
|
||||
-- },
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
name = "plenary",
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
config = function()
|
||||
require("oil").setup()
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- -- https://github.com/zbirenbaum/copilot.lua
|
||||
-- "zbirenbaum/copilot.lua",
|
||||
-- cmd = "Copilot",
|
||||
-- event = "InsertEnter",
|
||||
-- config = function()
|
||||
-- require("copilot").setup({
|
||||
-- panel = {
|
||||
-- keymap = {
|
||||
-- jump_prev = "]]",
|
||||
-- jump_next = "[[",
|
||||
-- accept = "<Tab>",
|
||||
-- refresh = "gr",
|
||||
-- open = "<M-]>",
|
||||
-- },
|
||||
-- },
|
||||
-- suggestion = {
|
||||
-- auto_trigger = true,
|
||||
-- keymap = {
|
||||
-- accept = "<M-Tab>",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- -- vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
-- -- vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
-- set <leader>cpd and <leader>cpe to disable/enable copilot
|
||||
vim.keymap.set("n", "<leader>cpe", "<cmd>Copilot enable<CR>")
|
||||
vim.keymap.set("n", "<leader>cpd", "<cmd>Copilot disable<CR>")
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "Exafunction/codeium.nvim",
|
||||
-- dependencies = {
|
||||
-- "nvim-lua/plenary.nvim",
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("codeium").setup({
|
||||
-- -- https://github.com/Exafunction/codeium.vim
|
||||
-- })
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
"ldelossa/gh.nvim",
|
||||
dependencies = {
|
||||
"ldelossa/litee.nvim",
|
||||
},
|
||||
},
|
||||
"eandrju/cellular-automaton.nvim",
|
||||
"gpanders/editorconfig.nvim",
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
|
||||
"lambdalisue/nerdfont.vim",
|
||||
"junegunn/vim-easy-align",
|
||||
"rcarriga/nvim-notify",
|
||||
|
||||
-- Highlight todo, notes, etc in comments
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = { signs = false },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
-- "SUSTech-data/neopyter",
|
||||
-- ---@type neopyter.Option
|
||||
-- opts = {
|
||||
-- mode = "proxy", -- was "direct"
|
||||
-- remote_address = "127.0.0.1:9001",
|
||||
-- file_pattern = { "*.ju.*" },
|
||||
-- on_attach = function(bufnr)
|
||||
-- -- do some buffer keymap
|
||||
-- end,
|
||||
-- highlight = {
|
||||
-- enable = true,
|
||||
-- shortsighted = false,
|
||||
-- },
|
||||
-- parser = {
|
||||
-- -- trim leading/tailing whitespace of cell
|
||||
-- trim_whitespace = false,
|
||||
-- },
|
||||
-- },
|
||||
-- on_attach = function(buf)
|
||||
-- local function map(mode, lhs, rhs, desc)
|
||||
-- vim.keymap.set(mode, lhs, rhs, { desc = desc, buffer = buf })
|
||||
-- end
|
||||
-- -- same, recommend the former
|
||||
-- map("n", "<C-Enter>", "<cmd>Neopyter execute notebook:run-cell<cr>", "run selected")
|
||||
-- -- map("n", "<C-Enter>", "<cmd>Neopyter run current<cr>", "run selected")
|
||||
--
|
||||
-- -- same, recommend the former
|
||||
-- map("n", "<space>X", "<cmd>Neopyter execute notebook:run-all-above<cr>", "run all above cell")
|
||||
-- -- map("n", "<space>X", "<cmd>Neopyter run allAbove<cr>", "run all above cell")
|
||||
--
|
||||
-- -- same, recommend the former, but the latter is silent
|
||||
-- map("n", "<space>nt", "<cmd>Neopyter execute kernelmenu:restart<cr>", "restart kernel")
|
||||
-- -- map("n", "<space>nt", "<cmd>Neopyter kernel restart<cr>", "restart kernel")
|
||||
--
|
||||
-- map("n", "<S-Enter>", "<cmd>Neopyter execute runmenu:run<cr>", "run selected and select next")
|
||||
-- map("n", "<M-Enter>", "<cmd>Neopyter execute run-cell-and-insert-below<cr>", "run selected and insert below")
|
||||
--
|
||||
-- map("n", "<F5>", "<cmd>Neopyter execute notebook:restart-run-all<cr>", "restart kernel and run all")
|
||||
-- end,
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "luvit-meta/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
|
||||
{ -- optional completion source for require statements and module annotations
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function(_, opts)
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, {
|
||||
name = "lazydev",
|
||||
group_index = 0, -- set group index to 0 to skip loading LuaLS completions
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- { "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
|
||||
}
|
||||
287
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/lsp.lua
Normal file
287
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/lsp.lua
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"saghen/blink.cmp",
|
||||
-- "folke/neodev.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"mason-org/mason-registry",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"j-hui/fidget.nvim",
|
||||
},
|
||||
config = function()
|
||||
local lspkind = require("lspkind")
|
||||
-- local cmp = require("cmp")
|
||||
-- local cmp_lsp = require("cmp_nvim_lsp")
|
||||
-- local capabilities = vim.tbl_deep_extend(
|
||||
-- "force",
|
||||
-- {},
|
||||
-- vim.lsp.protocol.make_client_capabilities(),
|
||||
-- cmp_lsp.default_capabilities()
|
||||
-- )
|
||||
|
||||
require("fidget").setup({})
|
||||
require("mason").setup()
|
||||
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
require("lspconfig").lua_ls.setup({ capabilites = capabilities })
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local c = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if not c then
|
||||
return
|
||||
end
|
||||
|
||||
if vim.bo.filetype == "lua" then
|
||||
-- Format the current buffer on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = args.buf, id = c.id })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- local vue_typescript_plugin = require("mason-registry")
|
||||
-- .get_package("vue-language-server")
|
||||
-- :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin"
|
||||
|
||||
-- require("mason-lspconfig").setup({
|
||||
-- ensure_installed = {
|
||||
-- "lua_ls",
|
||||
-- "rust_analyzer",
|
||||
-- "ts_ls",
|
||||
-- "cssls",
|
||||
-- "tailwindcss",
|
||||
-- "pyright",
|
||||
-- },
|
||||
-- handlers = {
|
||||
-- function(server_name) -- default handler (optional)
|
||||
-- if server_name == "rust_analyzer" then
|
||||
-- return
|
||||
-- end
|
||||
-- require("lspconfig")[server_name].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- end,
|
||||
--
|
||||
-- ["lua_ls"] = function()
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- lspconfig.lua_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- diagnostics = {
|
||||
-- globals = { "vim", "it", "describe", "before_each", "after_each" },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
--
|
||||
-- ["ts_ls"] = function()
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- lspconfig.ts_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- -- settings = {
|
||||
-- -- },
|
||||
-- init_options = {
|
||||
-- plugins = {
|
||||
-- {
|
||||
-- name = "@vue/typescript-plugin",
|
||||
-- location = vue_typescript_plugin,
|
||||
-- languages = { "vue" },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- filetypes = {
|
||||
-- "javascript",
|
||||
-- "javascriptreact",
|
||||
-- "javascript.jsx",
|
||||
-- "typescript",
|
||||
-- "typescriptreact",
|
||||
-- "typescript.tsx",
|
||||
-- "vue",
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- local cmp_select = { behavior = cmp.SelectBehavior.Select }
|
||||
|
||||
--- Select item next/prev, taking into account whether the cmp window is
|
||||
--- top-down or bottoom-up so that the movement is always in the same direction.
|
||||
-- local select_item_smart = function(dir, opts)
|
||||
-- return function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- opts = opts or { behavior = cmp.SelectBehavior.Select }
|
||||
-- if cmp.core.view.custom_entries_view:is_direction_top_down() then
|
||||
-- ({ next = cmp.select_next_item, prev = cmp.select_prev_item })[dir](opts)
|
||||
-- else
|
||||
-- ({ prev = cmp.select_next_item, next = cmp.select_prev_item })[dir](opts)
|
||||
-- end
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- cmp.setup({
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- end,
|
||||
-- },
|
||||
-- completion = {
|
||||
-- completeopt = "menu,menuone,noinsert",
|
||||
-- },
|
||||
-- -- No idea what this is
|
||||
-- matching = {
|
||||
-- disallow_fuzzy_matching = false,
|
||||
-- disallow_fullfuzzy_matching = false,
|
||||
-- disallow_partial_fuzzy_matching = false,
|
||||
-- },
|
||||
-- performance = {
|
||||
-- -- debounce = 50,
|
||||
-- debounce = 25,
|
||||
-- -- max_view_entries = 20,
|
||||
-- },
|
||||
-- That crazy window
|
||||
-- window = {
|
||||
-- completion = cmp.config.window.bordered({
|
||||
-- border = "single",
|
||||
-- side_padding = 2,
|
||||
-- col_offset = -3,
|
||||
-- max_width = 80,
|
||||
-- }),
|
||||
-- documentation = cmp.config.window.bordered({
|
||||
-- max_width = 50,
|
||||
-- }),
|
||||
-- },
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- ["<C-p>"] = select_item_smart("prev", cmp_select),
|
||||
-- ["<C-n>"] = select_item_smart("next", cmp_select),
|
||||
-- ["<C-e>"] = cmp.mapping.close(),
|
||||
-- ["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||
-- ["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
||||
-- ["<C-B>"] = cmp.mapping.complete(),
|
||||
-- ["<C-u>"] = cmp.mapping.scroll_docs(-3),
|
||||
-- ["<C-d>"] = cmp.mapping.scroll_docs(3),
|
||||
-- ["<C-g>"] = cmp.mapping.abort(),
|
||||
-- }),
|
||||
-- sorting = {
|
||||
-- comparators = {
|
||||
-- cmp.config.compare.locality,
|
||||
-- cmp.config.compare.offset,
|
||||
-- cmp.config.compare.recently_used,
|
||||
-- cmp.config.compare.exact,
|
||||
-- cmp.config.compare.order,
|
||||
-- cmp.config.compare.length,
|
||||
-- function(entry1, entry2)
|
||||
-- local _, entry1_under = entry1.completion_item.label:find("^_+")
|
||||
-- local _, entry2_under = entry2.completion_item.label:find("^_+")
|
||||
-- entry1_under = entry1_under or 0
|
||||
-- entry2_under = entry2_under or 0
|
||||
-- if entry1_under > entry2_under then
|
||||
-- return false
|
||||
-- elseif entry1_under < entry2_under then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
-- cmp.config.compare.kind,
|
||||
-- cmp.config.compare.sort_text,
|
||||
-- },
|
||||
-- },
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = "neopyter" },
|
||||
-- { name = "nvim_lsp" },
|
||||
-- { name = "codeium" },
|
||||
-- { name = "luasnip" }, -- For luasnip users.
|
||||
-- }, {
|
||||
-- { name = "buffer" },
|
||||
-- }),
|
||||
-- formatting = {
|
||||
-- fields = {
|
||||
-- "abbr",
|
||||
-- "kind",
|
||||
-- "menu",
|
||||
-- },
|
||||
-- expandable_indicator = true,
|
||||
-- format = lspkind.cmp_format({
|
||||
-- mode = "symbol_text",
|
||||
-- maxwidth = 50,
|
||||
-- ellipsis_char = "...",
|
||||
-- menu = {
|
||||
-- neopyter = "[Neopyter]",
|
||||
-- },
|
||||
-- symbol_map = {
|
||||
-- -- specific complete item kind icon
|
||||
-- ["Magic"] = "🪄",
|
||||
-- ["Path"] = "📁",
|
||||
-- ["Dict key"] = "🔑",
|
||||
-- ["Instance"] = "",
|
||||
-- ["Statement"] = "",
|
||||
-- },
|
||||
-- }),
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- -- menu item highlight
|
||||
-- vim.api.nvim_set_hl(0, "CmpItemKindMagic", { bg = "NONE", fg = "#D4D434" })
|
||||
-- vim.api.nvim_set_hl(0, "CmpItemKindPath", { link = "CmpItemKindFolder" })
|
||||
-- vim.api.nvim_set_hl(0, "CmpItemKindDictkey", { link = "CmpItemKindKeyword" })
|
||||
-- vim.api.nvim_set_hl(0, "CmpItemKindInstance", { link = "CmpItemKindVariable" })
|
||||
-- vim.api.nvim_set_hl(0, "CmpItemKindStatement", { link = "CmpItemKindVariable" })
|
||||
|
||||
-- vim.diagnostic.config({
|
||||
-- -- update_in_insert = true, -- Update diagnostics in Insert mode
|
||||
-- -- ^ (if false, diagnostics are updated on InsertLeave)
|
||||
--
|
||||
-- underline = true,
|
||||
--
|
||||
-- virtual_text = true,
|
||||
--
|
||||
-- severity_sort = true, -- high -> low
|
||||
--
|
||||
-- -- float = {
|
||||
-- -- focusable = false,
|
||||
-- -- style = "minimal",
|
||||
-- -- border = "rounded",
|
||||
-- -- source = true,
|
||||
-- -- header = { " Diagnostics", "String" },
|
||||
-- -- prefix = function(_, _, _)
|
||||
-- -- return " ", "String"
|
||||
-- -- end,
|
||||
-- -- },
|
||||
-- })
|
||||
|
||||
-- treesitter jupyter notebook stuff
|
||||
-- require("nvim-treesitter.configs").setup({
|
||||
-- textobjects = {
|
||||
-- move = {
|
||||
-- enable = true,
|
||||
-- goto_next_start = {
|
||||
-- ["]j"] = "@cellseparator",
|
||||
-- ["]c"] = "@cellcontent",
|
||||
-- },
|
||||
-- goto_previous_start = {
|
||||
-- ["[j"] = "@cellseparator",
|
||||
-- ["[c"] = "@cellcontent",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- follow latest release.
|
||||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
vim.keymap.set({ "i" }, "<C-K>", function() ls.expand() end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-L>", function() ls.jump(1) end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-J>", function() ls.jump(-1) end, { silent = true })
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end, { silent = true })
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
-- "iamcco/markdown-preview.nvim",
|
||||
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
-- build = "cd app && yarn install",
|
||||
-- init = function()
|
||||
-- vim.g.mkdp_filetypes = { "markdown" }
|
||||
-- end,
|
||||
-- ft = { "markdown" },
|
||||
}
|
||||
25
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/neogen.lua
Normal file
25
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/neogen.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
"danymat/neogen",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
config = function()
|
||||
local neogen = require("neogen")
|
||||
|
||||
neogen.setup({
|
||||
snippet_engine = "luasnip"
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>nf", function()
|
||||
neogen.generate({ type = "func" })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>nt", function()
|
||||
neogen.generate({ type = "type" })
|
||||
end)
|
||||
|
||||
end
|
||||
-- Uncomment next line if you want to follow only stable versions
|
||||
-- version = "*"
|
||||
}
|
||||
51
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/nullls.lua
Normal file
51
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/nullls.lua
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
--[[
|
||||
These three tabs are necessary when dealing with this nonsense:
|
||||
- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTIN_CONFIG.md#arguments
|
||||
- https://github.com/jay-babu/mason-null-ls.nvim
|
||||
- https://github.com/nvimtools/none-ls.nvim
|
||||
--]]
|
||||
return {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"jq",
|
||||
"mypy",
|
||||
"ruff",
|
||||
"black",
|
||||
},
|
||||
handlers = {
|
||||
["mypy"] = function(source_name, methods)
|
||||
local options = {
|
||||
extra_args = function()
|
||||
local command = "which python"
|
||||
local handle = io.popen(command)
|
||||
local python_path = ""
|
||||
if handle then
|
||||
python_path = handle:read("*a")
|
||||
python_path = string.gsub(python_path, "\n", "")
|
||||
handle:close()
|
||||
end
|
||||
return { "--python-executable", python_path }
|
||||
end,
|
||||
}
|
||||
null_ls.register(null_ls.builtins.diagnostics.mypy.with(options))
|
||||
end,
|
||||
--[[ ["ruff"] = function(source_name, methods)
|
||||
null_ls.register(null_ls.builtins.diagnostics.ruff)
|
||||
--require('mason-null-ls').default_setup(source_name, methods) -- to maintain default behavior
|
||||
end, ]]
|
||||
},
|
||||
})
|
||||
|
||||
null_ls.setup()
|
||||
end,
|
||||
}
|
||||
128
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/statusline.lua
Normal file
128
modules/home/dotfiles/nvim/lua/thegeneralist/lazy/statusline.lua
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
-- "freddiehaddad/feline.nvim",
|
||||
dependencies = {
|
||||
-- "Hitesh-Aggarwal/feline_one_monokai.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local tcolors = require("tokyonight.colors").setup() -- pass in any of the config options as explained above
|
||||
local util = require("tokyonight.util")
|
||||
local bgc = util.lighten(tcolors.bg_statusline, 0.9)
|
||||
|
||||
local theme = {
|
||||
normal = {
|
||||
a = { fg = tcolors.fg, bg = bgc },
|
||||
b = { fg = tcolors.fg, bg = bgc },
|
||||
c = { fg = tcolors.fg, bg = bgc },
|
||||
z = { fg = tcolors.fg, bg = bgc },
|
||||
},
|
||||
insert = { a = { fg = tcolors.black, bg = tcolors.green } },
|
||||
visual = { a = { fg = tcolors.black, bg = tcolors.orange } },
|
||||
replace = { a = { fg = tcolors.black, bg = tcolors.green } },
|
||||
}
|
||||
|
||||
local empty = require("lualine.component"):extend()
|
||||
function empty:draw(default_highlight)
|
||||
self.status = ""
|
||||
self.applied_separator = ""
|
||||
self:apply_highlights(default_highlight)
|
||||
self:apply_section_separators()
|
||||
return self.status
|
||||
end
|
||||
|
||||
-- Put proper separators and gaps between components in sections
|
||||
local function process_sections(sections)
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < "x"
|
||||
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = tcolors.bg_dark, bg = tcolors.bg_dark } })
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= "table" then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = "" } or { left = "" }
|
||||
end
|
||||
end
|
||||
return sections
|
||||
end
|
||||
|
||||
local function search_result()
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ""
|
||||
end
|
||||
local last_search = vim.fn.getreg("/")
|
||||
if not last_search or last_search == "" then
|
||||
return ""
|
||||
end
|
||||
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
|
||||
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
|
||||
end
|
||||
|
||||
local function modified()
|
||||
if vim.bo.modified then
|
||||
return "+"
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return "-"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = theme,
|
||||
component_separators = "",
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = process_sections({
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {
|
||||
"branch",
|
||||
-- "diff",
|
||||
{
|
||||
"diagnostics",
|
||||
source = { "nvim" },
|
||||
sections = { "error" },
|
||||
diagnostics_color = { error = { bg = tcolors.red1, fg = tcolors.bg } },
|
||||
},
|
||||
{
|
||||
"diagnostics",
|
||||
source = { "nvim" },
|
||||
sections = { "warn" },
|
||||
diagnostics_color = { warn = { bg = tcolors.orange, fg = tcolors.bg } },
|
||||
},
|
||||
{ "filename", file_status = false, path = 3 },
|
||||
{ modified, color = { bg = tcolors.red1, fg = "#ffffff" } },
|
||||
{
|
||||
"%w",
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
"%r",
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
"%q",
|
||||
cond = function()
|
||||
return vim.bo.buftype == "quickfix"
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { search_result, "filetype" },
|
||||
lualine_z = { "%l:%c", "%p%%/%L" },
|
||||
}),
|
||||
inactive_sections = {
|
||||
lualine_c = { "%f %y %m" },
|
||||
lualine_x = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
tag = "0.1.5",
|
||||
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
preview = {
|
||||
treesitter = true,
|
||||
},
|
||||
file_ignore_patterns = {
|
||||
"node_modules",
|
||||
},
|
||||
},
|
||||
})
|
||||
local builtin = require("telescope.builtin")
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
local search_string = vim.fn.input("Grep > ")
|
||||
if search_string == "" then
|
||||
return
|
||||
end
|
||||
builtin.grep_string({ search = search_string })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>pws", function()
|
||||
local word = vim.fn.expand("<cword>")
|
||||
builtin.grep_string({ search = word })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>pWs", function()
|
||||
local word = vim.fn.expand("<cWORD>")
|
||||
builtin.grep_string({ search = word })
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>pg", builtin.live_grep, {})
|
||||
|
||||
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
|
||||
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
|
||||
|
||||
vim.keymap.set("n", "<leader>pb", builtin.buffers, {})
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
|
||||
-- Shortcut for searching your Neovim configuration files
|
||||
vim.keymap.set("n", "<leader>on", function()
|
||||
builtin.find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end, { desc = "[O]pen [N]eovim files" })
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = {
|
||||
},
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
--[[
|
||||
ensure_installed = {
|
||||
"svelte",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"cpp",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query"
|
||||
},
|
||||
--]]
|
||||
--ensure_installed = 'all',
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
config = function()
|
||||
require("trouble").setup({
|
||||
icons = false,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
require("trouble").toggle()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("trouble").next({skip_groups = true, jump = true});
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("trouble").previous({skip_groups = true, jump = true});
|
||||
end)
|
||||
|
||||
end
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"mbbill/undotree",
|
||||
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
commit = "af4ded85542d40e190014c732fa051bdbf88be3d",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
t = {
|
||||
name = '+Trouble',
|
||||
w = { '<cmd>TroubleToggle workspace_diagnostics<cr>', 'Workspace Diagnostics' },
|
||||
d = { '<cmd>TroubleToggle document_diagnostics<cr>', 'Document Diagnostics' },
|
||||
q = { '<cmd>TroubleToggle quickfix<cr>', 'Quickfix' },
|
||||
l = { '<cmd>TroubleToggle loclist<cr>', 'Location List' },
|
||||
},
|
||||
g = {
|
||||
R = { '<cmd>TroubleToggle lsp_references<cr>', 'LSP References' },
|
||||
h = {
|
||||
name = "+Git",
|
||||
h = {
|
||||
name = "+Github",
|
||||
c = {
|
||||
name = "+Commits",
|
||||
c = { "<cmd>GHCloseCommit<cr>", "Close" },
|
||||
e = { "<cmd>GHExpandCommit<cr>", "Expand" },
|
||||
o = { "<cmd>GHOpenToCommit<cr>", "Open To" },
|
||||
p = { "<cmd>GHPopOutCommit<cr>", "Pop Out" },
|
||||
z = { "<cmd>GHCollapseCommit<cr>", "Collapse" },
|
||||
},
|
||||
i = {
|
||||
name = "+Issues",
|
||||
p = { "<cmd>GHPreviewIssue<cr>", "Preview" },
|
||||
},
|
||||
l = {
|
||||
name = "+Litee",
|
||||
t = { "<cmd>LTPanel<cr>", "Toggle Panel" },
|
||||
},
|
||||
r = {
|
||||
name = "+Review",
|
||||
b = { "<cmd>GHStartReview<cr>", "Begin" },
|
||||
c = { "<cmd>GHCloseReview<cr>", "Close" },
|
||||
d = { "<cmd>GHDeleteReview<cr>", "Delete" },
|
||||
e = { "<cmd>GHExpandReview<cr>", "Expand" },
|
||||
s = { "<cmd>GHSubmitReview<cr>", "Submit" },
|
||||
z = { "<cmd>GHCollapseReview<cr>", "Collapse" },
|
||||
},
|
||||
p = {
|
||||
name = "+Pull Request",
|
||||
c = { "<cmd>GHClosePR<cr>", "Close" },
|
||||
d = { "<cmd>GHPRDetails<cr>", "Details" },
|
||||
e = { "<cmd>GHExpandPR<cr>", "Expand" },
|
||||
o = { "<cmd>GHOpenPR<cr>", "Open" },
|
||||
p = { "<cmd>GHPopOutPR<cr>", "PopOut" },
|
||||
r = { "<cmd>GHRefreshPR<cr>", "Refresh" },
|
||||
t = { "<cmd>GHOpenToPR<cr>", "Open To" },
|
||||
z = { "<cmd>GHCollapsePR<cr>", "Collapse" },
|
||||
},
|
||||
t = {
|
||||
name = "+Threads",
|
||||
c = { "<cmd>GHCreateThread<cr>", "Create" },
|
||||
n = { "<cmd>GHNextThread<cr>", "Next" },
|
||||
t = { "<cmd>GHToggleThread<cr>", "Toggle" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
--conf end
|
||||
}
|
||||
}
|
||||
--local wk = require("which-key")
|
||||
--wk.register({
|
||||
--}, { prefix = "<leader>" })
|
||||
Loading…
Add table
Add a link
Reference in a new issue