Skip to main content
22 events
when toggle format what by license comment
Jul 21, 2020 at 13:12 comment added VladSavitsky Update: Problem appear for 'let g:netrw_liststyle = 1'. For '3' and default works fine.
Jul 21, 2020 at 13:00 comment added VladSavitsky Thanks for your code. I have a problem. Please help! There are 6 files in folder, I select all of them using 'Shift-v' and 'j'. Then press 't'. I see the same filename twice in the top. Command ':ls' shows: ------------------------------------------------------------------------------------------------------ 2 a "addon_fingerprint.admin.inc" line 0 3 h "[No Name]" line 1 4 a "addon_fingerprint.info" line 0 5 h "[No Name]" line 1 6 %a "addon_fingerprint.install" line 1 7 #h "[No Name]" line 1
Aug 28, 2017 at 11:42 comment added Jair López I got it, see my edit.
Aug 28, 2017 at 11:42 history edited Jair López CC BY-SA 3.0
added 8 characters in body
Aug 28, 2017 at 11:14 comment added Thunderbeef it is equal to tab count, but tabmove needs a number smaller by 1. E.g. if there are 3 tabs, executing tabmove -2 moves tab to the left completely, while tabmove -3 results in invalid argument.
Aug 27, 2017 at 23:43 comment added Jair López When is number higher than tab count?
Aug 27, 2017 at 13:45 comment added Thunderbeef I found that ":tabmove -" . n_lines should actually be ":tabmove -" . ( n_lines - 1 ). Older Vim versions do not report an error if number is higher than tab count, so you can even use tabmove -999, while newer ones, along with Neovim, returns invalid argument. I also use a:firstline instead of a:current_line, which is undefined.
Aug 26, 2017 at 8:33 comment added Jair López Well, I thought the same thing right off the top of my head, but in my Netrw it also works with t out of the box. It also works with "tgTj:+tabmove\<CR>" by pressing either T or t. Maybe you have something in your settings that modifies Netrw's behavior. This Netrw's issue was reported and fixed back in 2011 (see vim_user mailing list archive).
Aug 26, 2017 at 7:32 comment added Thunderbeef Thank you. It works. Though I think this line can be put under else clause for if a:0 > 0.
Aug 26, 2017 at 0:00 comment added Jair López See edit. How about now?
Aug 25, 2017 at 23:52 history edited Jair López CC BY-SA 3.0
Return the cursor to the line where the mapping is triggered
Aug 25, 2017 at 23:27 comment added Thunderbeef I see. Makes sense. My version is netrw v155.
Aug 25, 2017 at 23:13 comment added Jair López Because t is mapped by Netrw. By the way, what version of Netrw is it?
Aug 25, 2017 at 23:04 comment added Thunderbeef Do you know why the same code does not work if I use normal! instead of normal (to avoid mappings expansion)?
Aug 25, 2017 at 22:01 comment added Thunderbeef One extra thing I hope to achieve is to return the cursor to original line if netrw tab is in the focus at the end (e.g. when using Shift+T).
Aug 25, 2017 at 20:09 history edited Jair López CC BY-SA 3.0
Deal with [this old Netrw issue](https://groups.google.com/forum/#!topic/vim_use/JzqEBLx6M6A)
Aug 25, 2017 at 20:08 comment added Jair López @Thunderbeef Yes, You're right. And you could also avoid the line(".") function by adding a:firstline instead (see edit).
Aug 25, 2017 at 17:19 vote accept Thunderbeef
Aug 25, 2017 at 17:17 comment added Thunderbeef I replaced "tgTj:+tabmove\<CR>" with "tgT:" . ( line(".") + i ) . "\<CR>:+tabmove\<CR>". Now it seem to work correctly.
Aug 25, 2017 at 16:54 comment added Thunderbeef I tried to debug this, and with V=15 I found that, for 2 selected files, the following command is executed: "normal tgTj:+tabmove^MtgT:tabmove -2^M3gt". Afterwards, I tried to call it manually. From what I see, the problem is that after first "tgT" the cursor jumps to the top of netrw list (to ".."), and "j" moves it down to ".", which is why rest of the tabs are opened as a copy of current directory.
Aug 25, 2017 at 16:26 comment added Thunderbeef I like the idea, but currently it doesn't work correctly for me. When I select multiple files with Shift-V and press t, I see a correct number of new tabs opened, but only the first tab is a file (first one in the list), while the rest are just copies of netrw tab.
Aug 24, 2017 at 20:33 history answered Jair López CC BY-SA 3.0