vifm / vifm.vim

Vim plugin that allows use of vifm as a file picker
333 stars 19 forks source link

Disable vsplit while bulkrenaming #39

Open HA012 opened 4 years ago

HA012 commented 4 years ago

Hi.

After installing vifm.vim, the behavior of bulkrenaming changed, irrespective of whether I am running vifm within vim: it creates a vertical split with two vim windows containing the names of the selected files.

I wonder if that is the expected behavior and if I can disable the vertical split (my display is rather small, and, so, it makes a real difference to have just one window).

Thanks a lot in advance!

xaizek commented 4 years ago

Hello.

The second window provides original file names for reference, which might be helpful if you change them completely or reorder lines.

You can provide implementation that does nothing by creating ~/.vim/ftplugin/vifm-rename.vifm containing:

" override standard handling of bulk rename to do nothing
let b:did_ftplugin = 1
maxigaz commented 3 years ago

@xaizek I’ve tried your suggestion with Vifm 0.11. If I also have the plugin vim-symlink loaded, I still have one redundant pane. (If I don’t include the option you mentioned, I have two redundant panes.)

Here’s the minimal init.vim I have for reproducing the issue:

" vim:fdm=marker
" Required by many plugins
set nocompatible              " be iMproved
filetype off

" Plugin List
call plug#begin('~/.config/nvim/plugged')

Plug 'vifm/vifm.vim'
" Automatically follow symlinks
Plug 'moll/vim-bbye' " optional dependency
Plug 'aymericbeaumet/vim-symlink'

call plug#end()

" override standard handling of bulk rename to do nothing
let b:did_ftplugin = 1
xaizek commented 3 years ago

Putting it in general configuration doesn't make sense, it should be in ftplugin/vifm-rename.vifm to be meaningful.

maxigaz commented 3 years ago

Putting it in general configuration doesn't make sense, it should be in ftplugin/vifm-rename.vifm to be meaningful.

Oh, I misunderstood, then. But if I take a look at ftplugin/vifm-rename.vifm, it already has that line.

So, what can I do in the latest version to disable all the extra splits?

xaizek commented 3 years ago

There is ftplugin/ in vifm.vim and ftplugin/ outside of plugins. You create the file with that line outside the plugin to suppress loading of the file that is part of the plugin.

maxigaz commented 3 years ago

There is ftplugin/ in vifm.vim and ftplugin/ outside of plugins. You create the file with that line outside the plugin to suppress loading of the file that is part of the plugin.

Oh, I see. So it has to be in ~/.config/nvim/ftplugin. (I haven’t been familiar with the purpose of this folder, once created, but now I know it’s for filetype specific configurations.)

It works now. Thank you for your answers!