-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readme improvements #69
Comments
Recently I have become interested in Otter. I've come up with a turnkey solution using Packer. use {
'jmbuhr/otter.nvim',
requires = { 'neovim/nvim-lspconfig' },
config = function()
function otter_extensions(arglead, _, _)
local extensions = require'otter.tools.extensions'
local out = {}
for k, v in pairs(extensions) do
if arglead == nil then
table.insert(out, "*.otter." .. v)
elseif k:find("^" .. arglead) ~= nil then
table.insert(out, k)
end
end
return out
end
print(vim.inspect(otter_extensions()))
vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
group = vim.api.nvim_create_augroup("lspconfig", { clear = false }),
pattern = otter_extensions(),
callback = function(ev)
local buf = ev.buf
local ft = vim.api.nvim_get_option_value("filetype", { buf = ev.buf })
local matching_configs = require('lspconfig.util').get_config_by_ft(ft)
for _, config in ipairs(matching_configs) do
print("Activating ", config.name, " LspOtter in buffer ", buf, "...")
config.launch(buf)
end
end
})
vim.cmd [[ command! -nargs=* -complete=customlist,v:lua.otter_extensions LspOtter lua require'otter'.activate({<f-args>}) ]]
end
} Whenever you want to use Otter just call in the command line:
Any suggestions to improve the code are welcome. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be greatly appreciated if the README was a bit more detailed . With some added installation instructions and how to use .
For example:
These are never mentioned and the only docs is the README
Should this be called like
.setup()
or should this be called on file enter with all the languages the file is potentially going to have ?and a few other stuff.
Thanks for your hard work!
The text was updated successfully, but these errors were encountered: