We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [snippets]

Questions about the usage of snippets within Vim.

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

How to change the docstring format of the snippets by Ultisnips?

Using the snippets plugin I'm able to get: class MyClasnippets(object): """Docstring for MyClasnippets. """ def __init__(self): """TODO: to be defined. """ from just typing class. ...
0
votes
1answer
46 views

Ultisnips Sinppets in current scope on blank line

Background I'm using UltiSnips in conjunction with some autocomplete plugins. I have this line controlling the behavior of enter inoremap <expr> <cr> \ !empty(UltiSnips#...
0
votes
1answer
36 views

localleader is not obeyed

for my fortran code, I have defined: au FileType fortran let maplocalleader = "`" # i have tried \` as well. For fortran filetype in vim, :echo maplocalleader is showing ` as expected. But, then,...
1
vote
1answer
92 views

How to capture the name of a function on ultisnips plugin?

I have created a guard snippet (ultisnips) in order to add on my existing functions: snippet guard "add guard to functions" b if !exists('*${1:func_name}') ${VISUAL} endif ${0:jump here <C-j>...
2
votes
1answer
46 views

Reuse value in snippet

I recently switched to using neovim + deoplete + neosnippets and I'm trying to get a snippet to do a thing that I'm pretty sure that I've been able to do in UltiSnips. In a template I'd like to be ...
0
votes
1answer
51 views

inoremap inserts unwanted tabs

I recently made myself custom insert mode keybindings to type faster in LaTeX. However, When I use them, Vim adds tabs that weren't part of the original keybinding. Example: Here is my inoremap: ...
-1
votes
1answer
105 views

Insert C/C++ loops and statements templates automatically [closed]

How do I insert C/C++-type loops and statements templates automatically in Vim?
3
votes
2answers
348 views

Easiest way to insert LaTeX matrix?

Recently I found myself in a situation that need to type in quite a number of matrices to LaTeX by hand, so I was wondering if there are some tools that can help me to save some keystrokes. The ...
0
votes
1answer
194 views

Trigger reindentation after snippet has expanded to word in 'indentkeys'

The ftplugin vimtex provides the file indent/tex.vim with following line setlocal indentkeys+=[,(,{,),},],\&,=item,=else,=fi 'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e") ...
3
votes
0answers
45 views

Disable a specific set of snippets in SnipMate

Is it possible to tell SnipMate to ignore a specific set of snippets? Let's take vim-snippets/snippets/javascript/javascript-jquery.snippets as an example. When editing a JavaScript file, all snippet ...
1
vote
1answer
24 views

Fields in templates without resorting to commented-out lists (aka are drop-down options possible?)

I do a lot of work in plain TeX and XeTeX, editing the documents in vim, and have a variety of templates which I use to make the process more efficient. As you might expect, these use quite a lot of ...
2
votes
0answers
141 views

Comprehesive support for graphviz (linting/autocompletion/snippets)

Vim comes with some support (syntax highlighting) out of the box for the DOT language (graphviz) In addition, I found the plugin: https://github.com/wannesm/wmgraphviz.vim, which provides integrated ...
0
votes
1answer
227 views

Skip over closing html tag?

Plugins such as snipMate, emmet and many others allow me to quickly insert opening and closing html tags. For example by typing span and hitting the correct key (TAB for snipMate, <C-y>, for ...
1
vote
1answer
692 views

Execute normal is inserting “<tab>” instead of hitting tab key

I am trying to make a function that creates a new line and hits the tab key (aka 2 spaces / 4 spaces; what ever is set). I can do it easily with a keybinding: :inoremap <leader>ind <esc>...
1
vote
1answer
214 views

<Plug> was printed to the buffer instead of execute

I am using neovim with deoplete.nvim and neosnippet.vim. I am trying to make TAB key do both navigating through the popup menu and expand snippets when it's able to. Here is my config. " <TAB>: ...
0
votes
1answer
480 views

Expanding snippet in line using neosnippet

I'm using neosnippet to define and expand my snippets. I have the following snippet defined for javascript development snippet fn abbr () => {} (${1}) => {${2}} I can insert this snippet ...
1
vote
0answers
172 views

How can I uninstall a plugin I erroneously installed multiple times?

I had difficulties in using UltiSnips, so I fear I installed it multiple times with different plugin managers. At the moment tree -d in .vim folder gives the following result, showing that I ...
3
votes
1answer
876 views

auto insert text when creating a new file [duplicate]

Is there a way to auto insert text in vim when a new file is created? Maybe there is a plugin for it? Here is what I'm talking about: I work a lot with C/C++ and Python. Very often I need to create ....
0
votes
1answer
121 views

Header from Templates not appearing in newly created C source files

First, I did: % vim ~/.vim/cvim/c-support/templates/Templates From there, I changed my User Macros to their desired values. I then saved my changes. In Vim, I went to Normal Mode and entered: :!...
0
votes
1answer
117 views

Neosnippet expands to “options head”

I am creating my firsts neosnippet-snippets in c.snip, it looks like that: snippet head options head //////////////////////////////////////////////////////////////////////////////// // ${1:...
25
votes
4answers
15k views

What is the difference between the vim snippets plugins?

There is a great number of snippets plugins for vim: ultisnips, snipmate, xptemplate, neosnippet and a lot more. They all have pros and cons and more or less dependencies. So far I've been using ...
3
votes
1answer
151 views

Good method for saving and inserting commonly used snippets

I often need to insert the same text into a file. My approach has been to put the text into my vimrc as a variable: let map='<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">' And ...