New answers tagged

0

Per :h FileType the FileType event doesn't do anything unless 'filetype' is set. The standard way to set that is to have this in your vimrc/init.vim: :filetype on This "enables file type detection". You don't have anything in your init.vim so that's surely why this stuff isn't working "out of the box". Your Session.vim file, which contains a bunch of ...


0

Thunderbeef explained in the comments that this is caused by the difference in the way normal and command-line commands show output. With a command-line command, you see the whole output, but with a normal command, you only see the last line. You can work around this limitation by displaying all the desired output from your call to input(), which allows you ...


2

Try this: autocmd BufWritePre * %s/\s\+$//e if you want to do this for BufReadPre as well you can https://stackoverflow.com/questions/356126/how-can-you-automatically-remove-trailing-whitespace-in-vim


2

As a first resource on files, buffers, tabs, etc., I recommend this QA and the many links to be found there. As for autocommands, they are indeed an advanced topic, so having a good grasp of the fundamentals is crucial. In particular, when you start editing a file in a new tab (such as via :tabedit), either BufRead or BufNewFile should fire (Learn Vimscript ...


3

According to :help drag-n-drop and :help :drop, it doesn't seem like this behavior is change-able. The help also says If Vim happens to be editing a command line, the names of the dropped files and directories will be inserted at the cursor. This allows you to use these names with any Ex command. Special characters (space, tab, double quote and '|'; ...


Top 50 recent answers are included