vmware-archive / salt-vim

Vim files for editing Salt files
Other
249 stars 72 forks source link

How to make a string in single quotes is highlighted as blue? #40

Open quantonganh opened 9 years ago

quantonganh commented 9 years ago

I would like to use single quotes for pillar.get or concatenate strings:

jinja2 string in vim

but also want to highlight the string as blue like in the second line.

How to do that?

My ~/.vimrc:

set backup
let day = strftime("%Y-%m-%d")
let user = substitute(system('whoami'), '\n', '', '')
if user == 'root'
    let backupdir = "/var/root/.vim/backup/".day
else
    let backupdir = $HOME."/.vim/backup/".day
endif
silent! let xyz = mkdir(backupdir, "p")
let cmd = "set backupdir=".backupdir
execute cmd
let time = strftime(".%H:%M:%S")
let cmd = "set backupext=".time
execute cmd

syntax on
set number
set background=dark
let g:solarized_termcolors = 256
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
let g:solarized_termtrans = 1
colorscheme solarized

autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab

"autocmd FileType rst set syntax=rest

set clipboard=unnamed
execute pathogen#infect()
let g:SuperTabDefaultCompletionType = "context"

filetype off

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

Bundle 'gmarik/vundle'

" powerline

" end of powerline

set nocompatible
filetype plugin indent on
autocmd BufRead,BufNewFile *.jinja2 set filetype=sls.jinja2

nnoremap <F6> :GundoToggle<CR>

" ultisnips
let g:UltiSnipsSnippetsDir ="~/.vim/bundle/ultisnips/UltiSnips"
let g:UltiSnipsListSnippets = "<c-j>"
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" end of ultisnips

au BufNewFile *.jinja2 so ~/.vim/header/jinja_header.txt
au BufNewFile *.py so ~/.vim/header/py_header.txt
au BufNewFile *.sls so ~/.vim/header/sls_header.txt

let mapleader = ","
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_map = '<leader>f'
let g:ctrlp_prompt_mappings = {
    \ 'AcceptSelection("e")': ['<c-v>', '<2-LeftMouse>'],
    \ 'AcceptSelection("v")': ['<cr>', '<RightMouse>'],
    \ }
" airline
set laststatus=2
" end of airline

" highlight excess line length (79)
autocmd Filetype py rst textwidth=79
set colorcolumn=+1

" go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" end of go

" neocomplete
" let g:neocomplete#enable_at_startup = 1
" end of neocomplete

" disable folding
set nofoldenable
" end of disable folding

" disable matchparen
" let loaded_matchparen=1
" end of disable matchparen
basepi commented 9 years ago

Good question! It's hard because if we colorize the jinja too much, it will be hard to distinguish from the YAML. But maybe that won't be much of an issue. I don't have anything against colorizing strings in jinja.