summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <brahmajit.xyz@gmail.com>2024-05-18 03:22:47 +0530
committerBrahmajit Das <brahmajit.xyz@gmail.com>2024-05-18 03:22:47 +0530
commit7440d00244bd1b2953a6930beca607218029e982 (patch)
treeedea7f78c695245d98efa2dc6b3a9fd3eaf0877b
parent5f176f8728599e520359487b14246e930b234ce9 (diff)
nvim: init.lua: Adding option to add `gf` functionality in `.lua` files
Taken from https://github.com/sam4llis/nvim-lua-gf/blob/ca712497b2bab6351518917be219e9bfd8d63e4f/after/ftplugin/lua.lua Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
-rw-r--r--init.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index a1169a6..e55a29c 100644
--- a/init.lua
+++ b/init.lua
@@ -3,6 +3,16 @@ if vim.fn.executable('nvr') == 0 then
vim.api.nvim_command('!pip3 install --user --break-system-packages neovim-remote')
end
+-- Options to add `gf` functionality inside `.lua` files.
+-- https://github.com/sam4llis/nvim-lua-gf/blob/ca712497b2bab6351518917be219e9bfd8d63e4f/after/ftplugin/lua.lua
+_G.vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
+_G.vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
+for _, path in pairs(_G.vim.api.nvim_list_runtime_paths()) do
+_G.vim.opt_local.path:append(path .. '/lua')
+end
+_G.vim.opt_local.suffixesadd:prepend('.lua')
+
+
-- Load plugins
require('keymaps')
require('basics')