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>sf :Telescope find_files<CR>
nnoremap <leader>sg :Telescope live_grep<CR>
nnoremap <leader>sG :Telescope glyph<CR>
nnoremap <leader>sh :Telescope command_history<CR>
nnoremap <leader>sm :Telescope man_pages<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 {
'nvim-telescope/telescope-fzf-native.nvim',
run =
'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
run = '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 {{{
use 'mfussenegger/nvim-dap'
use 'nvim-neotest/nvim-nio'
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
use { 'mfussenegger/nvim-dap-python' }
use { 'theHamsta/nvim-dap-virtual-text' }
@ -298,6 +298,7 @@ require('packer').startup(function(use)
use { 'rcarriga/nvim-notify' }
use { 'stevearc/dressing.nvim' }
use { 'HiPhish/rainbow-delimiters.nvim' }
use { 'echasnovski/mini.nvim' }
-- }}}

View File

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

View File

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