Skip to content

Commit e8a156c

Browse files
committed
Merge branch 'main' of https://github.com/ayamir/nvimdots into 0.10
2 parents 2dfc8ea + ccd5eda commit e8a156c

File tree

5 files changed

+594
-1
lines changed

5 files changed

+594
-1
lines changed

.github/workflows/style_check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v4
9-
- uses: JohnnyMorganz/stylua-action@v3
9+
- uses: JohnnyMorganz/stylua-action@v4
1010
with:
1111
token: ${{ secrets.GITHUB_TOKEN }}
1212
version: latest

lua/keymap/helpers.lua

+12
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ _G._toggle_lazygit = function()
3838
vim.notify("Command [lazygit] not found!", vim.log.levels.ERROR, { title = "toggleterm.nvim" })
3939
end
4040
end
41+
42+
_G._buf_vtext = function()
43+
local a_orig = vim.fn.getreg("a")
44+
local mode = vim.fn.mode()
45+
if mode ~= "v" and mode ~= "V" then
46+
vim.cmd([[normal! gv]])
47+
end
48+
vim.cmd([[silent! normal! "aygv]])
49+
local text = vim.fn.getreg("a")
50+
vim.fn.setreg("a", a_orig)
51+
return text
52+
end

lua/keymap/tool.lua

+6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ local plug_map = {
132132
:with_desc("edit: Change current direrctory by zoxide"),
133133
["n|<leader>fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"),
134134
["n|<leader>fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"),
135+
["v|<leader>fs"] = map_callback(function()
136+
require("telescope.builtin").grep_string({ search = _buf_vtext() }) -- luacheck: ignore
137+
end)
138+
:with_noremap()
139+
:with_silent()
140+
:with_desc("find: Selection text"),
135141
["n|<leader>fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"),
136142

137143
-- Plugin: dap

0 commit comments

Comments
 (0)