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.
.vimrc.after
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
" 2019年2月8日修改:tsuquyomi => ale
" 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.
" 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 = "⚠"
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/
" 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*::'
" 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': ['prettier','eslint'],
\ 'typescript': ['prettier','tslint'],
\ 'css': ['prettier'],
\ 'json': ['prettier', 'eslint'],
\ 'less': ['prettier'],
\ 'sass': ['prettier'],
\}
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.
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment