Some dev functions

This commit is contained in:
dbroqua 2020-07-22 15:19:00 +02:00
parent 0b564e40e0
commit 20fccaf063

View file

@ -26,6 +26,7 @@ call plug#begin('~/.vim/plugged')
\ 'do': 'make install' \ 'do': 'make install'
\} \}
Plug 'JamshedVesuna/vim-markdown-preview' Plug 'JamshedVesuna/vim-markdown-preview'
Plug 'ternjs/tern_for_vim', {'do': 'yarn install'}
" Initialize plugin system " Initialize plugin system
call plug#end() call plug#end()
@ -49,6 +50,8 @@ filetype on
filetype plugin on filetype plugin on
filetype indent on filetype indent on
set omnifunc=syntaxcomplete#Complete
:highlight ExtraWhitespace ctermbg=red guibg=red :highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/ :match ExtraWhitespace /\s\+$/
:match errorMsg /\s\+$/ :match errorMsg /\s\+$/
@ -79,20 +82,6 @@ set backspace=indent,eol,start
" Hide file when open other file " Hide file when open other file
set hidden set hidden
" Disable arrow keys
"map <left> <nop>
"map <down> <nop>
"map <up> <nop>
"map <right> <nop>
"imap <left> <nop>
"imap <down> <nop>
"imap <up> <nop>
"imap <right> <nop>
" Remap esc key
:imap <C-x> <Esc>
:map <C-x> <Esc>
" Code formating " Code formating
set smartindent " Do smart autoindenting when starting a new line set smartindent " Do smart autoindenting when starting a new line
set tabstop=2 " Number of spaces that a <Tab> in the file counts for set tabstop=2 " Number of spaces that a <Tab> in the file counts for
@ -112,6 +101,32 @@ augroup myTodo
augroup END augroup END
highlight link myTodo Todo highlight link myTodo Todo
" Auto close brackets/…
inoremap " ""<left>
inoremap ' ''<left>
inoremap ` ``<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
" -- Remove unwantedd spaces
function TrimWhiteSpace()
%s/\s*$//
''
endfunction
set list listchars=trail:.,extends:>
autocmd FileWritePre * call TrimWhiteSpace()
autocmd FileAppendPre * call TrimWhiteSpace()
autocmd FilterWritePre * call TrimWhiteSpace()
autocmd BufWritePre * call TrimWhiteSpace()
map <F2> :call TrimWhiteSpace()<CR>
map! <F2> :call TrimWhiteSpace()<CR>
" -- Plugins configurations " -- Plugins configurations
" vim-javascript " vim-javascript