3

I have just updated Ubuntu 14.04.5 LTS with Software Updater.

After restarting, apparently something has changed on vim:

Previously, when opening a file with vim, then :q, and then opening it again, it automatically jumped to the last line I was reading.

After this update, when I open some files already saved in the computer, then :q and opening them again, they do jump to the line I was reading a minute ago, but other files do not, and are opened in line 1.

I have not modified anything

My /etc/vim/vimrc has uncommented these lines:

if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

And my ~/.vimrc has only one line:

syntax on

(All the files are normal text files)

EDIT:

The problematic files are in a folder path ~/work/(+1000 characters of folders and subfolders)/file.tex

Files on ~/work/folder1 do not present that problem.

Does the length of the path has something to do?

Answering @EliahKagan questions / suggestions:

Let the ~/work/folder1/test_1.tex be the file where the "jump to the last location" works well.

Let the ~/work/folder2/very-long-path-of-folders-and-subfolders--around_1000 characters_of_folders_and_subfolders/test_2.tex be the file(s) where the "jump to the last location" is not working.

1) Can you add the output of ls -l ~/.viminfo to your question?

david@so1:~$ ls -l ~/.viminfo
-rw------- 1 david david 330206 Jul  9 22:08 /home/david/.viminfo

2) Are the files for which you are not having the problem files that you typically edit by running vim as root?

No, I run them as user:

david@so1:~$ vi  ~/work/folder1/test_1.tex 

3) What is the output of file /etc/alternatives/vim

david@so1:~/work/folder1$ file /etc/alternatives/vim
/etc/alternatives/vim: symbolic link to `/usr/bin/vim.gtk3' 

4) Do you know what packages the Software Updater installed, upgraded, or removed? /var/log/apt/history.log

david@so1:~/work/folder1$ /var/log/apt/history.log
bash: /var/log/apt/history.log: Permission denied

And as root:

david@so1:~/work/folder1$ sudo su
root@so1:/home/david/work/folder1# /var/log/apt/history.log
bash: /var/log/apt/history.log: Permission denied

If I open the /var/log/apt/history.log file:

david@so1:~/work/folder1$ vim /var/log/apt/history.log

I see the following:

Start-Date: 2017-07-03  22:05:01
Commandline: apt-get install pandoc
Install: pandoc:amd64 (1.12.2.1-1build2), pandoc-data:amd64 (1.12.2.1-1build2, automatic)
End-Date: 2017-07-03  22:05:04

Start-Date: 2017-07-09  18:54:46
Commandline: aptdaemon role='role-commit-packages' sender=':1.682'
Install: linux-headers-4.4.0-83-generic:amd64 (4.4.0-83.106~14.04.1), linux-image-4.4.0-83-generic:amd64 (4.4.0-83.106~14.04.1), linux-headers-4.4.0-83:amd64 (4.4.0-83.106~14.04.1), linux-signed-image-4.4.0-83-generic:amd64 (4.4.0-83.106~14.04.1), linux-image-extra-4.4.0-83-generic:amd64 (4.4.0-83.106~14.04.1)

5) I have noticed a very interesting thing:

david@so1:~$ sudo su
[sudo] password for david: 
root@so1:/home/david# cd work/folder1/
root@so1:/home/david/work/folder1# ls
test_1.tex
root@so1:/home/david/work/folder1# vim test_1.tex 

and when opening the file, it is possible to move the cursor where you point and click.

However, when opening the file as user:

root@so1:/home/david/work/folder1# exit
exit
david@so1:~$ cd work/folder1/
david@so1:~/work/folder1$ ls
test_1.tex
david@so1:~/work/folder1$ vi test_1.tex 

the point-and-click cursor does not work (I actually prefer it this way, so I would prefer not to modify this).

If I now open the problematic file as root:

root@so1:/home/david/work/folder2/very-long-path-of-folders-and-subfolders--around_1000_characters_of_folders_and_subfolders# vi test_2.tex

I have the "jump-to-last-position" problem.

6) This is also even more interesting:

If I copy the file:

david@so1:~/work/folder2/very-long-path-of-folders-and-subfolders--around_1000_characters_of_folders_and_subfolders$ cp test_2.tex  ~/Documents/

and then open it:

david@so1:~/Documents$ vi test_2.tex 

Then the "jump-to-last-position" does work....

Where might be the problem then?

Answering @muru questions / suggestions:

If I do:

david@so1:~/work/folder2/very-long-path-of-folders-and-subfolders--around_1000_characters_of_folders_and_subfolders$ vim test_2.tex 

and I do :scriptnames I receive the following:

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim80/debian.vim
  3: ~/.vimrc
  4: /usr/share/vim/vim80/syntax/syntax.vim
  5: /usr/share/vim/vim80/syntax/synload.vim
  6: /usr/share/vim/vim80/syntax/syncolor.vim
  7: /usr/share/vim/vim80/filetype.vim
  8: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
  9: /usr/share/vim/vim80/plugin/gzip.vim
 10: /usr/share/vim/vim80/plugin/logiPat.vim
 11: /usr/share/vim/vim80/plugin/manpager.vim
 12: /usr/share/vim/vim80/plugin/matchparen.vim
 13: /usr/share/vim/vim80/plugin/netrwPlugin.vim
 14: /usr/share/vim/vim80/plugin/rrhelper.vim
 15: /usr/share/vim/vim80/plugin/spellfile.vim
 16: /usr/share/vim/vim80/plugin/tarPlugin.vim
 17: /usr/share/vim/vim80/plugin/tohtml.vim
 18: /usr/share/vim/vim80/plugin/vimballPlugin.vim
 19: /usr/share/vim/vim80/plugin/zipPlugin.vim
 20: /usr/share/vim/vim80/syntax/tex.vim

The result of :autocmd is: http://paste.ubuntu.com/25060281/

(Since the output of that command is very long, I could not post it directly here)

New update:

When running ipython on this problematic folder, I get this error message:

david@so1:~/work/folder2/very-long-path-of-folders-and-subfolders--around_1000_characters_of_folders_and_subfolders$ ipython    
[TerminalIPythonApp] ERROR | Current working directory doesn't exist.

as opposed to the expected result in any other folder:

david@so1:~/home/david/work/folder1$ ipython
Python 2.7.11 |Anaconda 4.0.0 (64-bit)| (default, Dec  6 2015, 18:08:32) 
Type "copyright", "credits" or "license" for more information.

IPython 4.1.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:

So, something must be happening in this problematic folder

Dave
  • 202

0 Answers0