1

I'm sorry if the question doesn't make much sense, but I really don't know how else to describe it. I'll do my best to clarify.

Let's say I have a text file containing the words

here is some text

If I were to place the cursor on the 'h' and press and hold x to delete the line (or any number of characters) it copies the last letter of the line over the rest of the text. If I were to delete the entire line by holding x it would then become

xxxxxxxxxxxxxxxxx

but I can't move the cursor past the first column on that line, so the text is properly deleted, it just doesn't display correctly.

This also only happens in tiling window managers. I have tested it in ratpoison, StumpWM, spectrwm, dwm, and i3. I use XFCE4 as my everyday desktop and have been looking into switching to a tiling one, but without vim I can't do that. I have no idea why this is happening either, which makes it that much worse.

.vimrc:
set nocompatible
set number
syntax on
set shiftwidth=2
set softtabstop=2  
set incsearch
set tabstop=2
set expandtab
set smartindent
set ruler
set wildmenu  
set relativenumber
set showcmd
set ignorecase
set smartcase
set laststatus=2
set mat=2
set showmatch
set so=999
scriptencoding utf-8
set enc=utf-8
set fileencoding=utf-8
set matchpairs+=<:>
set matchpairs+=/:/
"Key Bindings
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
inoremap <Up> <Nop>
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>
"vim-latexsuite mappings
filetype plugin on
set grepprg=grep\ -nH\ $* 
let g:tex_flavor='latex'
set iskeyword+=:
20
  • Does the same thing happen when you launch vim with vim -u NONE ? – DJMcMayhem Jul 1 '16 at 15:45
  • No, it doesn't. Thanks, I'll just make an alias in my bashrc. Can you explain why it's doing this though? – 3p1k5auc3 Jul 1 '16 at 15:47
  • 1
    Don't make an alias! That's a bad idea. The problem is something in your .vimrc and launching vim that way means "use no vimrc". Could you post your vimrc? – DJMcMayhem Jul 1 '16 at 15:48
  • 1
    You didn't mention the terminal you're using - try another (and gvim). – VanLaser Jul 1 '16 at 18:38
  • 1
    God, this really should be moved to the chat. Did you configure your terminal in i3? i.e. in ~/.config/i3/config you should have something like: bindsym $mod+Return exec xterm. The default i3 terminal is rather wanky. I have no clue about ratpoison, sorry. – grochmal Jul 1 '16 at 20:57
2

I managed to figure it out guys. I looked at the help entry for the '-u' command and saw there was also a '-u NORC' option which only skipped the vimrc file, not plugins. When I ran it, the problem was gone meaning that the problem had to be in the RC file. The first thing I did was delete the three lines regarding the enconding, but that didn't change anything either. After I looked at ':scriptnames' I saw there was another vimrc being loaded at /etc/vimrc, which was an exact copy of the one in my home directory prior to the edits I made. After commenting out the entire file and removing the comments one by one, I managed to figure out it is the

set enc=utf-8

line that was giving me all the trouble. My guess is that xterm was not being run in utf-8 mode, which was causing problems when trying to display (or more accurately delete) characters. Thanks for you help guys!

2
  • Yeah, xterm will not start in utf-8 mode by default, for historical reasons. Most distros will add LANG=en_GB.utf-8 (or US, or whatever language you might be using) env variable to the x11 session but yours apparently is not doing it. .xinitrc is a good place to force such definitions but not all display manger respect it. There is a rather complete answer on U&L about xterm encodings, it can guide you. – grochmal Jul 2 '16 at 17:24
  • I doubt it, seeing as I'm using Arch. I'll definitely look over the guide, thanks! – 3p1k5auc3 Jul 2 '16 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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