summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-11-12 18:54:01 +0100
committerAnton Khirnov <anton@khirnov.net>2020-11-12 18:54:01 +0100
commit9b0d96a52fb03d176e96266b57430d1b72be4472 (patch)
tree28b23c7b8b3c3c16aed393e10bdccedad08d2040
parent7bc1cba2ac68d10231358a9d61d3831483b4d600 (diff)
vim: add minisnip plugin
-rw-r--r--.gitmodules3
-rw-r--r--install.conf.yaml3
m---------vim/minisnip0
-rw-r--r--vim/minisnip_snippets/c/inc.snip1
-rw-r--r--vim/minisnip_snippets/c/incl.snip1
-rw-r--r--vim/vimrc5
6 files changed, 13 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
index 1ce5c11..fed8714 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "dotbot"]
path = dotbot
url = https://github.com/anishathalye/dotbot
+[submodule "vim/minisnip"]
+ path = vim/minisnip
+ url = https://github.com/Jorengarenar/miniSnip
diff --git a/install.conf.yaml b/install.conf.yaml
index d0425c0..1b9c64b 100644
--- a/install.conf.yaml
+++ b/install.conf.yaml
@@ -5,6 +5,7 @@
- ~/.local/var/bash
- ~/.local/var/vim/undo
- ~/.vim/colors
+ - ~/.vim/pack/dotfiles/start
- link:
~/.config/bash/prompt: bash/prompt
@@ -15,3 +16,5 @@
# TODO: clean up and install linediff script
~/.vimrc: vim/vimrc
~/.vim/colors/inkpot.vim: vim/inkpot.vim
+ ~/.vim/pack/dotfiles/start/minisnip: vim/minisnip
+ ~/.vim/miniSnip: vim/minisnip_snippets
diff --git a/vim/minisnip b/vim/minisnip
new file mode 160000
+Subproject 07095d824ed34f0c15c6b58d5e96063cb74edd7
diff --git a/vim/minisnip_snippets/c/inc.snip b/vim/minisnip_snippets/c/inc.snip
new file mode 100644
index 0000000..e09baf9
--- /dev/null
+++ b/vim/minisnip_snippets/c/inc.snip
@@ -0,0 +1 @@
+#include <<{}>.h>
diff --git a/vim/minisnip_snippets/c/incl.snip b/vim/minisnip_snippets/c/incl.snip
new file mode 100644
index 0000000..af70605
--- /dev/null
+++ b/vim/minisnip_snippets/c/incl.snip
@@ -0,0 +1 @@
+#include "<{!substitute(expand('%:t'), '\.c', '\.h', '')}>"
diff --git a/vim/vimrc b/vim/vimrc
index c7660f5..509ca2f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -79,6 +79,11 @@ nnoremap <Leader>b :FufBuffer<CR>
nnoremap <Leader>d :FufDir<CR>
nnoremap <Leader>f :FufCoverageFile<CR>
+" miniSnip configuration
+" FIXME split off?
+" TODO support local snippets
+let g:miniSnip_trigger = '<C-j>'
+
" line diff mode
" TODO: split off into plugin?
function LineDiff()