Browse Source

Added nvim-snippy for snippets

master
Julio Biason 3 years ago
parent
commit
375d4a41a2
  1. 3
      .gitmodules
  2. 13
      nvim/init.lua
  3. 1
      nvim/pack/plugins/start/nvim-snippy
  4. 16
      nvim/snippets/markdown.snippets
  5. 16
      nvim/snippets/rust.snippets

3
.gitmodules vendored

@ -16,3 +16,6 @@
[submodule "nvim/pack/syntaxes/start/vim-python-pep8-indent"] [submodule "nvim/pack/syntaxes/start/vim-python-pep8-indent"]
path = nvim/pack/syntaxes/start/vim-python-pep8-indent path = nvim/pack/syntaxes/start/vim-python-pep8-indent
url = https://github.com/Vimjas/vim-python-pep8-indent url = https://github.com/Vimjas/vim-python-pep8-indent
[submodule "nvim/pack/plugins/start/nvim-snippy"]
path = nvim/pack/plugins/start/nvim-snippy
url = https://github.com/dcampos/nvim-snippy.git

13
nvim/init.lua

@ -120,3 +120,16 @@ require 'lualine'.setup {
}, },
extensions = {} extensions = {}
} }
-- nvim-snippy
require('snippy').setup({
mappings = {
is = {
['<Tab>'] = 'expand_or_advance',
['<S-Tab>'] = 'previous',
},
nx = {
['<leader>x'] = 'cut_text',
},
},
})

1
nvim/pack/plugins/start/nvim-snippy

@ -0,0 +1 @@
Subproject commit 685db3a3c400a2830457d5d326f00fa4b4cf2e7b

16
nvim/snippets/markdown.snippets

@ -0,0 +1,16 @@
snippet header
+++
title = "$1"
date = `strftime('%Y-%m-%d')`
[taxonomies]
tags = ["$2"]
[extra.changelog]
`strftime('%Y-%m-%d')` = "Initial version"
+++
$0
snippet date
`strftime('%Y-%m-%d')`

16
nvim/snippets/rust.snippets

@ -0,0 +1,16 @@
snippet match
match ${1:condition} {
${2:arm} => $0
}
snippet envinit
env_logger::init();
$0
snippet VERSION
const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION");
$0
snippet start
log::info!("Starting up ${1:name} v{}...", VERSION.unwrap_or("???");
$0
Loading…
Cancel
Save