Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-11-2008, 04:07 PM
|
#1
|
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Arch
Posts: 1,374
Rep:
|
Strange Vim behavior in ubuntu, # goes to start of line.
The cursor jumps to the start of the line whenever I try to type a comment on an empty line while indented.
new line, go to insert mode, tab over any amount, type '#', and the cursor jumps.
I use the same vimrc fiel in gentoo w/o this problem, so I think it is probably an ubuntu setting.
My vimrc file:
Code:
:set number
:set incsearch
:set hidden
:set tabstop=4
:set shiftwidth=4
:set expandtab
:set list
:set listchars=tab:>.,trail:_
:map <F11> :w<cr>:! provep6 %<CR>
:imap <F11> <ESC>:w<cr>:! provep6 %<CR>
:map <F10> :w<cr>:! perl t/harness --fudge --keep-exit-code %<CR>
:imap <F10> <ESC>:w<cr>:! perl t/harness -v --fudge --keep-exit-code %<CR>
:map <F9> :w<cr>:! prove -v -I. -Ilib -It %<CR>
:imap <F9> <ESC>:w<cr>:! prove -v -I. -Ilib -It %<CR>
:map <F5> :w<cr>:! svn diff %<CR>
:imap <F5> <ESC>:w<cr>:! svn diff %<CR>
:map <F6> :w<cr>:! svn ci %<CR>
:imap <F6> <ESC>:w<cr>:! svn ci %<CR>
:map <F7> :w<cr>:! perldoc %<CR>
:imap <F7> <ESC>:w<cr>:! perldoc %<CR>
:map <delete> xi
:map <space> i
:map <tab> i<tab>
:map <return> a<CR>
:set autoindent
:set smartindent
:set foldmethod=marker
:set wildmenu
:set wildmode=list:longest
:set scrolloff=5
:set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
:set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
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
|
|
|
11-26-2008, 09:59 PM
|
#2
|
Senior Member
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,849
|
Quote:
The cursor jumps to the start of the line whenever I try to type a comment on an empty line while indented.
new line, go to insert mode, tab over any amount, type '#', and the cursor jumps.
I use the same vimrc fiel in gentoo w/o this problem, so I think it is probably an ubuntu setting.
|
You never mentioned what sort of file you were working on (shell script, C code, etc.) but there are language-specific syntax files that are probably different between your Ubuntu and Gentoo systems. (Does this signal a resumption of the "indent style" wars of long ago?) These aren't the same as your .vimrc file.
Look at the vim(1) manpage near the bottom in the FILES section for the location of these files. (On my SuSE system they're in /usr/share/vim/vim71/syntax/.) For what it's worth, us Emacs users have the same trouble; some systems have Emaces that have different ideas how far to indent for, say, Perl scripts. (Drives me crazy sometimes when I move a script from one flavor of UNIX to another.)
I'm not sure if it's possible to move those files from the system that behaves the way you prefer onto the system that has the odd pound-sign behavior. Worth a try but I'd tar up the exiting "syntax" subdirectory in case the files are, for some reason, incompatible. (Then just untar to restore the "syntax" subdirectory.)
Hope this helps...
--
Rick
|
|
|
All times are GMT -5. The time now is 01:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|