2017-01-05 1 views
0

왜 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입니다). 구문 폴더가 실제로 해당 폴더에 있는지 확인했습니다.

그러나 내가 neovim에있을 때 나는 공백을위한 빨간색 블록 이외의 강조 표시를 얻지 못합니다. ": 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 
+0

구문 상 들여 쓰기가 작동합니까? 네비 박스 내에 colorscheme을 설정해보십시오. 그냥': colorscheme'을 실행하고 가능한 스키마를 탭하세요. 아마도 네빌은 당신이 설정 한 색션을 찾을 수 없을지도 모릅니다. –

+0

나는 그것을 실제로 시험해 보았다. 그리고 주사위가 없었다. 나는 그러나 모든 것이 강조 표시되거나 선택 될 때 구문 강조 표시가있는 것처럼 보였습니다. 아무 것도 선택하지 않으면 구문 강조 표시가 없습니다. 무엇이 그 원인이 될 수 있는지에 대한 아이디어가 있습니까? –

+0

있습니다. colorscheme을 실행할 때 제대로 'gruvbox'가 인쇄됩니다. –

답변

0

이 솔루션은 엄청나게 바보입니다. iTerm2에서 명암 슬라이더가 끝까지 돌았을 때, 테마와 관련된 문제가 발생합니다. 모두 지금 일하고있다. 다행히도이 게시물은 앞으로 누군가에게 많은 골칫거리를 줄 것입니다.