You are not logged in.

#1 2005-07-01 16:19:25

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

vim in terminal

hello,

is there a way to control background and syntax highlighting when running vim in a terminal like urxvt?

i've been thinking of leaving gvim behind and just run vim in urxvt(or without x at all) instead,


arch + gentoo + initng + python = enlisy

Offline

#2 2005-07-01 16:45:24

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: vim in terminal

you may want to have a look what ~/.Xdefaults can do for you.  wink


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#3 2005-07-01 16:48:22

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 553

Re: vim in terminal

xerxes2 wrote:

hello,
is there a way to control background and syntax highlighting when running vim in a terminal like urxvt?

are  you lookin' for somethin' like
:colorscheme desert

from last line mode, or something more specific?

**************EDIT********************

:highlight <MODE> ctermfg=<COLOR> ctermbg=<COLOR>

might help, where MODE is NORMAL,VIUSAL etc and COLOR are predefined termcolors

-neri

Offline

#4 2005-07-01 16:56:56

Meshuggin
Member
From: /home/meshuggin
Registered: 2005-03-23
Posts: 137

Re: vim in terminal

About syntax:

syntax on

In ~/.vimrc it's enough.


Arch GNU/Linux 0.7.1 (Noodle)
Linux 2.6.14-archck1

Offline

#5 2005-07-01 16:58:26

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: vim in terminal

a good deal of coloration is achieved by adding things to .vimrc
is that what you mean?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2005-07-01 17:19:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

vimrc:

set nocompatible
behave xterm

syntax on
set bs=2
set ts=3
set sw=3
set tw=78
set et
set nu
set nowrap
set history=50
set ruler
set rulerformat=%55(%{strftime('%e-%b-%Y %I:%M %p')} [%5l,%-6(%c%V%)] %P%)
set incsearch
set autoindent
set hlsearch
set ww=<,>,[,]

if has("autocmd")
    filetype plugin indent on
    augroup vimrcFunctions
        au!
        autocmd FileType text setlocal textwidth=78
        autocmd BufReadPost * if line("'"")>0 && line("'"")<=line("$")|exe "normal g`""|endif
        autocmd Syntax * syn match Error /s+$| +zet/
    augroup END
endif

colorscheme desert

try that!

Offline

#7 2005-07-01 17:23:11

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

wow, this was fast answers,
who ever said arch community was slow, smile

":colorscheme" was the command i was looking for and if  i understand correctly background must be set the old way in .Xdefaults

that desert scheme looks really good with a dark background, i'm using koehler in gvim otherwise,


arch + gentoo + initng + python = enlisy

Offline

#8 2005-07-01 17:23:12

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 553

Re: vim in terminal

phrakture wrote:

vimrc:

colorscheme desert

try that!

*grin* everybody loves desert, I think ten out of eleven people on the Archlinux booth used that tongue

-neri

Offline

#9 2005-07-02 00:53:16

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: vim in terminal

Even I used to use desert!

now im using Metacosm.

Offline

#10 2005-07-02 05:34:58

Meshuggin
Member
From: /home/meshuggin
Registered: 2005-03-23
Posts: 137

Re: vim in terminal

Nice vimrc phrakture thanxs, mine was a little "minimalistic" tongue ,


Arch GNU/Linux 0.7.1 (Noodle)
Linux 2.6.14-archck1

Offline

#11 2005-07-02 06:58:41

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: vim in terminal

Mind if i ask.....

terminal, mlterm etc, when I run vim in them, they dont load up my colour scheme, they seem like they are restricted to the 16 colours the terminal is capable of displaying.

This is kinda crazy, I'm in X, it should be able to display more than 16 colours in a terminal, is there a way around this so that my vim colours appear correct?

iphitus

Offline

#12 2005-07-02 08:44:58

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

@iphitus

i've the same problem, my investigations tell me that there are some differences between console and gui colorschemes, i think i write my own scheme...


arch + gentoo + initng + python = enlisy

Offline

#13 2005-07-04 20:12:21

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

ok, i'm pretty comfortable now running vim in a terminal,
i wrote my own syntaxhighlighting theme so it looks bloody good now, smile

here is my .vimrc if anyone is interested:

set nocompatible      " We're running Vim, not Vi!
filetype on           " Enable fieltype detection
filetype indent on    " Enable filetype-specific indenting
filetype plugin on    " Enable filetype-specific plugins
 
"searching related"
"set ignorecase        "Ignore case in searches --opposite is: set noic
"sset incsearch        "highlight word while searching
"set nohls             "does not highlight searches
"set smartcase         "unless they contain upper-case letters
  
"indexting related"
"set noexpandtab       "Don't want tabs replaced with spaces
set expandtab
set ts=2              "tab stop
set softtabstop=2     "use the same value as shiftwidth
set shiftwidth=2      "use 4 spaces when using autoindent/cindent
"set smarttab          "smart tabs??
set autoindent        "Autoindentation
set smartindent
"set nosi             "turn off smart indenting
set whichwrap=<,>,[,]
set nowrap              "do not wrap lines
set bs=2              "allow backspacing of lines
"set statusline=%F%m%r%h%w [FORMAT=%{&ff}] [POS=%04l,%04v][%p%%] [LEN=%L]
"set laststatus=2 
set ruler
set rulerformat=%80(%F%m%r%h%w [%5l,%-6(%c%V%)] [LEN=%L] %P%)
"display"
set title             "Put title in title bar
syntax on             "Enable syntax highlighting
"et showmatch         "show matching parenthesis,brackets,etc
set showcmd           "show current uncompleted command
set showmode          "show current mod (ie insert or not)
set ttyfast           "Smoother changes
set scrolloff=5       "save 5 lines for scope
"set cmdheight=2
"misc"
"set noerrorbells      "no beeps
"set visualbell        "visual bell instead of beeping
set nobackup          "no backup copies..
set nomodeline        "don't have files trying to override this .vimrc
set nostartofline     "don't jump cursor around, stay in current column
set backspace=2       " Allow backspace to back over lines
set shell=bash
"set number           "show line numbers 
"set background=dark
"colorscheme xerxes

arch + gentoo + initng + python = enlisy

Offline

#14 2005-07-05 12:34:38

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: vim in terminal

aye, my vim in terminal is just as functional as the GUI one, even mouse scroll wheel and proper selecting works!!

iphitus

Offline

#15 2005-07-05 14:46:54

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

xerxes2 wrote:

here is my .vimrc if anyone is interested:...snip...

one thing I cannot live without, is:

set ww=<,>,[,]

(ww=whichwrap) which allows left and right movements to go up and down lines (i.e. left at the beginning of a line goes to end of previous line, and vice versa)

Offline

#16 2005-07-05 15:50:50

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

hey, thanks phrakture,

that thing has been a real pita, i didn't know that you could fix it like that,


arch + gentoo + initng + python = enlisy

Offline

#17 2005-07-05 18:18:21

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

heh, vim can do everything!

Offline

#18 2005-07-05 19:34:28

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 553

Re: vim in terminal

phrakture wrote:

heh, vim can do everything!

pull me a beer

-neri

Offline

#19 2005-07-05 21:08:38

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

neri wrote:
phrakture wrote:

heh, vim can do everything!

pull me a beer

-neri

vim -c 'r!cowsay beer'

Offline

#20 2005-07-06 10:37:28

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

http://benny.klapmuetz.org/lt05/p1010072.jpg

no more beers for you guys until next linuxtag,   tongue


arch + gentoo + initng + python = enlisy

Offline

#21 2005-07-26 15:24:50

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: vim in terminal

iphitus wrote:

Mind if i ask.....

terminal, mlterm etc, when I run vim in them, they dont load up my colour scheme, they seem like they are restricted to the 16 colours the terminal is capable of displaying.

This is kinda crazy, I'm in X, it should be able to display more than 16 colours in a terminal, is there a way around this so that my vim colours appear correct?

iphitus

So were you able to get the console version of vim to display colors correctly?  I'm on Xfce using Terminal, and turning syntax on doesn't do much aside from making some lines bold...

Offline

#22 2005-07-26 16:35:10

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

elasticdog wrote:

So were you able to get the console version of vim to display colors correctly?  I'm on Xfce using Terminal, and turning syntax on doesn't do much aside from making some lines bold...

you need to set your TERM variable properly - vim checks the TERM variable to see what colors your terminal supports when rendering...

try running

TERM="xterm-color" vim

Offline

#23 2005-07-26 18:56:38

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: vim in terminal

Thanks...that did it!  Now I'll just have to adjust the colors  big_smile

Offline

#24 2005-07-26 19:02:20

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: vim in terminal

here's mine for urxvt:
http://phraktured.net/.Xdefaults

the colors are going to depend on your terminal itself... oh, and use "colorscheme desert", heh - everyone loves desert

Offline

#25 2005-07-28 22:49:13

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: vim in terminal

i love you phrakture!!! tongue

i just bought a new hdd(samsung ultraquiet 200gb) and did a fresh archinstall, copied over my old homedir and everything worked except for this term stuff,

i was just about to post a thread when i saw this, tongue


arch + gentoo + initng + python = enlisy

Offline

Board footer

Powered by FluxBB