From 68c941406e06fe5fc89386d9c4ab20345c5e185b Mon Sep 17 00:00:00 2001 From: arobase-che Date: Sun, 10 Jan 2016 19:07:49 +0100 Subject: Init commit --- plugin/backup.vim | 15 ++ plugin/buffers.vim | 5 + plugin/colors.vim | 5 + plugin/comments.vim | 323 ++++++++++++++++++++++++++++++++++++++++++ plugin/compatibility.vim | 11 ++ plugin/completion.vim | 6 + plugin/editzone.vim | 39 +++++ plugin/encoding.vim | 8 ++ plugin/filetype.vim | 4 + plugin/indent.vim | 9 ++ plugin/misc-bindings.vim | 38 +++++ plugin/perso.vim | 49 +++++++ plugin/plugin_python-mode.vim | 11 ++ plugin/plugin_rainbow.vim | 4 + plugin/plugin_ultisnips.vim | 5 + plugin/plugin_unite.vim | 15 ++ plugin/search.vim | 9 ++ plugin/syntax.vim | 9 ++ plugin/trailing-spaces.vim | 6 + plugin/vim-airline.vim | 6 + plugin/viminfo.vim | 18 +++ 21 files changed, 595 insertions(+) create mode 100755 plugin/backup.vim create mode 100755 plugin/buffers.vim create mode 100755 plugin/colors.vim create mode 100755 plugin/comments.vim create mode 100755 plugin/compatibility.vim create mode 100755 plugin/completion.vim create mode 100755 plugin/editzone.vim create mode 100755 plugin/encoding.vim create mode 100755 plugin/filetype.vim create mode 100755 plugin/indent.vim create mode 100755 plugin/misc-bindings.vim create mode 100644 plugin/perso.vim create mode 100755 plugin/plugin_python-mode.vim create mode 100755 plugin/plugin_rainbow.vim create mode 100755 plugin/plugin_ultisnips.vim create mode 100755 plugin/plugin_unite.vim create mode 100755 plugin/search.vim create mode 100755 plugin/syntax.vim create mode 100755 plugin/trailing-spaces.vim create mode 100755 plugin/vim-airline.vim create mode 100755 plugin/viminfo.vim (limited to 'plugin') diff --git a/plugin/backup.vim b/plugin/backup.vim new file mode 100755 index 0000000..dfcf6a7 --- /dev/null +++ b/plugin/backup.vim @@ -0,0 +1,15 @@ +" backup.vim +" Backup related parameters + +set backup +set backupdir=~/.vimtmp/backup +set directory=~/.vimtmp/temp + +silent !mkdir -p ~/.vimtmp/backup +silent !mkdir -p ~/.vimtmp/temp + +if version >= 703 + set undofile + set undodir=~/.vimtmp/undo + silent !mkdir -p ~/.vimtmp/undo +endif diff --git a/plugin/buffers.vim b/plugin/buffers.vim new file mode 100755 index 0000000..13c8e4c --- /dev/null +++ b/plugin/buffers.vim @@ -0,0 +1,5 @@ +" buffers.vim +" Buffer related options + +" Hide the buffer when abandoned (ie. not displayed) +set hidden diff --git a/plugin/colors.vim b/plugin/colors.vim new file mode 100755 index 0000000..3199f5b --- /dev/null +++ b/plugin/colors.vim @@ -0,0 +1,5 @@ +" colors.vim + +set background=dark +"#colorscheme gruvbox +colo darkZ diff --git a/plugin/comments.vim b/plugin/comments.vim new file mode 100755 index 0000000..01bbfa5 --- /dev/null +++ b/plugin/comments.vim @@ -0,0 +1,323 @@ +" ********************************************************************************************* +" comments.vim +" ********************************************************************************************* +" Description : Global Plugin to comment and un-comment different +" source files in both normal and visual mode +" Last Change : 26th April, 2006 +" Created By : Jasmeet Singh Anand +" Version : 2.2 +" Usage : For VIM 6 - +" Stick this file in your ~/.vim/plugin directory or +" in some other 'plugin' directory that is in your runtime path +" For VIM 5 - +" Stick this file somewhere and 'source /comments.vim' it from +" your ~/.vimrc file +" Note : I have provided the following key mappings +" To comment in both normal and visual range select mode +" To un-comment in both normal and visual range select mode +" These can be changed based on user's likings or usage +" Contact : For any comments or bug fixes email me at +" ********************************************************************************************* + "Modification: +" ********************************************************************************************* +" Jasmeet Anand 26th April, 2006 v2.0 +" Fixed C commenting where a single line already had previous comments. +" int x=0; /*this is an x value*/ +" Still working on situations like +" Issue A: +" 1 int x=0; /*this +" 2 is +" 3 an +" 4 x +" 5 value*/ +" ********************************************************************************************* +" Jasmeet Anand 26th April, 2006 v2.1 +" Provided more granule checking for C Code but still working on Issue A +" ********************************************************************************************* +" Jasmeet Anand 27th April, 2006 v2.2 +" Fixed another minor C code commenting bug +" Provided for .csh, .php, .php2 and .php3 support +" Resolved Issue A with the following logic +" 1 /* int x=0; */ /*this*/ +" 2 /*is*/ +" 3 /*an*/ +" 4 /*x*/ +" 5 /*value*/ +" However care should be taken when un-commenting it +" in order to retain the previous comments +" ********************************************************************************************* +" Jasmeet Anand 1st May 2006 v2.3 +" Provided [:blank:] to accomodate for space and tab characters +" ********************************************************************************************* +" Jasmeet Anand 1st May 2006 v2.4 +" Provided support for .css as advised by Willem Peter +" ********************************************************************************************* +" Jasmeet Anand 2nd May 2006 v2.5 +" Removed auto-indenting for .sql, .sh and normal files when un-commenting +" ********************************************************************************************* +" Jasmeet Anand 5th June 2006 v2.6 +" Added support for .html, .xml, .xthml, .htm, .vim, .vimrc +" files as provided by Jeff Buttars +" ********************************************************************************************* +" Smolyar "Rastafarra" Denis 7th June 2007 v2.7 +" Added support for .tex +" ********************************************************************************************* +" Jasmeet Anand 5th June 2006 v2.8 +" Added support for Fortran .f, .F, .f90, .F90, .f95, .F95 +" files as provided by Albert Farres +" ********************************************************************************************* +" Jasmeet Anand 8th March 2008 v2.9 +" Added support for ML, Caml, OCaml .ml, mli, PHP (v.4) .php4, PHP (v.5) .php5 +" files as provided by Denis Smolyar +" Added support for noweb (requires only a small enhancement to the tex type) +" as provided by Meik "fuller" Temer +" Added support for vhdl files provided by Trond Danielsen +" ********************************************************************************************* +" Jasmeet Anand 20 th March 2008 v2.10 +" Bug fixes for php files as pointed by rastafarra +" ********************************************************************************************* +" Jasmeet Anand 29th November 2008 v2.11 +" Added support for haskel +" files as provided by Nicolas Martyanoff +" File Format changed to UNIX +" ********************************************************************************************* +" Jasmeet Anand 11th January 2009 v2.12 +" bug fix for haskel files as prpvided by Jean-Marie +" + +" Exit if already loaded +if exists("loaded_comments_plugin") + finish +endif + +let loaded_comments_plugin="v2.10" + +" key-mappings for comment line in normal mode +noremap :call CommentLine() +" key-mappings for range comment lines in visual mode +vnoremap :call RangeCommentLine() + +" key-mappings for un-comment line in normal mode +noremap :call UnCommentLine() +" key-mappings for range un-comment lines in visual mode +vnoremap :call RangeUnCommentLine() + +" function to comment line in normal mode +function! CommentLine() + let file_name = buffer_name("%") + + " for .cpp or .hpp or .java or .C files use // + if file_name =~ '\.cpp$' || file_name =~ '\.hpp$' || file_name =~ '\.java$' || file_name =~ '\.php[2345]\?$' || file_name =~ '\.C$' + execute ":silent! normal ^i//\==\^" + " for .c or .h or .pc or .css files use /* */ + elseif file_name =~ '\.c$' || file_name =~ '\.h$' || file_name =~ '\.pc$' || file_name =~ '\.css$' || file_name =~ '\.js$' + " if there are previous comments on this line ie /* ... */ + if stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") != -1 + execute ":silent! normal :nohlsearch\:s/\\([^\\/\\*]*\\)\\(\\/\\*.*\\*\\/\\)/\\1\\*\\/\\2/\:s/\\([^[:blank:]]\\+\\)/\\/\\*\\1/\:nohlsearch\==" + " if there is a /* but no */ like line 1 in Issue A above + elseif stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") == -1 + execute ":silent! normal :nohlsearch\:s/\\(.*\\)\\(\\/\\*.*$\\)/\\/\\*\\1\\*\\/\\2\\*\\//\:nohlsearch\==" + " if there is a */ but no /* like line 5 in Issue A above + elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") != -1 + execute ":silent! normal :nohlsearch\:s/\\(.*\\*\\/\\)/\\/\\*\\1/\:nohlsearch\==" + " if there are no comments on this line + elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") == -1 + execute ":silent! normal ^i/*\$a*/\==\^" + endif + "for .ml or .mli files use (* *) + elseif file_name =~ '\.ml$' || file_name =~ '\.mli$' + if stridx(getline("."), "\(\*") == -1 && stridx(getline("."), "\*)") == -1 + execute ":silent! normal ^i(*\$a*)\==\^" + endif + " .html,.xml,.xthml,.htm + elseif file_name =~ '\.html$' || file_name =~ '\.htm$' || file_name =~ '\.xml$' || file_name =~ '\.xhtml$' + if stridx( getline("."), "\ + elseif file_name =~ '\.html$' || file_name =~ '\.htm$' || file_name =~ '\.xml$' || file_name =~ '\.xhtml$' + execute ":silent! normal :nohlsearch\:s///\==" + " for .tex use % + elseif file_name =~ '\.tex$' || file_name =~ '\.nw$' + execute ":silent! normal :nohlsearch\:s/%/\:nohlsearch\" + " for fortran 77 files use C on first column + elseif file_name =~ '\.f$' || file_name =~ '\.F$' + execute ":silent! normal ^x\\^" + " for fortran 90/95 files use ! + elseif file_name =~ '\.f90$' || file_name =~ '\.F90$' || file_name =~ '\.f95$' || file_name =~ '\.F95$' + execute ":silent! normal :nohlsearch\:s/!//\:nohlsearch\" + " for VHDL and Haskell files use -- + elseif file_name =~ '\.vhd$' || file_name =~ '\.vhdl$' || file_name =~ '\.hs$' + execute ":silent! normal :nohlsearch\:s/-- //\:nohlsearch\" + " for all other files use # + else + execute ":silent! normal :nohlsearch\:s/\\#//\:nohlsearch\" + endif +endfunction + +" function to range comment lines in visual mode +function! RangeCommentLine() + let file_name = buffer_name("%") + + " for .cpp or .hpp or .java or .C files use // + if file_name =~ '\.cpp$' || file_name =~ '\.hpp$' || file_name =~ '\.java$' || file_name =~ '\.php[2345]\?$' || file_name =~ '\.C$' + execute ":silent! normal :s/\\S/\\/\\/\\0/\:nohlsearch==" + " for .c or .h or .pc or .css files use /* */ + elseif file_name =~ '\.c$' || file_name =~ '\.h$' || file_name =~ '\.pc$' || file_name =~ '\.css$' || file_name =~ '\.js$' + " if there are previous comments on this line ie /* ... */ + if stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") != -1 + execute ":silent! normal :nohlsearch\:s/\\([^\\/\\*]*\\)\\(\\/\\*.*\\*\\/\\)/\\1\\*\\/\\2/\:s/\\([^[:blank:]]\\+\\)/\\/\\*\\1/\:nohlsearch\==" + " if there is a /* but no */ like line 1 in Issue A above + elseif stridx(getline("."), "\/\*") != -1 && stridx(getline("."), "\*\/") == -1 + execute ":silent! normal :nohlsearch\:s/\\(.*\\)\\(\\/\\*.*$\\)/\\/\\*\\1\\*\\/\\2\\*\\//\:nohlsearch\==" + " if there is a */ but no /* like line 5 in Issue A above + elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") != -1 + execute ":silent! normal :nohlsearch\:s/\\(.*\\*\\/\\)/\\/\\*\\1/\:nohlsearch\==" + " if there are no comments on this line + elseif stridx(getline("."), "\/\*") == -1 && stridx(getline("."), "\*\/") == -1 + execute ":silent! normal :s/\\(\\S.*$\\)/\\/\\*\\1\\*\\//\:nohlsearch\==" + endif + " .html,.xml,.xthml,.htm + elseif file_name =~ '\.html$' || file_name =~ '\.htm$' || file_name =~ '\.xml$' || file_name =~ '\.xhtml$' + if stridx( getline("."), "\ + elseif file_name =~ '\.html$' || file_name =~ '\.htm$' || file_name =~ '\.xml$' || file_name =~ '\.xhtml$' + execute ":silent! normal :nohlsearch\:s///\==" + elseif file_name =~ '\.[kc]\?sh$' || file_name =~ '\.pl$' || file_name =~ '\.pm$' + execute ":silent! normal :s/\\#//\:nohlsearch\" + " for .tex use % + elseif file_name =~ '\.tex$' || file_name =~ '\.nw$' + execute ":silent! normal :s/%/\:nohlsearch\" + " for fortran 77 files use C on first column + elseif file_name =~ '\.f$' || file_name =~ '\.F$' + execute ":silent! normal ^x\\^" + " for fortran 90/95 files use ! + elseif file_name =~ '\.f90$' || file_name =~ '\.F90$' || file_name =~ '\.f95$' || file_name =~ '\.F95$' + execute ":silent! normal :s/!//\:nohlsearch\" + " for VHDL and Haskell files use -- + elseif file_name =~ '\.vhd$' || file_name =~ '\.vhdl$' || file_name =~ '\.hs$' + execute ":silent! normal :s/-- //\:nohlsearch\" + " for all other files use # + else + execute ":silent! normal :s/\\#//\:nohlsearch\" + endif +endfunction + diff --git a/plugin/compatibility.vim b/plugin/compatibility.vim new file mode 100755 index 0000000..98f229a --- /dev/null +++ b/plugin/compatibility.vim @@ -0,0 +1,11 @@ +" compatibility.vim +" Sets compatiblity parameters + +" disregard vi compatibility +"set nocompatible + +" allow backspacing over everything +"set backspace=eol,indent,start + +" show partial command in the last line of the screen +set showcmd diff --git a/plugin/completion.vim b/plugin/completion.vim new file mode 100755 index 0000000..d8da491 --- /dev/null +++ b/plugin/completion.vim @@ -0,0 +1,6 @@ +" completion.vim +" Completion related options + +" wildcard char = +set wildmenu +set wildmode=list:longest:full diff --git a/plugin/editzone.vim b/plugin/editzone.vim new file mode 100755 index 0000000..e257303 --- /dev/null +++ b/plugin/editzone.vim @@ -0,0 +1,39 @@ +" editzone.vim +" Parameters related to the edition zone + +" Display relative line numbers and absolute line number for the current line +set number relativenumber + +" In insert mode, display absolute line numbers +au InsertEnter * :set number norelativenumber +" Come back to standard mode when leaving insert mode +au InsertLeave * :set relativenumber + +" Default status line +set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] +set laststatus=2 + +" Disable bells +set noerrorbells +set novisualbell + +"set textwidth=100 +"if version >= 703 +" set colorcolumn=+1 +"endif + +" Show special chars +set list +set listchars=tab:.\ ,eol:¬,nbsp:␣ + +" Highlight the screen line of the cursor +set cursorline + +" Always show 5 lines around cursor +set scrolloff=5 + +" from : http://vim.wikia.com/wiki/Highlight_current_line +" toogle highlight cursor column +nnoremap c :set cursorcolumn! +" toogle highligh cursor line +nnoremap l :set cursorline! diff --git a/plugin/encoding.vim b/plugin/encoding.vim new file mode 100755 index 0000000..b245198 --- /dev/null +++ b/plugin/encoding.vim @@ -0,0 +1,8 @@ +" encoding.vim +" Sets Vim and files encoding. + +" Get the encoding from the environment +set encoding=utf-8 + +" Transliterate files in UTF-8 +set fileencoding=utf-8 diff --git a/plugin/filetype.vim b/plugin/filetype.vim new file mode 100755 index 0000000..cfdc038 --- /dev/null +++ b/plugin/filetype.vim @@ -0,0 +1,4 @@ +" filetype.vim +" Filetype related configuration. + +filetype plugin indent on diff --git a/plugin/indent.vim b/plugin/indent.vim new file mode 100755 index 0000000..de67636 --- /dev/null +++ b/plugin/indent.vim @@ -0,0 +1,9 @@ +" indent.vim +" Defines indentation behavior + +set softtabstop=2 +set shiftwidth=2 +set expandtab +set smarttab + +set autoindent diff --git a/plugin/misc-bindings.vim b/plugin/misc-bindings.vim new file mode 100755 index 0000000..4591fd9 --- /dev/null +++ b/plugin/misc-bindings.vim @@ -0,0 +1,38 @@ +" misc-bindings.vim +" Every miscellaneous key binding will go here. + +" << That stupid goddamned help key that you will invaribly hit constantly +" while aiming for escape >> -- Steve Losh +inoremap +vnoremap +nnoremap + +"inoremap l + +" << it's one less key to hit every time I want to save a file >> +" -- Steve Losh (again) +"nnoremap ; : +"vnoremap ; : + +" From Kalenz's Vim config. Life changing. +nnoremap + +" halfr personnal shortcurts +nnoremap \| v +nnoremap - s +nnoremap w + +" save +nnoremap :w +" save and quit +nnoremap :x + +nnoremap ! :tab sball + +nnoremap :make + +" I DONT WANT TO USE AN ENCRYPTION KEY +" http://stackoverflow.com/questions/3878692/aliasing-a-command-in-vim +" cnoreabbrev X ((getcmdtype() is# ':' && getcmdline() is# 'X')?('x'):('X')) + + diff --git a/plugin/perso.vim b/plugin/perso.vim new file mode 100644 index 0000000..f736e10 --- /dev/null +++ b/plugin/perso.vim @@ -0,0 +1,49 @@ +set showcmd + +set backspace=indent,eol,start + +set expandtab +set shiftwidth=2 +set softtabstop=2 +set cindent + + +set encoding=utf-8 +set fileencoding=utf-8 + +colo darkZ + +filetype plugin indent on + + +nnoremap :set pastem`o``:set nopaste +nnoremap :set pastem`O``:set nopaste + + +"inoremap { {}$ +"inoremap {{ { +"inoremap {} {} +"inoremap << <> +"inoremap [ [] +"inoremap [[ [ +"inoremap [] [] +"inoremap ( () +"inoremap (( ( +"inoremap () () +"inoremap " "" +"inoremap "" "" +"inoremap ' '' +"inoremap '' '' + +"Perso C définition" +inoremap prt printf +inoremap swf printf +inoremap #in< #include<> +inoremap #de #define + +" Personal shortcurts + +nnoremap èè__ :set pastem`o``:set nopaste +nmap :TagbarToggle +nmap :NERDTreeToggle + diff --git a/plugin/plugin_python-mode.vim b/plugin/plugin_python-mode.vim new file mode 100755 index 0000000..2bc009f --- /dev/null +++ b/plugin/plugin_python-mode.vim @@ -0,0 +1,11 @@ +" plugin_python-mode.vim +" Configuration for the python-mode plugin + +" I mostly use python3 +let g:pymode_python = "python3" + +" Do not run lint on each write +let g:pymode_lint_on_write = 0 + +" Disable folding +let g:pymode_folding = 0 diff --git a/plugin/plugin_rainbow.vim b/plugin/plugin_rainbow.vim new file mode 100755 index 0000000..493e2e3 --- /dev/null +++ b/plugin/plugin_rainbow.vim @@ -0,0 +1,4 @@ +" plugin_rainbow.vim +" rainbow configuration + +let g:rainbow_active = 1 diff --git a/plugin/plugin_ultisnips.vim b/plugin/plugin_ultisnips.vim new file mode 100755 index 0000000..0eafd77 --- /dev/null +++ b/plugin/plugin_ultisnips.vim @@ -0,0 +1,5 @@ +" plugin_ultisnips.vim +" UltiSnips configuration + +" disable missing python support warning +let g:UltiSnipsNoPythonWarning = 1 diff --git a/plugin/plugin_unite.vim b/plugin/plugin_unite.vim new file mode 100755 index 0000000..21e8861 --- /dev/null +++ b/plugin/plugin_unite.vim @@ -0,0 +1,15 @@ +" plugin_unite.vim + +" Bindings + +" Search files in current dir +nnoremap :Unite -start-insert file_rec/async +" Find pattern in current directory +nnoremap / :Unite grep:. +" Search in buffers +nnoremap s :Unite buffer + +" Search word under cursor +noremap * :Unite grep:.:: + +let g:unite_source_rec_async_command = 'ag --follow --nocolor --nogroup --hidden -g ""' diff --git a/plugin/search.vim b/plugin/search.vim new file mode 100755 index 0000000..6ae934b --- /dev/null +++ b/plugin/search.vim @@ -0,0 +1,9 @@ +" search.vim +" Defines search parameters + +set smartcase +set ignorecase +set incsearch +set gdefault +set showmatch +set nohlsearch diff --git a/plugin/syntax.vim b/plugin/syntax.vim new file mode 100755 index 0000000..ecd8edb --- /dev/null +++ b/plugin/syntax.vim @@ -0,0 +1,9 @@ +" syntax.vim + +syntax enable + +" Python specific options +let python_highlight_all = 1 + +" syntastic +let g:syntastic_cpp_compiler_options = "-std=cpp11" diff --git a/plugin/trailing-spaces.vim b/plugin/trailing-spaces.vim new file mode 100755 index 0000000..bea3f7a --- /dev/null +++ b/plugin/trailing-spaces.vim @@ -0,0 +1,6 @@ +" trailing-spaces.vim +" Trailing whitespaces highlighting + +highlight ExtraWhitespace ctermbg=darkred +" Show trailing whitepace and spaces before a tab: +autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL diff --git a/plugin/vim-airline.vim b/plugin/vim-airline.vim new file mode 100755 index 0000000..6152db7 --- /dev/null +++ b/plugin/vim-airline.vim @@ -0,0 +1,6 @@ +" vim-airline.vim +" vim-airline configuration + +let g:airline_left_sep='' +let g:airline_right_sep='' +let g:airline_theme='tomorrow' diff --git a/plugin/viminfo.vim b/plugin/viminfo.vim new file mode 100755 index 0000000..c543518 --- /dev/null +++ b/plugin/viminfo.vim @@ -0,0 +1,18 @@ +" viminfo.vim +" Viminfo parameters + +set viminfo='20,\"50,<100,n~/.vimtmp/viminfo + +" From the Vim wiki +" http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session +function! ResCur() + if line("'\"") <= line("$") + normal! g`" + return 1 + endif +endfunction + +augroup resCur + autocmd! + autocmd BufWinEnter * call ResCur() +augroup END -- cgit v1.2.3