feat(nvim): telescope/which-key config
This commit is contained in:
parent
b49b0596a0
commit
8be4fa917d
3 changed files with 143 additions and 0 deletions
37
dot_config/nvim/lua/config/copilot.lua
Normal file
37
dot_config/nvim/lua/config/copilot.lua
Normal file
|
@ -0,0 +1,37 @@
|
|||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = false,
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-J>",
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
yaml = false,
|
||||
markdown = false,
|
||||
help = false,
|
||||
gitcommit = false,
|
||||
gitrebase = false,
|
||||
hgcommit = false,
|
||||
svn = false,
|
||||
cvs = false,
|
||||
["."] = false,
|
||||
},
|
||||
copilot_node_command = "node",
|
||||
server_opts_overrides = {},
|
||||
})
|
||||
|
||||
-- local present, cmp = pcall(require, "cmp")
|
||||
-- if not present or not cmp then
|
||||
-- return
|
||||
-- end
|
||||
-- cmp.event:on("menu_opened", function()
|
||||
-- vim.b.copilot_suggestion_hidden = true
|
||||
-- end)
|
||||
-- cmp.event:on("menu_closed", function()
|
||||
-- vim.b.copilot_suggestion_hidden = false
|
||||
-- end)
|
49
dot_config/nvim/lua/config/telescope.lua
Normal file
49
dot_config/nvim/lua/config/telescope.lua
Normal file
|
@ -0,0 +1,49 @@
|
|||
local telescope = require("telescope")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
selection_caret = "▶ ",
|
||||
borderchars = {
|
||||
results = {
|
||||
"═",
|
||||
"│",
|
||||
" ",
|
||||
"║",
|
||||
"╔",
|
||||
"╤",
|
||||
"│",
|
||||
"║",
|
||||
},
|
||||
prompt = {
|
||||
"─",
|
||||
"│",
|
||||
"═",
|
||||
"║",
|
||||
"╟",
|
||||
"┤",
|
||||
"╧",
|
||||
"╚",
|
||||
},
|
||||
preview = {
|
||||
"═",
|
||||
"║",
|
||||
"═",
|
||||
" ",
|
||||
"═",
|
||||
"╗",
|
||||
"╝",
|
||||
"═",
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true,
|
||||
override_generic_sorter = true,
|
||||
override_file_sorter = true,
|
||||
case_mode = "smart_case",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
57
dot_config/nvim/lua/config/which-key.lua
Normal file
57
dot_config/nvim/lua/config/which-key.lua
Normal file
|
@ -0,0 +1,57 @@
|
|||
local wk = require("which-key")
|
||||
wk.setup({
|
||||
key_labels = {
|
||||
["<space>"] = "SPC",
|
||||
["<leader>"] = "SPC",
|
||||
["<cr>"] = " ",
|
||||
["<tab>"] = " ",
|
||||
},
|
||||
window = {
|
||||
border = "double",
|
||||
margin = { 0, 0, 0, 0 },
|
||||
},
|
||||
})
|
||||
|
||||
-- Telescope
|
||||
wk.register({
|
||||
["<leader>f"] = {
|
||||
name = "+Telescope",
|
||||
d = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||
r = { "<cmd>Telescope asynctasks all<cr>", "Run Asynctasks" },
|
||||
b = { "<cmd>Telescope file_browser<cr>", "File Browser" },
|
||||
g = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
|
||||
h = { "<cmd>Telescope help_tags<cr>", "Help Tags" },
|
||||
p = { "<cmd>Telescope project<cr>", "Project" },
|
||||
s = {
|
||||
function()
|
||||
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||
require("telescope.builtin").find_files({ cwd = confpath })
|
||||
end,
|
||||
"Find in config",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- clipboard
|
||||
wk.register({
|
||||
["<leader>"] = {
|
||||
y = { '"+y', "Copy to clipboard" },
|
||||
p = { '"+p', "Paste from clipboard" },
|
||||
},
|
||||
}, { mode = { "n", "v" } })
|
||||
|
||||
wk.register({
|
||||
-- easier split navigation
|
||||
["<C-J>"] = { "<C-W>j" },
|
||||
["<C-K>"] = { "<C-W>k" },
|
||||
["<C-L>"] = { "<C-W>l" },
|
||||
["<C-H>"] = { "<C-W>h" },
|
||||
["<C-W>\\"] = { "<cmd>vsplit<cr>" },
|
||||
["<C-W>-"] = { "<cmd>split<cr>" },
|
||||
["<C-W>x"] = { "<cmd>q<cr>" },
|
||||
-- diffs
|
||||
["<leader>gd"] = { "<cmd>Gvdiff!<cr>", "Diff vsplit" },
|
||||
["gd"] = { "<cmd>diffget<cr>", "Get from diff" },
|
||||
["gdh"] = { "<cmd>diffget //2<cr>", "Get diff from the left" },
|
||||
["gdl"] = { "<cmd>diffget //3<cr>", "Get diff from the right" },
|
||||
})
|
Loading…
Reference in a new issue