P
P
pcdesign2021-03-18 09:28:34
vim
pcdesign, 2021-03-18 09:28:34

How to use global labels in vim with tabs?

For example, I opened several files with tabs

vim -p 1.txt 2.txt 3.txt

Created a global label in the file 1.txt
mA

Switched to the next file gt, entered `Aand vim opened a new file 1.txt for me instead of switching to an already open tab.

I found this answer on SO
https://stackoverflow.com/questions/3297156/vim-ca...

Like, if you want to switch to an existing tab, then write your own function. Answering so for over 10 years. Maybe there are some options or a plugin of some kind?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
planc, 2021-03-18
@pcdesign

why tabs? use buffers, everything works with them
6052f88f2893b779013217.gif
https://github.com/vim-airline/vim-airline#smarter...

let g:airline#extensions#tabline#enabled = 1

" Buffers Navigation
noremap <silent> <C-h> :bprev<CR>
noremap <silent> <C-l> :bnext<CR>
" Close buffer
noremap <Leader>q :bdelete<CR>
noremap <Leader>Q :bwipeout<CR>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question