Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm sorry if my title seems vague. I wasn't sure how to make a succinct title.

I have 2 questions:

1) For tab movement in vim, when I map ctrl+pgup to ctrl+p and ctrl+pgdown to ctrl+n, it works fine moving between tabs but each time I move from a tab to different tabs and come back to said tab, the cursor moves one space to the right (it goes to the next line if it meets the end of the line) The mapping looks like this in my .vimrc file

map ^N ^[[6;5~ 
map ^P ^[[5;5~ 

2) I want to check if the colorscheme is a certain one and if so then do sth. eg I want to do this:

if &colorscheme == desert256
    highlight String ctermfg=217 ctermbg=235
endif

ps: I originally asked this question on stackoverflow but someone told me to ask here so...

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted
  1. You probably have a trailing space at the end of the line. Check for example by searching for:

    \s\+$
    
  2. Try this:

    if g:colors_name == "theme_name"
        <do something>
    endif
    

    note: colorscheme is not a variable and "desert256" must be inside quotes.

share|improve this answer
    
Thanks. It works now. Can you explain what the first thing (\s.\+*$) does (like what each thing means)? –  user26825 Feb 1 '10 at 13:51
    
Sorry, there was an error. The search pattern (\s\+$) searches for at least one (\+) whitespace character (\s) followed by the end of line ($). See :help regexp for more info. –  mrucci Feb 1 '10 at 14:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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