Tag Archives: vim

Links: Apr 4

My, when they would finally invent a direct interface from a brain to computer? Can’t wait, really.

Technology

  • Outlook is freaking evil: if you open a plain text email, it would happily ignore some of the new-line breaks. Crumbs! Appears that is a ‘feature’! If you need to make sure your email with command’s output will have new-lines preserved, the rule of thumb is either to have 2 spaces in front or 3 spaces at the end of each line.  Stackoverflow rules.
  • You might know I’m passionate about Solaris. Have just got more reasons for my passion. Reason one: sed can’t replace a character with ‘\n’. Seriously, you need to actually type in Enter to get it working. As if that was not enough, Solaris’s mail tool doesn’t have an option to specify subject line (yes, I know about mailx, but that complicates writing cross platform code).
  • Google cancelled underlining of links, what’s the world coming to?!
  • And a response to “Let Nagios die peacefully” — “I’ll be letting Nagios live on“, which I back.
  • systemd development culture seems to have a detrimental effect on the mental health of people being involved. Have heard many times a range of complaints about Linus’s harsh management manners, but I’m inclined to think that Linux became possible in its current form in many ways thanks to such streaks in Linus’s character.

Putting my favourite vim cheat sheet here, so I don’t have to plough through google-results next time I need to recall how to use named registers.

vi-vim-cheat-sheet





And to finish up on a cheerful note: How it feels to be an Engineer in the Corporate World


http://www.youtube.com/watch?v=s1G6lNAE_XI

I’m happy I don’t feel like that, but it does ring some bells, doesn’t it? See ya.

vim syntax highlighting for cfengine3

Major part of my work these days is connected with cfengine3 and writing promises. I’m kind of a vim-guy, so clearly I’m using it when writing cfengine promises and when you write a lot of code, you’d definitely want to make your development environment comfy and snug. Part of being comfy and sung in my understanding is syntax highlighting, which tremendously simplifies reading code and makes you spot typos and other sorts of mistakes right away.

There’s an initial version of syntax highlighting for cfeninge, written by Neil Watson available on github. However, I wanted more sophisticated highlighting functionality, so I took Neil’s work and spent couple of weekends extending it. Here are some screenshots with results of that extension (click to see them full-size):


At the moment, the module highlights correctly cfengine-stdlib.cf and all cf files in examples/ directory of cfengine with exception of knowledge-related promises. There’s still a lot of work to do – a bit of refactoring and then, perhaps, a rudimental syntax checker – but it seems to me already usable, so I decided to release it’s “first” version.

The syntax highlighting module is available at https://github.com/ivanpesin/vim_cf3/tree/master/syntax. To activate it, you’ll need to save cf3.vim in ~/.vim/ directory and add following lines to your ~/.vimrc:

 

Как выключить цветовую подсветку в vi или vim из Red Hat Enterprise Linux

Система: Red Hat Enterprise Linux, все версии

Проблема: В Red Hat Enterprise Linux команда vi является псевдонимом текстового редактора vim, улучшенной версии vi. Некоторым людям не нравится цветной вариант и подсветка в vim и они хотят того же стиля, как в старом vi.

Решение:

Самый простой способ решения этой проблемы — выключить синтаксическую подсветку в vim. Введите следующую команду в vim для отключения синтаксической подсветки:

:syntax off

Если вы захотите опять включить цвета и подсветку, просто введите:

:syntax on

Примечание: если вы хотите, чтобы запрет подсветки синтаксиса сохранялся при последующих запусках vim для данной учётной записи, вы можете отредактировать файл .vimrc в домашнем каталоге пользователя.

Выполните команду:

vi ~/.vimrc

Добавьте следующую строку в файл .vimrc, чтобы запретить подсветку синтаксиса для текущей учётной записи:

syntax off

Если вы захотите вернуть обратно синтаксическую подсветку в vim, укажите “syntax on”.

vim — программа с богатым набором настроек. Вы даже можете создавать собственные наборы цветовых схем и синтаксических подсветок. Подробная информация о возможностях vim доступна в документации, которую можно прочесть, введя в редакторе команды:

:help
:help syntax