私は2日間、私の構文ハイライトがなぜNeovimで機能しないのかを解明しようとしています。構文Neovimのハイライトの問題
私はsysinit.vimと "filetype plugin indent on"に "syntax on"を含めました。そして、nvimを実行するとエラーは発生しません。
"echo $ VIMRUNTIME"を実行すると、適切なディレクトリが作成されます(私はhomebrewを使ってインストールしました。パスはusr/local/Cellar/neovim/0.1.7/share/nvim/runtimeです)。私は構文フォルダが実際にそのフォルダに存在することを確認しました。
しかし、私がネオビムにいるとき、後続の空白のための赤いブロック以外の強調表示はありません。 ":syntax"を実行すると、適切な構文(Pythonでテスト)が識別されます。私が特定したもう一つの奇妙な出来事は、エディタ内で ":syntax on"を実行すると、色がより暗くなります。私がそれを元に戻すと、何も変わりません。 init.vimファイルで構文が有効になっているので、なぜエディタの外観が変わるのかわかりません。
私はこれに対して壁に頭を打っています。助けてください!私のinit.vimは以下の通りです。進行中の作業です!
" Disables Vi compatibility. Vi compatibility mode disables some modern Vim Features.
set nocompatible
" Enables filetype detection, filetype-specific scripts (ftplugins),
" and filetype-specific indent scripts.
filetype plugin indent on
syntax on " Turns on syntax highlighting
set ruler " Show row and column ruler information
set number " Show line numbers
set spelllang=en " Enable spell-checking
set softtabstop=4 " Number of spaces per tab
set title " Set the terminal title to the current file
set visualbell " Turn on the visual bell
set cursorline " Highlight the line under the cursor
set hidden " Hide inactive buffers
set ttimeoutlen=0 " Eliminate delay when switching modes
set expandtab " Converts tabs into spaces
" Lazyredraw attempts to solve Vim lag by reducing processing required. When
" enabled, any action that is not typed will not cause the screen to redraw.
set lazyredraw
" Faster redrawing
set ttyfast
" Don't display the current mode in the status line.
" This info is already displayed in the Airline status bar.
set noshowmode
inoremap jj <esc> " Remaps the esc key to 'jj'
inoremap jk <esc> " Remaps the esc key to 'jk'
" Disabling all of the cursor keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" Changes the cursor shape. (Flashing pipe in insert mode, block in normal node.)
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
" Colors and Theme Options
set termguicolors " Enables "True Color" support
silent! colorscheme gruvbox " Sets the color scheme, if present
set background=dark " Sets the default background to dark mode
let g:gruvbox_contrast_dark="hard" " Changes dark mode contrasts. Possible values are soft, medium, and hard. Default is medium
let g:gruvbox_contrast_light="hard" " Changes light mode contrasts. Possible values are soft, medium, and hard. Default is medium
let g:gruvbox_italicize_comments=1 " Enables italics for comments
let g:gruvbox_italicize_strings=1 " Enables italics for strings
構文インデントは機能しますか? colorschemeをneovim内で設定してみてください。単に ':colorscheme'を実行して、可能なスキームをタブするだけです。ネオビムは、あなたが設定した色合いを見つけることができないかもしれません。 –
私は実際にそれを試みましたが、ダイスはありませんでした。しかし、私は、すべてが強調表示されている/選択されているときに、構文の強調表示をしているように見えることに気がつきました。何も選択されていない場合は、構文ハイライトはありません。それを引き起こす可能性のあるアイデアは何ですか? –
です。 colorschemeを実行すると、正しく 'gruvbox'が印刷されます –