repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim/ftplugin/lua.lua

Raw
-- Options to add `gf` functionality inside `.lua` files.
vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
for _, path in pairs( vim.api.nvim_list_runtime_paths() ) do
  vim.opt_local.path:append( path .. '/lua' )
end
vim.opt_local.suffixesadd:prepend '.lua'

local map = require 'std.map'

map.normal {
  description = 'Wrap word under cursor with require call',
  keys = '<leader>rq',
  category = 'refactor',
  -- sourround word with '
  -- insert `require`
  -- move 3 words
  command = "ebi'<esc>ea'<esc>bbirequire <esc>www",
  buffer = true,
  remap = true,
}