Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Vim integration for DrString
Vim script
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugin
LICENSE.md
README.md

README.md

DrString.vim

Wrappers for DrString, a DocString formatter and linter for Swift.

Usage

First, install DrString.

Install dduan/DrString.vim with your plugin mananger. For example, with vim-plug this would be

Plug 'dduan/DrString.vim'

Call directly or bind one of the included functions. For example, add the following in your config to make <leader>d generate and format docstrings within selected range:

autocmd FileType swift nnoremap <buffer> <leader>d :call DrString#Format()<cr>
autocmd FileType swift vnoremap <buffer> <leader>d :call DrString#Format()<cr>

Function

Function Description
DrString#Format() Formats docstring under the cursor or selecetd range. Generate placeholders for missing docstring components.
DrString#FormatAll() Like DrString#Format() but for the entire file.
DrString#Check() Runs DrString's check subcommand for the file associated with the buffer. If any problems are found, show them the quickfix window
DrString#Version() Shows DrString's release version.

For formatting and checking commands, the Vim buffer must have been written to a file first.

License

MIT.

You can’t perform that action at this time.