1

I am using the gg=G, =ap etc. paradigms to reformat some code. This code is in tcl:

proc something { foo bar } {
set foo [yadda yadda]
set foo [yadda yadda]
set foo [yadda yadda]
}

When I try adjust indents, the formatting changes to:

proc something { foo bar } {
    set foo [yadda yadda]
        set foo [yadda yadda]
        set foo [yadda yadda]
}

I would expect all the set statements at the same indent level. Is there a way to do that?

This is the "VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 4 2017 18:14:54)" what comes with MacS Sierra, invoked as "vi".

Thanks

1
  • Can you tell us the output of :filetype and :verbose set sts? ts? sw? cindent? indentexpr? autoindent? smartindent? ? Commented Aug 24, 2017 at 9:33

1 Answer 1

0

Is the &filetype properly detected? Vim 7.4 runtime should already include the correct indent file.

Execute :scriptnames to list all sourced files and look for /usr/share/vim/vim74/indent/tcl.vim.

If it's missing, make sure you have this line in your vimrc file:

filetype plugin indent on

Read Indenting source code on the Vim Tips Wiki for more info on file-type based indentation.

1
  • Thanks for getting me started. tcl.vim is not listed as a plugin in OSX Sierra. My Deniers of IT Services have my mac locked down so I can't add files to that directory, and the other place I need to edit it is on a F5 load balancer. The F5 lists tcl.vim as a plugin, but it's vim 7.0.
    – wsanders
    Commented Aug 25, 2017 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.