syntax question.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

syntax question.

sinbadd
How does vim syntax formatting works? for instance when i type ':' the whole line gets left justified to the start of the line, though this action makes sense for c-coding, it also happens for other file types. I want to disable this specific syntax action. how can i achieve that ?

:set filetype
  filetype=new

:set syntax
  syntax=new

these are my current filtype and syntax settings. I just set both of them to a nonexistent value 'new'. but i still see that left justification.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax question.

Nikolay Aleksandrovich Pavlov
2017-02-22 23:10 GMT+03:00 sinbad <[hidden email]>:
> How does vim syntax formatting works? for instance when i type ':' the whole line gets left justified to the start of the line, though this action makes sense for c-coding, it also happens for other file types. I want to disable this specific syntax action. how can i achieve that ?
>
> :set filetype
>   filetype=new
>
> :set syntax
>   syntax=new
>
> these are my current filtype and syntax settings. I just set both of them to a nonexistent value 'new'. but i still see that left justification.

&syntax is completely irrelevant, it is only used for highlighting.
What you need is normally managed by indentation scripts placed in
`{runtimepath}/indent/{filetype}.vim` (uses &filetype). But in
addition to indentation scripts there are default values, specifically
all options containing indent are relevant: `:helpgrep
\*'\w*indent\w*'\*` (or use the same search in `:h options.txt`). Also
there may be option values leaked from previously open filetypes or
global settings set in vimrc/etc.

The easiest solution should be `:setlocal indentkeys-=:`, but this
will only disable reindenting on colon. Vim will *still* think that
line needs to be shifted to the start, yet it will not autoindent when
you type colon.

>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...