DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default Syntax highlighting problem at nano

Dear OpenBSD user,

-I installed nano with:
Code:
pkg_add nano
-Then opened up a python file with:
Code:
nano test.py
But there was no syntax highlighting.
Then I checked nano with:
Code:
apropos nano
Read nanorc(5) with:
Code:
man 5 nanorc
-It describes several locations for nanorc configuraiton file but it was missing in my system. So I created inside /etc with
Code:
doas touch /etc/nanorc
-Then added this lines
Code:
include /usr/local/share/nano/python.nanorc
After that I tried syntax highlighting with a python file. There is partial syntax highlighting. Keywords are showed with bold white font and the user code is gray. Just bold white and gray. There is no any other color.

Could you please explain how can I get fully functioning syntax highligthing?
Reply With Quote
  #2   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 387
Default

Try it with a wildcard to pick up all the syntax highlight files:
Code:
include "/usr/local/share/nano/*.nanorc"
Reply With Quote
  #3   (View Single Post)  
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

Dear Matthew,
Thanks for the reply. I did it, the result is still the same.

Edit:
I checked it for an html file and in that file there is no syntax highlighting at all. Not even white and gray.

Last edited by gordon.f; 4 Weeks Ago at 05:03 PM. Reason: Additional file formats too
Reply With Quote
  #4   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 387
Default

Is this with xterm?

Perhaps try
Code:
TERM=xterm-256color nano /path/to/file.html
If that works add export TERM=xterm-256color to ~/.profile.
Reply With Quote
  #5   (View Single Post)  
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

Dear Matthew,
When I type
Code:
echo $TERM
ksh replied
Code:
vt220
Is this issue happened because of terminal?

Edit:
TERM=xterm-256color nano /path/to/file.html
I typed the code above but not everything fit into screen. There were colors though.
So this is related to terminal type. I created this virtual machine on Windows Hyper-V and it is not covering the whole screen. It only holds 11x28 cm on 25x40 cm display. How can make it fullscreen?

Last edited by gordon.f; 4 Weeks Ago at 06:08 PM.
Reply With Quote
  #6   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 387
Default

So this is from the console (TTY) then? Don't use xterm's terminfo in the console, it will probably break stuff.

EDIT: I think you're out of luck:

https://marc.info/?l=openbsd-misc&m=144286056911508&w=2

Last edited by Head_on_a_Stick; 4 Weeks Ago at 06:46 PM.
Reply With Quote
  #7   (View Single Post)  
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

I think I can change the terminal but I don't know how to do it. I don't want to break working stuff for nothing.
Reply With Quote
  #8   (View Single Post)  
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 387
Default

According to my linked mailing list thread the only way to get syntax highlighting working properly is to use X and xterm. The console just doesn't support it.
Reply With Quote
  #9   (View Single Post)  
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

Well, in the installation I excluded the X. So can I use xterm instead?
Reply With Quote
Old 4 Weeks Ago
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 387
Default

Not without X. The clue is in the name :-)
Reply With Quote
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

Dear Matthew,
I also have another desktop and it is bare-metal OpenBSD installation. Let me try at that machine because I excluded X at that machine too. I'll let you know about the result. Thanks for the help.
Reply With Quote
Old 4 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 57
Default

UPDATE:
I checked if the same condition exists on the desktop machine and the answer is yes. Terminal is vt200, again. Installed nano and edited .nanorc file in order to make syntax highlighting for python but there was no syntax highlighting, not even partial syntax highlighting.

Results are listed below.
On both machines X is excluded on installation.
OpenBSD amd64 VM on Windows Hyper-V: Terminal= vt200; partial syntax highlighting.
OpenBSD i386 on bare-metal: Terminal= vt200; no syntax highlighting at all.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to install nano in openbsd 5.6 Crypto333 OpenBSD Packages and Ports 24 30th December 2014 11:17 PM
can't install nano barti OpenBSD Packages and Ports 6 31st July 2012 06:42 PM
Hardware VIA Announces the VIA Nano X2 Dual Core CPU vermaden News 11 6th January 2011 04:18 PM
C/C++ Syntax highlighting in emacs rex FreeBSD General 1 12th October 2008 03:21 AM
Syntax Highlighting JMJ_coder Programming 17 22nd June 2008 02:24 PM


All times are GMT. The time now is 03:08 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick