Timeline for How to ident the cursor to the indentation of the above line?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 31, 2020 at 11:48 | comment | added | Rich |
@Shuzheng Possibly you just missed it? At the end of :h filetype-indent-on , there's a link to :h indent-expression which explains and links to :h 'indentexpr' .
|
|
Jan 18, 2020 at 10:28 | comment | added | Shuzheng |
@Rich - reading the documentation for filetype plugin indent on nothing is mentioned of indentexpr - why is that?
|
|
Jan 18, 2020 at 9:51 | comment | added | Shuzheng | @Rich - thanks for this! I can’t believe that such indentation is not the default behavior. | |
Jan 18, 2020 at 9:51 | vote | accept | Shuzheng | ||
Jan 18, 2020 at 8:44 | comment | added | Rich |
@Shuzheng You don’t need to set indentexpr yourself. You just need to allow Vim to set it automatically with the filetype command I suggested. indentexpr is better than cindent because it is specifically tailored for whichever language you are using. cindent is designed for C so it will work in places where Go syntax is the same as C but will fail when there are differences.
|
|
Jan 18, 2020 at 6:10 | comment | added | Shuzheng |
@Rich - yes, the language is Go. I haven’t used indentexpr or cindent in my .vimrc. Why is it better than cindent ?
|
|
Jan 16, 2020 at 12:06 | history | edited | Rich | CC BY-SA 4.0 |
added 50 characters in body
|
Jan 16, 2020 at 11:59 | history | edited | Rich | CC BY-SA 4.0 |
added 44 characters in body
|
Jan 16, 2020 at 11:54 | history | edited | Rich | CC BY-SA 4.0 |
added 119 characters in body
|
Jan 16, 2020 at 11:40 | history | edited | Rich | CC BY-SA 4.0 |
added 465 characters in body
|
Jan 16, 2020 at 11:18 | history | answered | Rich | CC BY-SA 4.0 |