Switch, open browser, click on search, search...aah I was tired of this, Now I can web search directly through nvim.
Especially the errors I can just visual select and hit keymap and...voila done!
- Search Web Directly
- Set your preffered Search Engine
- Support for Custom Search Engine URLs
- Wikipedia Search Command
- Visual Mode Search: select text or errors to search directly
witcomp.mp4
You can install wit.nvim using any plugin manager for example:
Using packer.nvim:
require('packer').startup(function()
use {
'aliyan-21/wit.nvim',
config = function()
require('wit').setup()
end
}
end)
Using lazy.nvim:
return {
"aliqyan-21/wit.nvim",
config = function()
require('wit').setup()
end
}
To perform a web search, use the :WitSearch
command followed by your query.
:WitSearch your search query
To perform a direct wikipedia search, use the :WitSearchWiki
command followed by your query.
:WitSearchWiki your search topic
Select the text you want to search and then hit :WitVisualSearch
and enter.
Configure wit.nvim
by adding the setup function in your configuration file.
require("wit").setup({
-- You can choose your preferred search engine from
-- the supported list: {google, bing, duckduckgo, ecosia, brave, perplexity}.
--
-- There's also the possibility of just specifying a custom
-- search engine URL by providing the base URL and the required search params.
-- EXAMPLE:
-- engine = "https://<your_preferred_search_engine>/search?q="
engine = "google", -- search engine (default: "google")
command_search = "WitSearch", -- custom command to search (default: "WitSearch")
command_search_visual = "WitSearchVisual", -- custom command to search visually (default: "WitSearchVisual")
command_search_wiki = "WitSearchWiki", -- custom command to search wikipedia (default: "WitSearchWiki")
})
You can also specify a custom search engine URL by providing the base URL in the search_engine configuration. Just ensure you include the ?q= at the end.
Feel free to contribute to the development of wit.nvim
by submitting issues or pull requests.
wit.nvim is licensed under the MIT License.
Special thanks to the Neovim and Neovim community.