use mini.clue

This commit is contained in:
Јован Ђокић-Шумарац 2024-06-16 16:52:09 +02:00
parent 15b55beb06
commit 06dce3980e
5 changed files with 112 additions and 10 deletions

View file

@ -7,6 +7,8 @@ local options = { noremap = true }
local cmd_options = { noremap = true, silent = true } local cmd_options = { noremap = true, silent = true }
map('n', '<C-space>', '<cmd>Telescope buffers<CR>', options)
-- slef explanitory -- slef explanitory
map("n", "<leader>tw", "<cmd>lua MiniTrailspace.trim()<CR>", options) map("n", "<leader>tw", "<cmd>lua MiniTrailspace.trim()<CR>", options)

View file

@ -12,3 +12,4 @@ require("plugins.wilder")
require("plugins.mini") require("plugins.mini")
require("plugins.oil") require("plugins.oil")
-- require("plugins.fterm") -- require("plugins.fterm")
require("plugins.telescope")

View file

@ -1,13 +1,13 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", 'git',
"clone", 'clone',
"--filter=blob:none", '--filter=blob:none',
"https://github.com/folke/lazy.nvim.git", 'https://github.com/folke/lazy.nvim.git',
"--branch=stable", -- latest stable release '--branch=stable', -- latest stable release
lazypath, lazypath,
}) })
end end
@ -15,7 +15,7 @@ end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require('lazy').setup({
'EdenEast/nightfox.nvim', 'EdenEast/nightfox.nvim',
'luckasRanarison/tree-sitter-hypr', 'luckasRanarison/tree-sitter-hypr',
@ -26,10 +26,18 @@ require("lazy").setup({
'bkad/camelcasemotion', 'bkad/camelcasemotion',
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
{
'nvim-telescope/telescope.nvim',
tag = '0.1.8',
dependencies = {
'nvim-lua/plenary.nvim'
}
},
{ {
'stevearc/oil.nvim', 'stevearc/oil.nvim',
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons" 'nvim-tree/nvim-web-devicons'
}, },
}, },
@ -96,5 +104,5 @@ require("lazy").setup({
vim.opt.laststatus=2 vim.opt.laststatus=2
vim.keymap.set('i', '<Tab>', [[pumvisible() ? "\<C-n>" : "\<Tab>"]], { expr = true }) vim.keymap.set('i', '<Tab>', [[pumvisible() ? '\<C-n>' : '\<Tab>']], { expr = true })
vim.keymap.set('i', '<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]], { expr = true }) vim.keymap.set('i', '<S-Tab>', [[pumvisible() ? '\<C-p>' : '\<S-Tab>']], { expr = true })

View file

@ -4,6 +4,67 @@ require('mini.comment').setup()
require('mini.pairs').setup() require('mini.pairs').setup()
local miniclue = require('mini.clue')
miniclue.setup({
triggers = {
-- Leader triggers
{ mode = 'n', keys = '<Leader>' },
{ mode = 'x', keys = '<Leader>' },
-- Built-in completion
{ mode = 'i', keys = '<C-x>' },
-- `g` key
{ mode = 'n', keys = 'g' },
{ mode = 'x', keys = 'g' },
-- Marks
{ mode = 'n', keys = "'" },
{ mode = 'n', keys = '`' },
{ mode = 'x', keys = "'" },
{ mode = 'x', keys = '`' },
-- Registers
{ mode = 'n', keys = '"' },
{ mode = 'x', keys = '"' },
{ mode = 'i', keys = '<C-r>' },
{ mode = 'c', keys = '<C-r>' },
-- Window commands
{ mode = 'n', keys = '<C-w>' },
-- `z` key
{ mode = 'n', keys = 'z' },
{ mode = 'x', keys = 'z' },
},
clues = {
-- Enhance this by adding descriptions for <Leader> mapping groups
miniclue.gen_clues.builtin_completion(),
miniclue.gen_clues.g(),
miniclue.gen_clues.marks(),
miniclue.gen_clues.registers(),
miniclue.gen_clues.windows(),
miniclue.gen_clues.z(),
},
-- Array of opt-in triggers which start custom key query process.
-- **Needs to have something in order to show clues**.
-- Clue window settings
window = {
-- Floating window config
config = {},
-- Delay before showing clue window
delay = 200,
-- Keys to scroll inside the clue window
scroll_down = '<C-d>',
scroll_up = '<C-u>',
},
})
require('mini.surround').setup( require('mini.surround').setup(
{ {
-- Add custom surroundings to be used on top of builtin ones. For more -- Add custom surroundings to be used on top of builtin ones. For more

30
lua/plugins/telescope.lua Normal file
View file

@ -0,0 +1,30 @@
require('telescope').setup{
defaults = {
-- Default configuration for telescope goes here:
-- config_key = value,
mappings = {
i = {
-- map actions.which_key to <C-h> (default: <C-/>)
-- actions.which_key shows the mappings for your picker,
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
["<C-h>"] = "which_key"
}
}
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
-- 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
}
}