sheerun / vim-polyglot

A solid language pack for Vim.
5.59k stars 298 forks source link

autocommand compiler python command already exist #257

Closed tgzhou98 closed 5 years ago

tgzhou98 commented 6 years ago

This is my vim log (level 9)

Executing FileType Auto commands for "python"
autocommand compiler python

Error detected while processing FileType Auto commands for "python":
E174: Command already exists: add ! to replace it

I have more log info, should I put that on it?

sheerun commented 6 years ago

Maybe please post your .vimrc

tgzhou98 commented 6 years ago
set nocompatible              " required
filetype off                  " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
"**************************************************
" Track the engine.
" ppets are separated from the engine. Add this if you want them:"
" 
"Plugin 'vim-scripts/taglist.vim'
Plugin 'rizzatti/dash.vim'
Plugin 'rsmenon/vim-mathematica'
Plugin 'Shougo/vimproc.vim'
Plugin 'wookayin/vim-typora'
Plugin 'xolox/vim-easytags'
Plugin 'xolox/vim-misc'
Plugin 'kshenoy/vim-signature'
Plugin 'scrooloose/nerdcommenter'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'shime/vim-livedown'
"Plugin 'JamshedVesuna/vim-markdown-preview'
"Plugin 'lazywei/vim-matlab'
"Plugin 'vim-scripts/Conque-GDB'
Plugin 'tpope/vim-surround'
Plugin 'lervag/vimtex'
Plugin 'flazz/vim-colorschemes'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'vim-scripts/matchit.zip'
Plugin 'tell-k/vim-autopep8'
Plugin 'ervandew/supertab' 
Plugin 'vim-latex/vim-latex'
Plugin 'honza/vim-snippets'
Plugin 'SirVer/ultisnips'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
"Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'indentLine.Vim'
Plugin 'sheerun/vim-polyglot' "language packages
Plugin 'hdima/python-syntax'
Plugin 'dyng/ctrlsf.vim'
Plugin 'majutsushi/tagbar'
Plugin 'vim-airline/vim-airline'
"Plugin 'Lokaltog/vim-powerline'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Bundle 'terryma/vim-expand-region'
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'  
Plugin 'Lokaltog/vim-easymotion'  
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}  "Html writting
"Bundle 'thinca/vim-quickrun'
"Bundle 'tpope/vim-rails.git'  
Plugin 'nvie/vim-flake8'
"Bundle 'TabBar'
"Bundle 'L9'  
Plugin 'valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
"Bundle 'FuzzyFinder'  
Plugin 'Shougo/unite.vim'

set omnifunc=syntaxcomplete#Complete
"set tags=/Users/zhoutiangang/Documents/Tools/tags
set tags+=~/.vimtags
"manuual
"dictionary  <C-X><C-K>
set dictionary+=/usr/share/dict/words
"spelling file
function! SpellLocalCheck()
    setlocal spell spelllang=en_us
endfunction

inoremap jk <ESC>
nnoremap ,cd :cd %:p:h<CR>:pwd<CR>
autocmd! FileType python,c,cpp,tex,fortran,ncl noremap <buffer> <F3> :call Autopep8()<CR>

let g:ycm_server_python_interpreter ='/usr/local/bin/python3'
let g:ycm_python_binary_path = '/usr/local/bin/python3'

let g:ag_prg="<custom-ag-path-goes-here> --vimgrep"
"let g:ctrlsf_default_root = 'cwd'
let gLeaderlFold_docstring_preview = 1

let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"

"
let g:ycm_key_invoke_completion = ''

nnoremap <buffer> ,st :call SetTitle()<cr>
nnoremap <buffer> ,td :call TitleDet()<cr>

"Syntastic
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_loc_list_height=3
let g:syntastic_tex_checkers = ['lacheck']
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_cpp_checkers = ['gcc']
let g:syntastic_c_checkers = ['gcc']
let g:syntastic_matlab_checkers = ['mlint']

autocmd FileType python set =python3complete#Complete
"" I have poly 
"------------Start Python PEP 8 stuff----------------
" Number of spaces that a pre-existing tab is equal to.
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=4
"spaces for indents
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
au BufRead,BufNewFile *.py,*.pyw set expandtab
au BufRead,BufNewFile *.py set softtabstop=4
" Use the below highlight group when displaying bad whitespace is desired.
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad.
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Make trailing whitespace be flagged as bad.
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Wrap text after a certain number of characters
au BufRead,BufNewFile *.py,*.pyw, set textwidth=100
" Use UNIX (\n) line endings.
au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
" Set the default file encoding to UTF-8:
set encoding=utf-8
" Keep indentation level from previous line:
autocmd! FileType python set autoindent
" make backspaces more powerfull
set backspace=indent,eol,start
"Folding based on indentation:
autocmd! FileType python set foldmethod=indent
"use space to open folds
"nnoremap <leader> za 

"
"----------Stop python PEP 8 stuff--------------
"js stuff"
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2

set cursorline
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <Alt-k> <C-X><C-K>
let g:SimpylFold_docstring_preview=1
let python_highlight_all=1
syntax on
let g:autopep8_disable_show_diff=1

These are some of my .vimrc that I think may contribute to the problem.

And it is the full version of my vimrc vimrc

I have tried to delete the python PEP8 configuration in my vimrc, but not work.

Wish for your help

sheerun commented 5 years ago

I wasn't able to reproduce. You can disable loading python stuff via vim-polyglot by adding following to your vimrc: let g:polyglot_disabled = ['python']