[vim]Correct plugin indent

And get inspiration from defaults.vim
This commit is contained in:
Mathieu Maret 2016-08-29 18:22:37 +02:00
parent f942b8785a
commit 79290b1c24

45
.vimrc
View File

@ -36,8 +36,21 @@
""""""""""" """""""""""
" disable vi-compatible mode " disable vi-compatible mode
set nocompatible set nocompatible
syntax on
" Switch syntax highlighting on when the terminal has colors or when using the
" GUI (which always has colors).
if &t_Co > 2 || has("gui_running")
" Revert with ":syntax off".
syntax on
" I like highlighting strings inside C comments.
" Revert with ":unlet c_comment_strings".
let c_comment_strings=1
endif
filetype plugin on filetype plugin on
" enable file type detection and do language-dependent indenting
filetype plugin indent on
"set clipboard=unnamed "set clipboard=unnamed
"""""""" """"""""
" SAVE " " SAVE "
@ -46,15 +59,23 @@ filetype plugin on
set nobackup set nobackup
" save before compilation " save before compilation
set autowrite set autowrite
" jump to last known position when reopening a file " Put these in an autocmd group, so that you can revert them with:
if has("autocmd") " ":augroup vimStartup | au! | augroup END"
autocmd BufReadPost * augroup vimStartup
\ if line("'\"") > 0 && line("'\"") <= line("$") | au!
\ execute "normal! g`\"" |
\ endif " When editing a file, always jump to the last known cursor position.
endif " Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
" command line history " command line history
set history=50 set history=200
" Check that file have not been changed " Check that file have not been changed
" CursorHold : after cursor move " CursorHold : after cursor move
@ -98,6 +119,8 @@ set number
set statusline=%<%f\ %h%w%m%r%3.(\ %)%{fugitive#statusline()}%=%([%{Tlist_Get_Tagname_By_Line()}]%)%3.(\ %)%-14.(%l,%c%V%)\ %P set statusline=%<%f\ %h%w%m%r%3.(\ %)%{fugitive#statusline()}%=%([%{Tlist_Get_Tagname_By_Line()}]%)%3.(\ %)%-14.(%l,%c%V%)\ %P
" always display status line " always display status line
set laststatus=2 set laststatus=2
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
" show bad white spaces " show bad white spaces
let c_space_errors = 1 let c_space_errors = 1
@ -158,8 +181,6 @@ augroup Binary
augroup END augroup END
if has("autocmd") if has("autocmd")
" enable file type detection and do language-dependent indenting
" filetype plugin indent on
" detect indentation see http://www.freehackers.org/Indent_Finder " detect indentation see http://www.freehackers.org/Indent_Finder
if has('python') if has('python')
autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output "' . expand('%') . '"' ) autocmd BufReadPost /* execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output "' . expand('%') . '"' )
@ -335,7 +356,9 @@ imap <M-S-F1> <Esc><M-S-F1>
" show current changes with F10 " show current changes with F10
command! DiffOrig command! DiffOrig
\ vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis \ vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
\ | wincmd p | diffthis
map <M-F10> :DiffOrig<CR> map <M-F10> :DiffOrig<CR>
imap <M-F10> <ESC><M-F10>a imap <M-F10> <ESC><M-F10>a
" show git diff when committing " show git diff when committing
let g:git_diff_spawn_mode = 1 let g:git_diff_spawn_mode = 1