~garritfra/dotfiles

ef9f2753e826cf49304c37545cce2eb3d33b722e — Garrit Franke 5 months ago e18b419
fix(vim): smart indent issues
1 files changed, 16 insertions(+), 2 deletions(-)

M .config/nvim/init.vim
M .config/nvim/init.vim => .config/nvim/init.vim +16 -2
@@ 10,14 10,13 @@ endif

call plug#begin()
Plug 'gruvbox-community/gruvbox'
Plug 'scrooloose/syntastic'
Plug 'itchyny/lightline.vim'
Plug 'scrooloose/nerdtree'
Plug 'prettier/vim-prettier'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'mxw/vim-jsx'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'luochen1990/rainbow'

" FZF


@@ 71,6 70,21 @@ set laststatus=2
set noshowmode
set nohlsearch


" Fix for smart indent edge-case
" https://vi.stackexchange.com/a/22924
filetype indent off
function F_ind()
   let n_ind = indent(line('.'))
   let n_col = col('.') - 1
   if n_col > n_ind
      return "\n" . repeat("\t", n_ind / 4)
   else
      return "\n" . repeat("\t", n_col / 4)
   endif
endfunction
imap <expr> <CR> F_ind()

" when running at every change you may want to disable quickfix
let g:prettier#quickfix_enabled = 0
let g:prettier#autoformat = 0