Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes
Accepted

How to make Vim start at the end of a template?

If you associate a template to a file extension using the following autocmd: autocmd! BufNewFile *.foo 0r ~/vimfiles/template/template.foo The autocmd import the ~/vimfiles/template/template.foo when ...
Vivian De Smedt's user avatar
2 votes

Set key to toggle full screen in MacVim

MacVim is not supposed to start in full screen by default. You can uncheck the "Use native full screen mode" option to prevent MacVim to take up its own desktop when going full screen. Vim ...
romainl's user avatar
  • 41.1k
2 votes
Accepted

Change what Vim does by default when no files are given

Here is the test used by Startify: fun! Start() " Don't run if: we have commandline arguments, we don't have an empty " buffer, if we've not invoked as vim or gvim, or if we'e start ...
Vivian De Smedt's user avatar
1 vote

Neovim is looking for configs in current directory, how do I fix this?

The error was that my lazy.lua was in my C:\Users\{username}\AppData\Local\nvim\lua folder. However, you need to create a config folder inside your lua folder and put lazy.lua inside that config ...
Hello's user avatar
  • 31
1 vote
Accepted

How to open the last modified file at startup?

To open the last file edited you can do: vim -c "'0" Or after starting Vim hit '0. More information with :help viminfo-file-marks But if you are interested by the MRU feature. There are two ...
Vivian De Smedt's user avatar
1 vote
Accepted

How do I position cursor according to filetype (gitcommit)?

Even though Vim saves the last known cursor position into viminfo file upon exit, it doesn't restore it by default. Instead, there is a piece of VimScript code at :h restore-cursor (also in defaults....
Matt's user avatar
  • 20.8k

Only top scored, non community-wiki answers of a minimum length are eligible