开发者

Vim PHP Tab jumping to next blank line after statement

开发者 https://www.devze.com 2023-03-13 01:05 出处:网络
I\'m having an odd problem with editing PHP files with macvim. When I press tab, instead of giving me a tab or series of spaces, it instead jumps down to a blank line after any series of statements. I

I'm having an odd problem with editing PHP files with macvim. When I press tab, instead of giving me a tab or series of spaces, it instead jumps down to a blank line after any series of statements. It will do this through the entire file until it reaches the end. For example, in the following snippet, if I have my cursor in front of "$products" and pressed tab, no tab or space would be inserted, and the cursor would land on the empty line below it:

  public function index()
  {
     // get a distinct list of product names
     $products = $this->license_model->get_all_product_names();

     // get all records and fields from the view
     $records = $this->license_model->get_all_records();开发者_如何学Python

     // assign objects to the array to pass to the view
     $data = array(
        'products' => $products,
        'records' => $records
     );

     // load the view
     $this->load->view('home.php', $data);
  }

If I was to try and tab the comment above the $data array, the cursor would move to the line just above the next comment "load the view".

Using the vim command >> will indent the line as expected, however. The problem only seems to be with *.php files. Tabbing in say a *.java file works as normal.

Any ideas how I can fix this?

Thanks


Sounds like something has mapped <Tab> or <C-i> in insert mode to something. See what maps are defined for <Tab> by issuing:

:verbose map <Tab>

This should output any mappings that are currently set up and which file set these mappings (so you may remove them).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号