質問

よう推奨していまvimからの置き換えスタブがautoindentですか?

例:している場合はタブが二つと7つのスペースの初めに、 tabstop=3, しEnterを押し、次の行には、タブを1スペースが、たくないのに---

役に立ちましたか?

解決

でも良いアイデアを使わないタブ。

:set expandtab

したい場合は全て入れ替えるタブのファイル3つの空間(見た目や聞こえの良さだと類似 tabstop=3):

:%s/^I/   /

^Iタブ 文字)

からVIMのオンラインヘルプ

'tabstop' 'ts'      number  (default 8)
        local to buffer
Number of spaces that a <Tab> in the file counts for.  Also see
|:retab| command, and 'softtabstop' option.

Note: Setting 'tabstop' to any other value than 8 can make your file
appear wrong in many places (e.g., when printing it).

There are four main ways to use tabs in Vim:
1. Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4
   (or 3 or whatever you prefer) and use 'noexpandtab'.  Then Vim
   will use a mix of tabs and spaces, but typing <Tab> and <BS> will
   behave like a tab appears every 4 (or 3) characters.
2. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use
   'expandtab'.  This way you will always insert spaces.  The
   formatting will never be messed up when 'tabstop' is changed.
3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
   |modeline| to set these values when editing the file again.  Only
   works when using Vim to edit the file.
4. Always set 'tabstop' and 'shiftwidth' to the same value, and
   'noexpandtab'.  This should then work (for initial indents only)
   for any tabstop setting that people use.  It might be nice to have
   tabs after the first non-blank inserted as spaces if you do this
   though.  Otherwise aligned comments will be wrong when 'tabstop' is
   changed.

他のヒント

すべてのいのautoindentedラインにおいて、まさに同じインデントの文字としては、前回ます。

:help copyindent

'copyindent' 'ci' boolean (デフォルトoff);地域へのバッファ;{なVi}

コピーの構造、既設ラインインデントがautoindenting、 新しいライン。通常のインデントが再構築によるシリーズ タブの後に半角スペースとして必要な 'expandtab' 有効にし その場合のみスペースが使用されます。このオプションの 新しいコピーの何文字を使用した記述に 既存路線です。場合にはインデントにより、既存の ラインの残りのスペースが通常です。

注意: 'copyindent' リセット時 "対応' を設定します。
'preserveindent'.

:help preserveindent

'preserveindent' "pi' boolean (デフォルトoff);地域へのバッファ;{なVi}

を変更する場合には、そのインデントの現在の線まで、保存のどれにも当てはまらない インデントな構造が可能です。通常のインデントであるにも関わら シリーズのタブの後に半角スペースとして必要な 'expandtab' は 有効にする場合のみスペースが使用されます。このオプション のインデントを維持し、多くの既存の文字数 のための記述、追加のタブは狭いスペースが必要です。

注意:使用時">>"を複数回のインデントキンセールゴルフクラブ タブ。ない場合がございます。
注意: 'preserveindent' リセット時 "対応' を設定します。
'copyindent'.
用途:retabクリーンにしていきます。

きのすべてを TABSPACE

:set et
:ret!

またはすべてを SPACETAB

:set et!
:ret!

ここでの私の .vimrc:

set autoindent
set expandtab
set softtabstop=4
set shiftwidth=4

この作品をよくわきまえていない私にはとて絶対にしないタブの私のソースコード。からのお問いきたいタブが二つ、空間ライセンスには、なんなのかがえvimすることはあります。

うことができるのか?

標準vi解釈tabキーを押すと、文字通り、人気がありvi由来代替するスマートのように、vim.車vim解釈するタブとして`インデント"コマンドの代わりに挿入、ブタブの"コマンドは、この:

set softtabstop=2

場合は交換したいすべてのタブをスペースの設定に基づいて'ts'を使用できretab.でも、逆になります。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top