How to enable syntax highlighting and syntax indentation in msysgit vim?

Uses mysgit for Windows, but the mysgit vi editor cannot perform syntax highlighting and padding for my source code (html / python / css .... files)

I managed to copy the syntax folder from my initial installation of GVIM7.2 to the Git Vim72 installation folder, now I see that the syntax highlighting is active.

What cannot be done is indentation. I tried to copy the ftplugin folder from my GVim7.2 installation to the Git Vim72 folder, but still not back down.

I tried to set the filetype plugin's formatting option to in the vimrc file, but still nothing works?

Any help on how to enable syntax indentation?

Gough

+4
source share
3 answers

If you want to configure the msysgit vi editor, you will have to edit the configuration files in the msysgit installation folder. I installed msysgit on C:\Program Files\Git , so my vimrc file is in the path C:\Program Files\Git\share\vim .

The plugin and syntax files were located in \share\vim\vim72 . I could only find syntax files for C and C ++. You may need to get syntax files for other languages ​​elsewhere. ( This site has syntax files for a large number of languages.)

For indentation, make sure that the file \share\vim\vimrc has the following line:

  set ai
+7
source

You may need to verify that the file type definition is correct. To find out which file vim you are encountering, type :set filetype without any other parameters. Vim may not know how to reject your file type, or you may have to download the filetype plugin and put it in the right folder (I don't know where to get this plugin).

Did you mean msysgit instead of mysgit ?

0
source

Nithin's answer worked for me, although my vimrc file is in the path C:\Program Files (x84)\Git\bin\vim instead of ..\share\vim .

I need to highlight Java syntax, so I copied java.vim from /usr/share/vim/vim70/syntax/java.vim from my Linux server. It turned out that java.vim using html.vim (no problem, I copied html.vim ).

To work on windows in java.vim you need to change the following line:

 syntax include @javaHtml <sfile>:p:h/html.vim 

to

 syntax include @javaHtml <sfile>:p:h\html.vim 

I also found out that \share\vim\vimrc pretty much has all the important settings for programmers, including:

set syntax = on
set background = dark
set ai

I hope this helps anyone who has the same problem.

0
source

Source: https://habr.com/ru/post/1307123/


All Articles