You are not logged in.

#1 2005-11-23 10:23:31

jonathantan86
Member
Registered: 2004-05-02
Posts: 42

Vim: Suppressing display refresh?

Hello, I'm quite new to Vim but I heard it's a good text editor to use so I'm trying it now. I regularly edit more than one file at a time so I have this in my ~/.vimrc:

set autowrite
noremap <Left> :prev<CR>
noremap <Right> :next<CR>
noremap <Down> :args<CR>

and run Vim by 'vim *.html'.

Last time I tried

noremap <Left> :prev<CR>:args<CR>

but the status bar flickered "index.html" before showing the result of :args i.e. "[index.html] index2.html". How do I prevent this flicker from happen? I suppose that I should prevent it by suppressing the refresh of the display, much like Ctrl-S and Ctrl-Q do in the xterm. I've tried inserting those control codes into the noremap, but they don't work. So is there any way for me to prevent the flicker?

On a side note, for all the Vim users out there, how do you edit multiple files effectively (what method do you use)?

And another question...what is the Vim code for the Menu key (the key next to the right Windows key)?

Thanks.

Offline

#2 2005-11-23 16:21:58

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim: Suppressing display refresh?

I personally use the tabbar.vim plugin from www.vim.org - it's slightly buggy, so minibufexplorer may work better.

Offline

#3 2005-11-23 16:32:40

arooaroo
Member
From: London, UK
Registered: 2005-01-13
Posts: 1,268
Website

Re: Vim: Suppressing display refresh?

phrakture wrote:

I personally use the tabbar.vim plugin from www.vim.org - it's slightly buggy, so minibufexplorer may work better.

Since you posted on your blog about tabbar, I gave it a whirl and installed it. It's ok but I've been doing a lot recently with vim-diff and tabbar gets in the way. I have yet to find how I can disable a plugin interactively.

Phrak, oh Vim God, do you have any clues?

Offline

#4 2005-11-23 16:49:11

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim: Suppressing display refresh?

edit: removed the 'call' from the mappings

arooaroo wrote:

Phrak, oh Vim God, do you have any clues?

And I harken unto you, thine solution:

noremap F5 :TTabBar<CR>
inoremap F5 <esc>:TTabBar<CR>a

now you can use F5 to toggle the tabbar

Tabbar gets screwy in vsplits (which would explain why it doesn't like vimdiff), I've sent an email to the maintainer about it, but he hasn't responded.  I may just patch it myself if it gets too annoying

edit: - it was simply a missing setting from minibufexplorer.vim - g:Tb_SplitToEdge - I added it in, and it can be found here:
http://phraktured.net/tabbar.vim

Offline

#5 2005-11-23 19:02:22

arooaroo
Member
From: London, UK
Registered: 2005-01-13
Posts: 1,268
Website

Re: Vim: Suppressing display refresh?

Good man!

Gold star for Phrak smile

Offline

#6 2005-11-24 00:36:38

jonathantan86
Member
Registered: 2004-05-02
Posts: 42

Re: Vim: Suppressing display refresh?

phrakture wrote:
noremap F5 :TTabBar<CR>
inoremap F5 <esc>:TTabBar<CR>a

I think

inoremap F5 <C-o>:TTabBar<CR>

would be better, but correct me if I'm wrong. If the cursor was at the start of the line, pressing <esc> and then <a> would move the cursor forward one character.

Thanks for the suggestions.

Offline

#7 2005-11-26 19:17:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Vim: Suppressing display refresh?

jonathantan86 wrote:
phrakture wrote:
noremap F5 :TTabBar<CR>
inoremap F5 <esc>:TTabBar<CR>a

I think

inoremap F5 <C-o>:TTabBar<CR>

would be better, but correct me if I'm wrong. If the cursor was at the start of the line, pressing <esc> and then <a> would move the cursor forward one character.

Thanks for the suggestions.

Yeah, you're right - I just copied the bindings from some I have in my vimrc and have not updated to use <c-o>

Offline

Board footer

Powered by FluxBB