{"action":"created","issue":{"url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/11","labels_url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/11/comments","events_url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/11/events","html_url":"https://github.com/vhda/verilog_systemverilog.vim/issues/11","id":59569035,"number":11,"title":"# moves to column 0 if smartindent is enabled","user":{"login":"ghilton319","id":9616262,"avatar_url":"https://avatars.githubusercontent.com/u/9616262?v=3","gravatar_id":"","url":"https://api.github.com/users/ghilton319","html_url":"https://github.com/ghilton319","followers_url":"https://api.github.com/users/ghilton319/followers","following_url":"https://api.github.com/users/ghilton319/following{/other_user}","gists_url":"https://api.github.com/users/ghilton319/gists{/gist_id}","starred_url":"https://api.github.com/users/ghilton319/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghilton319/subscriptions","organizations_url":"https://api.github.com/users/ghilton319/orgs","repos_url":"https://api.github.com/users/ghilton319/repos","events_url":"https://api.github.com/users/ghilton319/events{/privacy}","received_events_url":"https://api.github.com/users/ghilton319/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-02T23:26:42Z","updated_at":"2015-03-03T21:32:47Z","closed_at":null,"body":"I noticed that when stating a new line with `#` and smartindent is enabled, the line will un-indent back to column 0. Formatting with `==` or `gg=V` corrected the indenting, but the extra step is not desired.\r\n\r\nPoking around the vim documentation I found [this](http://vimdoc.sourceforge.net/htmldoc/options.html#%27smartindent%27):\r\n>When typing '#' as the first character in a new line, the indent for that line is removed, the '#' is put in the first column.  The indent is restored for the next line.  If you don't want this, use this mapping: \":inoremap # X^H#\", where ^H is entered with CTRL-V CTRL-H.\r\n\r\nAdding `au FileType verilog_systemverilog inoremap # X^H#` to my `~/.vimrc` is one solution. I am more in favor of add the below to `indent/verilog_systemverilog.vim` (or another file) so other users with smartindent will not run into the same issue.\r\n\r\n    \" inoremap if smartindent is on (^H is CTRL-V CTRL-H)\r\n    inoremap # X^H#\r\n\r\nFrom my tests, the change only effects the intended verilog/systemverilog files. c/cpp files retain the column shift functionality.\r\n\r\nNote: don't copy-past `inoremap # X^H#`, the `^H` need to entered as `CTRL-V CTRL-H` in vim"},"comment":{"url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/comments/77039646","html_url":"https://github.com/vhda/verilog_systemverilog.vim/issues/11#issuecomment-77039646","issue_url":"https://api.github.com/repos/vhda/verilog_systemverilog.vim/issues/11","id":77039646,"user":{"login":"vhda","id":606876,"avatar_url":"https://avatars.githubusercontent.com/u/606876?v=3","gravatar_id":"","url":"https://api.github.com/users/vhda","html_url":"https://github.com/vhda","followers_url":"https://api.github.com/users/vhda/followers","following_url":"https://api.github.com/users/vhda/following{/other_user}","gists_url":"https://api.github.com/users/vhda/gists{/gist_id}","starred_url":"https://api.github.com/users/vhda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhda/subscriptions","organizations_url":"https://api.github.com/users/vhda/orgs","repos_url":"https://api.github.com/users/vhda/repos","events_url":"https://api.github.com/users/vhda/events{/privacy}","received_events_url":"https://api.github.com/users/vhda/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T21:32:47Z","updated_at":"2015-03-03T21:32:47Z","body":"I don't think you should be using `smartindent` in Verilog/SystemVerilog.\r\nWhat are you trying to accomplish that is not done already by `autoindent`?"}}