" _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | configuration vim + IDE | " | pcht 2016-2024 | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " Vundle https://github.com/VundleVim/Vundle.vim " install with : " git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim " set nocompatible be iMproved, required - Isnt it automatic with .vimrc?? " utf8 set encoding=utf-8 filetype off " required " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | Vundle | " | | " |https://github.com/VundleVim/Vundle.vim | " |install with : | " | git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim| " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim' " git Plugin 'tpope/vim-fugitive' " commentary Plugin 'commentary.vim' " Plugin 'Syntastic' " set statusline+=%#warningmsg# " set statusline+=%{SyntasticStatuslineFlag()} " set statusline+=%* " let g:syntastic_always_populate_loc_list = 1 " let g:syntastic_auto_loc_list = 1 " let g:syntastic_check_on_open = 1 " let g:syntastic_check_on_wq = 0 " let g:syntastic_auto_jump = 2 Plugin 'ctrlpvim/ctrlp.vim' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-repeat' " ys : ajoute autour de (sous le curseur) " ysw" : ajoute des " autour du word " ysW' : ajout des ' autour du WORD " yss{ : ajoute { a la phrase (avec espace) " yss} : ajoute { a la phrase " ySS[ : ajoute [ a la phrase, en indentant + a la ligne " " cs : change en dans " cs"' : change les " par des ' " " ds : supprime une " ds" : supprime les " " " : w = word, W = WORD, s = sentence, p = paragraph " " ' ( ) [ ] { } < > " t " unicode characters " :h unicode-plugin " map: " c-x c-z: complete unicode char " c-x c-g: complete unicode digraph Plugin 'chrisbra/unicode.vim' " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | LSP vim client | " | ALE (Asynchronous Lint Engine) | " | https://github.com/dense-analysis/ale | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " Plugin 'dense-analysis/ale' " let g:ale_linters = { " \ 'sh': ['shellcheck'], " \ 'py': ['flake8'], " \} " " flake8 ignore " let g:ale_python_flake8_options = '--ignore=E501' " let g:ale_fixers = { " \ '*': ['remove_trailing_lines', 'trim_whitespace'], " \} " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | LSP vim client | " | YouCompleteMe | " | https://valloric.github.io/YouCompleteMe/ | " | | " | Install: | " | https://github.com/ycm-core/YouCompleteMe?tab=readme-ov-file#linux-64-bit| " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) Plugin 'Valloric/YouCompleteMe' let g:ycm_language_server = [] " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | Language Server Protocol LSP | " | https://langserver.org/ | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " Archlinux " https://github.com/hashicorp/terraform-ls " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | bash-language-server | " | https://github.com/bash-lsp/bash-language-server | " | | " | install: | " | npm i -g bash-language-server | " | test: | " | bash-language-server --help | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) let g:ycm_language_server += \ [ \ { \ 'name': 'bash', \ 'cmdline': [ 'bash-language-server', 'start' ], \ 'filetypes': [ 'sh' ], \ } \ ] " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | dockerfile-language-server | " | https://github.com/rcjsuen/dockerfile-language-server | " | | " | install: | " | npm install -g dockerfile-language-server-nodejs | " | test: | " | ?? | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) let g:ycm_language_server += \ [ { 'name': 'docker', \ 'filetypes': [ 'dockerfile' ], \ 'cmdline': [ '/home/patrick/.npm-packages/bin/docker-langserver --stdio' ], \ }, \ ] " vim-language-server " https://github.com/iamcco/vim-language-server " install: " npm install -g vim-language-server " " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | reStructuredText | " | https://github.com/swyddfa/esbonio/tree/develop/lib/esbonio | " | | " | install: | " | pipx install esbonio | " | sudo pacman -Ss esbonio | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) let g:ycm_language_server += \ [ { 'name': 'esbonio', \ 'filetypes': [ 'rst' ], \ 'cmdline': [ 'esbonio' ], \ }, \ ] " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | Terraform | " | https://github.com/hashicorp/terraform-ls | " | | " | install: | " | https://github.com/hashicorp/terraform-ls | " | AUR: https://aur.archlinux.org/terraform-ls.git | " | | " | test: | " | terraform-ls version | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) let g:ycm_language_server += \ [ { 'name': 'terraform-ls', \ 'filetypes': [ "ts", "terraform", "terraform-vars" ], \ 'cmdline': [ 'terraform-ls', 'serve' ], \ }, \ ] """""""""""""""""""""""""" " languages autocompletion " toml " Plugin 'cespare/vim-toml' " COC https://github.com/neoclide/coc.nvim " Use release branch (recommend) " Plugin 'neoclide/coc.nvim', {'branch': 'release'} " Or build from source code by using yarn: https://yarnpkg.com " Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} " tabNine https://www.tabnine.com/ " online deeplearning all language sementic completion system " Plugin 'zxqfl/tabnine-vim' " Codeium - « free » coding assistant " https://github.com/Exafunction/codeium.vim Plugin 'Exafunction/codeium.vim' " Ollama Support for Vim " https://github.com/gergap/vim-ollama " Plugin 'gergap/vim-ollama' " Default chat model let g:ollama_chat_model = 'llama3.2:1b' " Codellama models " let g:ollama_model = 'codellama:7b' " " Codegemma (small and fast) " let g:ollama_model = 'codegemma:2b' " let g:ollama_fim_prefix = '<|fim_prefix|>' " let g:ollama_fim_middle = '<|fim_middle|>' " let g:ollama_fim_suffix = '<|fim_suffix|>' " " Deepseek-coder-v2 let g:ollama_model = 'deepseek-coder:1.3b' " let g:ollama_fim_prefix = '<|fim▁begin|>' " let g:ollama_fim_suffix = '<|fim▁hole|>' " let g:ollama_fim_middle = '<|fim▁end|>' " " activate debug let g:ollama_debug = 1 let g:ollama_logfile = '/home/patrick/vim-ollama.log' " ansible " Plugin 'pearofducks/ansible-vim' " enable YAML for hosts.yml " autocmd BufNewFile,BufRead hosts.y[a]ml setfiletype yaml.ansible " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | language server | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " languages " Plugin 'octol/vim-cpp-enhanced-highlight' " " C++ http://www.vim.org/scripts/script.php?script_id=3302 " install with vim clang_complete.vmb -c 'so %' -c 'q' " " GLSL " Plugin 'tikhomirov/vim-glsl' " rust " Plugin 'rust-lang/rust.vim' " golang " require Vim 8.0.1453 Plugin 'fatih/vim-go' au FileType go nmap m (go-test) au FileType go nmap a :GoAlternate au FileType go nmap gd (go-def) au FileType go set foldmethod=syntax " :Refactor extract newfunc " Plugin 'godoctor/godoctor.vim' " elm ElmCast https://guide.elm-lang.org/ " Plugin 'ElmCast/elm-vim' " ksp/kos script syntax " Plugin 'KSP-KOS/EditorTools', {'rtp': 'VIM/vim-kerboscript'} " kerboscript comment " or " Plugin 'Freedzone/kerbovim' " autocmd FileType kerboscript setlocal commentstring=//\ %s " terraform Plugin 'hashivim/vim-terraform' let g:terraform_align=1 " let g:terraform_fold_sections=1 let g:terraform_fmt_on_save=1 " let g:terraform_binary_path="/usr/local/Cellar/terraform/0.13.5/bin/terraform" " screeps.com game " Plugin 'dbaileychess/vim-screeps' " python - hand-made " from https://vim.fandom.com/wiki/Python_-_check_syntax_and_run_script " autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\" """"""" " tools " https://github.com/dhruvasagar/vim-table-mode " activation: \tm " add sep : || " add line : | blabla | blibli | " realign : \tr Plugin 'dhruvasagar/vim-table-mode' let g:table_mode_corner_corner='+' let g:table_mode_header_fillchar='=' nmap tm :TableModeToggle imap tm :TableModeTogglei " vim-shellcheck " map: " \m to launch Shellcheck " gb to see SCxxx in browser Plugin 'itspriddle/vim-shellcheck' au FileType sh compiler shellcheck au FileType sh nmap m :ShellCheck! au FileType sh imap m :ShellCheck!i " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | end Vundle | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " syntax syntax on " colorscheme default colorscheme pcht " print code with :hardcopy using impression.lam.jussieu.fr " set printdevice=hp5550-509 " set printoptions=left:5pt,right:5pt,top:5pt,bottom:5pt,number:y,duplex:off,wrap:y,paper:A4,portrait:y " set printheader=%<%F\ -\ page\ %N%=Print\ at\ %{strftime(\'%Y-%m-%d\ %H:%M\')} " FIXME set printfont=:h18 " modeline : enable « vim: [ vim_set ] + » set modeline " set backspace normal set backspace=2 " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | ligne de statut | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) set statusline=%F%m%r%h%w\ %{fugitive#statusline()}%=[BUF=%n][FORMAT=%{&ff}][TYPE=%Y][ASCII=%03.3b][LINE=%03l][COL=%03v][%p%%] set laststatus=2 """"""""""""""""""" " affiche les touches en mode commande set showcmd " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | numéro de ligne | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) set number highlight LineNr ctermbg=black ctermfg=gray """"""""""""""""""" " ligne et colonne courante: activation en mode insert et pas en mode normal " :autocmd InsertEnter,InsertLeave * set cursorline! cursorcolumn! " highlight CursorLine term=underline cterm=underline " set cursorcolumn cursorline " " highlight CursorColumn term=none cterm=none ctermbg=grey ctermfg=black " highlight CursorColumn term=underline cterm=underline """"""""""""""""""" " ligne courante: activation en mode insert et pas en mode normal :autocmd InsertEnter,InsertLeave * set cursorline! set cursorline highlight CursorLine term=underline cterm=underline """"""""""""""""""" " Search/IncSearch set hlsearch highlight Search term=reverse,bold cterm=reverse,bold ctermfg=None ctermbg=None set incsearch highlight IncSearch term=reverse cterm=reverse ctermfg=None ctermbg=None " /lemot : insensible a la case " /LeMot : sensible " /\clemot : insensible " /\CleMot : sensible set smartcase " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | tab/eof as characters | " | | " | https://vi.stackexchange.com/questions/422/displaying-tabs-as-characters | " | dans vim, utiliser Ctrl-v + u + code utf8 | " | code : https://codepoints.net/control_pictures | " | tab : ␉ (U+2409 - SYMBOL FOR HORIZONTAL TABULATION) | " | : ˍ (U+02cd - MODIFIER LETTER LOW MACRON) | " | : ․ (U+2024 - ONE DOT LEADER) | " | : • (U+2022 - BULLET) | " | eol : ¶ (U+00b6 - PILCROW SIGN) | " | trail : ␠ (U+2420 - SYMBOL FOR SPACE) | " | : ␣ (U+2423 - OPEN BOX) | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) set list set listchars=tab:␉․,trail:␠,nbsp:⎵,precedes:<,extends:>,eol:¶ " listchars as grey highlight SpecialKey ctermfg=DarkGrey highlight NonText ctermfg=DarkGrey nmap l :set invlist imap l :set invlistli " disable by default set invlist " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | autoindent | " | | " | set autoindent | " | tabulation | " | set expandtab | " | set shiftwidth=4 | " | set softtabstop=4 | " | set tabstop=4 | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " replis de code " zf pour créer un repli " za pour ouvrir/fermer un repli déjà crée " zm pour fermer tous les replis " zr pour ouvrir tous les replis " function! MyFoldFunction () " let line = getline(v:foldstart) " let sub = substitute(line,'/\*\|\*/\|^\s+','','g') " let lines = v:foldend - v:foldstart + 1 " return '[+] ' . v:folddashes.sub . '...' . lines . ' lignes...' . getline(v:foldend) " endfunction set nofoldenable set foldlevel=3 "" afficher un = sur les replis " set fillchars=fold:= " set foldtext=MyFoldFunction() " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | les onglets | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " tabe créer un onglet "function! MoveTab(direction) " if (a:direction == 'left') " let tabnum = tabpagenr()-2 " if (tabnum < 0) " let tabnum = 0 " endif " execute 'tabm '.tabnum " else " let tabnum = tabpagenr() " execute 'tabm '.tabnum " endif "endfunction highlight TabLine term=none cterm=none highlight TabLineSel ctermbg=darkblue " raccourcis " gF ouvre un onglet sur le mot sous le cursor map :tabprevious map :tabprevious map :tabnext map :tabnext " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | correcteur orthographique | " | utilisation | " | <]+s>, <[+s>: aller a l'erreur precedente, suivante | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) setlocal spell spelllang=fr,en " setlocal spell spelllang=en_us,fr set spell highlight SpellBad term=underline ctermfg=white ctermbg=red cterm=underline highlight SpellCap term=italic,underline ctermfg=yellow ctermbg=red cterm=underline highlight SpellRare term=bold,italic,underline ctermfg=cyan ctermbg=red cterm=underline highlight SpellLocal term=underline ctermfg=grey ctermbg=red cterm=underline highlight SpellErrors term=italic,underline ctermbg=red ctermfg=white " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | ouverture du fichier à l'ancienne position | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) function! s:CursorOldPosition() if line("'\"") > 0 && line("'\"") <= line("$") exe "normal g`\"" endif endfunction autocmd BufReadPost * silent! call s:CursorOldPosition() " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | templates | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) function! LoadTemplate(extension,type) if (a:type == 'all') silent! execute '0r' . $HOME . '/.vim/__tpl/' . a:extension . '.tpl' silent! execute 'source ' .$HOME . '/.vim/__tpl.vim' endif " abbreviations silent! execute 'source ' .$HOME . '/.vim/__tpl/' . a:extension . '.abb' " dictionaries silent! execute 'source ' .$HOME . '/.vim/__tpl/' . a:extension . '.dict' " commandes vim silent! execute 'source ' .$HOME . '/.vim/__tpl/' . a:extension . '.vim' endfunction autocmd BufNewFile * silent! call LoadTemplate('%:e','all') autocmd BufRead * silent! call LoadTemplate('%:e','notall') " " omnifunc " if has("autocmd") && exists("+omnifunc") " autocmd Filetype * " \ if &omnifunc == "" | " \ setlocal omnifunc=syntaxcomplete#Complete | " \ endif " endif " CISCO ACL augroup filetype au! BufRead,BufNewFile *.crules set filetype=ciscoacl au! BufRead,BufNewFile *.acl set filetype=ciscoacl augroup END " markdown syntax for gitit augroup filetype au! BufRead,BufNewFile *.page set filetype=markdown au! BufRead,BufNewFile *.md set filetype=markdown augroup END " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | boxes tool to pretty print code | " | from https://boxes.thomasjensen.com/docs/install.html | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) autocmd BufEnter * nmap bb !!boxes -d shell -s 80 autocmd BufEnter * vmap bb !boxes -d shell -s 80 autocmd BufEnter * nmap BB !!boxes -d shell -s 80 -r autocmd BufEnter * vmap BB !boxes -d shell -s 80 -r autocmd BufEnter *.go,*.java nmap bb !!boxes -d cpp -s 80 autocmd BufEnter *.go,*.java vmap bb !boxes -d cpp -s 80 autocmd BufEnter *.go,*.java nmap BB !!boxes -d cpp -s 80 -r autocmd BufEnter *.go,*.java vmap BB !boxes -d cpp -s 80 -r autocmd BufEnter .vimrc* nmap bb !!boxes -d vim -s 80 autocmd BufEnter .vimrc* vmap bb !boxes -d vim -s 80 autocmd BufEnter .vimrc* nmap BB !!boxes -dvim -s 80 -r autocmd BufEnter .vimrc* vmap BB !boxes -d vim -s 80 -r " Search down into subfolders " Provides tab-completion for all file-related tasks " use :find + set path+=** " Display all matching files when we tab complete set wildmenu " formatoptions set formatoptions=tcpr " tab and spaces " see http://vimcasts.org/episodes/tabs-and-spaces/ " set ts=4 sts=4 sw=4 noet set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab " keep center set scrolloff=999 " _\|/_ " (o o) " <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " | | " | keymaps | " | | " <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> " (_) (_) " no arrows keys no more nmap nmap nmap nmap " Esc remap imap jj imap kk " moves " nmap K " nmap J " search next/previous with center view " no need with scrolloff=99 " nmap n nzz " nmap N Nzz " always open file even new one nmap gf :e " increase / decrease :nnoremap :nnoremap " speed up " edit .vimrc nmap v :vs ~/.vimrc imap v :vs ~/.vimrci nmap V :source ~/.vimrc " see file imap s :!see %i nmap s :!see % " html + php " nmap h :set ft=html " imap h :set ft=htmli " nmap p :set ft=php " imap p :set ft=phpi " make nmap m :w:!clear:make imap m :w:!clear:make nmap t :w:!clear:make test imap t :w:!clear:make test nmap , :cprevious imap , :cpreviousi nmap . :cnext imap . :cnexti " change alternative nmap / :e# " auto indent nmap i m`gg=G`` " try ; as : nmap ; : " translate with trans (https://github.com/soimort/translate-shell) vmap fr :!trans -b :fr vmap en :!trans -b :en