Open hank-der-hafenarbeiter opened 3 years ago
I have the exact same issue using Vim 8. Is there any workaround?
Well, my workaround is learning functional programming using haskell instead. For me it was about learning functional programming and I got haskell to work. I'll probably come back to this later. So for now: No, haven't found a workaround.
Had the same issue. I use a Lua init file and it works nicely. Lua has its own namespace. You should try something like this:
local set = vim.opt -- acts like the :set command in vimscript; set global, window and buffer settings
set.shiftwidth = 2 -- set shift width to 4 spaces.
set.tabstop = 2 -- set tab width to 4 columns.
set.expandtab = true -- Use space characters instead of tabs.
Tabs are great! But yes, the PureScript compiler doesn't support it... yet.
EditorConfig: https://editorconfig.org/ purescript-tidy: https://github.com/natefaubion/purescript-tidy
This are two great options for your projects to help as well. EditorConfig will make sure your whole team's editors are using the same white space across projects. Tidy will make sure your PureScript code is formatted similarly across the project and team--including configurable indentation. With the tab support being an open discussion and the popularity of Tidy in the community allowing users to configure the number of spaces, I don't think it's in the best interest for the Vim project here to be dictating these settings on users, and instead users can differ to other tools like the ones mentioned or changing their local vimrc.
Maybe it would be a good idea to enable just expandtab
in the purescript.vim config? since the current situation is that tabs is not allowed in purescript, That would still allow users to use what ever shiftwidth and tabstop they like. It's particularly frustrating if users switch to Haskell because of this.
Agreed that we should not enforce the shiftwidth and tabstop given tools like purescript-tidy
allow users to configure this value. With the tab support issue having interest and being unresolved (with a community member saying they were going to investigate it), I think that this may be a bit hasty. I will double check with that member.
@FredTheDino is there an issue with setting up EditorConfig + editorconfig-vim while I get some confirmations?
I haven't used editorconfig in the purescript projects I'm working on - it looks to work. I lean heavily on the formatter. I was mostly trying to be solve the problem practically.
I have no problems with NeoVim 0.8.1 atleast.
Workaround for vim:
"{{ ~/.vimrc
function! PurescriptIndent()
setlocal expandtab
setlocal shiftwidth=2
setlocal tabstop=2
endfunction
au BufRead,BufNewFile *.purs call PurescriptIndent()
Hey everyone,
I don't know if this is an issue particular to my neovim setup but my editor indents using tabs and these are not legal characters in purescript. So purescript-vim should probably make sure that tabs aren't used for indentation. I mostly c+p my vimrc/init.vim together so I'm not sure what the best way to implement this is, but it should probably just say:
Somewhere