From 9c09b879c0d7206aa72a2dfe9f2c437518ba5e07 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 12 Jan 2017 11:06:53 +0100 Subject: [PATCH] update --- .vimrc | 3 ++ config/Vundle.vim | 6 +++ config/default.vim | 44 +++++++++++++++------- config/maps.vim | 32 +++++++++++----- config/plugins/easy-align.vim | 5 +++ config/plugins/instant-markdown.vim | 10 +++++ config/plugins/markdown.vim | 2 + snippets/js.snippets | 58 +++++++++++++++++++++++++++++ 8 files changed, 137 insertions(+), 23 deletions(-) create mode 100644 config/plugins/easy-align.vim create mode 100644 config/plugins/instant-markdown.vim create mode 100644 config/plugins/markdown.vim create mode 100644 snippets/js.snippets diff --git a/.vimrc b/.vimrc index 310ddc4..b3a0c2c 100644 --- a/.vimrc +++ b/.vimrc @@ -22,6 +22,9 @@ so ~/.vim/config/plugins/tagbar.vim so ~/.vim/config/plugins/airline.vim so ~/.vim/config/plugins/nerdtree.vim so ~/.vim/config/plugins/ultisnips.vim +so ~/.vim/config/plugins/easy-align.vim +so ~/.vim/config/plugins/instant-markdown.vim +so ~/.vim/config/plugins/markdown.vim " Vim default diff --git a/config/Vundle.vim b/config/Vundle.vim index 4bbe9a6..2c82dbe 100644 --- a/config/Vundle.vim +++ b/config/Vundle.vim @@ -8,6 +8,12 @@ call vundle#begin() "call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required + Plugin 'evidens/vim-twig' + Plugin 'tpope/vim-markdown' + Plugin 'suan/vim-instant-markdown' + Plugin 'dhruvasagar/vim-table-mode' + Plugin 'tpope/vim-haml' + Plugin 'christoomey/vim-tmux-navigator' Plugin 'junegunn/vim-easy-align' Plugin 'jelera/vim-javascript-syntax' Plugin 'elzr/vim-json' diff --git a/config/default.vim b/config/default.vim index 14ad83a..1820cef 100644 --- a/config/default.vim +++ b/config/default.vim @@ -3,26 +3,42 @@ colorscheme onedark syntax on set mouse=a -set ignorecase -set smartcase -set splitright -set autoindent -set relativenumber " show relative number lines -set number " but absolute number for current line -set showcmd -set encoding=utf-8 -scriptencoding utf-8 -" show whitespaces -set list -set listchars=eol:¬,tab:>\ ,trail:⋅ +"""""""""" +" search " +"""""""""" +set ignorecase " ignore case +set smartcase " . only if not all in lowercase +set incsearch " show matches when typing pattern +set hlsearch " highlights matches + + +""""""""""" +" display " +""""""""""" +set splitright " split right instead of left +set autoindent " auto linebreak indentation +set relativenumber " show relative number for lines +set number " but absolute number for current line +set showcmd " show typed command +set encoding=utf-8 " set encoding +scriptencoding utf-8 " set encoding ?? +set list " for next command +set listchars=eol:¬,tab:>\ ,trail:⋅ " characters to display instead of whitespace characters " default fold method set foldmethod=syntax +" use filetype +filetype plugin on + " search path recursive set path+=** " abbreviations -ab tf tabfind -ab f find + +" functions + " yank buffer "0 to clipboard + map :tabnew"0p:saveas /tmp/cclip.tmp:!cat % \| xclip -sel clip:!rm %:q! + " paste clipboard to buffer "0 + map :tabnew:.!xclip -sel clip -oggdG:q! diff --git a/config/maps.vim b/config/maps.vim index 5bc979a..3765e20 100644 --- a/config/maps.vim +++ b/config/maps.vim @@ -1,16 +1,30 @@ +" words backwards with SHIFT-w +nnoremap W b + + +" INSERT mode -> go back to NORMAL mode +imap " new tab nmap :tabnew " new line shortcut (ctrl+o) -nnoremap o +nnoremap ee o -" switch windows -" nmap :wincmd k -" nmap :wincmd j -" nmap :wincmd h -" nmap :wincmd l +" switch tabs +nmap :tabprevious +nmap :tabnext -" bind window : scroll + cursor -nmap :set scrollbind:set cursorbind -nmap :set noscrollbind:set nocursorbind +" split windows +nnoremap \| :vnew +nnoremap = :new + +" bind windows: scroll + cursor +let bounded_wins=0 +nmap :if (bounded_wins%2 == 0) \| set scrollbind \| set cursorbind \| else \| set noscrollbind \| set nocursorbind \| endif \| let bounded_wins=bounded_wins+1 + +" autoread (real-time changes) +nmap :set autoread + +" reloads file +nmap :e! diff --git a/config/plugins/easy-align.vim b/config/plugins/easy-align.vim new file mode 100644 index 0000000..bdd9803 --- /dev/null +++ b/config/plugins/easy-align.vim @@ -0,0 +1,5 @@ +" Start interactive EasyAlign in visual mode (e.g. vipga) +map ga (EasyAlign) + +" Start interactive EasyAlign for a motion/text object (e.g. gaip) +map ga (EasyAlign) diff --git a/config/plugins/instant-markdown.vim b/config/plugins/instant-markdown.vim new file mode 100644 index 0000000..5819792 --- /dev/null +++ b/config/plugins/instant-markdown.vim @@ -0,0 +1,10 @@ +" to update only when some events occurs (not real-time) +let g:instant_markdown_slow = 1 + +" launched on startup if markdown +let g:instant_markdown_autostart = 1 + +" allow external content (images, etc) +let g:instant_markdown_allow_external_content = 1 + + diff --git a/config/plugins/markdown.vim b/config/plugins/markdown.vim new file mode 100644 index 0000000..1b16c44 --- /dev/null +++ b/config/plugins/markdown.vim @@ -0,0 +1,2 @@ +" consider *.md as markdown files +autocmd BufNewFile,BufReadPost *.md set filetype=markdown diff --git a/snippets/js.snippets b/snippets/js.snippets new file mode 100644 index 0000000..bc326ea --- /dev/null +++ b/snippets/js.snippets @@ -0,0 +1,58 @@ + +snippet comh + /**nippet definition.*********************** + * ${1:Program Name} * + * ${2: Date} * + *************************** + * Designed & Developed by * + * xdrm-brackets * + *************************** + * https://xdrm.io/ * + **************************/ + $0 +snippet comc + /* [${1:Number}] ${2:Chapter Title} + =========================================================*/ + $0 +snippet comcc + /* (${1:Number}) ${2:Chapter Title} + ---------------------------------------------------------*/ + $0 +snippet coms + /* (${1:Number}) ${2:Section Title} */ + $0 +snippet comss + {${1:Number}} ${2:Section Title} // + $0 +snippet comf + ${1:RESUME DE LA FONCTION} + * + * @${2:nomParam}<${3:typeParam}> ${4:Description du param} + * + * @return ${5:nomRetour}<${6:typeRetour}> ${7:Description du retour} + * + */${8:} + $0 +snippet comcf + /* [${1:Number}] ${2:Chapter Title} + * + * @inputname inputdesc + * + * @return outputname outputdesc + * + =========================================================*/ + $0 +snippet comccf + /* (${1:Number}) ${2:Chapter Title} + * + * @inputname inputdesc + * + * @return outputname outputdesc + * + ---------------------------------------------------------*/ + $0 +snippet comt + /************************************************ + ****${1: Titre }**** + ************************************************/ + $0