improving startup time by using lazy loading or filetype loading
This commit is contained in:
parent
bdb655c5a1
commit
7f1b34fd6f
62 changed files with 1285 additions and 561 deletions
|
|
@ -1 +1,23 @@
|
|||
return {
|
||||
-- Function to get the current visual selection
|
||||
get_visual_selection = function()
|
||||
vim.cmd 'noau normal! "vy"'
|
||||
local text = vim.fn.getreg 'v'
|
||||
vim.fn.setreg('v', {})
|
||||
|
||||
text = string.gsub(text, '\n', '')
|
||||
if #text > 0 then
|
||||
return text
|
||||
else
|
||||
return ''
|
||||
end
|
||||
end,
|
||||
|
||||
-- Function to get the current search query
|
||||
get_search_query = function()
|
||||
local word_under_cursor = vim.fn.expand '<cword>'
|
||||
local visual_selection = require('config.utils').get_visual_selection()
|
||||
|
||||
return visual_selection ~= '' and visual_selection or word_under_cursor
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue