Skip to content

Vim plugin that adds short-cuts/commands for MarkDown headings

License

Notifications You must be signed in to change notification settings

vim-utilities/markdown-headings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Headings

Vim plugin that adds short-cuts/commands for MarkDown headings

Byte size of Markdown Headings Open Issues Open Pull Requests Latest commits



Requirements

This repository requires the Vim text editor to be installed the source code is available on GitHub -- vim/vim, and most GNU Linux package managers are able to install Vim directly, eg...

  • Arch based Operating Systems
    sudo packman -Syy
    
    sudo packman -S gawk make vim
  • Debian derived Distributions
    sudo apt-get update
    
    sudo apt-get install gawk make vim

Note gawk and make are only required if not utilizing a Vim plugin manager.


Quick Start

Clone this project...

mkdir -vp ~/git/hub/vim-utilities

cd ~/git/hub/vim-utilities

git clone git@github.com:vim-utilities/markdown-headings.git

If not using a plugin manager, then this plugin may be installed via make install command...

cd ~/git/hub/vim-utilities/markdown-headings

make install

To upgrade in the future use make upgrade command...

cd ~/git/hub/vim-utilities/markdown-headings

make upgrade

After installation, plugin documentation may be accessed via Vim's :help command, eg...

:help markdown-heading-transform

:help markdown-heading-link

Usage

Features of this plugin automatically activate if detected filetype is markdown

Example Usage

  1. Write a line of text...
Heading line to be
  1. Use Vim leader sequence to convert line into level 2 MarkDown heading...
<Leader>h2
  1. Example results...
## Heading line to be
  1. Use Vim command to build Heading Link with title text...
:Hl Text about heading
  1. Example results...
## Heading line to be
[heading__heading_line_to_be]: #heading-line-to-be "Text about heading"
  1. Edit text of heading...
## Edited heading line
[heading__heading_line_to_be]: #heading-line-to-be "Text about heading"
  1. Use Vim leader sequence to update Heading Link...
<Leader>hl
  1. Example results...
## Edited heading line
[heading__edited_heading_line]: #edited-heading-line "Text about heading"

... Note, either :Hl or <Leader>hl will update any references to the heading within the document too!

For example for a table of contents similar to...

- [Link to Some Heading][heading__heading_line_to_be]

... would be updated to...

- [Link to Some Heading][heading__edited_heading_line]
  1. Convert the level two heading to a level three heading...
<Leader>h3

... example results...

### Edited heading line

Notes

Notice, some MarkDown interpreters may sanitize symbols within heading text slightly different to GitHub.


This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.

  • Fork this repository to an account that you have write permissions for.

  • Add remote for fork URL. The URL syntax is git@github.com:<NAME>/<REPO>.git...

cd ~/git/hub/vim-utilities/markdown-headings

git remote add fork git@github.com:<NAME>/markdown-headings.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/vim-utilities/markdown-headings


git commit -F- <<'EOF'
:bug: Fixes #42 Issue


**Edits**


- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF


git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Attribution


License

Vim plugin that adds short-cuts/commands for MarkDown headings
Copyright (C) 2024 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

For further details review full length version of AGPL-3.0 License.

About

Vim plugin that adds short-cuts/commands for MarkDown headings

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project