NOTE: since YouCompleteMe started supporting highlighting, that project is abandoned and no longer supported.
Fast asynchronous vim client for hl-server.
Provide semantic highlighting for c
, cpp
(based on clang
) and go (based on
go ast).
Uses .color_coded file for specify
compile flags for analizing.
use version protocol: v1.1
-
vim 8.2
(can be usedvim 8
with branchwin-matching
) -
go
(optional)
-
Install
cmake
,libclang-dev
andllvm-dev
packages -
Use vundle for install this plagin. Add to your
.vimrc
next line:
Plugin 'andrejlevkovitch/vim-hl-client'
and call :PluginUpdate
in vim command line
- Compile hl-server by
cmake
. Just call:
make clean
make build
At the end this command will print path to server binary file that you should
put in your .vimrc
file (see bellow)
In case of some some problems with cmake configuration or compilation, please look into hl-server README
NOTE for not linux
system you can try use boost
branch of hl-server,
or checkout to v1.0
. Anyway the program doesn't tested on other systems
- Add to your
.vimrc
file next line:
let g:hl_server_binary = "/path/to/hl-server/binary"
This command starts your hl-server
automaticly after starting vim
- set port for server manually
let g:hl_server_port = 53827
- debug mode for
hl-server
. All logs will write in debug file.
let g:hl_debug_file = "/path/to/debug/file"
- for check some errors you can call:
echo HLServerLastError()
- for restarting
hl-server
you can run command:
call HLServerStop()
call HLServerStart()
- for check status of
hl-server
you can call
call HLServerStatus()
NOTE that hl-server
can be started only ones (with same port), so if you
run other instance of vim this command return that hl-server
is dead
color-coded is similar plugin for
semantic highlighting for c/c++
. I used it previously, but it has several
serious problems, like:
-
need
vim
, compiled withlua
support -
impassible to integrate the plugin with other editors
-
hard for debug
-
low stability -
color-coded
crashes sometimes and crashesvim
also! -
speed and memory -
color-coded
can use above 2Gb of memory and can work very slowly with big files
-
this plugin has client-server architecture: vim-hl-client as client and hl-server as server. So vim don't need some extra features like
be compiled with lua support
. It works with standard features only (jobs, channels, textproperties). -
absolutly asynchronous.
vim-hl-client
uses standardvim
asynchronous features likechannels
andcallbacks
for calling requests. All tasks handles on server side. -
simple to debug. Server is a separate program, you can start it by
gdb
, or just see logs -
high stability. Even if
hl-server
will crash,vim
will work as expected, but without highlighting. -
hl-server
absolutly independent fromvim
, so you can integrate it with other editors - just create you own*-hl-client
After updating plugin you can get notice that you should recompile hl-server. Highly recomended remove previous cmake configs and generate new.
cd build
rm * -r
cmake ..
cmake --build . -- -j4
Also note, that debug file truncate every time when new instance of vim raised.
So, if you set g:hl_debug_file
like a static file, then you may have a problem
with save it, or even reading (you can't open it by new instance of vim, because
it will be trancated before opening). So highly recomended set debug file as:
let g:hl_debug_file = "/path/to/file" . localtime()
In this case every instance of vim will has your own debug file