dblume commited on 2024-04-27 22:19:39
Showing 2 changed files, with 9 additions and 1 deletions.
When only in Alacritty, nvim receives <C-i> as a different command than <Tab>. But in tmux, then they're the same. So have Alacritty map <C-i> to <leader>i so that nvim still has a chance to map <C-i> differently then <Tab>. All this so <C-o>/<C-i> are a pair and so are <Tab>/<S-Tab>.
| ... | ... |
@@ -39,12 +39,14 @@ nnoremap <C-l> <C-w>l |
| 39 | 39 |
" clear search highlights |
| 40 | 40 |
nnoremap <cr> :noh<cr><cr> |
| 41 | 41 |
|
| 42 |
+" tmux in Alacritty doesn't send C-i, so I have Alacritty map C-i to <leader>i |
|
| 43 |
+nnoremap <leader>i <C-i> |
|
| 42 | 44 |
" Use (Shift-)Tab to switch buffers if Tab different than C-i (usually not in tmux). |
| 43 | 45 |
" Test with this: |
| 44 | 46 |
" nvim -Nu NONE +'nno <C-i> :echom "C-i pressed"<cr>' +'nno <tab> :echom "Tab pressed"<cr>' |
| 45 | 47 |
if stridx(expand($TERM), 'xterm') == 0 |
| 46 | 48 |
nnoremap <C-i> <C-i> |
| 47 |
- nnoremap <Tab> :bn<cr> |
|
| 49 |
+ nmap <Tab> :bn<cr> |
|
| 48 | 50 |
endif |
| 49 | 51 |
nnoremap <S-Tab> :bp<cr> |
| 50 | 52 |
|
| 51 | 53 |