configuratinde vim et de gvim sous linux

Mise à jour: 08/09/2023
Version: 1.0
Author: Jean-Louis Bicquelet-Salaün
Location: http://jlbicquelet.free.fr
Copyright: (c) 2023 Jean-Louis BICQUELET-SALAÜN
@h1/configuration gvim et vim l n'est pas facile de configurer vim ou gvim. es possibilités sont nombreuses. Je vais vous donnez mon fichier .vimrc de configuration. Il n'est pas très complet, mais il a le mérite de fonctionner pour vim et pour gvim.

installation

Je n'utilise que @vim) et @(vil-gtk3). je n'ai donc utilisé que ces deux paquets:

@sudo apt install vim
@sudo apt install vim-gtk3

fichier .vimrc

Le contenu de vimrc est :


" Disable compatibility with vi which can cause unexpected issues.
ial command you type in the last line of the screen.
set showcmd

" Show the mode you are on the last line.
set showmode

" Show matching words during a search.
set showmatch

" Use highlighting when doing a search.
set hlsearch

ommands to save in history default number is 20.
 set history=1000

 " Enable auto completion menu after pressing TAB.
 set wildmenu

 " Make wildmenu behave like similar to Bash completion.
 set wildmode=list:longest

 " There are certain files that we would never want to edit with Vim.
 " Wildmenu will ignore files with these extensions.
 set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx

 " PLUGINS ---------------------------------------------------------------- {{{

 " Plugin code goes here.

 " }}}


 " MAPPINGS --------------------------------------------------------------- {{{

" Mappings



explications

Les principaux points de la configuration sont:

mise en valeur de la syntaxe sont l'affichage en fonction du type de fichier:

     " Turn syntax highlighting on.
     syntax on
 
@h3/ Le curseur La mise en evidence du curseur afin de savoir où on se trouve dans le fichier et se repérer:
      " Add numbers to each line on the left-hand side.
      set number

      " Highlight cursor line underneath the cursor horizontally.
      set cursorline
 
@h3/ l'indentation L'indentatiion est définie ainsi:
     " Load an indent file for the detected file type.
     filetype indent on

     " Set shift width to 3 spaces.
     set shiftwidth=3

     " Set tab width to 3 columns.
     set tabstop=3

     " Use space characters instead of tabs.
     set expandtab
 

fichiers géréa par vi

Les fichiers binaires (comme .docx, .pdf, .png, etc..) sont exclu:
    On fixe le pas d'indentation à trois espaces et on n'utilisera que des espaces (pas de tab).

    " There are certain files that we would never want to edit with Vim.
    " Wildmenu will ignore files with these extensions.
    set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx

plugins

La derniere partie à partir de
    " PLUGINS ---------------------------------------------------------------- {{{
        " 
 
est destinée à préparer la mise en place de future extension.