Linked Questions
20 questions linked to/from What is the difference between the vim snippets plugins?
0
votes
2
answers
786
views
How to get the filename where the line of vimscript/lua is in?
As title. Say I have a line to create an augroup located in file git.lua. What I want to achieve is that that line will always create an augroup named git.lua without hard-coding it by the string &...
0
votes
1
answer
77
views
List of Acronyms / Abbreviations for a paper
What is the best way in Vim to handle abbreviations for a paper? For example:
When working with Artificial Intelligence (AI) there must be .... and furthermore AI enables you to....
And later in the ...
2
votes
1
answer
147
views
Inserting abbreviation from file
First, I apologize if this is a trivial question.
I have the following file (main.ab) defining a Python snippet:
def main(args):
...
if __name__ == '__main__':
args = ...
main(args)
And ...
3
votes
1
answer
494
views
iabbrev with <CR> and <Space>
I use vim to develop with Python and it works fine. However I want to improve the behavior for documenting my code. For instance I wrote this in vimrc :
:iabbrev """ """ &...
0
votes
0
answers
241
views
Is there any snippet generator available for vim?
In vscode/atom/sublime there is a snippet generator. https://snippet-generator.app/
Likewise any snippet generator or plugin to generate present in vim? Can I store snippet in my project github and ...
4
votes
3
answers
3k
views
create own snippets
I'm rather new to vim. And I don't like much to install many packages.
I use html, javascript and react.js, and i would like to create some simple way to type and then have the correct snippet on the ...
1
vote
1
answer
2k
views
Code snippet completion for vim in C++
I have YouCompleteMe installed; however that only complete certain words or phrases. I am looking for something similar in VSCode or Emacs' Yasnippet. For example, if I type if, then press Tab, then ...
3
votes
3
answers
237
views
Automatic completion in Latex environments
I am trying to implement a way to get automatic completion when typing Latex environments. Consider the following situation:
\begin{|}
\end{}
where | stands for the position of the cursor. Then I ...
3
votes
1
answer
36
views
How can I make $ in LaTeX insert \( and \) automatically? [duplicate]
I'm writing a lot of LaTeX recently, and am used to hitting the $ key for inline math, but have heard that \( and \) is better (apparently it confuses vim less, especially with $$, which I'm also not ...
0
votes
1
answer
159
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
1
answer
365
views
Insert C/C++ loops and statements templates automatically [closed]
How do I insert C/C++-type loops and statements templates automatically in Vim?
0
votes
1
answer
551
views
Shortcuts for math and quotes with vim-latex & insert space after fullstop
I have recently managed to install and configure vim-latex and started using it. I used to use TexStudio for writing my file and in it I used to have several setting that were tailored for my workflow:...
1
vote
0
answers
115
views
Macros behaving unexpectedly (not executing commands)
I have the following macro
let @f='ivoid function (void param^[o {^M^M^[3kwi'
where ^[ represents ESC and ^M new line.
for some reason it does not execute anything after the 3k, I tried replacing ...
8
votes
2
answers
4k
views
Insert code snippets?
I'm creating a folder with common code snippets I use.
I want to create a quick command in vim to insert them, for example something like:
:snippet codeblock1
Ideally it would be a single command ...
0
votes
2
answers
308
views
How to insert tabs in key remapping?
I wrote the following in my .vimrc file in order to automate getting an HTML file set up.
:imap html<tab>
\<html><enter>
\<tab><head><enter>
....
and so on. ...