nvim-config

Log | Files | Refs | Submodules | README

commit 85141649924349fd75cf68c05c92808cd8a39f03
parent 1fbc4b9ce7bff4553db1e30334580bbb5d22333b
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Mon,  4 Jul 2022 15:15:12 +0200

Update markdown config a tidy snippets

Diffstat:
Mafter/ftplugin/markdown.lua | 15+++------------
Dsnippets/c.json | 24------------------------
Dsnippets/gitcommit.json | 27---------------------------
Dsnippets/gitcommit.snip | 242-------------------------------------------------------------------------------
Dsnippets/global.json | 23-----------------------
Dsnippets/json.json | 15---------------
Dsnippets/lua.json | 48------------------------------------------------
Dsnippets/markdown.json | 29-----------------------------
Dsnippets/tex.json | 32--------------------------------
Dsnippets/text.json | 17-----------------
Dsnippets/vim.json | 12------------
Dsnippets/vim.snip | 22----------------------
Dsnippets/xml.json | 15---------------
13 files changed, 3 insertions(+), 518 deletions(-)

diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua @@ -1,12 +1,3 @@ -vim.cmd[[setlocal textwidth=70]] -vim.cmd[[setlocal nowrap]] -vim.cmd[[compiler mdpdf]] - -if vim.fn.executable 'zest' == 0 then return end - -if #(vim.fn.system{ 'zest', 'search', string.format('file:%s', vim.fn.expand"%:p")}) ~= 0 then - vim.api.nvim_buf_set_keymap(0, 'n', '<Leader>r', '<cmd>ZestRefs<CR>', { noremap=true, silent=true }) - vim.api.nvim_buf_set_keymap(0, 'n', 'gf', ':ZestGoto file:<C-R><C-W><CR>', { noremap=true, silent=true }) - - vim.cmd[[au BufWritePost <buffer> :silent! !zest update]] -end +vim.opt_local.textwidth = 70 +vim.opt_local.wrap = false +vim.opt_local.conceallevel = 0 diff --git a/snippets/c.json b/snippets/c.json @@ -1,24 +0,0 @@ -{ - "Switch" : { - "prefix" : "switch", - "body" : [ - "switch ($1) {", - "\t$2", - "\tdefault:", - "\t\t$3", - "}", - "$0" - ], - "description" : "A switch statement." - }, - "Case" : { - "prefix" : "case", - "body" : [ - "case $1:", - "\t$2", - "\tbreak", - "$0" - ], - "description" : "A case statement." - } -} diff --git a/snippets/gitcommit.json b/snippets/gitcommit.json @@ -1,27 +0,0 @@ -{ - "Co Author" : { - "prefix" : "coauth", - "body" : [ - "Co-authored-by: ${1:name} <${2:email}>" - ], - "description" : "A co-author on github." - }, - "Fix" : { - "prefix" : "fix", - "body" : [ - "fix: ${1:description}", - "", - "${0:body}" - ], - "description" : "Fix without scope or breaking change" - }, - "Feature" : { - "prefix" : "feat", - "body" : [ - "feat: ${1:description}", - "", - "${0:body}" - ], - "description" : "New feature without scope or breaking change" - } -} diff --git a/snippets/gitcommit.snip b/snippets/gitcommit.snip @@ -1,242 +0,0 @@ -snippet revert -abbr revert: ... -options head - revert: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet reverts -abbr revert(...): ... -options head - revert(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet revertsb -abbr revert!(...): ... -options head - revert!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet config -abbr config: ... -options head - config: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet configs -abbr config(...): ... -options head - config(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet configsb -abbr config!(...): ... -options head - config!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet feat -abbr feat: ... -options head - feat: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet feats -abbr feat(...): ... -options head - feat(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet featsb -abbr feat!(...): ... -options head - feat!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet fix -abbr fix: ... -options head - fix: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet fixs -abbr fix(...): ... -options head - fix(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet fixsb -abbr fix!(...): ... -options head - fix!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet chore -abbr chore: ... -options head - chore: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet chores -abbr chore(...): ... -options head - chore(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet choresb -abbr chore!(...): ... -options head - chore!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet refactor -abbr refactor: ... -options head - refactor: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet refactors -abbr refactor(...): ... -options head - refactor(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet refactorsb -abbr refactor!(...): ... -options head - refactor!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet perf -abbr perf: ... -options head - perf: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet perfs -abbr perf(...): ... -options head - perf(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet perfsb -abbr perf!(...): ... -options head - perf!(${1:scope}): ${2:description} - - BREAKING CHANGE: ${3:#:body} - - ${4:#:footer} - -snippet docs -abbr docs: ... -options head - docs: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet docss -abbr docs(...): ... -options head - docs(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet style -abbr style: ... -options head - style: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet styles -abbr style(...): ... -options head - style(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} - -snippet test -abbr test: ... -options head - test: ${1:description} - - ${2:#:body} - - ${3:#:footer} - -snippet tests -abbr test(...): ... -options head - test(${1:scope}): ${2:description} - - ${3:#:body} - - ${4:#:footer} diff --git a/snippets/global.json b/snippets/global.json @@ -1,23 +0,0 @@ -{ - "TODO" : { - "prefix" : "todo", - "body" : [ - "TODO(vigoux): ${0:content}" - ], - "description" : "A todo placeholder" - }, - "FIXME" : { - "prefix" : "fixme", - "body" : [ - "FIXME(vigoux): ${0:content}" - ], - "description" : "A fixme code tag" - }, - "HACK" : { - "prefix" : "hack", - "body" : [ - "HACK(vigoux): ${0:content}" - ], - "description" : "A hack code tag" - } -} diff --git a/snippets/json.json b/snippets/json.json @@ -1,15 +0,0 @@ -{ - "Snippet": { - "prefix": "snip", - "body": [ - "\"${1:name}\" : {", - "\t\"prefix\" : \"${2:pref}\",", - "\t\"body\" : [", - "\t\t\"${3:content}\"", - "\t],", - "\t\"description\" : \"${4:desc}\"", - "}" - ], - "description" : "Snippet snippet" - } -} diff --git a/snippets/lua.json b/snippets/lua.json @@ -1,48 +0,0 @@ -{ - "For" : { - "prefix" : "for", - "body" : [ - "for ${1:i}=${2:start},${3:stop} do", - "\t$4", - "end", - "$0" - ], - "description" : "" - }, - "ForIn" : { - "prefix" : "forin", - "body" : [ - "for ${1:var} in ${2:iter} do", - "\t$3", - "end", - "$0" - ], - "description" : "" - }, - "Iterate" : { - "prefix" : "iter", - "body" : [ - "for _, ${1:var} in ipairs(${2:table}) do", - "\t$3", - "end", - "$0" - ], - "description" : "" - }, - "LocalRequire" : { - "prefix" : "req", - "body" : [ - "local $1 = require'$2'" - ], - "description" : "Local require" - }, - "Test" : { - "prefix" : "test", - "body" : [ - "it(\"$1\", function()", - "\t$0", - "end)" - ], - "description" : "A busted test case" - } -} diff --git a/snippets/markdown.json b/snippets/markdown.json @@ -1,29 +0,0 @@ -{ - "Slide" : { - "prefix" : "slide", - "body" : [ - "---", - "", - "# ${1:Title}", - "", - "${2:body}", - "", - "???", - "", - "${3:notes}" - ], - "description" : "A new pres.nvim slide" - }, - "Header" : { - "prefix" : "header", - "body" : [ - "---", - "author: Thomas Vigouroux", - "title: ${1:Title}", - "toc: false", - "", - "---" - ], - "description" : "A Pandoc yaml header" - } -} diff --git a/snippets/tex.json b/snippets/tex.json @@ -1,32 +0,0 @@ -{ - "GlossaryEntry" : { - "prefix" : "gloss", - "body" : [ - "\\newglossaryentry{$1}{", - "\tname={$2},", - "\tdescription={$3}", - "}" - ], - "description" : "A glossary entry." - }, - "section" : { - "prefix" : "section", - "body" : [ - "% $1 %(", - "\\section{$1}", - "$0", - "%)" - ], - "description" : "A section with folding" - }, - "Frame" : { - "prefix" : "frame", - "body" : [ - "\\begin{frame}", - "\t\\frametitle{$1}", - "\t$0", - "\\end{frame}" - ], - "description" : "A beamer frame" - } -} diff --git a/snippets/text.json b/snippets/text.json @@ -1,17 +0,0 @@ -{ - "TSTest" : { - "prefix" : "ts", - "body" : [ - "=============================", - "$1", - "=============================", - "", - "$2", - "", - "---", - "", - "$3" - ], - "description" : "A treesitter test case" - } -} diff --git a/snippets/vim.json b/snippets/vim.json @@ -1,12 +0,0 @@ -{ - "If Exists" : { - "prefix" : "ife", - "body" : [ - "if exists(\"g:loaded_$1\")", - "\tfinish", - "endif", - "$0" - ], - "description" : "Classic vim load guard" - } -} diff --git a/snippets/vim.snip b/snippets/vim.snip @@ -1,22 +0,0 @@ -snippet ifmakefile -abbr if makefile ... endif -options head - if globpath('.', '?akefile*') ==? '' - compiler ${0:TARGET} - endif - -snippet ifplugin -abbr if !exists("g:loaded_{plugin}") -options head - if !exists('g:loaded_${1}') - finish - endif - -snippet function -abbr function ... endfunction -options head - " ${2:doc} - function! ${1} "{{{ - ${0:TARGET} - endfunction "}}} - diff --git a/snippets/xml.json b/snippets/xml.json @@ -1,15 +0,0 @@ -{ - "RSSEntry" : { - "prefix" : "item", - "body" : [ - "<item>", - "\t<title>${1:title}</title>", - "\t<description>${2:desc}</description>", - "\t<link>gopher://vigoux.giize.com/0/phlog/${3:file_path}</link>", - "\t<guid isPermaLink=\"true\">gopher://vigoux.giize.com/0/phlog/$3</guid>", - "\t<pubDate>${VIM:strftime('%c %Z')}</pubDate>", - "</item>" - ], - "description" : "RSS XML entry" - } -}