Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Migrate php-mode configuration to web-mode

General Tech Bugs & Fixes

Max. 2000 characters
Tuteehub
Replies

usr_profile.png

User

( 6 months ago )

 

I currently have my php-mode configuration like so:

(require 'php-mode)
(add-hook 'php-mode-hook
          (lambda ()
             (require 'ac-php-company)
             (company-mode t)
             (setq c-syntactic-indentation nil)
             (setq indent-tabs-mode t)
             (setq tab-width 4)
             (setq c-basic-indent 4)
             (c-set-offset 'topmost-intro 4)
             (c-set-offset 'cpp-macro -4)
             (add-to-list 'company-backends 'company-ac-php-backend)))

I would like to use this configuration to start using web-mode and have php in web-mode use this configuration, however I can't seem to figure out how to configure php in web-mode.

How would I use this configuration for php in web-mode?

EDIT

I should probably clarify a little better what I am trying to achieve for the PHP portion of web-mode.

One thing I do in php-mode is have it configured to indent my PHP code inside the <?php block like so:

<?php

    echo "hello world";
    do_some_func();

This is one of the main things I would like to do in web-mode, along with use company as my auto-complete engine.

Would anyone be able to provide me with examples or point me in the direction of solving this problem?

EDIT 2

Thanks to the comment by phils I was able to get my indentation set up correctly, however I still can't figure out how to set up company php in web mode, and googling doesn't seem to provide me with any answers. Any help would be much appreciated.

Sorry for not being as clear originally.

what's your interest


forum_ban8_5d8c5fd7cf6f7.gif