Skip to content

Instantly share code, notes, and snippets.

@zhang-ning
Last active February 9, 2019 14:51
Show Gist options
  • Save zhang-ning/d3e98bce79db2c7117e873f41c22200b to your computer and use it in GitHub Desktop.
Save zhang-ning/d3e98bce79db2c7117e873f41c22200b to your computer and use it in GitHub Desktop.

Revisions

  1. zhang-ning revised this gist Feb 9, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -123,6 +123,7 @@ let g:ale_fixers = {
    \ 'javascript': ['prettier','eslint'],
    \ 'typescript': ['prettier','tslint'],
    \ 'css': ['prettier'],
    \ 'json': ['prettier', 'eslint'],
    \ 'less': ['prettier'],
    \ 'sass': ['prettier'],
    \}
  2. zhang-ning revised this gist Feb 9, 2019. 1 changed file with 17 additions and 11 deletions.
    28 changes: 17 additions & 11 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,4 @@
    Plugin 'dracula/vim'
    " 2019年2月8日修改,新增3个plugin
    " Plugin 'leafgarland/typescript-vim'
    " Plugin 'Quramy/tsuquyomi'
    " Plugin 'w0rp/ale'

    " for indent
    set autoindent
    @@ -55,8 +51,8 @@ autocmd QuickFixCmdPost l* nested lwindow
    let g:tsuquyomi_disable_quickfix = 1

    " 2019年2月8日修改:tsuquyomi => ale
    let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['ale'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['tslint'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.


    @@ -82,6 +78,12 @@ let g:syntastic_error_symbol = "✗"
    let g:syntastic_warning_symbol = "⚠"


    let g:ale_sign_error = '✘'
    let g:ale_sign_warning = '⚠'
    " highlight ALEErrorSign ctermbg=NONE ctermfg=red
    " highlight ALEWarningSign ctermbg=NONE ctermfg=yellow


    " set nocompatible
    " set completeopt+=menuone
    " set rtp+=~/.yadr/vim/bundle/neocomplete/
    @@ -110,20 +112,24 @@ let g:neocomplete#force_omni_input_patterns.typescript = '[^. *\t]\.\w*\|\h\w*::
    " In ~/.vim/ftplugin/javascript.vim, or somewhere similar.

    " Fix files with prettier, and then ESLint.
    " let b:ale_fixers = ['prettier', 'eslint']
    let b:ale_fixers = ['prettier', 'eslint']
    " Equivalent to the above.
    " let b:ale_fixers = {'javascript': ['prettier', 'eslint']}
    let b:ale_fixers = {'javascript': ['prettier', 'eslint']}


    " In ~/.vim/vimrc, or somewhere similar.
    let g:ale_fixers = {
    \ '*': ['remove_trailing_lines', 'trim_whitespace'],
    \ 'javascript': ['eslint', 'prettier'],
    \ 'typescript': ['tslint', 'eslint', 'prettier'],
    \ 'javascript': ['prettier','eslint'],
    \ 'typescript': ['prettier','tslint'],
    \ 'css': ['prettier'],
    \ 'less': ['prettier'],
    \ 'sass': ['prettier'],
    \}

    let g:ale_linters_explicit = 1

    let g:ale_linters_ignore = {'typescript': ['tslint']}
    " let g:ale_linters_explicit = 1


    " Set this variable to 1 to fix files when you save them.
  3. zhang-ning revised this gist Feb 8, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -55,9 +55,9 @@ autocmd QuickFixCmdPost l* nested lwindow
    let g:tsuquyomi_disable_quickfix = 1

    " 2019年2月8日修改:tsuquyomi => ale
    " let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['ale'] " You shouldn't use 'tsc' checker.
    let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.



  4. zhang-ning revised this gist Feb 8, 2019. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,8 @@ let g:tsuquyomi_disable_quickfix = 1

    " 2019年2月8日修改:tsuquyomi => ale
    " let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    let g:syntastic_typescript_checkers = ['ale'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['ale'] " You shouldn't use 'tsc' checker.
    let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.



    @@ -118,7 +119,7 @@ let g:neocomplete#force_omni_input_patterns.typescript = '[^. *\t]\.\w*\|\h\w*::
    let g:ale_fixers = {
    \ '*': ['remove_trailing_lines', 'trim_whitespace'],
    \ 'javascript': ['eslint', 'prettier'],
    \ 'typescript': ['eslint', 'prettier'],
    \ 'typescript': ['tslint', 'eslint', 'prettier'],
    \ 'css': ['prettier'],
    \}

  5. zhang-ning revised this gist Feb 8, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    Plugin 'dracula/vim'
    " 2019年2月8日修改,新增3个plugin
    Plugin 'leafgarland/typescript-vim'
    Plugin 'Quramy/tsuquyomi'
    Plugin 'w0rp/ale'
    " Plugin 'leafgarland/typescript-vim'
    " Plugin 'Quramy/tsuquyomi'
    " Plugin 'w0rp/ale'

    " for indent
    set autoindent
  6. zhang-ning revised this gist Feb 8, 2019. 1 changed file with 49 additions and 2 deletions.
    51 changes: 49 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,8 @@
    Plugin 'dracula/vim'
    " 2019年2月8日修改,新增3个plugin
    Plugin 'leafgarland/typescript-vim'
    Plugin 'Quramy/tsuquyomi'
    Plugin 'w0rp/ale'

    " for indent
    set autoindent
    @@ -32,7 +36,7 @@ set fileencodings=utf-8,cp936,big5,ucs-bom
    " }}}
    "

    " let g:yadr_disable_solarized_enhancements = 1
    let g:yadr_disable_solarized_enhancements = 1
    " set guifont=Menlo\ Regular:h14
    set guifont=Inconsolata:h17,Monaco:h15
    " colorscheme base16-twilight
    @@ -49,7 +53,13 @@ autocmd QuickFixCmdPost [^l]* nested cwindow
    autocmd QuickFixCmdPost l* nested lwindow

    let g:tsuquyomi_disable_quickfix = 1
    let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.

    " 2019年2月8日修改:tsuquyomi => ale
    " let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    let g:syntastic_typescript_checkers = ['ale'] " You shouldn't use 'tsc' checker.



    " let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.

    " autocmd FileType typescript setlocal completeopt-=menu
    @@ -86,4 +96,41 @@ endif
    let g:neocomplete#force_omni_input_patterns.typescript = '[^. *\t]\.\w*\|\h\w*::'


    " Make `jj` and `jk` throw you into normal mode
    " inoremap jj <esc>
    " inoremap jk <esc>

    " Map `Escape` to ‘nothing’ in Normal, Visual, Select, Operator-pending modes
    " noremap: <esc> <nop>
    " Map `Escape` to ‘nothing’ in Insert and Command modes
    " noremap!: <esc> <nop>


    " In ~/.vim/ftplugin/javascript.vim, or somewhere similar.

    " Fix files with prettier, and then ESLint.
    " let b:ale_fixers = ['prettier', 'eslint']
    " Equivalent to the above.
    " let b:ale_fixers = {'javascript': ['prettier', 'eslint']}


    " In ~/.vim/vimrc, or somewhere similar.
    let g:ale_fixers = {
    \ '*': ['remove_trailing_lines', 'trim_whitespace'],
    \ 'javascript': ['eslint', 'prettier'],
    \ 'typescript': ['eslint', 'prettier'],
    \ 'css': ['prettier'],
    \}

    let g:ale_linters_explicit = 1


    " Set this variable to 1 to fix files when you save them.
    let g:ale_fix_on_save = 1

    " npm install --global prettier
    " npm install --global eslint
    " 需要执行 yav -u 执行下面的命令
    " Plugin 'https://github.com/leafgarland/typescript-vim'
    " Plugin 'https://github.com/Quramy/tsuquyomi'
    " Plugin 'w0rp/ale'
  7. zhang-ning created this gist Dec 23, 2018.
    89 changes: 89 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,89 @@
    Plugin 'dracula/vim'

    " for indent
    set autoindent
    " tab and space
    set smarttab
    set tabstop=4
    set shiftwidth=4
    set expandtab
    " fold
    set foldmethod=indent
    set foldlevelstart=999
    set noswapfile
    " text
    set textwidth=120
    set colorcolumn=120
    set linebreak
    " set nowrap
    " statusline complete menu
    set wildmenu
    set cmdheight=2
    " set cursorline
    " set cursorcolumn
    " }}}

    " encoding && fileformat ----------------------------- {{{
    " let &termencoding=&encoding
    set fileencoding=utf-8
    set fileencodings=utf-8,cp936,big5,ucs-bom
    " set termencoding=utf-8
    " set encoding=utf-8
    " }}}
    "

    " let g:yadr_disable_solarized_enhancements = 1
    " set guifont=Menlo\ Regular:h14
    set guifont=Inconsolata:h17,Monaco:h15
    " colorscheme base16-twilight
    " set background=light
    colorscheme gruvbox
    " colorscheme base16-gruvbox-dark-hard
    " colorscheme dracula
    highlight Normal ctermbg=NONE


    let g:typescript_compiler_binary = 'tsc'
    let g:typescript_compiler_options = ''
    autocmd QuickFixCmdPost [^l]* nested cwindow
    autocmd QuickFixCmdPost l* nested lwindow

    let g:tsuquyomi_disable_quickfix = 1
    let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
    " let g:syntastic_typescript_checkers = ['tsc'] " You shouldn't use 'tsc' checker.

    " autocmd FileType typescript setlocal completeopt-=menu
    " let g:tsuquyomi_completion_detail = 1
    autocmd FileType typescript setlocal completeopt+=menu,preview

    " " 不建议首次打开文件时进行检查
    " let g:syntastic_check_on_open = 0
    " " `:wq`时不进行检查,注意这跟`:w`不一样
    " let g:syntastic_check_on_wq = 0
    " " 如果你想在写文件时不进行检查,需要配置`passive`模式
    " " 在`passive`模式下,只有手动调用了`:SyntasticCheck`才会触发检查
    " let g:syntastic_mode_map = {'mode': 'passive'}
    " " 你可以配置一个快捷方式,用来快速检查当前文件
    " nmap <silent> <F5> :SyntasticCheck<cr>
    " let g:syntastic_javascript_checkers = ['fecs']
    " let g:syntastic_javascript_fecs_args = "--reporter=baidu"
    let g:syntastic_error_symbol = "✗"
    let g:syntastic_warning_symbol = "⚠"


    " set nocompatible
    " set completeopt+=menuone
    " set rtp+=~/.yadr/vim/bundle/neocomplete/
    " set rtp+=~/.yadr/vim/bundle/vimproc.vim/
    " set rtp+=~/.cache/neobundle/tsuquyomi/
    "

    " filetype plugin indent on
    let g:neocomplete#enable_at_startup = 1
    if !exists('g:neocomplete#force_omni_input_patterns')
    let g:neocomplete#force_omni_input_patterns = {}
    endif
    let g:neocomplete#force_omni_input_patterns.typescript = '[^. *\t]\.\w*\|\h\w*::'