Syntax highlight works for gvim but not for terminal vim

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am new to vim and I want to code in vim. I have installed the necessary plugins for syntax highlighting JSX in TypeScript and everything works fine for GUI version of Vim but not for terminal-based Vim. Please help me figure out the issue. Below are the plugins that I am using for syntax highlighting:



  1. For TypeScript: https://github.com/leafgarland/typescript-vim

  2. For JSX in TypeScript: https://github.com/peitalin/vim-jsx-typescript

I am using Vundle to install plugins. I tried to make some customizations in the colors as given in the README section of the second plugin mentioned above. According to that when I used the hi command, it did not have any effect on terminal-based Vim but it worked perfectly fine on GUI based Vim. I am trying to setup syntax highlight for JSX in TypeScript for React Development and I have installed above plugins to achieve that. Below is the content of my .vimrc file.



set nocompatible " choose no compatibility with legacy vi syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
set t_Co=256
filetype plugin indent on " load file type plugins + indentation

"" monkai theme
syntax enable
colorscheme monokai

set nu
set guifont=monacob bold 9

highlight ColorColumn ctermbg=gray
set colorcolumn=80

"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optinal)
set backspace=indent,eol,start " backspace through everything in insert mode

"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter

" set the runtime path to include Vundle and initialize
set rtp +=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive.git'
Plugin 'tpope/vim-rails'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" autocmd FileType typescript.tsx setlocal commentstring=/* %s */
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
autocmd BufNewFile,BufRead *.ts,*.js set filetype=typescript.jsx

" dark red
hi tsxTagName guifg=#E06C75

" orange
hi tsxCloseString guifg=#F99575
hi tsxCloseTag guifg=#F99575
hi tsxAttributeBraces guifg=#F99575
hi tsxEqual guifg=#F99575

" yellow
hi tsxAttrib guifg=#F8BD7F cterm=italic


Below is the screenshot of the JSX syntax highlight in GUI version of Vim
enter image description here



Below is the screenshot of the JSX syntax highlight in terminal version Vim
enter image description here



As we can see in the .vimrc and screenshots, the JSX tag colors etc.. declared at the end of the file are working fine for Gvim but not working for terminal-based vim. Please help me understand what wrong I am doing here.










share|improve this question









New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
    – statox♦
    35 mins ago















up vote
1
down vote

favorite












I am new to vim and I want to code in vim. I have installed the necessary plugins for syntax highlighting JSX in TypeScript and everything works fine for GUI version of Vim but not for terminal-based Vim. Please help me figure out the issue. Below are the plugins that I am using for syntax highlighting:



  1. For TypeScript: https://github.com/leafgarland/typescript-vim

  2. For JSX in TypeScript: https://github.com/peitalin/vim-jsx-typescript

I am using Vundle to install plugins. I tried to make some customizations in the colors as given in the README section of the second plugin mentioned above. According to that when I used the hi command, it did not have any effect on terminal-based Vim but it worked perfectly fine on GUI based Vim. I am trying to setup syntax highlight for JSX in TypeScript for React Development and I have installed above plugins to achieve that. Below is the content of my .vimrc file.



set nocompatible " choose no compatibility with legacy vi syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
set t_Co=256
filetype plugin indent on " load file type plugins + indentation

"" monkai theme
syntax enable
colorscheme monokai

set nu
set guifont=monacob bold 9

highlight ColorColumn ctermbg=gray
set colorcolumn=80

"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optinal)
set backspace=indent,eol,start " backspace through everything in insert mode

"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter

" set the runtime path to include Vundle and initialize
set rtp +=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive.git'
Plugin 'tpope/vim-rails'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" autocmd FileType typescript.tsx setlocal commentstring=/* %s */
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
autocmd BufNewFile,BufRead *.ts,*.js set filetype=typescript.jsx

" dark red
hi tsxTagName guifg=#E06C75

" orange
hi tsxCloseString guifg=#F99575
hi tsxCloseTag guifg=#F99575
hi tsxAttributeBraces guifg=#F99575
hi tsxEqual guifg=#F99575

" yellow
hi tsxAttrib guifg=#F8BD7F cterm=italic


Below is the screenshot of the JSX syntax highlight in GUI version of Vim
enter image description here



Below is the screenshot of the JSX syntax highlight in terminal version Vim
enter image description here



As we can see in the .vimrc and screenshots, the JSX tag colors etc.. declared at the end of the file are working fine for Gvim but not working for terminal-based vim. Please help me understand what wrong I am doing here.










share|improve this question









New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
    – statox♦
    35 mins ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am new to vim and I want to code in vim. I have installed the necessary plugins for syntax highlighting JSX in TypeScript and everything works fine for GUI version of Vim but not for terminal-based Vim. Please help me figure out the issue. Below are the plugins that I am using for syntax highlighting:



  1. For TypeScript: https://github.com/leafgarland/typescript-vim

  2. For JSX in TypeScript: https://github.com/peitalin/vim-jsx-typescript

I am using Vundle to install plugins. I tried to make some customizations in the colors as given in the README section of the second plugin mentioned above. According to that when I used the hi command, it did not have any effect on terminal-based Vim but it worked perfectly fine on GUI based Vim. I am trying to setup syntax highlight for JSX in TypeScript for React Development and I have installed above plugins to achieve that. Below is the content of my .vimrc file.



set nocompatible " choose no compatibility with legacy vi syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
set t_Co=256
filetype plugin indent on " load file type plugins + indentation

"" monkai theme
syntax enable
colorscheme monokai

set nu
set guifont=monacob bold 9

highlight ColorColumn ctermbg=gray
set colorcolumn=80

"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optinal)
set backspace=indent,eol,start " backspace through everything in insert mode

"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter

" set the runtime path to include Vundle and initialize
set rtp +=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive.git'
Plugin 'tpope/vim-rails'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" autocmd FileType typescript.tsx setlocal commentstring=/* %s */
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
autocmd BufNewFile,BufRead *.ts,*.js set filetype=typescript.jsx

" dark red
hi tsxTagName guifg=#E06C75

" orange
hi tsxCloseString guifg=#F99575
hi tsxCloseTag guifg=#F99575
hi tsxAttributeBraces guifg=#F99575
hi tsxEqual guifg=#F99575

" yellow
hi tsxAttrib guifg=#F8BD7F cterm=italic


Below is the screenshot of the JSX syntax highlight in GUI version of Vim
enter image description here



Below is the screenshot of the JSX syntax highlight in terminal version Vim
enter image description here



As we can see in the .vimrc and screenshots, the JSX tag colors etc.. declared at the end of the file are working fine for Gvim but not working for terminal-based vim. Please help me understand what wrong I am doing here.










share|improve this question









New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I am new to vim and I want to code in vim. I have installed the necessary plugins for syntax highlighting JSX in TypeScript and everything works fine for GUI version of Vim but not for terminal-based Vim. Please help me figure out the issue. Below are the plugins that I am using for syntax highlighting:



  1. For TypeScript: https://github.com/leafgarland/typescript-vim

  2. For JSX in TypeScript: https://github.com/peitalin/vim-jsx-typescript

I am using Vundle to install plugins. I tried to make some customizations in the colors as given in the README section of the second plugin mentioned above. According to that when I used the hi command, it did not have any effect on terminal-based Vim but it worked perfectly fine on GUI based Vim. I am trying to setup syntax highlight for JSX in TypeScript for React Development and I have installed above plugins to achieve that. Below is the content of my .vimrc file.



set nocompatible " choose no compatibility with legacy vi syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
set t_Co=256
filetype plugin indent on " load file type plugins + indentation

"" monkai theme
syntax enable
colorscheme monokai

set nu
set guifont=monacob bold 9

highlight ColorColumn ctermbg=gray
set colorcolumn=80

"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optinal)
set backspace=indent,eol,start " backspace through everything in insert mode

"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter

" set the runtime path to include Vundle and initialize
set rtp +=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive.git'
Plugin 'tpope/vim-rails'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" autocmd FileType typescript.tsx setlocal commentstring=/* %s */
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx
autocmd BufNewFile,BufRead *.ts,*.js set filetype=typescript.jsx

" dark red
hi tsxTagName guifg=#E06C75

" orange
hi tsxCloseString guifg=#F99575
hi tsxCloseTag guifg=#F99575
hi tsxAttributeBraces guifg=#F99575
hi tsxEqual guifg=#F99575

" yellow
hi tsxAttrib guifg=#F8BD7F cterm=italic


Below is the screenshot of the JSX syntax highlight in GUI version of Vim
enter image description here



Below is the screenshot of the JSX syntax highlight in terminal version Vim
enter image description here



As we can see in the .vimrc and screenshots, the JSX tag colors etc.. declared at the end of the file are working fine for Gvim but not working for terminal-based vim. Please help me understand what wrong I am doing here.







syntax-highlighting gvim






share|improve this question









New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 39 mins ago









statox♦

24.2k659125




24.2k659125






New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Bhasky93

61




61




New contributor




Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Bhasky93 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
    – statox♦
    35 mins ago













  • 1




    Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
    – statox♦
    35 mins ago








1




1




Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
– statox♦
35 mins ago





Welcome to this site! tivn's answer is very probably the correct one. On a totally different topic but which might still be useful: You don't need set nocompatible since is it off by default if you have a vimrc and it is generally a good idea to use the complete form of the commands and options in your vimrc (like set number and highlight instead of set nu and hi) it is much more readable
– statox♦
35 mins ago











1 Answer
1






active

oldest

votes

















up vote
3
down vote













guifg or guibg only works for GUI vim. For terminal version you will need to add other attributes: ctermfg, ctermbg.



Type :highlight without any attributes in your vim to show currenly set color settings.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "599"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Bhasky93 is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17416%2fsyntax-highlight-works-for-gvim-but-not-for-terminal-vim%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    guifg or guibg only works for GUI vim. For terminal version you will need to add other attributes: ctermfg, ctermbg.



    Type :highlight without any attributes in your vim to show currenly set color settings.






    share|improve this answer


























      up vote
      3
      down vote













      guifg or guibg only works for GUI vim. For terminal version you will need to add other attributes: ctermfg, ctermbg.



      Type :highlight without any attributes in your vim to show currenly set color settings.






      share|improve this answer
























        up vote
        3
        down vote










        up vote
        3
        down vote









        guifg or guibg only works for GUI vim. For terminal version you will need to add other attributes: ctermfg, ctermbg.



        Type :highlight without any attributes in your vim to show currenly set color settings.






        share|improve this answer














        guifg or guibg only works for GUI vim. For terminal version you will need to add other attributes: ctermfg, ctermbg.



        Type :highlight without any attributes in your vim to show currenly set color settings.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 45 mins ago









        Rich

        13.5k11761




        13.5k11761










        answered 53 mins ago









        tivn

        1,12178




        1,12178




















            Bhasky93 is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Bhasky93 is a new contributor. Be nice, and check out our Code of Conduct.












            Bhasky93 is a new contributor. Be nice, and check out our Code of Conduct.











            Bhasky93 is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17416%2fsyntax-highlight-works-for-gvim-but-not-for-terminal-vim%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery