0

When I press 0 in Normal mode, the cursor goes to the second column and not the first one. This is not the normal behavior stated in vim's :help 0.

I have tried disabling the remaps to move between wrapped lines from my config (below) and the behavior is the same. Is there any way to change this? Maybe a package it's interfering with the regular behavior but I cannot see which one.

Here is my .vimrc config file

set backspace=indent,eol,start " backspace over everything in insert mode
set nocompatible               " be improved, required
filetype off                   " required

" vim-plug manager
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')

Plug 'lervag/vimtex'
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=1
let g:tex_conceal='abdmg'

Plug 'sirver/ultisnips'
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'

Plug 'itchyny/lightline.vim'

Plug 'sainnhe/gruvbox-material'

Plug 'scrooloose/nerdcommenter'

" List ends here. Plugins become visible to Vim after this call.
call plug#end()


syntax enable
"colorscheme monokai
set number
set ts=4
set expandtab
set autoindent
set wildmenu
set showmatch
set showmatch
set incsearch
set nohlsearch
set linebreak
set ttimeoutlen=0
set laststatus=2
set noshowmode
" Lets you edit another file without saving the current
set hidden

" GUI enhancements
" Set nice colors for 256 terminal
if !has('gui_running')
  set t_Co=256
endif
" Set the airline colorscheme
let g:lightline = {'colorscheme' : 'gruvbox_material'}
" Set colorscheme
set termguicolors
set background=dark
let g:gruvbox_material_background = 'medium'
colorscheme gruvbox-material

" REMAPS
" Inserting a real Tab when pressing Shift + Tab
:inoremap <S-Tab> <C-V>Tab>
" Move between wrapped lines
noremap <silent> k gk
noremap <silent> j gj
noremap <silent> 0 g0 
noremap <silent> $ g$
3
  • 1
    There already is an answer but this is definitely a duplicate of how do I debug a mapping or how do I debug my vimrc.
    – statox
    Nov 20, 2019 at 14:03
  • This is not debugging a mapping
    – plr
    Nov 20, 2019 at 16:17
  • 1
    Well it turns out that the problem came from your noremap <silent> 0 g0 line but anyway it's still a duplicate of how to debug your vimrc :) Also for reference, here is a crosspost to SO
    – statox
    Nov 20, 2019 at 16:21

1 Answer 1

5

Result of map 0 :

  0           * g0<Space>

There is a space after g0, remove it should solve your problem.

Put this to your vimrc to show trailing space, tab and other stuffs:

scriptencoding utf-8
set list listchars=trail:┄,tab:†·,extends:>,precedes:<,nbsp:+
scriptencoding

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.