LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   vim slow editing php files in ubuntu (https://www.linuxquestions.org/questions/linux-software-2/vim-slow-editing-php-files-in-ubuntu-642204/)

exodist 05-14-2008 03:18 PM

vim slow editing php files in ubuntu
 
I am a gentoo person, and I have never had a problem with this before. However at work I need to use a company laptop that has ubuntu.

Vim is my editor of choice. When editing perl or other files it runs fine. However when I edit php files it is very slow, scrolling down alone looks jittery and can take a while, even moving the cursor lags!

I am using the same .vimrc files I used on the gentoo system that had no problems. I will attach them below.

I did have some initial problems getting php syntax highlighting, I do not recall how I solved them.

user .vimrc file:
Code:

:set number
:set incsearch
:set hidden
:set tabstop=4
:set expandtab
:set list
:set listchars=tab:>.
:map <F9> :w<cr>:! prove -v -I. -Ilib -It %<CR>
:imap <F9> <ESC>:w<cr>:! prove -v -I. -Ilib -It %<CR>
syntax on
filetype on
set exrc            " execute all found .vimrc files
" :setlocal spell spelllang=en

if has("autocmd")
  " Drupal *.module files.     
  augroup module               
    autocmd BufRead *.module set filetype=php
  augroup END                 
endif

.vimrc file in the directory I am working on.
Code:

:set tabstop=2
:set shiftwidth=2
:set autoindent
:set smartindent

if has("autocmd")
  " Drupal *.module files.
  augroup module
    autocmd BufRead *.module set filetype=php
    autocmd BufRead *.install set filetype=php
    autocmd BufRead *.t set filetype=php
    autocmd BufRead *.info set filetype=php
  augroup END
endif


Gryyphyn 05-15-2008 04:05 PM

Quote:

Originally Posted by exodist (Post 3153278)
I am a gentoo person, and I have never had a problem with this before. However at work I need to use a company laptop that has ubuntu.

Vim is my editor of choice. When editing perl or other files it runs fine. However when I edit php files it is very slow, scrolling down alone looks jittery and can take a while, even moving the cursor lags!

I am using the same .vimrc files I used on the gentoo system that had no problems. I will attach them below.

I did have some initial problems getting php syntax highlighting, I do not recall how I solved them.

I won't claim to be an expert on .vimrc files, but one of the most basic things I would check is that all of the packages for php and vim are updated. If vim isn't higlighting selected areas (I assume you're speaking of open/close symbols such as {}, "" and ()) it may be that the files aren't being interpereted correctly. That's where I'd start, emerge -U ***. Hope that's some kind of helpful.

Gryyphyn, out.

bjagee 05-15-2008 05:49 PM

It seems that you are missing a line that is in all of my vimrc s and the comment would suggest that it is important. Hope this helps.

Code:

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

If not, try adding:
Code:

:set compatible

Worksman 05-17-2008 01:43 PM

This won't help but... I moved to Emacs recently and I'm happy. ;)

Gryyphyn 05-17-2008 01:59 PM

Quote:

Originally Posted by Worksman (Post 3156371)
This won't help but... I moved to Emacs recently and I'm happy. ;)

EMACS isn't a text editor, it's an operating system! ^_^

Worksman 05-17-2008 02:18 PM

There's also MicroEMACS
 
Quote:

Originally Posted by Gryyphyn (Post 3156384)
EMACS isn't a text editor, it's an operating system! ^_^

If that's what it takes! ;)

(there's also MicroEMACS)


All times are GMT -5. The time now is 05:16 AM.