1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 19:40:29 +01:00

Added simple json reformat

This commit is contained in:
2014-12-05 07:28:56 +01:00
parent f476a42da0
commit 0ad2727e21
2 changed files with 10 additions and 1 deletions

View File

@@ -1,2 +1,5 @@
setlocal foldmethod=syntax setlocal foldmethod=syntax
setlocal list setlocal list
" reformat json struct
map <leader>] <esc>:%!python -m json.tool<cr>

8
vimrc
View File

@@ -75,6 +75,7 @@ set background=dark "Hint Vim that I use dark colorscheme
set confirm "Ask for confirmation rather then refuse certain commands set confirm "Ask for confirmation rather then refuse certain commands
set cursorline "Turn on current line highlight set cursorline "Turn on current line highlight
set hlsearch "Turn on highlighting search text by default set hlsearch "Turn on highlighting search text by default
set smartcase "Be case aware when needed
set expandtab "I want spaces instead of tabs set expandtab "I want spaces instead of tabs
set fileencodings=ucs-bom,utf-8,latin2,default,latin1,default set fileencodings=ucs-bom,utf-8,latin2,default,latin1,default
set fileformats=unix,dos "Type of <EOL> in written files set fileformats=unix,dos "Type of <EOL> in written files
@@ -150,13 +151,18 @@ let html_use_encoding = "utf-8"
let g:browser = 'firefox' let g:browser = 'firefox'
"}}} "}}}
"COMMON: specific vim behaviour {{{ "COMMON: specific vim behaviour {{{
"
"remove all trailing whitespace for specified files before write "remove all trailing whitespace for specified files before write
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces(0) autocmd BufWritePre * :call <SID>StripTrailingWhitespaces(0)
"set correct filetype for tmux "set correct filetype for tmux
autocmd BufRead *.tmux.conf set filetype=tmux autocmd BufRead *.tmux.conf set filetype=tmux
autocmd BufRead *.mako set filetype=mako autocmd BufRead *.mako set filetype=mako
autocmd BufRead *.ass set filetype=kickass autocmd BufRead *.ass set filetype=kickass
" make the current line highlighted only on current window
autocmd WinEnter * setlocal cursorline
autocmd WinLeave * setlocal nocursorline
" }}} " }}}
"TERMINAL: options for terminal emulators {{{ "TERMINAL: options for terminal emulators {{{
if $TERM == 'rxvt-unicode-256color' || $TERM == 'xterm' if $TERM == 'rxvt-unicode-256color' || $TERM == 'xterm'