LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-31-2014, 11:33 PM   #1
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Rep: Reputation: Disabled
vim configuration


Hi guys,

I am trying to use a different vim color scheme and I am running into issues.

1) I don't have a ~/.vimrc file; should I copy the file located in /usr/share/vim/vimrc?

2) I am not sure where vim is looking for the color scheme files. I see a few .vim files (color scheme files) in the /usr/share/vim/vim74/colors directory, but when I run :colorscheme delek.vim, for example, it give me a color scheme not found error.

Any help would be much appreciated!
 
Old 02-01-2014, 12:02 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
You can create your own ~/.vimrc from scratch, or try to work from the copy you mentioned, or examples found on the net.

My own started a long time ago when using Mandrake 7.2 and I have brought it along and modified it and it is among the first things I install with a new Slackware installation.

Color schemes are found in /usr/share/vim/vim74/colors/... in Slackware 14.1, as you have noted. Try it like this (without the .vim file extension):

Code:
:colorscheme delek
Here too I have my own I always install as /usr/share/vim/vim7x/colors/robert.vim. Then in my ~/.vimrc I add the line:

Code:
colorscheme robert

Last edited by astrogeek; 02-01-2014 at 12:03 AM.
 
2 members found this post helpful.
Old 02-01-2014, 05:09 AM   #3
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
You can also put colors into your ~/.vim/colors directory. Also, a ~/.vimrc is not strictly needed, see for example: https://github.com/ap/dotvim (His old vimrc is located here: http://web.archive.org/web/*/plasmas...iles/dot.vimrc
 
2 members found this post helpful.
Old 02-01-2014, 11:18 AM   #4
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
Thanks guys! That worked very well!
 
Old 02-01-2014, 06:34 PM   #5
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Some color schemes (256 colors I guess) only work in gvim, they look a little bit awful in vim.
You can maintain only one .vimrc for both, instead .vimrc and .gvimrc,
this if does the magic
Code:
if has("gui_running")
  " GUI is running or is about to start.
  " Maximize gvim window.
  "set lines=999 columns=999
  set lines=45 columns=120
  colorscheme peachpuff
else
  " This is console Vim.
  "if exists("+lines")
  "  set lines=50
  "endif
  "if exists("+columns")
  "  set columns=100
  "endif
  colorscheme blue
endif
 
2 members found this post helpful.
Old 02-02-2014, 04:54 AM   #6
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
I haven't tested it, but there is a vim plugin that makes GVim colorschemes work in vim: http://www.vim.org/scripts/script.php?script_id=2390

This needs a terminal that supports 88 or 256 colours (Slackware's xterm is compiled with 88 and 256 colours support; KDE's konsole should work as well. Here is a script which can be used to test for 256 colour support: https://gist.github.com/justinabrahms/1047767.)

lems

p.s. One might need to use:

Code:
set t_Co=256

Last edited by lems; 02-02-2014 at 06:11 AM. Reason: 265 -> 256
 
1 members found this post helpful.
Old 02-02-2014, 06:42 AM   #7
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Thanks lems works like a charm.
No more blue scheme (or maybe not, I'm too much used to it...)

I ran that python script on konsole and returned a whole rainbow,
but in text console returned just 8 colors, why not at least 16?
 
Old 02-02-2014, 07:58 AM   #8
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Hi Paulo2,

I had more luck with the following code (from this link) on the linux console:
Code:
for x in 0 1 4 5 7 8; do for i in `seq 30 37`; do for a in `seq 40 47`; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";
lems

Last edited by lems; 02-02-2014 at 09:03 AM. Reason: Quote was wrong
 
Old 02-02-2014, 11:02 AM   #9
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by lems View Post
Hi Paulo2,

I had more luck with the following code (from this link) on the linux console:
Code:
for x in 0 1 4 5 7 8; do for i in `seq 30 37`; do for a in `seq 40 47`; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; done; echo; done; done; echo "";
lems
You're right, I forgot that we have the normal colors, plus the bold ones, plus the background colors.
I tried once write a color scheme with only console colors but it is very hard and time consuming,
then I chose the blue scheme.
 
Old 02-02-2014, 11:08 AM   #10
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
I also use the blue scheme. Works very well.
 
Old 02-02-2014, 11:17 AM   #11
StevenXL
Member
 
Registered: Jan 2014
Posts: 81

Original Poster
Rep: Reputation: Disabled
I am not sure if this is the appropriate place to post this, but I like to use xfce4-terminal, and I was looking for a way to change the color scheme for that as well. It comes with some pre-set color schemes that you can change through the menu within xfce4-terminal, but you can also edit the file located at ~./config/xfce4/terminal/terminalrc. What I did was just copied these lines (minus the first configuration line) to that file:

https://github.com/sgerrand/xfce4-te...ght/terminalrc
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim configuration (.vimrc) muthu_al Linux - Newbie 1 03-07-2011 10:56 PM
vim configuration giraf Debian 1 12-24-2006 11:53 AM
Wanna change my VIM configuration naren Programming 4 04-19-2004 08:34 PM
Question about VIM configuration ICO Linux - General 4 01-06-2004 07:41 PM
Configuration for VIM editor ICO Linux - General 5 08-02-2003 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration