LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   vim configuration (https://www.linuxquestions.org/questions/slackware-14/vim-configuration-4175493320/)

StevenXL 01-31-2014 11:33 PM

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!

astrogeek 02-01-2014 12:02 AM

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

lems 02-01-2014 05:09 AM

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

StevenXL 02-01-2014 11:18 AM

Thanks guys! That worked very well!

Paulo2 02-01-2014 06:34 PM

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


lems 02-02-2014 04:54 AM

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

Paulo2 02-02-2014 06:42 AM

Thanks lems :hattip: works like a charm.
No more blue scheme :p (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? :scratch:

lems 02-02-2014 07:58 AM

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

Paulo2 02-02-2014 11:02 AM

Quote:

Originally Posted by lems (Post 5109651)
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.

StevenXL 02-02-2014 11:08 AM

I also use the blue scheme. Works very well.

StevenXL 02-02-2014 11:17 AM

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


All times are GMT -5. The time now is 04:33 PM.