added latex support and reorg ftplugins

This commit is contained in:
Jeremie Fraeys 2024-08-20 01:31:44 -04:00
parent 7f1b34fd6f
commit f2eaf7c67a
38 changed files with 600 additions and 234 deletions

View file

@ -1,23 +1,27 @@
-- Function to get the current visual selection
local function get_visual_selection()
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
local function get_search_query()
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
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,
get_visual_selection = get_visual_selection,
get_search_query = get_search_query,
}