From 5564d449535bdd03d5aef0d1d13297b07c8795e3 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Fri, 19 Jun 2020 08:03:11 +0200 Subject: [PATCH] Rewrote vim config --- dotfiles/vimrc | 97 +++++++++++++++++-- .../dotfiles}/vim/colors/nord.vim | 0 .../dotfiles}/vim_runtime/my_configs.vim | 50 ++++++---- old/dotfiles/vimrc | 11 +++ 4 files changed, 129 insertions(+), 29 deletions(-) rename {dotfiles => old/dotfiles}/vim/colors/nord.vim (100%) rename {dotfiles => old/dotfiles}/vim_runtime/my_configs.vim (83%) create mode 100644 old/dotfiles/vimrc diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 7b16604..8cffb1e 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -1,11 +1,90 @@ -set runtimepath+=~/.vim_runtime +" VIM Configuration - DarKou -source ~/.vim_runtime/vimrcs/basic.vim -source ~/.vim_runtime/vimrcs/filetypes.vim -source ~/.vim_runtime/vimrcs/plugins_config.vim -source ~/.vim_runtime/vimrcs/extended.vim +" Cancel VI compatibility +set nocompatible -try -source ~/.vim_runtime/my_configs.vim -catch -endtry +" -- Vim-plug +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + +call plug#begin('~/.vim/plugged') + Plug 'arcticicestudio/nord-vim' + Plug 'sjbach/lusty' + Plug 'kshenoy/vim-signature' + Plug 'w0rp/ale' + Plug 'ap/vim-css-color' + Plug 'mileszs/ack.vim' + Plug 'ctrlpvim/ctrlp.vim' +" Initialize plugin system +call plug#end() + +" -- Display +colorscheme nord +set title +set number +set ruler +set wrap +set scrolloff=5 +syntax enable + +filetype on +filetype plugin on +filetype indent on + +:highlight ExtraWhitespace ctermbg=red guibg=red +:match ExtraWhitespace /\s\+$/ + +" -- Search +set ignorecase +set smartcase +set incsearch +set hlsearch + +" -- Ack search +let g:ackprg="ack -H --nocolor --nogroup --column" +nmap j mA:Ack +nmap ja mA:Ack "=expand("")" +nmap jA mA:Ack "=expand("")" + +" -- Ctrlp +let g:ctrlp_map='c' + +" -- Beep +set visualbell +set noerrorbells + +" +set backspace=indent,eol,start + +" Hide file when open other file +set hidden + +" Disable arrow keys +"map +"map +"map +"map +"imap +"imap +"imap +"imap + +" Remap esc key +:imap +:map + +" Code formating +set expandtab +set tabstop=2 +set shiftwidth=2 + +let b:ale_linters = ['eslint'] +let g:ale_fixers = { + \ 'javascript': ['eslint'] + \ } +let g:ale_sign_error = '❌' +let g:ale_sign_warning = '⚠️' +let g:ale_fix_on_save = 1 diff --git a/dotfiles/vim/colors/nord.vim b/old/dotfiles/vim/colors/nord.vim similarity index 100% rename from dotfiles/vim/colors/nord.vim rename to old/dotfiles/vim/colors/nord.vim diff --git a/dotfiles/vim_runtime/my_configs.vim b/old/dotfiles/vim_runtime/my_configs.vim similarity index 83% rename from dotfiles/vim_runtime/my_configs.vim rename to old/dotfiles/vim_runtime/my_configs.vim index 6537a44..f553c93 100644 --- a/dotfiles/vim_runtime/my_configs.vim +++ b/old/dotfiles/vim_runtime/my_configs.vim @@ -1,29 +1,39 @@ syntax enable colorscheme nord +" Annule la compatibilité avec Vi +set nocompatible + set colorcolumn=100 set number - " Afficher les commandes partielles - set showcmd - " Montrer le mode courant - set showmode - " toujours montrer la barre de status dans toutes les fenêtres - set laststatus=2 - " whitespace characters - set list - " ne pas monter hightlight () - let loaded_matchparen = 1 - " highlight position curseur - set cursorline - " redraw only when needed - set lazyredraw - " MENU - "---------------- - " Complete files like a shell - set wildmode=list:longest - " affiche menu de completion - set wildmenu +" Afficher les commandes partielles +set showcmd + +" Montrer le mode courant +set showmode + +" toujours montrer la barre de status dans toutes les fenêtres +set laststatus=2 + +" whitespace characters +set list + +" ne pas monter hightlight () +let loaded_matchparen = 1 + +" highlight position curseur +set cursorline + +" redraw only when needed +set lazyredraw + +" MENU +"---------------- +" Complete files like a shell +set wildmode=list:longest +" affiche menu de completion +set wildmenu "----------------------------- " BEHAVIOUR diff --git a/old/dotfiles/vimrc b/old/dotfiles/vimrc new file mode 100644 index 0000000..7b16604 --- /dev/null +++ b/old/dotfiles/vimrc @@ -0,0 +1,11 @@ +set runtimepath+=~/.vim_runtime + +source ~/.vim_runtime/vimrcs/basic.vim +source ~/.vim_runtime/vimrcs/filetypes.vim +source ~/.vim_runtime/vimrcs/plugins_config.vim +source ~/.vim_runtime/vimrcs/extended.vim + +try +source ~/.vim_runtime/my_configs.vim +catch +endtry