Add function SyntaxItem
This commit is contained in:
parent
58975ea8a1
commit
b0c38d4bca
31
vimrc
31
vimrc
|
@ -116,8 +116,11 @@ set foldcolumn=1
|
|||
colorscheme customred256
|
||||
|
||||
|
||||
|
||||
|
||||
" statusline format
|
||||
set statusline=\ %F\ " filename and path
|
||||
"set statusline+=%{SyntaxItem()}
|
||||
set statusline+=%h " help file flag
|
||||
set statusline+=%w " preview window flag
|
||||
set statusline+=%m " modified flag
|
||||
|
@ -144,13 +147,6 @@ set laststatus=2
|
|||
set colorcolumn=100
|
||||
|
||||
set foldmethod=manual
|
||||
" color of indent
|
||||
" hi Folded ctermfg=7
|
||||
" hi Folded ctermbg=233 " not working - investigate
|
||||
"augroup OpenAllFoldsOnFileOpen
|
||||
" autocmd!
|
||||
" autocmd BufRead * normal zR
|
||||
"augroup END
|
||||
|
||||
syntax on
|
||||
" tabs
|
||||
|
@ -168,6 +164,9 @@ set pastetoggle=<F2>
|
|||
set showmode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
" fix higlight problems such as vertical-align etc
|
||||
augroup VimCSS3Syntax
|
||||
autocmd!
|
||||
|
@ -176,6 +175,14 @@ augroup VimCSS3Syntax
|
|||
augroup END
|
||||
|
||||
|
||||
" autocommands
|
||||
" automatically reload if color scheme file written
|
||||
augroup coloreload
|
||||
au!
|
||||
au BufWritePost customred256.vim so $MYVIMRC
|
||||
augroup end
|
||||
|
||||
|
||||
|
||||
" Automatically reload .vimrc if chanaged
|
||||
augroup myvimrc
|
||||
|
@ -190,6 +197,16 @@ set undofile
|
|||
|
||||
|
||||
|
||||
" Functions
|
||||
|
||||
" get name of syntax item
|
||||
function! SyntaxItem()
|
||||
return synIDattr(synID(line("."),col("."),1),"name")
|
||||
endfunction
|
||||
nnoremap <leader>p :echom SyntaxItem()<CR>
|
||||
|
||||
|
||||
|
||||
" plugins stuff
|
||||
|
||||
" NERDtree
|
||||
|
|
Loading…
Reference in New Issue