cool nvim stuff
This commit is contained in:
@ -10,10 +10,11 @@ size = 11.0
|
||||
family = "Input Mono"
|
||||
style = "Regular"
|
||||
|
||||
|
||||
[font.offset]
|
||||
x = 0
|
||||
y = 4
|
||||
|
||||
[window.padding]
|
||||
x = 10
|
||||
x = 30
|
||||
y = 10
|
||||
|
||||
@ -11,15 +11,17 @@ require("user.blank_indent_highlight")
|
||||
require("user.autopairs")
|
||||
require("user.telescope")
|
||||
require("user.lsp_format")
|
||||
require("user.neoscroll")
|
||||
require("user.dropbar")
|
||||
require("user.bufferline")
|
||||
require("user.null_ls")
|
||||
require("user.nvim_scrollbar")
|
||||
require("user.onedark_config")
|
||||
require("user.gitsigns")
|
||||
require("user.lualine")
|
||||
require("user.dap.dap")
|
||||
require("user.dap.dapui")
|
||||
require("user.neotree")
|
||||
require("user.which_key")
|
||||
require("user.harpoon")
|
||||
|
||||
vim.cmd("set cursorline")
|
||||
vim.cmd("colorscheme kanagawa")
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
options = {
|
||||
mode = "tabs",
|
||||
offsets = {
|
||||
{ filetype = "NvimTree", text = "", padding = 1 },
|
||||
{ filetype = "neo-tree", text = "", padding = 1 },
|
||||
{ filetype = "Outline", text = "", padding = 1 },
|
||||
},
|
||||
style_preset = bufferline.style_preset.no_italic,
|
||||
buffer_close_icon = "",
|
||||
modified_icon = "",
|
||||
close_icon = "",
|
||||
|
||||
@ -42,7 +42,6 @@ local kind_icons = {
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
}
|
||||
-- find more here: https://www.nerdfonts.com/cheat-sheet
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
|
||||
@ -25,14 +25,6 @@ dap.configurations.cs = {
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>dr', dap.continue)
|
||||
vim.keymap.set('n', '<leader>dj', dap.step_into)
|
||||
vim.keymap.set('n', '<leader>dl', dap.step_over)
|
||||
vim.keymap.set('n', '<leader>dk', dap.step_out)
|
||||
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint)
|
||||
vim.keymap.set('n', '<leader>ds', dap.terminate)
|
||||
|
||||
|
||||
--Autostart ui when debugging
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
|
||||
6
.config/nvim/lua/user/dropbar.lua
Normal file
6
.config/nvim/lua/user/dropbar.lua
Normal file
@ -0,0 +1,6 @@
|
||||
local null_ls_status_ok, breadcrumbs = pcall(require, "breadcrumbs")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
breadcrumbs.setup()
|
||||
@ -1,11 +1,11 @@
|
||||
require('gitsigns').setup {
|
||||
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' },
|
||||
untracked = { hl = 'GitSignsAdd' , text = '┆', numhl='GitSignsAddNr' , linehl='GitSignsAddLn' },
|
||||
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" },
|
||||
untracked = { hl = "GitSignsAdd", text = "┆", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
@ -13,30 +13,30 @@ require('gitsigns').setup {
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
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'
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <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',
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
enable = false,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
40
.config/nvim/lua/user/harpoon.lua
Normal file
40
.config/nvim/lua/user/harpoon.lua
Normal file
@ -0,0 +1,40 @@
|
||||
local null_ls_status_ok, harpoon = pcall(require, "harpoon")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
|
||||
vim.keymap.set("n", "<leader>hm", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-1>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-2>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-3>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-4>", function() harpoon:list():select(4) end)
|
||||
|
||||
-- Toggle previous & next buffers stored within Harpoon list
|
||||
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end)
|
||||
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end)
|
||||
|
||||
local conf = require("telescope.config").values
|
||||
local function toggle_telescope(harpoon_files)
|
||||
local file_paths = {}
|
||||
for _, item in ipairs(harpoon_files.items) do
|
||||
table.insert(file_paths, item.value)
|
||||
end
|
||||
|
||||
require("telescope.pickers").new({}, {
|
||||
prompt_title = "Harpoon",
|
||||
finder = require("telescope.finders").new_table({
|
||||
results = file_paths,
|
||||
}),
|
||||
previewer = conf.file_previewer({}),
|
||||
sorter = conf.generic_sorter({}),
|
||||
}):find()
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
|
||||
{ desc = "Open harpoon window" })
|
||||
@ -29,7 +29,6 @@ keymap("v", "p", '"_dP', opts)
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
|
||||
-- center view for different commands
|
||||
keymap("n", "n", "nzz", opts)
|
||||
keymap("n", "N", "Nzz", opts)
|
||||
@ -45,22 +44,9 @@ keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
|
||||
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
|
||||
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
|
||||
|
||||
-- Navigate buffers
|
||||
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
||||
-- Navigate tabs
|
||||
keymap("n", "<S-l>", ":tabnext<CR>", opts)
|
||||
keymap("n", "<S-h>", ":tabprevious<CR>", opts)
|
||||
|
||||
--Close buffer
|
||||
keymap("n", "<C-w>", ":bd | bp <CR>", opts)
|
||||
|
||||
--Format document
|
||||
keymap("n", "<leader>F", ":lua vim.lsp.buf.format() <CR>", opts)
|
||||
|
||||
keymap("n", "<leader>ff",
|
||||
"<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>",
|
||||
opts)
|
||||
keymap("n", "<leader>fw",
|
||||
"<cmd>lua require'telescope.builtin'.live_grep()<cr>",
|
||||
opts)
|
||||
|
||||
|
||||
keymap("n", "<leader>e", ":Neotree toggle <CR>", opts)
|
||||
-- keymap("n", "<C-w>", ":bd | bp <CR>", opts)
|
||||
|
||||
@ -16,22 +16,6 @@ end
|
||||
mason.setup()
|
||||
mason_lspconfig.setup()
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "grr", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
-- vim.api.nvim_buf_set_keymap("n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
vim.api.nvim_set_keymap("n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_set_keymap("n", "gl", '<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_set_keymap("n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
|
||||
vim.api.nvim_set_keymap("n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
|
||||
vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]])
|
||||
|
||||
require("user.lsp.mason_lsp_config")
|
||||
|
||||
26
.config/nvim/lua/user/neoscroll.lua
Normal file
26
.config/nvim/lua/user/neoscroll.lua
Normal file
@ -0,0 +1,26 @@
|
||||
require("neoscroll").setup({
|
||||
-- All these keys will be mapped to their corresponding default scrolling animation
|
||||
mappings = { "<C-u>", "<C-d>", "<C-b>", "<C-f>", "<C-y>", "<C-e>", "zt", "zz", "zb" },
|
||||
hide_cursor = true, -- Hide cursor while scrolling
|
||||
stop_eof = true, -- Stop at <EOF> when scrolling downwards
|
||||
respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file
|
||||
cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further
|
||||
easing_function = nil, -- Default easing function
|
||||
pre_hook = nil, -- Function to run before the scrolling animation starts
|
||||
post_hook = nil, -- Function to run after the scrolling animation ends
|
||||
performance_mode = false, -- Disable "Performance Mode" on all buffers.
|
||||
})
|
||||
|
||||
local t = {}
|
||||
-- Syntax: t[keys] = {function, {function arguments}}
|
||||
t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '250'}}
|
||||
t['<C-d>'] = {'scroll', { 'vim.wo.scroll', 'true', '250'}}
|
||||
t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '450'}}
|
||||
t['<C-f>'] = {'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '450'}}
|
||||
t['<C-y>'] = {'scroll', {'-0.10', 'false', '100'}}
|
||||
t['<C-e>'] = {'scroll', { '0.10', 'false', '100'}}
|
||||
t['zt'] = {'zt', {'250'}}
|
||||
t['zz'] = {'zz', {'250'}}
|
||||
t['zb'] = {'zb', {'250'}}
|
||||
|
||||
require('neoscroll.config').set_mappings(t)
|
||||
@ -69,5 +69,13 @@ require("neo-tree").setup({
|
||||
{ source = "git_status", display_name = " Git " },
|
||||
},
|
||||
},
|
||||
-- Other options ...
|
||||
|
||||
event_handlers = {
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function(arg)
|
||||
vim.opt.relativenumber = true
|
||||
end,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@ -3,9 +3,7 @@ if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
local diagnostics = null_ls.builtins.diagnostics
|
||||
|
||||
null_ls.setup({
|
||||
@ -1,8 +0,0 @@
|
||||
require("onedark").setup({
|
||||
style = "darker",
|
||||
transparent = true,
|
||||
highlights = {
|
||||
NvimTreeWinSeparator = {fg ='#aaaaa'}
|
||||
}
|
||||
})
|
||||
require("onedark").load()
|
||||
@ -4,7 +4,7 @@ vim.opt.completeopt = { "menuone", "noselect" }
|
||||
vim.opt.showmode = false
|
||||
vim.opt.fileencoding = "utf-8"
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.showtabline = 2
|
||||
vim.opt.showtabline = 1
|
||||
vim.opt.pumblend = 5
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.smartcase = true
|
||||
|
||||
@ -70,9 +70,14 @@ lazy.setup({
|
||||
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
tag = "v2.*",
|
||||
version = "*",
|
||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||
},
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
@ -100,6 +105,14 @@ lazy.setup({
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
--scrollbar
|
||||
"petertriho/nvim-scrollbar",
|
||||
@ -118,14 +131,21 @@ lazy.setup({
|
||||
|
||||
"folke/neodev.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"b0o/schemastore.nvim"
|
||||
"b0o/schemastore.nvim",
|
||||
-- {
|
||||
-- 'Bekaboo/dropbar.nvim',
|
||||
-- -- optional, but required for fuzzy finder support
|
||||
-- dependencies = {
|
||||
-- 'nvim-telescope/telescope-fzf-native.nvim'
|
||||
-- }
|
||||
-- },
|
||||
{
|
||||
"LunarVim/breadcrumbs.nvim",
|
||||
dependencies = {
|
||||
{ "SmiteshP/nvim-navic" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"karb94/neoscroll.nvim",
|
||||
},
|
||||
})
|
||||
|
||||
-- vim.cmd([[
|
||||
-- augroup packer_user_config
|
||||
-- autocmd!
|
||||
-- autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
-- augroup end
|
||||
-- ]])
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
|
||||
@ -3,11 +3,11 @@ if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.load_extension('media_files')
|
||||
telescope.load_extension("media_files")
|
||||
|
||||
local actions = require "telescope.actions"
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup {
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { "node_modules", "venv" },
|
||||
prompt_prefix = " ",
|
||||
@ -93,12 +93,12 @@ telescope.setup {
|
||||
-- filetypes whitelist
|
||||
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
|
||||
filetypes = { "png", "webp", "jpg", "jpeg" },
|
||||
find_cmd = "rg" -- find command (defaults to `fd`)
|
||||
}
|
||||
find_cmd = "rg", -- find command (defaults to `fd`)
|
||||
},
|
||||
-- Your extension configuration goes here:
|
||||
-- extension_name = {
|
||||
-- extension_config_key = value,
|
||||
-- }
|
||||
-- please take a look at the readme of the extension you want to configure
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
@ -17,10 +17,6 @@ require("kanagawa").setup({
|
||||
overrides = function(colors) -- add/modify highlights
|
||||
local theme = colors.theme
|
||||
return {
|
||||
Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1, blend = vim.o.pumblend }, -- add `blend = vim.o.pumblend` to enable transparency
|
||||
PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 },
|
||||
PmenuSbar = { bg = theme.ui.bg_m1 },
|
||||
PmenuThumb = { bg = theme.ui.bg_p2 },
|
||||
CursorLine = { bg = "#272735" },
|
||||
}
|
||||
end,
|
||||
|
||||
183
.config/nvim/lua/user/which_key.lua
Normal file
183
.config/nvim/lua/user/which_key.lua
Normal file
@ -0,0 +1,183 @@
|
||||
local status_ok, which_key = pcall(require, "which-key")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
which_key.setup({
|
||||
plugins = {
|
||||
marks = false, -- shows a list of your marks on ' and `
|
||||
registers = false, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true,
|
||||
suggestions = 20,
|
||||
}, -- use which-key for spelling hints
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ...
|
||||
motions = false, -- adds help for motions
|
||||
text_objects = false, -- help for text objects triggered after entering an operator
|
||||
windows = false, -- default bindings on <c-w>
|
||||
nav = false, -- misc bindings to work with windows
|
||||
z = false, -- bindings for folds, spelling and others prefixed with z
|
||||
g = false, -- 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",
|
||||
},
|
||||
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 = "single", -- 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 = true, -- 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 currently pressed key and its label as a message in the command line
|
||||
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 the WhichKey popup for certain buf types and file types.
|
||||
-- Disabled by default for Telescope
|
||||
disable = {
|
||||
buftypes = {},
|
||||
filetypes = { "TelescopePrompt" },
|
||||
},
|
||||
})
|
||||
|
||||
which_key.register({
|
||||
name = "Hotkeys",
|
||||
e = {
|
||||
":Neotree toggle <CR>",
|
||||
"File tree toggle",
|
||||
},
|
||||
F = {
|
||||
":lua vim.lsp.buf.format() <CR>",
|
||||
"Format file",
|
||||
},
|
||||
f = {
|
||||
name = "Find",
|
||||
f = {
|
||||
"<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>",
|
||||
"Find file",
|
||||
},
|
||||
w = {
|
||||
"<cmd>lua require'telescope.builtin'.live_grep()<cr>",
|
||||
"Grep file",
|
||||
},
|
||||
b = {
|
||||
"<cmd>lua require'telescope.builtin'.buffers()<cr>",
|
||||
"Find buffer",
|
||||
},
|
||||
},
|
||||
c = {
|
||||
name = "Code actions",
|
||||
a = {
|
||||
"<cmd>lua vim.lsp.buf.code_action()<CR>",
|
||||
"Show code actions",
|
||||
},
|
||||
},
|
||||
l = {
|
||||
"<cmd>lua vim.diagnostic.setloclist()<CR>",
|
||||
"Show diagnostic list",
|
||||
},
|
||||
d = {
|
||||
name = "DAP",
|
||||
r = {
|
||||
"<cmd>DapContinue<CR>",
|
||||
"DapContinue",
|
||||
},
|
||||
j = {
|
||||
"<cmd>DapStepInto<CR>",
|
||||
"StepInto",
|
||||
},
|
||||
l = {
|
||||
"<cmd>DapStepOver<CR>",
|
||||
"StepOver",
|
||||
},
|
||||
k = {
|
||||
"<cmd>DapStepOut<CR>",
|
||||
"StepOut",
|
||||
},
|
||||
b = {
|
||||
"<cmd>DapToggleBreakpoint<CR>",
|
||||
"Toggle breakpoint",
|
||||
},
|
||||
s = {
|
||||
"<cmd>DapTerminate<CR>",
|
||||
"Terminate",
|
||||
},
|
||||
},
|
||||
t = {
|
||||
name = "Tabs",
|
||||
n = {
|
||||
"<cmd>tabnew<CR>",
|
||||
"New tab",
|
||||
},
|
||||
q = {
|
||||
"<cmd>tabclose<CR>",
|
||||
"Close tab",
|
||||
},
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
which_key.register({
|
||||
name = "LSP Actions",
|
||||
D = {
|
||||
"<cmd>lua vim.lsp.buf.declaration()<CR>",
|
||||
"Go to declaration",
|
||||
},
|
||||
d = {
|
||||
"<cmd>lua vim.lsp.buf.definition()<CR>",
|
||||
"Go to definition",
|
||||
},
|
||||
i = {
|
||||
"<cmd>lua vim.lsp.buf.implementation()<CR>",
|
||||
"Show implementations",
|
||||
},
|
||||
rr = {
|
||||
"<cmd>lua vim.lsp.buf.rename()<CR>",
|
||||
"Rename",
|
||||
},
|
||||
r = {
|
||||
"<cmd>lua vim.lsp.buf.references()<CR>",
|
||||
"Show references",
|
||||
},
|
||||
l = {
|
||||
"<cmd>lua vim.diagnostic.open_float({ border = 'rounded' })<CR>",
|
||||
"Show diagnostic at line",
|
||||
},
|
||||
}, { prefix = "g" })
|
||||
|
||||
which_key.register({
|
||||
["<C-k>"] = {
|
||||
"<cmd>lua vim.lsp.buf.signature_help()<CR>",
|
||||
"Signature help",
|
||||
},
|
||||
}, {})
|
||||
Reference in New Issue
Block a user