mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-05 02:53:38 -08:00
Compare commits
3 Commits
441ab51f62
...
714e0ee2ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
714e0ee2ad | ||
|
|
efe301850a | ||
|
41c43a24cf
|
@@ -75,7 +75,6 @@ alias mysan='feh --bg-scale ~/.wallpapers/MYSanGun-Inverted.png ~/.wallpapers/MY
|
||||
alias scripts='cd /home/sudacode/scripts'
|
||||
alias freud='cd /home/sudacode/'
|
||||
alias c=clear
|
||||
alias open='xdg-open'
|
||||
alias glow='glow -p'
|
||||
alias jn='jupyter-notebook'
|
||||
alias blog='cd ~/projects/React/github/Sudacode-Blog-V3'
|
||||
|
||||
@@ -6,7 +6,7 @@ local term_factory = term.term_factory
|
||||
local term_toggle = term.term_toggle
|
||||
|
||||
local opts = { silent = true, noremap = true }
|
||||
local nosilent = { noremap = true }
|
||||
local nosilent = { silent = false, noremap = true }
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = " "
|
||||
@@ -199,23 +199,37 @@ local lsp_mappings = {
|
||||
group = "Goto Previous Preview",
|
||||
},
|
||||
{ mode = "n", key = "<leader>cl", cmd = ":lua vim.diagnostic.setloclist()<CR>", group = "Set Loclist" },
|
||||
{
|
||||
mode = "n",
|
||||
key = "<leader>cPs",
|
||||
cmd = function()
|
||||
vim.cmd("!pyright --createstub " .. vim.fn.expand("<cword>"))
|
||||
end,
|
||||
group = "Generate Stub File",
|
||||
},
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Code Companion Mappings
|
||||
local code_companion_mappings = {
|
||||
{ mode = "n", key = "<leader>cp", cmd = ":vert Copilot panel<CR>", group = "Code" },
|
||||
{ mode = "n", key = "<leader>oc", cmd = ":CodeCompanionChat Toggle<CR>", group = "Open" },
|
||||
{ mode = "n", key = "<leader>Cc", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanionChat" },
|
||||
{ mode = "n", key = "<leader>Ci", cmd = ":CodeCompanion ", group = "Inline CodeCompanion", opts = nosilent },
|
||||
{ mode = "n", key = "<leader>cp", cmd = ":vert Copilot panel<CR>", group = "Copilot Panel" },
|
||||
{ mode = "n", key = "<leader>oc", cmd = ":CodeCompanionChat Toggle<CR>", group = "Toggle Codecompanion" },
|
||||
{ mode = "n", key = "<leader>Cc", cmd = ":CodeCompanionChat Toggle<CR>", group = "Toggle Codecompanion" },
|
||||
{
|
||||
mode = "n",
|
||||
key = "<leader>Ci",
|
||||
cmd = ":CodeCompanion #{buffer} ",
|
||||
group = "Inline CodeCompanion",
|
||||
opts = nosilent,
|
||||
},
|
||||
{ mode = "n", key = "<leader>CT", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanion Toggle" },
|
||||
{ mode = "n", key = "<leader>Ca", cmd = ":CodeCompanionActions<CR>", group = "CodeCompanion Actions" },
|
||||
{ mode = "v", key = "<leader>Cc", cmd = ":CodeCompanionChat Add<CR>", group = "CodeCompanion Add" },
|
||||
{
|
||||
mode = "v",
|
||||
key = "<leader>Ci",
|
||||
cmd = ":CodeCompanion #buffer ",
|
||||
group = "CodeCompanion #buffer",
|
||||
cmd = ":CodeCompanion #{buffer} ",
|
||||
group = "CodeCompanion #{buffer}",
|
||||
opts = nosilent,
|
||||
},
|
||||
{ mode = "v", key = "<leader>Ce", cmd = ":CodeCompanion /explain<CR>", group = "CodeCompanion /explain" },
|
||||
@@ -537,6 +551,7 @@ add_to_whichkey(nil, { key = "<leader>a", group = "AnyJump" })
|
||||
add_to_whichkey(nil, { key = "<leader>b", group = "Buffers" })
|
||||
add_to_whichkey(nil, { key = "<leader>c", group = "Code" })
|
||||
add_to_whichkey(nil, { key = "<leader>ca", group = "Code Actions" })
|
||||
add_to_whichkey(nil, { key = "<leader>cc", group = "Calls" })
|
||||
add_to_whichkey(nil, { key = "<leader>C", group = "CodeCompanion" })
|
||||
add_to_whichkey(nil, { key = "<leader>d", group = "ODIS" })
|
||||
add_to_whichkey(nil, { key = "<leader>f", group = "Find" })
|
||||
@@ -555,6 +570,7 @@ add_to_whichkey(nil, { key = "<leader>w", group = "Workspace" })
|
||||
add_to_whichkey(nil, { key = "<leader>x", group = "Make Executable" })
|
||||
add_to_whichkey(nil, { key = "<leader>y", group = "System Yank" })
|
||||
add_to_whichkey(nil, { key = "<leader>0", group = "Horizontal Terminal" })
|
||||
add_to_whichkey(nil, { key = "<leader>cP", group = "Python" })
|
||||
--}}}
|
||||
|
||||
--{{{ Whichkey Mappings
|
||||
|
||||
@@ -1,101 +1,107 @@
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
opts = {
|
||||
-- text = {
|
||||
-- spinner = "pipe", -- animation shown when tasks are ongoing
|
||||
-- done = "✔", -- character shown when all tasks are complete
|
||||
-- commenced = "Started", -- message shown when task starts
|
||||
-- completed = "Completed", -- message shown when task completes
|
||||
-- },
|
||||
-- align = {
|
||||
-- bottom = true, -- align fidgets along bottom edge of buffer
|
||||
-- right = true, -- align fidgets along right edge of buffer
|
||||
-- },
|
||||
progress = {
|
||||
poll_rate = 0, -- How and when to poll for progress messages
|
||||
suppress_on_insert = false, -- Suppress new messages while in insert mode
|
||||
ignore_done_already = false, -- Ignore new tasks that are already complete
|
||||
ignore_empty_message = false, -- Ignore new tasks that don't contain a message
|
||||
clear_on_detach = -- Clear notification group when LSP server detaches
|
||||
function(client_id)
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
return client and client.name or nil
|
||||
end,
|
||||
notification_group = -- How to get a progress message's notification group key
|
||||
function(msg) return msg.lsp_client.name end,
|
||||
ignore = {}, -- List of LSP servers to ignore
|
||||
"j-hui/fidget.nvim",
|
||||
opts = {
|
||||
-- text = {
|
||||
-- spinner = "pipe", -- animation shown when tasks are ongoing
|
||||
-- done = "✔", -- character shown when all tasks are complete
|
||||
-- commenced = "Started", -- message shown when task starts
|
||||
-- completed = "Completed", -- message shown when task completes
|
||||
-- },
|
||||
-- align = {
|
||||
-- bottom = true, -- align fidgets along bottom edge of buffer
|
||||
-- right = true, -- align fidgets along right edge of buffer
|
||||
-- },
|
||||
progress = {
|
||||
poll_rate = 0, -- How and when to poll for progress messages
|
||||
suppress_on_insert = false, -- Suppress new messages while in insert mode
|
||||
ignore_done_already = false, -- Ignore new tasks that are already complete
|
||||
ignore_empty_message = false, -- Ignore new tasks that don't contain a message
|
||||
-- Clear notification group when LSP server detaches
|
||||
clear_on_detach = function(client_id)
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
return client and client.name or nil
|
||||
end,
|
||||
-- How to get a progress message's notification group key
|
||||
notification_group = function(msg)
|
||||
return msg.lsp_client.name
|
||||
end,
|
||||
ignore = {}, -- List of LSP servers to ignore
|
||||
|
||||
-- Options related to how LSP progress messages are displayed as notifications
|
||||
display = {
|
||||
render_limit = 16, -- How many LSP messages to show at once
|
||||
done_ttl = 3, -- How long a message should persist after completion
|
||||
done_icon = "✔", -- Icon shown when all LSP progress tasks are complete
|
||||
done_style = "Constant", -- Highlight group for completed LSP tasks
|
||||
progress_ttl = math.huge, -- How long a message should persist when in progress
|
||||
progress_icon = -- Icon shown when LSP progress tasks are in progress
|
||||
{ "dots" },
|
||||
progress_style = -- Highlight group for in-progress LSP tasks
|
||||
"WarningMsg",
|
||||
group_style = "Title", -- Highlight group for group name (LSP server name)
|
||||
icon_style = "Question", -- Highlight group for group icons
|
||||
priority = 30, -- Ordering priority for LSP notification group
|
||||
skip_history = true, -- Whether progress notifications should be omitted from history
|
||||
format_message = -- How to format a progress message
|
||||
require("fidget.progress.display").default_format_message,
|
||||
format_annote = -- How to format a progress annotation
|
||||
function(msg) return msg.title end,
|
||||
format_group_name = -- How to format a progress notification group's name
|
||||
function(group) return tostring(group) end,
|
||||
overrides = { -- Override options from the default notification config
|
||||
rust_analyzer = { name = "rust-analyzer" },
|
||||
},
|
||||
},
|
||||
-- Options related to how LSP progress messages are displayed as notifications
|
||||
display = {
|
||||
render_limit = 16, -- How many LSP messages to show at once
|
||||
done_ttl = 3, -- How long a message should persist after completion
|
||||
done_icon = "✔", -- Icon shown when all LSP progress tasks are complete
|
||||
done_style = "Constant", -- Highlight group for completed LSP tasks
|
||||
progress_ttl = math.huge, -- How long a message should persist when in progress
|
||||
-- Icon shown when LSP progress tasks are in progress
|
||||
progress_icon = { "dots" },
|
||||
-- Highlight group for in-progress LSP tasks
|
||||
progress_style = "WarningMsg",
|
||||
group_style = "Title", -- Highlight group for group name (LSP server name)
|
||||
icon_style = "Question", -- Highlight group for group icons
|
||||
priority = 30, -- Ordering priority for LSP notification group
|
||||
skip_history = true, -- Whether progress notifications should be omitted from history
|
||||
-- How to format a progress message
|
||||
format_message = require("fidget.progress.display").default_format_message,
|
||||
-- How to format a progress annotation
|
||||
format_annote = function(msg)
|
||||
return msg.title
|
||||
end,
|
||||
-- How to format a progress notification group's name
|
||||
format_group_name = function(group)
|
||||
return tostring(group)
|
||||
end,
|
||||
overrides = { -- Override options from the default notification config
|
||||
rust_analyzer = { name = "rust-analyzer" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Options related to Neovim's built-in LSP client
|
||||
lsp = {
|
||||
progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
|
||||
log_handler = false, -- Log `$/progress` handler invocations (for debugging)
|
||||
},
|
||||
},
|
||||
notification = {
|
||||
window = {
|
||||
winblend = 0,
|
||||
},
|
||||
poll_rate = 10, -- How frequently to update and render notifications
|
||||
filter = vim.log.levels.INFO, -- Minimum notifications level
|
||||
history_size = 128, -- Number of removed messages to retain in history
|
||||
override_vim_notify = false, -- Automatically override vim.notify() with Fidget
|
||||
-- How to configure notification groups when instantiated
|
||||
configs = { default = require("fidget.notification").default_config },
|
||||
-- Conditionally redirect notifications to another backend
|
||||
redirect = function(msg, level, opts)
|
||||
if opts and opts.on_open then
|
||||
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
|
||||
end
|
||||
end,
|
||||
-- Options related to Neovim's built-in LSP client
|
||||
lsp = {
|
||||
progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
|
||||
log_handler = false, -- Log `$/progress` handler invocations (for debugging)
|
||||
},
|
||||
},
|
||||
notification = {
|
||||
window = {
|
||||
winblend = 0,
|
||||
},
|
||||
poll_rate = 10, -- How frequently to update and render notifications
|
||||
filter = vim.log.levels.INFO, -- Minimum notifications level
|
||||
history_size = 128, -- Number of removed messages to retain in history
|
||||
override_vim_notify = false, -- Automatically override vim.notify() with Fidget
|
||||
-- How to configure notification groups when instantiated
|
||||
configs = { default = require("fidget.notification").default_config },
|
||||
-- Conditionally redirect notifications to another backend
|
||||
redirect = function(msg, level, opts)
|
||||
if opts and opts.on_open then
|
||||
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
|
||||
end
|
||||
end,
|
||||
|
||||
-- Options related to how notifications are rendered as text
|
||||
view = {
|
||||
stack_upwards = true, -- Display notification items from bottom to top
|
||||
icon_separator = " ", -- Separator between group name and icon
|
||||
group_separator = "---", -- Separator between notification groups
|
||||
},
|
||||
},
|
||||
integration = {
|
||||
["nvim-tree"] = {
|
||||
enable = true, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
|
||||
},
|
||||
["xcodebuild-nvim"] = {
|
||||
enable = false, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
|
||||
},
|
||||
},
|
||||
-- Options related to logging
|
||||
logger = {
|
||||
level = vim.log.levels.WARN, -- Minimum logging level
|
||||
max_size = 10000, -- Maximum log file size, in KB
|
||||
float_precision = 0.01, -- Limit the number of decimals displayed for floats
|
||||
-- Where Fidget writes its logs to
|
||||
path = string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache")),
|
||||
},
|
||||
},
|
||||
-- Options related to how notifications are rendered as text
|
||||
view = {
|
||||
stack_upwards = true, -- Display notification items from bottom to top
|
||||
icon_separator = " ", -- Separator between group name and icon
|
||||
group_separator = "---", -- Separator between notification groups
|
||||
},
|
||||
},
|
||||
integration = {
|
||||
["nvim-tree"] = {
|
||||
enable = true, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
|
||||
},
|
||||
["xcodebuild-nvim"] = {
|
||||
enable = false, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
|
||||
},
|
||||
},
|
||||
-- Options related to logging
|
||||
logger = {
|
||||
level = vim.log.levels.WARN, -- Minimum logging level
|
||||
max_size = 10000, -- Maximum log file size, in KB
|
||||
float_precision = 0.01, -- Limit the number of decimals displayed for floats
|
||||
-- Where Fidget writes its logs to
|
||||
path = string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache")),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -93,35 +93,24 @@ return {
|
||||
vim.lsp.enable(lsp)
|
||||
elseif lsp == "basedpyright" then
|
||||
vim.lsp.config(lsp, {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
useLibraryCodeForTypes = true,
|
||||
autoFormatStrings = true,
|
||||
},
|
||||
diagnosticMode = "openFilesOnly",
|
||||
inlayHints = {
|
||||
callArgumentNames = true,
|
||||
},
|
||||
allowedUntypedLibraries = true,
|
||||
reportMissingTypeStubs = false,
|
||||
reportImportCycles = true,
|
||||
reportUnusedImport = true,
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspPyrightOrganizeImports", function()
|
||||
client:exec_cmd({
|
||||
command = "basedpyright.organizeimports",
|
||||
arguments = { vim.uri_from_bufnr(bufnr) },
|
||||
on_init = function(client)
|
||||
client.config.settings.basedpyright =
|
||||
vim.tbl_deep_extend("force", client.config.settings.basedpyright, {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
useLibraryCodeForTypes = true,
|
||||
autoFormatStrings = true,
|
||||
},
|
||||
diagnosticMode = "openFilesOnly",
|
||||
inlayHints = {
|
||||
callArgumentNames = true,
|
||||
},
|
||||
allowedUntypedLibraries = true,
|
||||
reportMissingTypeStubs = true,
|
||||
reportImportCycles = true,
|
||||
reportUnusedImport = true,
|
||||
})
|
||||
end, {
|
||||
desc = "Organize Imports",
|
||||
})
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspPyrightSetPythonPath", set_python_path, {
|
||||
desc = "Reconfigure basedpyright with the provided python path",
|
||||
nargs = 1,
|
||||
complete = "file",
|
||||
})
|
||||
end,
|
||||
})
|
||||
vim.lsp.enable(lsp)
|
||||
|
||||
Reference in New Issue
Block a user