Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken auto indentation #185

Open
jonashaag opened this issue Feb 5, 2019 · 7 comments
Open

Broken auto indentation #185

jonashaag opened this issue Feb 5, 2019 · 7 comments

Comments

@jonashaag
Copy link

Using vim-javascript and vim-jsx, JSX indentation is horribly broken. I've reduce to a minimal .vimrc that is attached – same behaviour.

asciicast

@jonashaag
Copy link
Author

home.tar.gz

@jonashaag
Copy link
Author

VIM - Vi IMproved 8.1 (2018 May 18 kompiliert am Jan 24 2019 00:25:24)
MacOS Version
Inklusive der Patches: 1-800
Übersetzt von Homebrew
Riesige Version ohne GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften:
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        -toolbar
-clientserver      +job               +perl              +user_commands
+clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           -python            +visualextra
+conceal           +linebreak         +python3           +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       +lua               +ruby              +windows
+dialog_con        +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             -X11
+digraphs          +modify_fname      +smartindent       -xfontset
-dnd               +mouse             +startuptime       -xim
-ebcdic            -mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      -xsmp
+eval              -mouse_gpm         +syntax            -xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
          System-vimrc-Datei: "$VIM/vimrc"
        Benutzer-vimrc-Datei: "$HOME/.vimrc"
 zweite Benutzer-vimrc-Datei: "~/.vim/vimrc"
         Benutzer-exrc-Datei: "$HOME/.exrc"
      defaults Datei: "$VIMRUNTIME/defaults.vim"
     Voreinstellung für $VIM: "/usr/local/share/vim"
Übersetzt: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linken: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6     

@dhilst
Copy link

dhilst commented Feb 9, 2019

I'm facing this on Fedora 29 too, vim 8.1

@dhilst
Copy link

dhilst commented Feb 9, 2019

au! BufWrite *.jsx :normal gg=G``

This make it less anoying

@scottdiemer
Copy link

I've been having this issue also on Manjaro with vim 8.1. The indention is all over the place. It's been driving me crazy! I tried what dhilst recommended which helped some but it's still an issue

au! BufWrite *.jsx :normal gg=G``

@tankorsmash
Copy link

tankorsmash commented Apr 5, 2019

I'm dealing with a similar issue. Every time I insert > or <, the lines indentation gets increased in that direction. As a wild guess I've done set noai nosi noci but that didn't help any either, short of disabling this plugin.

Installed the other jsx plugin instead, https://github.com/MaxMEllon/vim-jsx-pretty, and things seem to work out better, so people might want to give that a shot if they can't resolve the issue here.

@JESii
Copy link

JESii commented Apr 22, 2019

Suggest you switch to another JSX formatter -- this repo appears to have been abandoned.
I've switched to neoclide/vim-jsx-improve and am very happy with the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants