Hot answers tagged

4

The highlight group Todo just defines how a "todo" should be highlighted. What is actually highlighted by Todo is defined by the syntax. For the C language, the expression is: syn keyword cTodo contained TODO FIXME XXX This defines the syntax group cTodo, that contains the named keywords. This syntax group is later linked to highlight group ...


2

The only explanation I have, is that there is another syntax enable (or syntax on) somewhere. Background: If syntax enable is executed and syntax was enabled before, all syntax items are cleared. See $VIMRUNTIME/syntax/syntax.vim line 12. The documentation only talks about :highlight, not :syntax. If you have the directory $HOME/.vim with other setup ...


2

Add the following to your .vimrc: fun! SetMyTodos() syn match myTodos /\%(HABA:\)\|\%(NOTE:\)/ hi link myTodos Todo endfu autocmd bufenter * :call SetMyTodos() autocmd filetype * :call SetMyTodos() Restart. Then everytime you will set filetype (usually when you edit a file) or when you enter a buffer (:e newfile) it will add a myTodos syntax that ...


2

Your terminal send ^@ as <c-space> to vim, ^@ is ctrl-@, it's equivalent to <Nul> in vim, check :h keycodes if you have doubts. You get E29: No inserted text yet error message because :h i_CTRL-@ is trying to insert previously inserted text (it doesn't exist). To fix it, use: inoremap <Nul> <c-n> or inoremap <c-@> <c-n&...


2

I believe you’ve got the map syntax backwards (see :help :map): try inoremap <C-Space> <C-n> Also see :help ins-completion


2

You could avoid this by using the right files: :h ftplugin *41.12* Writing a filetype plugin *write-filetype-plugin* *ftplugin* A filetype plugin is like a global plugin, except that it sets options and defines mappings for the current buffer only. See |add-filetype-plugin| for how this type of plugin is used. So keep your command related to syntax in ...


2

The syntax files define regions of code and links them to highlight groups, which in turn are colored by the colorscheme. So, if you want to keep your colorscheme for more than just ui elements (status/tabline, etc.), you’ll need to syntax enable. That said, there are a few ways to improve the speed of syntax highlighting. See this very detailed QA further ...


2

From :h 41.2 *41.2* Variables A variable name consists of ASCII letters, digits and the underscore. It cannot start with a digit. Valid variable names are: counter _aap3 very_long_variable_name_with_underscores FuncLength LENGTH Invalid names are "foo+bar" and "6var". And I think it's the same for functions, note that user defined ...


1

~/.vim/view is a default value (under *nix) for :h 'viewdir' option, which, in turn, is used by the :h :mkview and :h :loadview commands. :mkview is a rarely used :mksession-like command which saves some settings of a single window/view.


1

It turns out this was easier than expected. It just boils down to installing the pip and apt packages for pylint and flake8, i.e.: sudo apt install pylint sudo apt install flake8 pip install pylint pip install flake8 This of course needs to use pip-python3 instead of pip if you've configured YCM with Python3. From there, I just install the YCM and w0rp/ale ...


1

In general a good plugin will provide good and complete documentation using Vim's own help system, :help, but sometimes it is hard to figure out the right topic name. How to find documentation topics? Vim's documentation uses tags to provide quick navigation, e.g. :help :s. This makes for a little chicken and egg problem because you might not know the help ...


1

The :syntax command only covers actual buffer contents. Both statusline and (terminal) tabline, though displayed with the same font and highlighting possibilities as the windows that contain buffer contents, are different: They belong to the editor UI elements. The main reason for syntax highlighting is highlighting parts of the text with different colors ...


Only top voted, non community-wiki answers of a minimum length are eligible