Linked Questions

315 votes
10 answers

What are the differences between the Vim plugin managers?

I have been looking at the different package managers for Vim, and the one I decided to use is vim-plug. However, I have seen others like pathogen and vundle, and I honestly don't know what the ...
ZucchiniZe's user avatar
  • 3,253
6 votes
5 answers

How to generate closing tags for HTML?

I want to do the following: When I insert an HTML tag (which is a sequence of text that starts with <tagname tag_attributes and ends with >), as soon as I press > to insert the > character, ...
Utku's user avatar
  • 305
11 votes
2 answers

How can I insert a character repeatedly until even with next line?

Say I have a comment like this: //This is a comment And I want to make it like this: //***************** //This is a comment //***************** Is there an easy way to insert a character ...
Samuel's user avatar
  • 275
3 votes
5 answers

How to conveniently add ornate headers to source code?

Currently I’m adding source sections manually, e.g.: /******************************************************************************* * entry point *******************...
phg's user avatar
  • 197
8 votes
2 answers

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
4 votes
3 answers

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
4 votes
2 answers

Shortcut / abbreviation to insert text block

I'm trying to do something fairly simple. I'm writing latex and I have all these blocks of code, that I'm trying to comment out (and disregard the words in the word count). So I have to write these ...
Zeth's user avatar
  • 415
1 vote
1 answer

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
1 answer

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
2 answers

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,510
3 votes
3 answers

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
  • 173
0 votes
1 answer

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
0 votes
2 answers

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
-1 votes
1 answer

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
  • 966
2 votes
1 answer

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

15 30 50 per page