purescript-contrib / purescript-vim

Syntax highlighting and indentation for PureScript
BSD 2-Clause "Simplified" License
154 stars 35 forks source link

line after type declaration begins indented #51

Open matthewleon opened 7 years ago

matthewleon commented 7 years ago

for example

x :: Number

The line immediately after will begin indented. This is undesirable to me.

Removing the setlocal indentexpr=GetPurescriptIndent() line from the indentation file stops this, but of course it stops all indentation.

I can't tell if this is something unique to my vim configuration, or if this happens to everyone. I'd appreciate any advice you can give for further debugging.

matthewleon commented 7 years ago

I've removed all plugins except this one, and the behavior continues. This is in Vim 8.

Baudin999 commented 7 years ago

I can confirm this behaviour in vim 8. My vim configuration is:

call plug#begin('~/.vim/plugged')

Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'valloric/youcompleteme'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'flazz/vim-colorschemes'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/syntastic'
Plug 'bling/vim-bufferline'
Plug 'tpope/vim-surround'
Plug 'elmcast/elm-vim'
Plug 'purescript-contrib/purescript-vim'

call plug#end()

" Airline configuration
let g:airline#extensions#tabline#enabled = 1

" Syntax highlighting
colo apprentice
syntax enable
let g:jsx_ext_required = 0
let g:javascript_plugin_jsdoc = 1

" Syntax Checking
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_javascript_eslint_exe='$(npm bin)/eslint'
let g:syntastic_javascript_checkers=['eslint']

" Spaces and tabs
set tabstop=4       " number of spaces a tab counts for
set softtabstop=4   " number of spaces a tab counts for when editing
set expandtab       " tabs are spaces
set shiftwidth=4
set smarttab

" UI config
set number      " show line numbers
set showcmd     " show the last command entered
filetype plugin indent on   " filetype detection and allows loading of language specific indentation
set wildmenu        " vim autocompletes things like filenames
set lazyredraw
set showmatch

" searching
set incsearch       " search as characters are entered
set hlsearch        " highlight matches

" NERDTree keymappings
nnoremap <silent> <F2> :NERDTreeFind<CR>
noremap <F3> :NERDTreeToggle<CR>
map <F3> :NERDTreeToggle<CR>
map <F2> :NERDTreeFind<CR>

" CtrlP settings
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git|elm-stuff\'
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'

" Set the mouse to allow scrolling
set mouse=a
set encoding=utf-8
set hidden
set wildchar=<Tab> wildmenu wildmode=full
set wrap!

nnoremap <s-right> :bn<CR>
nnoremap <s-left> :bp<CR>
nnoremap <F5> :buffers<CR>:buffer<Space>

" autoformat on save
augroup autoindent
    au!
    autocmd BufWritePre * :normal migg=G`i
augroup End

" Save sessions in vim
nnoremap <S-F8> :mksession! ~/.vim/vim_session <cr> " Quick write session with F2
nnoremap <F8> :source ~/.vim/vim_session <cr>     " And load session with F3