set nocompatible filetype off filetype plugin indent on syntax on set mouse= set ttyfast " Indicate fast terminal conn for faster redraw set lazyredraw " Wait to redraw set magic set ruler " affiche la position du curseur en bas droite set showmode " affiche le mode (insert ou autre) set showcmd " Show current command. set laststatus=2 set number set signcolumn=auto set encoding=utf-8 set fileencoding=utf-8 set termencoding=utf-8 set backspace=indent,eol,start " activation de la touche backspace set ai " autoindentation active set sm " syntax match: soulignement d'une parenth e associ ,... set hlsearch " colorisation de la recherche set ignorecase set ts=4 " taille des tabulations set sw=4 " taille des indentations set tw=0 " textwidth: largeur du texte (commentaires) 0=pas de limite set expandtab " converti les tab en espaces set directory=/tmp set wildmode=full " vim bar autocomplete set wildmenu set smartindent set autoread " Set vim to update autmatically when a file's read-only state is changed set undodir=~/.cache/vim.lite/undodir set undofile " Persistent undo set undolevels=10000 " maximum number of changes that can be undone set undoreload=100000 " maximum number lines to save for undo on a buffer reload set history=1000 " remember more commands and search history set nobackup " no backup or swap file, live dangerously set noswapfile " swap files give annoying warning set clipboard^=unnamedplus " send yank to system clipboard set updatetime=100 set hidden " Allow modified hidden buffers set autowriteall set nofoldenable " Folding makes things unreadable. set noautochdir set keymodel=startsel " shift+arrow selection " Autocompletion set shortmess+=c set pumheight=20 " colorscheme set notermguicolors " this fix mosh/tmux color set background=light set term=screen-256color let g:gruvbox_contrast_light = "hard" colorscheme gruvbox " Remap some common typos command! -bang E e command! -bang Q q command! -bang W w command! -bang QA qa command! -bang Qa qa command! -bang Wa wa command! -bang WA wa command! -bang Wq wq command! -bang WQ wq " Mapping let mapleader = " " " Leader key set to map ? :exec printf('view %s/help.md', fnamemodify(expand($MYVIMRC), ':p:h')) map V :tabedit $MYVIMRC map S :source $MYVIMRC \| :echo $MYVIMRC 'reloaded' map :set nonumber \| :set signcolumn=no map :set number \| :set signcolumn=auto map :call ToggleNetrw() map :set number! map :set paste! map :call custom#ToggleMouse() map ^ map $ map e map b map :vsplit map \ :split map :wincmd k map :wincmd j map :wincmd l map :wincmd h " https://vim.fandom.com/wiki/Fix_arrow_keys_that_display_A_B_C_D_on_remote_shell map OA :wincmd k map OB :wincmd j map OC :wincmd l map OD :wincmd h map :noh map o " paste last yank (not from dd) map p "0p nnoremap :-10 vnoremap :-10 nnoremap :+10 vnoremap :+10 " Always forward with n / backward with N noremap n (v:searchforward ? 'n' : 'N') noremap N (v:searchforward ? 'N' : 'n') " Tab map :tabprevious map :tabnext map :tabnew for i in range(1, 9) execute "map " . i . " " . i . "gt" endfor map 0 :tablast " Specific filetype autocmd BufNewFile,BufRead *.lib set filetype=sh autocmd BufNewFile,BufRead *.source set filetype=sh autocmd BufNewFile,BufRead *.pp set filetype=puppet autocmd BufNewFile,BufRead *.inc set filetype=perl " trim whitespace autocmd BufWritePre * :%s/\s\+$//e " Enable Omnicomplete features - vim-auto-popmenu set completeopt=longest,menuone,noinsert,noselect let g:apc_enable_ft = {'text':1, 'markdown':1, 'sh':1, 'python':1, 'perl':1, 'puppet':1, 'ansible':1} " enable filetypes let g:apc_min_length = 2 " minimal length to open popup let g:apc_key_ignore = [] " ignore keywords