Linked Questions

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 &...
NeoZoom.lua's user avatar
  • 1,462
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 ...
Diesel's user avatar
  • 103
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 ...
Alexandru Dinu's user avatar
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 """ """ &...
Nimu Nobdy's user avatar
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 ...
Samselvaprabu's user avatar
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 ...
mister nobody's user avatar
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 ...
mle0312's user avatar
  • 341
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 ...
fresh's user avatar
  • 163
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 ...
D. Ben Knoble's user avatar
  • 26.2k
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: ...
Benjamin Chausse's user avatar
-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?
Geremia's user avatar
  • 956
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:...
lucian's user avatar
  • 153
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 ...
Jose V's user avatar
  • 121
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 ...
Philip Kirkbride's user avatar
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. ...
Addem's user avatar
  • 141

15 30 50 per page