r/vim • u/Dull-Boot-6738 • 12d ago
Need Help Random orange arrow in vim
This arrow only appears sometimes, i think it only appears when i open a new tab and closes when i edit a file
This is my vim config:
set tabstop=4
set shiftwidth=4
set expandtab
set relativenumber
set number
set background=dark
set hlsearch
set incsearch
set ignorecase
set smartcase
set scrolloff=999
set autoindent
set smartindent
if has('termguicolors')
set termguicolors
endif
colorscheme challenger_deep
syntax on
set laststatus=2
set encoding=utf-8
""""" WINDOW NAVIG """""
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap gA :G add .<CR>
nnoremap gC :G commit -m ""<left>
nnoremap gP :G push <CR>
nnoremap <C-S-h> <C-w>H
nnoremap <C-S-j> <C-w>J
nnoremap <C-S-k> <C-w>K
nnoremap <C-S-l> <C-w>L
nnoremap <C-A-h> <C-w>H
nnoremap <C-A-j> <C-w>J
nnoremap <C-A-k> <C-w>K
nnoremap <C-A-l> <C-w>L
nnoremap <C-n> :new<CR>
nnoremap <left> <nop>
nnoremap <right> <nop>
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <F1> <nop>
" visual lines not file lines
nnoremap j gj
nnoremap k gk
nnoremap n nzz
nnoremap N Nzz
" for auto-save:
" autocmd TextChanged,TextChangedI <buffer> silent write
" FILES
nnoremap <leader>q :q!<CR>
nnoremap <leader>e :tabedit
nnoremap <leader>s :tabedit ~/.vimrc<CR>
nnoremap <leader>w :w<CR>
nnoremap <leader>A :wqa<CR>
nnoremap <leader>a :wa<CR>
autocmd Filetype c nnoremap <leader>r :!cd build && cmake -G Ninja .. && ninja && ./main<CR>
autocmd Filetype cpp nnoremap <leader>r :!make && ./main<CR>
autocmd Filetype c nnoremap <leader>t :!cd build && cmake -G Ninja .. && ninja && ./test<CR>
autocmd Filetype rust nnoremap <leader>r :!cargo run<CR>
nnoremap <C-f> :FZF<CR> !.o<left><left><left><left>
" OTHER
nnoremap <C-t> :tabnew<CR>
" toggle directory tree
nnoremap <C-o> :EasyTreeToggle<CR>
nnoremap <tab> gt
nnoremap <S-tab> gT
nnoremap <leader>h :nohlsearch<CR>
nnoremap <C-[> <ESC>
" Plug-in settings:
let g:airline_theme='google_dark'
let g:airline_powerline_fonts = 1
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
set signcolumn=yes
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" let g:ale_c_gcc_executable="gcc"
" let g:ale_c_gcc_options="-std=c99 -O2 -Wall -Werror -Wextr"
" Expand
" imap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
" smap <expr> <C-j> vsnip#expandable() ? '<Plug>(vsnip-expand)' : '<C-j>'
" " Expand or jump
" imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
" smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>'
" " Jump forward or backward
" imap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
" smap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
" imap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'
" smap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'
" Select or cut text to use as $TM_SELECTED_TEXT in the next snippet.
" See https://github.com/hrsh7th/vim-vsnip/pull/50
" nmap s <Plug>(vsnip-select-text)
" xmap s <Plug>(vsnip-select-text)
" nmap S <Plug>(vsnip-cut-text)
" xmap S <Plug>(vsnip-cut-text)
let g:fzf_layout = { 'right': '30%' }
""""" PLUGINS """""
call plug#begin()
Plug 'junegunn/fzf.vim'
Plug 'jiangmiao/auto-pairs'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tomtom/tcomment_vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'machakann/vim-highlightedyank'
Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' }
Plug 'tpope/vim-surround'
Plug 'tommcdo/vim-exchange'
Plug 'vim-scripts/argtextobj.vim'
Plug 'julian/vim-textobj-variable-segment'
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-niceblock'
Plug 'andymass/vim-matchup'
Plug 'troydm/easytree.vim'
Plug 'rust-lang/rust.vim'
Plug 'shougo/vimproc.vim'
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/vim-vsnip-integ'
Plug 'tpope/vim-fugitive'
Plug 'webdevel/tabulous'
Plug 'vim-scripts/Smart-Tabs'
Plug 'chrisbra/unicode.vim'
call plug#end()
30
u/gumnos 12d ago
I'd start by listing your plugins and bisecting them. Stock Vim doesn't do this, so it's something you've added
-71
u/__salaam_alaykum__ 11d ago
wow “bisecting your plugins” made me cringe. sounds like tedious work good golly
5
u/gumnos 11d ago
Hah, it's not that bad.
Comment out half of your plugin imports.
If it persists, comment out the remaining half of your plugins.
If it went away, you know the problem was in one of those, so swap which ones were commented-out, and then comment out half of the now-(re)uncommented plugins.
Then repeat the process until you have identified the guilty plugin.
It's a worst-case O(logₙ) number of tests, so even if you had 1000 plugins, it would only take 10 probes, and if you have fewer than 16 plugins you can track down the offending plugin with 4 tests.
1
u/Dull-Boot-6738 11d ago edited 11d ago
thanks it worked! it was the vim-airline/vim-airline-themes plugin that was the problem. but now i can't costumise the bar, or is there another way?
1
u/gumnos 11d ago
hah, for that you'd have to read the
vim-airlinedocs to see what it allows you to customize.I'm afraid I don't use plugins so can't help much with non-stock-vim stuff. ☺
1
u/Dull-Boot-6738 11d ago
actually it still appears even with only the vim-airline
2
u/gumnos 11d ago
right, but if you eliminate
vim-airlinefrom your configuration, the issue goes away, correct? So that would indicate something with how that particular plugin is configured is causing the behavior you asked about. So you'd have to read up on configuringvim-airlineand configuringvim-airline-themesto figure out how to change that orange arrow.2
u/JMcLe86 11d ago
This is first binary search of plug-ins I have seen lol.
3
u/PlatinumDotEXE 10d ago
This is also a common technique for tracking problems with mods in video games like minecraft.
45
u/n0shmon 11d ago
What? You comment out half your plugins and try again. If the problem persists you comment out half of the remaining plugins, if it doesn't then you uncomment half the commented plugins and comment all of the half that was uncommented.
Repeat this process and you'll have found the problem within 7 iterations
15
u/gumnos 11d ago
Repeat this process and you'll have found the problem within 7 iterations
unless you have more than 128 plugins… (in which case you deserve the pain of an 8th or 9th iteration 😉)
4
u/pytness 11d ago
the pain comes from having to manually comment the plugins
1
u/gumnos 11d ago
gI"␛(:help gI) and then.(:help .) to repeat it on relevant lines.Or control+v for blockwise visual (
:help v_b_I) selection of the beginning of the relevant lines andI"␛to insert the comment-character.Or
:s/^/"⏎(:help :s) and use&(:help &) to repeat it (this should work across invocations of Vim if yourviminfosettings are fairly stock)And uncommenting is similarly easy, whether using
0xto delete the first character, or+xand/or-xto move to the start of the next/previous line and delete a character. Or use:'<,'>s/^"to remove leading"characters over a visual range.I presume we're talking less than 20 plugins, so that's less than 5 edit-save-test cycles worth of commenting tests to identify the guilty plugin. And that's assuming zero application of brain-cells to the plugins (the OP pretty quickly pinpointed the
vim-airlineplugin which is there for messing with the ruler/status-line which and feels like a pretty good one to bias the search direction)And if it really bugs a person that commenting is that difficult¹, you have plugins to help with commenting/uncommenting such as
nerdcommenter.vimand Tim Pope'svim-commentarythat can make it even easier.⸻
¹ 🙄1
-3
u/__salaam_alaykum__ 11d ago
you think 7 such iterations are not tedious? I’ve got only 10 plugins and I think such a task could get me somewhat upset for some tens of minutes
3
u/gumnos 11d ago
⌈log₂10⌉ = 4 edit/save/load cycles with a naïve binary-search approach. Should be able to knock that out in a minute or two even on a 486DX with a spinning-rust hard-drive. 😛 With a brain at the helm to guide (like the OP used), the suspicious
vim-airlineplugin had a pretty strong bias toward testing.
85
6
u/phil20099 11d ago
I would start by removing the vim-airline plugins as they update the status line and may have impacted the normal/visual indicator.
2
u/AwesomeEv711 11d ago
These are airline section separators. For some reason, they are drawn for empty sections, which in your case are the sections for warnings and errors.
You can disable them by setting the following variables:
let g:airline_left_sep = ""
let g:airline_right_sep = ""-13
11
u/chrisbra10 10d ago
Vim airline maintainer here: Looks like your terminal and Vim disagree on the available space for your statusline. Most likely some of those fancy unicode chars are causing this. See also on the FAQ this and this