Useful vim Tricks (2022-08-23)

Shortcuts

guu     : lowercase line
gUU     : uppercase line
~       : invert case (upper->lower; lower->upper) of current character

ga      : display hex, ascii value of character under cursor
g8      : display hex value of utf-8 character under cursor

=       : (re)indent the text on the current line or on the area selected

* #     : find word under cursor (forwards/backwards)
%       : match brackets {}[]()

<C-^>   : return to last opened file
<C-N><C-P>   : word completion in insert mode
<C-X><C-L>   : Line complete in insert mode

Config

set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab
set number relativenumber

Extentions

  • vim-airline: status bar
  • ale: lsp (error check, code suggestion, quick fix)
  • vim-cpp-enhanced-highlight: highlight