t-b / igor-pro-vim

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Recognize Doxygen comments #7

Open ukos-git opened 4 years ago

ukos-git commented 4 years ago

I would like to recommend adding doxygen comments to the ftplugin. This allows convenient line breaking and text flowing using gwap in normal mode with comments in formatoptions formatoptions+=c enabled.

/// @brief Write the data of a single channel to the NWB file
///
/// @param locationID      HDF5 file identifier
/// @param path            Absolute path in the HDF5 file where the data should be stored
/// @param version         major NWB version
/// @param p               Filled #IPNWB::WriteChannelParams structure
/// @param tsp             Filled #IPNWB::TimeSeriesProperties structure
/// @param compressionMode [optional, defaults to NO_COMPRESSION] Type of compression to use, one of @ref CompressionMode

this is conveniently reflown using vip and gwap.

/// @brief Write the data of a single channel to the NWB file
///
/// @param locationID      HDF5 file identifier
/// @param path            Absolute path in the HDF5 file where the data should
///                        be stored
/// @param version         major NWB version
/// @param p               Filled #IPNWB::WriteChannelParams structure
/// @param tsp             Filled #IPNWB::TimeSeriesProperties structure
/// @param compressionMode [optional, defaults to NO_COMPRESSION] Type of
///                        compression to use, one of @ref CompressionMode

My current vimrc to make this happen looks like this:

set formatoptions=tcqornj
set formatlistpat+=\\\|^@param\\s\\+\\w\\+\\s\\+
if has("autocmd")
  augroup fileTypeCustom
  autocmd!
    autocmd FileType igorpro
      \ setlocal nospell |
      \ setlocal comments+=b:///
  augroup END
endif

Would it be possible to add the following lines to the ftplugin?

set comments+=b:///
set formatlistpat+=\\\|^@param\\s\\+\\w\\+\\s\\+
ukos-git commented 4 years ago

could also be extended to match the @brief keyword.

t-b commented 4 years ago

@ukos-git Go for it!