refact: improve indent, reogranise, simplify

server
iGor milhit 2017-12-10 10:48:12 +01:00
parent cb84240178
commit c38ee5e78a
No known key found for this signature in database
GPG Key ID: 3E9D7C1605E40FCD
1 changed files with 57 additions and 54 deletions

109
init.vim
View File

@ -1,8 +1,3 @@
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
" Syntax coloration and color theme
syntax enable
set background=dark
@ -19,27 +14,71 @@ endif
" add some tags for html indentations
:let g:html_indent_inctags = "html,body,head,tbody"
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
set mouse=a " Enable mouse usage (all modes)
set linebreak " Line wrap
set number " Line numbering
set cindent
set smartindent
set autoindent
set tabstop=4
set expandtab
set softtabstop=4
set shiftwidth=4
autocmd FileType json setlocal shiftwidth=2 tabstop=2
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
set mouse=a " Enable mouse usage (all modes)
set linebreak " Line wrap
set tw=79 " Lines longer than 79 chars will be wrapped
set colorcolumn=79 " Colors the 79th column
set number " Line numbering
set cursorline
set ruler
set wrap
set modeline
" fold
autocmd FileType json setlocal foldmethod=syntax " Type de fold si c'est du JSON
autocmd FileType json set foldlevel=2 " Détermine le niveau de fold par défaut pour le JSON
autocmd FileType markdown set foldlevel=0 " Détermine le niveau de fold par défaut pour le md
let g:xml_syntax_folding=3
au FileType xml setlocal foldmethod=syntax
autocmd FileType xml set foldlevel=1
" `.md` for markdown files
au BufRead,BufNewFile *.md set filetype=markdown
" vim-pandoc
" default languages grammar check
:let g:pandoc#spell#default_langs = ['fr', 'en']
" set C-l to :nohlsearch
nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
" copy to clipboard with `"+y`
set clipboard+=unnamedplus
" airline
let g:airline_powerline_fonts = 1
" vim-table-mode
:let g:table_mode_corner='|'
" netrw, instead of NERDTree
let g:netrw_liststyle = 3
let g:netrw_banner = 0
let g:netrw_browse_split = 3
" vim-json, don't conceal
let g:vim_json_syntax_conceal = 0
" plugins (vim-plug)
call plug#begin('~/.config/nvim/plugged')
Plug 'altercation/vim-colors-solarized'
@ -66,39 +105,3 @@ Plug 'https://github.com/nvie/vim-flake8.git'
Plug 'https://github.com/kien/ctrlp.vim'
Plug 'https://github.com/tpope/vim-commentary'
call plug#end()
" fold
autocmd FileType json setlocal foldmethod=syntax " Type de fold si c'est du JSON
autocmd FileType json set foldlevel=2 " Détermine le niveau de fold par défaut pour le JSON
autocmd FileType markdown set foldlevel=0 " Détermine le niveau de fold par défaut pour le md
let g:xml_syntax_folding=3
au FileType xml setlocal foldmethod=syntax
autocmd FileType xml set foldlevel=1
" `.md` for markdown files
au BufRead,BufNewFile *.md set filetype=markdown
" vim-pandoc
:let g:pandoc#spell#default_langs = ['fr', 'en', 'de_de'] " default languages grammar check
" set C-l to :nohlsearch
nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
" copy to clipboard with `"+y`
set clipboard+=unnamedplus
" airline
let g:airline_powerline_fonts = 1
" vim-table-mode
:let g:table_mode_corner='|'
" netrw, instead of NERDTree
let g:netrw_liststyle = 3
let g:netrw_banner = 0
let g:netrw_browse_split = 3
" vim-json, don't conceal
let g:vim_json_syntax_conceal = 0