From bae6e0e44162d42a80018fa50b67622cac67e54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Tue, 30 Mar 2021 16:17:37 +0200 Subject: [PATCH] Add tools for writing vim doc files --- symlinks/config/nvim/after/ftplugin/lua.vim | 2 + symlinks/config/nvim/init.lua | 4 + symlinks/config/nvim/lua/init/plugins.lua | 1 + symlinks/config/nvim/plugin/projectionist.vim | 90 +++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 symlinks/config/nvim/after/ftplugin/lua.vim create mode 100644 symlinks/config/nvim/plugin/projectionist.vim diff --git a/symlinks/config/nvim/after/ftplugin/lua.vim b/symlinks/config/nvim/after/ftplugin/lua.vim new file mode 100644 index 0000000..fa15b9a --- /dev/null +++ b/symlinks/config/nvim/after/ftplugin/lua.vim @@ -0,0 +1,2 @@ +setlocal ts=2 sts=2 sw=2 expandtab autoindent +let b:undo_ftplugin .= '|setlocal ts< sts< sw< expandtab< autoindent<' diff --git a/symlinks/config/nvim/init.lua b/symlinks/config/nvim/init.lua index 9bb4255..873af79 100644 --- a/symlinks/config/nvim/init.lua +++ b/symlinks/config/nvim/init.lua @@ -2,6 +2,10 @@ if require('init.first_load')() then return end +vim.cmd [[filetype plugin on]] +vim.cmd [[filetype indent on]] +vim.cmd [[syntax on]] + vim.api.nvim_exec('let $OVIMHOME = $HOME."/.vim"', false) vim.api.nvim_exec('let $VIMHOME = $HOME."/.config/nvim"', false) vim.api.nvim_exec('let $NVIMHOME = $HOME."/.local/share/nvim"', false) diff --git a/symlinks/config/nvim/lua/init/plugins.lua b/symlinks/config/nvim/lua/init/plugins.lua index 24bf293..a9bc15e 100644 --- a/symlinks/config/nvim/lua/init/plugins.lua +++ b/symlinks/config/nvim/lua/init/plugins.lua @@ -58,6 +58,7 @@ return require('packer').startup { use 'vimwiki/vimwiki' -- Vimwiki - personal wiki in vim use 'esensar/vimwiki-reviews-lua' -- Vimwiki extension for periodic reviews use 'ledger/vim-ledger' -- Support for ledger-cli format + use 'tandrewnichols/vim-docile' -- Support for vim doc.txt format -- Treesitter -- use { -- diff --git a/symlinks/config/nvim/plugin/projectionist.vim b/symlinks/config/nvim/plugin/projectionist.vim new file mode 100644 index 0000000..4e24885 --- /dev/null +++ b/symlinks/config/nvim/plugin/projectionist.vim @@ -0,0 +1,90 @@ +let g:projectionist_heuristics = { + \ "plugin/|autoload/": { + \ "doc/*.txt": { + \ "type": "help", + \ "template": [ + \ "*{}.txt* Description", + \ "", + \ "INTRODUCTION *{}*", + \ "", + \ "Description", + \ "", + \ "CONTENTS *{}-contents*", + \ "", + \ " 1. Overview |{}-overview|", + \ " 2. Requirements |{}-requirements|", + \ " 3. Installation |{}-installation|", + \ " 4. Usage |{}-usage|", + \ " 5. Commands |{}-commands|", + \ " 6. Functions |{}-functions|", + \ " 7. Mappings |{}-mappings|", + \ " 8. Plugs |{}-plugs|", + \ " 9. Options |{}-options|", + \ " 10. Issues |{}-issues|", + \ " 11. Contributing |{}-contributing|", + \ " 12. Version |{}-version|", + \ " 13. License |{}-license|", + \ "", + \ "OVERVIEW *{}-overview*", + \ "", + \ "REQUIREMENTS *{}-requirements*", + \ "", + \ "INSTALLATION *{}-installation*", + \ "", + \ " 1. Plug ", + \ "", + \ " Add the following to your vimrc, or something sourced therein: >", + \ "", + \ " Plug 'esensar/{}'", + \ "<", + \ " Then install via `:PlugInstall`", + \ "", + \ " 2. Pathogen >", + \ "", + \ " cd ~/.vim/bundle", + \ " git clone https://github.com/esensar/{}.git", + \ "<", + \ " Then run `:Helptags`", + \ "", + \ " 3. Manual", + \ "", + \ " Clone this repository and copy the files in plugin/, autoload/, and doc/", + \ " to their respective directories in your vimfiles, or copy the text from", + \ " the github repository into new files in those directories. Make sure to", + \ " run `:helptags`.", + \ "", + \ "USAGE *{}-usage*", + \ "", + \ "COMMANDS *{}-commands*", + \ "", + \ "FUNCTIONS *{}-functions*", + \ "", + \ "MAPPINGS *{}-mappings*", + \ "", + \ "PLUGS *{}-plugs*", + \ "", + \ "OPTIONS *{}-options*", + \ "", + \ "ISSUES *{}-issues*", + \ "", + \ "If you experience issues using {}, please report them at", + \ ".", + \ "", + \ "CONTRIBUTING *{}-contributing*", + \ "", + \ "Feel free to look at already reported issues at ", + \ ".", + \ "If available, check out CONTRIBUTING.md in the repository.", + \ "Otherwise, feel free to create a new issue or pull request.", + \ "", + \ "VERSION *{}-version*", + \ "", + \ "Version 1.0.0", + \ "", + \ "LICENSE *{}-license*", + \ "", + \ "vim:tw=78:ts=2:ft=help:norl:" + \ ] + \ }, + \ } + \ }