Vimはインデント、行番号、ブラケットの自動マッチングを構成し、配色を変更します



Vim Configures Indentation



1.インデント、行番号、および角かっこの自動マッチング
vim --version vimのバージョンと使用可能な関数、リンクされているライブラリなどを表示します。
ユーザーレベル:vim〜 / .vimrc .vimrcファイルを開き、次のコードを記述して、構成を永続的に変更できるようにします。
システムレベル:/ etc / vim / vimrc
ユーザーレベルの構成を優先する
次のコードは、.vimrcファイルに直接コピーできます。

'Set the (soft) tab width to 4' set tabstop=4 set softtabstop=4 'Set the number of spaces for indentation to 4' set shift 'Set automatic indentation: the indentation value of each line is equal to the previous line use noautoindent to cancel the setting:' set autoindent 'Use the automatic indentation method of C/C++ language' set cindent 'Set the specific indentation method of C/C++ language (take my windows style as an example):' set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s 'Display line number' set nu 'Show Ruler' set ruler 'Reverse search content' set hlsearch 'Any value can be deleted' set backspace=2 'When the cursor encounters a parenthesis, square bracket, or brace, it automatically highlights the corresponding parenthesis, square bracket, or brace' set showmatch 'Automatic matching and completion of brackets' inoremap ( ()i inoremap [ []i inoremap { {}i inoremap { {}O 'coloring scheme' :colorscheme desert

2.配色



現在の配色を表示するには、最後の行モードでcolorschemeと入力します。デフォルトはデフォルトのcolorscheme配色です。
配色を一時的に変更できますvim〜 / .vimrc挿入モードで:colorscheme配色を入力して、配色を永続的に変更します
システムには配色が付属しています:ブルー、ダークブルー、デフォルト、デレク、デザート、エルフロード、イブニング、ケーラー、モーニング、マーフィー、パブロ、ピーチパフ、ロン、シャイン、スレート、トルテ、ゼルナー

青い
画像
濃紺
画像
デフォルト
画像
デレク
画像
砂漠
画像
エルフロード
画像
イブニング
画像
ケーラー
画像

画像
マーフィー
画像
パブロ
画像
ピーチパフ
画像
ロン
画像
輝く
画像
スレート
画像
ケーキ
画像
ウェイター
画像
Xshellを使用してLinuxに接続する場合、vimを使用すると、配色がXshellの配色と混ざって変更されることがあります。たとえば、私が設定した配色は、vimで使用されている灰色です。配色は砂漠で、開いた後の色は次のとおりです。
画像
砂漠のオリジナルの配色:
画像