dart-lang/dart-vim-plugin

How do I indent my code with tabs?

ProgrammingLife opened this issue · 2 comments

I've noticed about:

Enable Dart style guide syntax (like 2-space indentation) with let g:dart_style_guide = 2

but I wanna indent my code with tabs. How can I get it?

I can't use spaces because I will not be able to turn on highlighting for hierarchy like this:

set listchars=tab:\┆\ ,trail:•,extends:»,precedes:«
set list

You can't, unfortunately.

but I wanna indent my code with tabs. How can I get it?

If you aren't setting the g:dart_style_guide variable this plugin should not impact your indent settings.

See :help expandtab and :help ftplugin for general vim information on setting indent options in vim. This is unrelated to this plugin.

In particular you either want an ftplugin/dart.vim file with

setlocal noexpandtab

or in your vimrc

augroup dart-indent
  autocmd!
  autocmd FileType dart setlocal noexpandtab
augroup END

If you are indenting with tabs you should not use :DartFmt. The Dart formatter only support spaces for indent so you'll need to manually format your code.