diff options
| author | Anton Bobov <abobov@gmail.com> | 2017-05-03 22:30:43 +0500 |
|---|---|---|
| committer | Anton Bobov <abobov@gmail.com> | 2017-05-03 22:30:43 +0500 |
| commit | dc7fdbfaa0b8ee1197df67ef1ff440d6d15fd4b0 (patch) | |
| tree | 1b7236497d074b7219d11f6f40e0e29bc22d2e65 /files | |
| parent | d50fed6dee55d25963d5bd793d48b8d78eb7676e (diff) | |
Vim and git config update.
git:
- branch alias
vim:
- add diff option to prefer vertical split
- map *GeoJSON* files to json file type
- add map for json formatting using jq
- list files using *find* in CtrlP
Diffstat (limited to 'files')
| -rw-r--r-- | files/.gitconfig | 1 | ||||
| -rw-r--r-- | files/.vimrc | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/files/.gitconfig b/files/.gitconfig index a179549..07a1e6b 100644 --- a/files/.gitconfig +++ b/files/.gitconfig @@ -16,6 +16,7 @@ [alias] aa = add --all --intent-to-add ar = !sh -c 'git archive --format=tar --prefix="$(basename "$PWD")-$1/" $1^{tree} | bzip2 >"$(basename "$PWD")-$1.tar.bz2"' - + br = branch c = commit --verbose co = checkout ci = commit diff --git a/files/.vimrc b/files/.vimrc index 5539f77..cbd8356 100644 --- a/files/.vimrc +++ b/files/.vimrc @@ -17,6 +17,7 @@ Plugin 'https://github.com/vim-scripts/L9.git' " Git inside vim Plugin 'https://github.com/tpope/vim-fugitive.git' +Plugin 'https://github.com/tpope/vim-unimpaired' " Intelligent date inc/dec Plugin 'https://github.com/tpope/vim-speeddating' @@ -117,6 +118,7 @@ set omnifunc=syntaxcomplete#Complete runtime! macros/matchit.vim set virtualedit+=block set backspace=indent,eol,start +set diffopt+=vertical " Показывать столбец с номерами строк set number set relativenumber @@ -296,6 +298,8 @@ if has('autocmd') au BufEnter * if &filetype == "" | setlocal ft=text | endif au BufReadPost *.ledger norm G + au BufRead,BufNewFile *.geojson if &ft == "" | setfiletype json | endif + " Set scripts to be executable from shell "au BufWritePost * if getline(1) =~ "^#!.*/bin/" | silent !chmod +x <afile> | endif au BufWritePost * if getline(1) =~ "^#!.*/bin/" | silent exec "!chmod +x <afile>" | endif @@ -423,6 +427,19 @@ augroup ft_javascript augroup END " }}} +" JSON {{{ + +augroup ft_json + au! + + if executable('jq') + au FileType json noremap <Leader>jq :%!jq --indent 4 .<CR> + au FileType json vnoremap <Leader>jq :'<,'>!jq --indent 4 .<CR> + endif + +augroup END + +" }}} " Ledger {{{ augroup ft_ledger au! @@ -533,6 +550,11 @@ au FileType html let b:delimitMate_matchpairs="(:),[:],{:}" let g:templates_directory=$HOME . "/.vim/templates" " }}} +" Ctrl-P {{{ + +let g:ctrlp_user_command = 'find %s -type f' + +" }}} " }}} " Load custom local config {{{ |
