aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 15:21:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 15:21:01 -0300
commita3103720f129bac2a60943d4e5e882144e5bd604 (patch)
tree04144ead383ac79717e20b167ee4425e11e8fbfc
parentfd271de3618194c264248e82c1441fd520e498fb (diff)
downloadvim-a3103720f129bac2a60943d4e5e882144e5bd604.tar.gz
vim-a3103720f129bac2a60943d4e5e882144e5bd604.tar.bz2
Feat: try preservim/vim-markdown
-rw-r--r--.gitmodules6
-rw-r--r--vim.dot.link/filetype.vim15
m---------vim.dot.link/pack/preservim/start/vim-markdown0
m---------vim.dot.link/pack/vitalk/opt/vim-simple-todo0
-rw-r--r--vim.dot.link/plugin/lib.vim21
5 files changed, 39 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules
index 5b8d086..dd06fac 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -68,3 +68,9 @@
[submodule "vim.dot.link/pack/masukomi/start/vim-markdown-folding"]
path = vim.dot.link/pack/masukomi/start/vim-markdown-folding
url = https://github.com/masukomi/vim-markdown-folding
+[submodule "vim.dot.link/pack/vitalk/start/vim-simple-todo"]
+ path = vim.dot.link/pack/vitalk/opt/vim-simple-todo
+ url = https://github.com/vitalk/vim-simple-todo
+[submodule "vim.dot.link/pack/preservim/start/vim-markdown"]
+ path = vim.dot.link/pack/preservim/start/vim-markdown
+ url = https://github.com/preservim/vim-markdown
diff --git a/vim.dot.link/filetype.vim b/vim.dot.link/filetype.vim
index 26e7eea..522d674 100644
--- a/vim.dot.link/filetype.vim
+++ b/vim.dot.link/filetype.vim
@@ -6,7 +6,7 @@ endif
" Markdown
augroup markdown
- " Markdown configuration
+ " Markdown configuration without vim-markdown plugin
"
" Include folding setup:
" https://github.com/masukomi/vim-markdown-folding
@@ -16,9 +16,18 @@ augroup markdown
"
" Seem like this things should be set during BufRead or BufNewFile; they're
" not working when set during the FileType event.
+ "autocmd!
+ "autocmd BufRead,BufNewFile *.md set filetype=markdown foldexpr=NestedMarkdownFolds() autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:>
+ "autocmd BufRead,BufNewFile *.mdwn set filetype=ikiwiki foldexpr=NestedMarkdownFolds()
+
+ " Markdown configuration with vim-markdown plugin
autocmd!
- autocmd BufRead,BufNewFile *.md set filetype=markdown foldexpr=NestedMarkdownFolds() autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:>
- autocmd BufRead,BufNewFile *.mdwn set filetype=ikiwiki foldexpr=NestedMarkdownFolds()
+ autocmd BufRead,BufNewFile *.md set autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:>
+ let g:vim_markdown_new_list_item_indent = 2
+ let g:vim_markdown_folding_style_pythonic = 1
+ let g:vim_markdown_folding_level = 1
+ let g:vim_markdown_auto_insert_bullets = 0
+ let g:vim_markdown_new_list_item_indent = 0
augroup END
" Python
diff --git a/vim.dot.link/pack/preservim/start/vim-markdown b/vim.dot.link/pack/preservim/start/vim-markdown
new file mode 160000
+Subproject a657e697376909c41475a686eeef7fc7a4972d9
diff --git a/vim.dot.link/pack/vitalk/opt/vim-simple-todo b/vim.dot.link/pack/vitalk/opt/vim-simple-todo
new file mode 160000
+Subproject e2eead5640244cbf4e376ad91f649e2a4f536da
diff --git a/vim.dot.link/plugin/lib.vim b/vim.dot.link/plugin/lib.vim
new file mode 100644
index 0000000..7e71c6f
--- /dev/null
+++ b/vim.dot.link/plugin/lib.vim
@@ -0,0 +1,21 @@
+" lib.vim - Miscelaneous functions
+"
+" Author: Silvio Rhatto <rhatto@riseup.net>
+"
+
+" Checkbox handling
+"
+" Thanks https://www.reddit.com/r/vim/comments/slqsao/readymade_solution_for_handling_markdown/
+"function! ToggleCheckbox()
+" let line = getline('.')
+"
+" if line =~ '- \[ \]'
+" call setline('.', substitute(line, '- \[ \]', '- \[x\]', ''))
+" elseif line =~ '- \[x\]'
+" call setline('.', substitute(line, '- \[x\]', '- \[ \]', ''))
+" elseif line =~ '- '
+" call setline('.', substitute(line, '- ', '- \[ \] ', ''))
+" endif
+"endf
+"
+"nnoremap <Leader>c :call ToggleCheckbox()<CR>