esquema de cores badwolf não funciona no ubuntu 14.04

0

Eu quero usar o esquema de cores badwolf para o meu vim, então baixei-o aqui link e copiei colors/badwolf.vim para meu diretório ~/.vim/colors . Mas não funciona. Não faz alterações. Eu tenho o Ubuntu 14.04 agora, mas quando eu tinha Ubuntu 15.04 e Ubuntu 15.10 (sim, eu tive que fazer o downgrade do meu sistema por causa de alguns problemas) exatamente o mesmo .vimrc e badwolf funcionou.

Eu tenho a versão 7.4.52 do vim e no meu .vimrc tenho a linha color badwolf . Meu uname -a :

Linux dima-UX32LN 4.2.0-35-generic #40~14.04.1-Ubuntu SMP Fri Mar 18 16:37:35 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

My bash verison: GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)

PS também Ctrl + Fim parou de funcionar. Não consigo navegar até o final da página usando isso.

Meu terminal ( echo $COLORTERM ) é gnome-terminal .

Atualizar

Meu vim --version :

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:32)
Included patches: 1-52
Modified by [email protected]
Compiled by buildd@
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl    -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions 

Meu .vimrc :

conjunto nocompatível "be iMproved, required     filetype off "obrigatório

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'Valloric/YouCompleteMe'

Plugin 'dag/vim2hs'

call vundle#end()            " required
filetype plugin indent on    " required

" YCM settings {{{
let g:clang_library_path = "/usr/lib64/"
let g:clang_complete_copen = 0
let g:clang_hl_errors = 1
let g:clang_snippets = 1
let g:clang_snippets_engine = "ultisnips"
let g:clang_close_preview = 1
let g:clang_complete_macros = 1

let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_use_ultisnips_completer = 1
let g:ycm_key_list_select_completion=[]
let g:ycm_key_list_previous_completion=[]

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

syntax on

color badwolf
set cursorline
" hi CursorLine term=bold cterm=bold guibg=Grey40

let python_highlight_all = 1

set autoread
set ruler
set ignorecase
set incsearch
set number
set hlsearch " Enable search highlighting

set expandtab
set smarttab
set shiftwidth=4
set tabstop=4

set ai
set si

set encoding=utf8

set fileformat=unix
set ffs=unix,dos,mac

vnoremap <silent> # :call VisualSelection('b')<CR>

set laststatus=2

set pastetoggle=<F2>

map <F5> :edit!<cr>
map <c-s> :w<cr>
map <c-z> :undo<cr>
nmap \M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
nmap \t :set expandtab tabstop=4 softtabstop=4 shiftwidth=4<CR>

" open tagbar
nmap <F8> :TagbarToggle<CR>
" open nerdtree
nmap <F7> :NERDTreeToggle<CR>
" open it automatically
" autocmd vimenter * NERDTree

nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab>   :tabnext<CR>
nnoremap <C-t>     :tabnew<CR>

au BufNewFile *.cpp 0r ~/.vim/template.cpp | let IndentStyle = "cpp"

command Compile !g++ -O2 -std=c++11 -Wall -Wextra -DLOCAL -Wpedantic %:t
execute pathogen#infect()
call pathogen#helptags()
    
por PepeHands 16.04.2016 / 12:40

1 resposta

1

Finalmente encontrei a resposta. O problema é que, por padrão, o suporte a cores em ~/.bashrc e ~/.vimrc está desativado. Eu não enfrentei esse problema no Ubuntu 15. Encontrei uma correção aqui: Como habilito o suporte a cores no Vim? . Então tudo que eu tive que fazer é inserir

if $COLORTERM == 'gnome-terminal'
    set t_Co=256
endif

no meu ~/.vimrc

UPDATE

Como @muru disse, é melhor inserir

if [ "$COLORTERM" == "gnome-terminal" ]; then
    export TERM=xterm-256color
fi

no seu .bashrc (veja porque no link acima)

    
por PepeHands 20.04.2016 / 22:31