This commit is contained in:
ksyasuda 2024-08-13 23:30:39 -07:00
parent 9d905d573c
commit 050243904c
No known key found for this signature in database
4 changed files with 144 additions and 267 deletions

View File

@ -171,6 +171,7 @@ nnoremap <leader>sc :nohls<CR>
nnoremap <leader>sC :Telescope commands<CR> nnoremap <leader>sC :Telescope commands<CR>
nnoremap <leader>sf :Telescope find_files<CR> nnoremap <leader>sf :Telescope find_files<CR>
nnoremap <leader>sg :Telescope live_grep<CR> nnoremap <leader>sg :Telescope live_grep<CR>
nnoremap <leader>sG :Telescope glyph<CR>
nnoremap <leader>sh :Telescope command_history<CR> nnoremap <leader>sh :Telescope command_history<CR>
nnoremap <leader>sm :Telescope man_pages<CR> nnoremap <leader>sm :Telescope man_pages<CR>
nnoremap <leader>s/ :Telescope search_history<CR> nnoremap <leader>s/ :Telescope search_history<CR>

View File

@ -20,8 +20,7 @@ require('packer').startup(function(use)
use { 'nat-418/telescope-color-names.nvim' } use { 'nat-418/telescope-color-names.nvim' }
use { use {
'nvim-telescope/telescope-fzf-native.nvim', 'nvim-telescope/telescope-fzf-native.nvim',
run = run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
} }
-- }}} -- }}}
@ -252,6 +251,7 @@ require('packer').startup(function(use)
-- DAP {{{ -- DAP {{{
use 'mfussenegger/nvim-dap' use 'mfussenegger/nvim-dap'
use 'nvim-neotest/nvim-nio'
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } } use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
use { 'mfussenegger/nvim-dap-python' } use { 'mfussenegger/nvim-dap-python' }
use { 'theHamsta/nvim-dap-virtual-text' } use { 'theHamsta/nvim-dap-virtual-text' }
@ -298,6 +298,7 @@ require('packer').startup(function(use)
use { 'rcarriga/nvim-notify' } use { 'rcarriga/nvim-notify' }
use { 'stevearc/dressing.nvim' } use { 'stevearc/dressing.nvim' }
use { 'HiPhish/rainbow-delimiters.nvim' } use { 'HiPhish/rainbow-delimiters.nvim' }
use { 'echasnovski/mini.nvim' }
-- }}} -- }}}

View File

@ -1,43 +1,48 @@
require('gitsigns').setup { require('gitsigns').setup {
signs = { signs = {
add = {hl = 'GitSignsAdd' , text = '', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, add = { text = '' },
change = {hl = 'GitSignsChange', text = '', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, change = { text = '' },
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, delete = { text = '_' },
topdelete = {hl = 'GitSignsDelete', text = '', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, topdelete = { text = '' },
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, changedelete = { text = '~' },
}, untracked = { text = '' }
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` },
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` signs_staged = {
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` add = { text = '' },
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` change = { text = '' },
watch_gitdir = { delete = { text = '_' },
interval = 1000, topdelete = { text = '' },
follow_files = true changedelete = { text = '~' },
}, untracked = { text = '' }
attach_to_untracked = true, },
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` signs_staged_enable = true,
current_line_blame_opts = { signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
virt_text = true, numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
delay = 1000, word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
ignore_whitespace = false, watch_gitdir = { follow_files = true },
}, auto_attach = true,
current_line_blame_formatter_opts = { attach_to_untracked = false,
relative_time = false current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
}, current_line_blame_opts = {
sign_priority = 6, virt_text = true,
update_debounce = 100, virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
status_formatter = nil, -- Use default delay = 1000,
max_file_length = 40000, ignore_whitespace = false,
preview_config = { virt_text_priority = 100
-- Options passed to nvim_open_win },
border = 'single', current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
style = 'minimal', sign_priority = 6,
relative = 'cursor', update_debounce = 100,
row = 0, status_formatter = nil, -- Use default
col = 1 max_file_length = 40000, -- Disable if file is longer than this (in lines)
}, preview_config = {
yadm = { -- Options passed to nvim_open_win
enable = false border = 'single',
}, style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
}
} }

View File

@ -1,226 +1,96 @@
local wk = require("which-key") local wk = require("which-key")
wk.setup { wk.add({
plugins = { { "<leader>C", group = "ChatGPT", desc = "ChatGPT", icon = "󰭻" },
marks = true, -- shows a list of your marks on ' and ` { "<leader>Cd", desc = "Docstring" }, { "<leader>Ce", desc = "Explain Code" },
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode { "<leader>Cf", desc = "Fix Bugs" },
spelling = { { "<leader>Ci", desc = "Edit with Instructions" },
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions { "<leader>Co", desc = "Optimize Code" }, { "<leader>Cs", desc = "Summarize" },
suggestions = 20 -- how many suggestions should be shown in the list? { "<leader>Ct", desc = "Add Tests" },
}, { "<leader>K", desc = "Show Docs", icon = "󱔗" },
-- the presets plugin, adds help for a bunch of default keybindings in Neovim { "<leader>T", group = "Telescope", icon = "" },
-- No actual key bindings are created { "<leader>Tc", desc = "Color Names" }, { "<leader>Tg", desc = "Glyph" },
presets = { { "<leader>Tn", desc = "Notifications" }, { "<leader>Tt", desc = "Telescope" },
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion { "<leader>a", group = "AnyJump", icon = "" },
motions = true, -- adds help for motions { "<leader>ab", desc = "Back" }, { "<leader>al", desc = "Last Result" },
text_objects = true, -- help for text objects triggered after entering an operator { "<leader>b", group = "Buffers" }, { "<leader>bb", desc = "Show Buffers" },
windows = true, -- default bindings on <c-w> { "<leader>bd", desc = "Delete Buffer" },
nav = true, -- misc bindings to work with windows { "<leader>bn", desc = "Next Buffer" },
z = true, -- bindings for folds, spelling and others prefixed with z { "<leader>bp", desc = "Previous Buffer" },
g = true -- bindings for prefixed with g { "<leader>c", group = "Code", icon = "" },
} { "<leader>cD", group = "Diagnostic List" },
}, { "<leader>cDn", desc = "Next Diagnostic" },
-- add operators that will trigger motion and text object completion { "<leader>cDp", desc = "Previous Diagnostic" },
-- to enable all native operators, set the preset / operators plugin above { "<leader>ca", desc = "Code Action" }, { "<leader>cd", desc = "Diagnostics" },
operators = { gc = "Comments" }, { "<leader>cl", desc = "Set Loclist" },
key_labels = { { "<leader>cp", desc = "Copilot Panel" }, { "<leader>d", group = "Debug" },
-- override the label used to display some keys. It doesn't effect WK in any other way. { "<leader>dO", desc = "Step Out" }, { "<leader>dP", group = "Dap-python" },
-- For example: { "<leader>dPc", desc = "Test Class" }, { "<leader>dPm", desc = "Test Method" },
-- ["<space>"] = "SPC", { "<leader>dPs", desc = "Debug Selection" },
-- ["<cr>"] = "RET", { "<leader>db", desc = "Toggle Breakpoint" },
-- ["<tab>"] = "TAB", { "<leader>dc", desc = "Continue" }, { "<leader>df", desc = "Frames" },
}, { "<leader>dh", desc = "Hover" }, { "<leader>di", desc = "Step Into" },
icons = { { "<leader>dl", desc = "Run Last" }, { "<leader>do", desc = "Step Over" },
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo { "<leader>dp", desc = "Preview" }, { "<leader>dr", desc = "REPL Open" },
separator = "", -- symbol used between a key and it's label { "<leader>ds", desc = "Scopes" }, { "<leader>du", group = "Dap UI" },
group = "+" -- symbol prepended to a group { "<leader>duc", desc = "Close" }, { "<leader>duo", desc = "Open" },
}, { "<leader>dut", desc = "Toggle" }, { "<leader>f", group = "Find File" },
popup_mappings = { { "<leader>fb", desc = "File Browser" }, { "<leader>fc", desc = "File Color" },
scroll_down = '<c-d>', -- binding to scroll down inside the popup { "<leader>ff", desc = "Find in Current Directory" },
scroll_up = '<c-u>' -- binding to scroll up inside the popup { "<leader>fg", desc = "Live Grep" }, { "<leader>fr", desc = "File Recent" },
}, { "<leader>g", group = "Git" },
window = { { "<leader>gP", desc = "Close goto-preview window" },
border = "none", -- none, single, double, shadow { "<leader>gR", desc = "Telescope References" },
position = "bottom", -- bottom, top { "<leader>gb", desc = "Blame" }, { "<leader>gc", desc = "Commit" },
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] { "<leader>gf", desc = "Files" }, { "<leader>gg", desc = "Lazygit" },
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] { "<leader>gp", desc = "Peek" }, { "<leader>gpc", desc = "Close Preview" },
winblend = 0 { "<leader>gpd", desc = "Preview Definition" },
}, { "<leader>gpi", desc = "Preview Implementation" },
layout = { { "<leader>h", group = "Help", icon = "󰋖" },
height = { min = 4, max = 25 }, -- min and max height of the columns { "<leader>hc", desc = "Commands" },
width = { min = 20, max = 50 }, -- min and max width of the columns { "<leader>hd", group = "Dap", icon = "" },
spacing = 3, -- spacing between columns { "<leader>hdC", desc = "Configurations" },
align = "left" -- align columns left, center or right { "<leader>hdb", desc = "Breakpoints" }, { "<leader>hdc", desc = "Commands" },
}, { "<leader>hdf", desc = "Frames" }, { "<leader>hdv", desc = "Variables" },
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label { "<leader>hk", desc = "Keymaps" }, { "<leader>hs", desc = "Spell Suggest" },
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate { "<leader>hv", desc = "Vim Options" },
show_help = true, -- show help message on the command line when the popup is visible { "<leader>i", group = "Insert", icon = "" },
show_keys = true, -- show the key strokes for your commands { "<leader>is", group = "Snippet" }, { "<leader>isp", desc = "Python File" },
triggers = "auto", -- automatically setup triggers { "<leader>j", desc = "Any Jump", icon = "" },
-- triggers = {"<leader>"}, -- or specify a list manually { "<leader>l", group = "LSP", icon = "" },
triggers_blacklist = { { "<leader>lD", desc = "Diagnostics" }, { "<leader>lR", desc = "Rename" },
-- list of mode / prefixes that should never be hooked by WhichKey { "<leader>la", desc = "Code Actions" }, { "<leader>lc", group = "Calls" },
-- this is mostly relevant for key maps that start with a native binding { "<leader>lci", desc = "Incoming" }, { "<leader>lco", desc = "Outgoing" },
-- most people should not need to change this { "<leader>ld", desc = "Definitions" },
i = { "j", "k" }, { "<leader>lh", desc = "Signature Help" },
v = { "j", "k" } { "<leader>li", desc = "Implementations" },
}, { "<leader>lr", desc = "References" },
disable = { buftypes = {}, filetypes = { "TelescopePrompt" } } { "<leader>ls", desc = "Document Symbols" },
} { "<leader>lt", desc = "Type Definitions" },
{ "<leader>lw", desc = "Workspace Symbols" },
wk.register({ { "<leader>n", desc = "NvimTree" },
a = { name = "AnyJump", b = "Back", l = "Last Result" }, { "<leader>o", group = "Open", icon = "󰮫" }, { "<leader>oB", desc = "Btop" },
b = { { "<leader>oC", desc = "Nvim Config" },
name = "Buffers", { "<leader>oP", desc = "Ipython (fullscreen)" },
b = "Show Buffers", { "<leader>ob", desc = "File Browser" }, { "<leader>oc", desc = "ChatGPT" },
d = "Delete Buffer", { "<leader>od", desc = "Lazydocker" },
n = "Next Buffer", { "<leader>of", desc = "Floating Terminal" },
p = "Previous Buffer" { "<leader>oh", desc = "Horizontal Terminal" },
}, { "<leader>op", desc = "Ipython" }, { "<leader>or", desc = "Ranger" },
c = { { "<leader>ot", desc = "Vertical Terminal" }, { "<leader>s", group = "Search" },
name = "Code", { "<leader>sC", desc = "Commands" },
a = "Code Action", { "<leader>sc", desc = "Clear Highlights" }, { "<leader>sf", desc = "Files" },
d = "Diagnostics", { "<leader>sG", desc = "Glyph" }, { "<leader>sg", desc = "Grep" },
D = { { "<leader>sh", desc = "Command History" },
name = "Diagnostic List", { "<leader>sm", desc = "Man Pages" }, { "<leader>t", group = "Toggle" },
n = "Next Diagnostic", { "<leader>tP", desc = "Ipython (fullscreen)" },
p = "Previous Diagnostic" { "<leader>tc", desc = "Colorscheme" }, { "<leader>td", desc = "DBUI" },
}, { "<leader>tf", desc = "Floating Terminal" },
p = "Copilot Panel", { "<leader>tp", desc = "Ipython" }, { "<leader>tt", desc = "Split Terminal" },
l = "Set Loclist" { "<leader>w", group = "Workspace" }, { "<leader>wa", desc = "Add Folder" },
}, { "<leader>wl", desc = "List Folders" },
C = { { "<leader>wr", desc = "Remove Folder" },
name = "ChatGPT", { "<leader>x", group = "Set Executable Bit", desc = "Set Executable Bit" },
i = "Edit with Instructions", { "<leader>y", desc = "System Yank", icon = "" },
d = "Docstring", { "<leader>e", desc = "Edit", icon = "" }
t = "Add Tests", })
o = "Optimize Code",
s = "Summarize",
f = "Fix Bugs",
e = "Explain Code"
},
d = {
name = "Debug",
b = "Toggle Breakpoint",
c = "Continue",
i = "Step Into",
o = "Step Over",
O = "Step Out",
r = "REPL Open",
l = "Run Last",
h = "Hover",
p = "Preview",
f = "Frames",
s = "Scopes",
u = { name = "Dap UI", t = "Toggle", o = "Open", c = "Close" },
P = {
name = "Dap-python",
m = "Test Method",
c = "Test Class",
s = "Debug Selection"
}
},
f = {
name = "Find File",
b = "File Browser",
c = "File Color",
f = "Find in Current Directory",
g = "Live Grep",
r = "File Recent"
},
g = {
name = "Git",
b = "Blame",
c = "Commit",
f = "Files",
g = "Lazygit",
P = "Close goto-preview window",
R = "Telescope References",
p = {
"Peek",
c = "Close Preview",
d = "Preview Definition",
i = "Preview Implementation"
}
},
h = {
name = "Help",
c = "Commands",
d = {
name = "Dap",
c = "Commands",
C = "Configurations",
b = "Breakpoints",
v = "Variables",
f = "Frames"
},
v = "Vim Options",
k = "Keymaps",
s = "Spell Suggest"
},
i = { name = "Insert", s = { name = "Snippet", p = "Python File" } },
j = "Any Jump",
K = "Show Docs",
l = {
name = "LSP",
d = "Definitions",
D = "Diagnostics",
a = "Code Actions",
c = { name = "Calls", i = "Incoming", o = "Outgoing" },
h = "Signature Help",
i = "Implementations",
r = "References",
R = "Rename",
s = "Document Symbols",
t = "Type Definitions",
w = "Workspace Symbols"
},
n = "NvimTree",
o = {
name = "Open",
b = "File Browser",
B = "Btop",
c = "ChatGPT",
C = "Nvim Config",
d = "Lazydocker",
f = "Floating Terminal",
h = "Horizontal Terminal",
p = "Ipython",
P = "Ipython (fullscreen)",
r = "Ranger",
t = "Vertical Terminal"
},
s = {
name = "Search",
c = "Clear Highlights",
C = "Commands",
f = "Files",
g = "Glyph",
h = "Command History",
m = "Man Pages"
},
t = {
name = "Toggle",
c = "Colorscheme",
d = "DBUI",
f = "Floating Terminal",
p = "Ipython",
P = "Ipython (fullscreen)",
t = "Split Terminal"
},
T = {
name = "Telescope",
c = "Color Names",
g = "Glyph",
n = "Notifications",
t = "Telescope"
},
w = {
name = "Workspace",
a = "Add Folder",
l = "List Folders",
r = "Remove Folder"
},
x = "Set Executable Bit",
y = "System Yank"
}, { prefix = "<leader>" })