A simple plugin that provides Processing support for Neovim.
-
Processing ctags generates an index file of symbols in your source code, enabling quick navigation to definitions and declarations directly within your editor.
-
The
:make
command in Neovim is configured to execute your Processing sketch directly using processing-java --sketch=/path/to/your/sketch --run -
The
:Processing lsp
command starts the Processing Language Server (LSP), which must be manually set up. ifvim.g.processing_nvim.lsp.cmd
is nil, the LSP will not start. -
The commentstring is set to
// %s
to format comments in a way that matches the style used in Java, where//
is used for single-line comments.
- Neovim >= 0.10.0 (may work on previous versions).
- processing-java
- Optional:
- ctags (for
:Processing ctags
). - a Processing Language Server (for lsp setup and
:Processing lsp
). - nvim-treesitter with the tree-sitter-java parser for syntax highlighting.
- ctags (for
Warning
macOS users will need to install the processing-java command from the IDE.
The :make
command will not function without doing this.
Location: Menu Bar > Tools > Install "processing-java"
Install processing.nvim with a package manager of your choice.
:Rocks install processing.nvim
{
'sophieforrest/processing.nvim'
-- This plugin is already lazy-loaded.
lazy = false,
-- Recommended.
version = "^1",
}
use 'sophieforrest/processing.nvim'
'sophieforrest/processing.nvim'
Plug 'sophieforrest/processing.nvim'
Important
If the plugin isn't working correctly, run :checkhealth processing
to
identify possible issues.
processing.nvim uses the vim.g.processing_nvim
namespace for configuration.
The default configuration can be found below.
vim.g.processing_nvim = {
---@type processing.Config
Default.default = {
highlight = {
-- Whether to enable treesitter highlighting.
---@type boolean
enable = true,
},
lsp = {
-- The command to use for processing-lsp. This needs to be created
-- manually as processing doesn't bundle their LSP as a separate package.
-- This generally involves editing the processing wrapper script.
-- This will not start the LSP if set to nil.
---@type string[]|nil|fun(dispatchers: vim.lsp.rpc.Dispatchers): vim.lsp.rpc.PublicClient
cmd = nil,
-- Example: cmd = { "processing-lsp" }
},
},
}
Code examples that users of processing.nvim may find useful to include in their configs. These can be included anywhere in your configuration.
local processing_ctags = vim.api.nvim_create_augroup('ProcessingCtags', {})
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
command = 'Processing ctags',
desc = 'Generate ctags for Processing on save.',
group = processing_ctags,
pattern = { '*.pde' },
})
vim.api.nvim_create_autocmd('QuickFixCmdPost', {
pattern = '*',
callback = function()
if #vim.fn.getqflist() > 0 then
vim.cmd('copen')
end
end,
})