Skip to content
/ vimrc Public

vim configuration - Optimized for azerty keyboard layout

Notifications You must be signed in to change notification settings

frazrepo/vimrc

Repository files navigation

VIM Configuration

This repository hosts my vim configuration.

For neovim configuration, see here : https://github.com/frazrepo/nvim-config

How to install on Linux ?

1) git clone --depth=1 https://github.com/frazrepo/vimrc.git ~/.vim_runtime

2) run ./install.sh

How to install on Windows ?

1) git clone --depth=1 https://github.com/frazrepo/vimrc.git %USERPROFILE%/.vim_runtime

2) run install.bat

How to update to latest version?

Just do a git rebase!

cd ~/.vim_runtime
git pull --rebase

And run install.sh (or install.bat) to update vimrc configuration file

Cheat Sheet

Rotatable color schemes

Default GUI : auy (light theme), dracula (dark theme)
Default Terminal : apprentice (dark theme)
Dark theme : anderson, atom-dark256, apprentice, codedark, gruvbox8, minimalist, 
             molokai, mustang, monokai(sublime text), nord, seoul, space-vim-dark
Light theme : ayu (dark available), seoul256-light, pencil

Mappings

Click to expand

Leader key

leader =

Normal mode mappings

General

Mapping Action
<leader>w Save buffer
:W Save as sudo (linux)
<leader>fr Find/Replace highlighted text
<leader> noh
<leader>m Remove bad formatting ^M
<leader>f Search current buffer using Ilist

Move between Windows

Mapping Action
<C-h> Left
<C-l> Right

Buffers

Mapping Action
<leader>bn New buffer
<leader>bd or ! Close buffer
<leader>ba Close all buffers
<bs> Navigate alternate buffer
<leader>h Navigate previous
<leader>l Navigate next
<leader>e Edit in current buffer's path
<leader>x Scratch txt
<leader>d: Scratch Markdown
<leader>s Scratch SQL

Tabs

Mapping Action
<leader>tn New tab
<leader>to Tab Only
<leader>tc Close tab
<leader><bs> Alternate tab
<leader>te Edit new tab in current buffer's path

Editing mappings

Paste inner object quickly

Mapping Action
<leader>p "0p

Formatting

Mapping Action
g= Equalize entire document
gQ Format entire document

Visual mode mappings

Mapping Action
* Search current selection
# Search current selection backward
<leader>r Replace visual selection

Command line mappings

Mapping Action
:W Write sudo

Various mappings

Mapping Action
F3 Neoformat
F4 UndoTreeToggle
F8 Toggle quickfix window
F9 Toggle CtrlSF
F10 Rotate colorschemes
<M-0> Set font bigger (gui only)
<M-9> Set font smaller (gui only)

Plugins usage

Emmet

Mapping Action
,, Generate emmet

vim-lion

Mapping Action
gl{to-m}= Right Align with =
gL{to-m}= Left Align with =

vim-abolish

Mapping Action
Subvert Search Command
crs Coerce to snake_case
crm Coerce to MixedCase
crc Coerce to CamelCase
cru Coerce to UPPER_CASE
cr- Coerce to dash-case
cr. Coerce to dot-case
cr Coerce to space case
crt Coerce to Title Case

vim-exchange

Mapping Action
cx{to-motion} Exchange with text object or motion
cxx Exchange lines

ReplaceWithRegister

Mapping Action
{"reg}gr{to-motion} Paste register content on text object or motion
{"reg}{motion}grr Paste register content on lines

vim-sandwich with surroung mappings

Mapping Action
cs"= Change surround
css" Change surround on line (detect surrouding)
ys{motion}" Add surround
yss" Add surround on line
ds" Delete surround
dss Delete surround on line
S" Add surround on visual selection

vim-gtfo

Mapping Action
gof Open current buffer directory
got Open current buffer directory on terminal

vim-unimpaired

Mapping Action
( and ) Map keys
(t, )t Switch between tabs
(b, )b Switch between buffers
yo[r,n,w,x,....] Toggle Options
(space, )space, 10)space, (e, )e Lines operations

LeaderF

Mapping Action
<c-p> Files (t to open file in tab)
<leader>, Buffers
<leader>; BLines
<leader>u MRU
<leader>co Commands

vim-rainbow

Mapping Action
RainbowToggle Toggle coloring

vim-rotatescheme

Mapping Action
F10 / <S-F10> Rotate Forward/Backward

vim-scripts/Tranpose

Mapping Action
Tranpose
TranposeWords
TranposeTab
TranposeCSV ,
TranposeInteractive

sort-motion

Mapping Action
gs{motion} gs3j, gsi(,

ultisnips and vim-snippets

Mapping Action
<Tab> Expand
<Tab> Jump forward
<S-Tab> Jump backward

CtrlSF

Mapping Action
<leader>* Find selected word
F9 Toggle CtrlSF result Window
<leader>/ Prompt or Exec in Visual Mode

yankmatches

Mapping Action
ym / YM Yank highlighted search lines (YM for inverse)
dm / DM Delete highlighteed search line (DM for inverse)

zirrostig/vim-schlepp

Mapping Action
up/down/left/right After a selection in visual mode, drag using arrow key
D Duplicate in Visual Mode

custom text-objects

Mapping Action
ciq, daq Quotes q
vic, vac, viC, vaC Columns c
cii, dai Indents i
cin(l)q, dai, ci,, ci=, .. Targets
cil, yil Line l
yie, cie Entire e

Miscellaneous Commands

Mapping Action
ListLeaders Show all leader mappings
VisualBlock Activate visual block mode
SortByWitdh Sort lines by width
WipeReg Clean all registers
RemoveTrailingSpaces Remove spaces

Custom Docs

Regexp search/replace pattern

:h fztips
:h fzvimtips

Plugins list

How to uninstall

Just do following:

  • Remove ~/.vim_runtime
  • Remove any lines that reference .vim_runtime in your ~/.vimrc

Resources