buffer manage and tab remap