Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VIm fancy
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
clock_cycles
n00b
n00b


Joined: 04 Nov 2006
Posts: 47

PostPosted: Fri May 11, 2007 5:26 pm    Post subject: Log files Reply with quote

Has anyone thought about a log file syntax?

Code:
~/.vim/syntax/log.vim
syntax keyword keyword emerge
syntax keyword keyword Cleaning
syntax keyword keyword Merging
syntax keyword keyword Updating
syntax keyword keyword Finished
syntax keyword keyword Compiling
syntax match number "\<[0-9]*\>"
syntax region String start="("hs=e+1 end=")"he=s-1
syntax region Comment start=">>>"hs=e+1 end="$"
highlight number ctermfg=DarkYellow
highlight keyword ctermfg=DarkGreen
highlight String ctermfg=DarkCyan
highlight Comment ctermfg=Magenta

~/.vimrc
autocmd BufRead *.log set filetype=log
Back to top
View user's profile Send private message
smlgbl
Guru
Guru


Joined: 10 Feb 2005
Posts: 305

PostPosted: Sat May 12, 2007 6:42 am    Post subject: Reply with quote

Sedrik wrote:
A friend of mine tipped me today about this plugin for firefox, checck it out I find the hints (f) quite usefull =)

http://vimperator.mozdev.org/


Thanks for the tip, I love it!
_________________
samuel.
'Do not let one girding on boast about himself like one unfastening'
Back to top
View user's profile Send private message
grx
Apprentice
Apprentice


Joined: 19 Jan 2005
Posts: 173
Location: Maryland

PostPosted: Wed May 30, 2007 7:36 am    Post subject: Reply with quote

These are all great tips-- thanks everyone.

Does anyone know how to get vi to automatically detect when it should start indenting, not just when the previous line is indented?

For example, if I type
Code:
int main(void)
{

it would automatically try to indent the next line?
Back to top
View user's profile Send private message
dkure
n00b
n00b


Joined: 20 Apr 2004
Posts: 51
Location: Sydney, Australia

PostPosted: Thu May 31, 2007 3:31 pm    Post subject: Reply with quote

grx wrote:
Does anyone know how to get vi to automatically detect when it should start indenting, not just when the previous line is indented?


Code:
set cindent
Back to top
View user's profile Send private message
dustice
n00b
n00b


Joined: 06 Jun 2007
Posts: 20

PostPosted: Fri Jun 08, 2007 4:49 pm    Post subject: Reply with quote

Just like to share something I found handy:

Code:
syntax sync fromstart


Fixes the mistaken syntax highlighting which occurs sometimes in longer files.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Sat Oct 13, 2007 8:43 am    Post subject: Reply with quote

I recently found this little peace of code godness on the vim tip wiki.

Code:
"Highlight trailing backspaces =)
au Syntax * syn match Error /\s\+$/ | syn match Error /^\s* \t\s*/


It replaces the highlighting I have posted before and works like a charm without errors :)
_________________
From Gentoo with love
Back to top
View user's profile Send private message
Wi1d
Apprentice
Apprentice


Joined: 15 Mar 2004
Posts: 282
Location: USA, Iowa

PostPosted: Sun Dec 09, 2007 10:26 am    Post subject: Reply with quote

As far as scripts/plugins here is my top 3 list:

snippetsEmu - Be jealous of the mac's textmate no more. It's easy to customize and works great. I'm predicting in a future releases of this plugin I will only have to think and it will appear.
NERD_tree - Nice to set your projects directory
svncommand - Nice svn integration
autoclose - Inserts matching bracket, paren, brace or quote
Back to top
View user's profile Send private message
iElectric
n00b
n00b


Joined: 25 Dec 2007
Posts: 19

PostPosted: Sat Dec 29, 2007 2:12 am    Post subject: Vim (gVim): proper using of tabs Reply with quote

If I open a file from terminal with "gvim -p pathtofile", it opens every time a new instance of gvim with that tab.

Is there a way to let it use only one instance and add the tabs inside? (that is how it works in Windows for example)
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2483
Location: Silver City, NM

PostPosted: Sat Dec 29, 2007 6:50 am    Post subject: Reply with quote

Take a look at this page.

Code:
$ gvim --servername xyzzy file-1
$ gvim --serverlist
XYZZY
$ gvim --servername xyzzy --remote file-2

The first line opens file-1 in gvim and is a "vim server" named xyzzy. The second line merely verifies that the xyzzy server is available. The third line opens file-2 in the first gvim instance.

Unfortunately, this combo does not open file-2 in a new tab. But maybe this will get you started in the right direction. You can tell gvim to first open up a new tab with:
Code:
$ gvim --servername xyzzy --remote-send "<Esc>:tabenew<CR>"


I think it would be pretty easy to write a little Bash function that will let you open a bunch of files in tabs in an existing instance of gvim although there might be an easier way that I don't know about.
Back to top
View user's profile Send private message
iElectric
n00b
n00b


Joined: 25 Dec 2007
Posts: 19

PostPosted: Sat Dec 29, 2007 9:28 am    Post subject: Reply with quote

BitJam, thank you very much! This is the key:

alias vim='gvim -p --servername gvim1 --remote-tab'
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2483
Location: Silver City, NM

PostPosted: Sat Dec 29, 2007 6:54 pm    Post subject: Reply with quote

I can't believe I missed remote-tab. Thanks for posting the correct solution. I will be using it.
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Fri Mar 07, 2008 1:23 pm    Post subject: Reply with quote

Anyone that knows how to rebind every command in vim? I would like a list of the commands available so that I can change them (recently changed to sv_dvorak and now every key is quite messed up).

Thanks =)
_________________
From Gentoo with love
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Wed Mar 19, 2008 11:39 am    Post subject: Reply with quote

I recently wrote this as a follow up of the G=gg tip that was posted.

Code:

map ? mnG=gg'nzz


It has some issues I would like to get your opinions on.

the mark is apperently set on the start of the line so you dont return to the exact same spot as you where in, can this be fixed?

You dont get to see where long lines where broken, if you have long strings this is anoying since c wont compile anymore then.

I would like to see how many rows where affected, can this be done?
_________________
From Gentoo with love
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum