View previous topic :: View next topic |
Author |
Message |
clock_cycles n00b
Joined: 04 Nov 2006 Posts: 47
|
Posted: Fri May 11, 2007 5:26 pm Post subject: Log files |
|
|
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 |
|
|
smlgbl Guru
Joined: 10 Feb 2005 Posts: 305
|
Posted: Sat May 12, 2007 6:42 am Post subject: |
|
|
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 |
|
|
grx Apprentice
Joined: 19 Jan 2005 Posts: 173 Location: Maryland
|
Posted: Wed May 30, 2007 7:36 am Post subject: |
|
|
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
it would automatically try to indent the next line? |
|
Back to top |
|
|
dkure n00b
Joined: 20 Apr 2004 Posts: 51 Location: Sydney, Australia
|
Posted: Thu May 31, 2007 3:31 pm Post subject: |
|
|
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? |
|
|
Back to top |
|
|
dustice n00b
Joined: 06 Jun 2007 Posts: 20
|
Posted: Fri Jun 08, 2007 4:49 pm Post subject: |
|
|
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 |
|
|
Sedrik l33t
Joined: 08 Apr 2005 Posts: 655 Location: Uppsala, Sweden
|
Posted: Sat Oct 13, 2007 8:43 am Post subject: |
|
|
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 |
|
|
Wi1d Apprentice
Joined: 15 Mar 2004 Posts: 282 Location: USA, Iowa
|
Posted: Sun Dec 09, 2007 10:26 am Post subject: |
|
|
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 |
|
|
iElectric n00b
Joined: 25 Dec 2007 Posts: 19
|
Posted: Sat Dec 29, 2007 2:12 am Post subject: Vim (gVim): proper using of tabs |
|
|
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 |
|
|
BitJam Advocate
Joined: 12 Aug 2003 Posts: 2508 Location: Silver City, NM
|
Posted: Sat Dec 29, 2007 6:50 am Post subject: |
|
|
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 |
|
|
iElectric n00b
Joined: 25 Dec 2007 Posts: 19
|
Posted: Sat Dec 29, 2007 9:28 am Post subject: |
|
|
BitJam, thank you very much! This is the key:
alias vim='gvim -p --servername gvim1 --remote-tab' |
|
Back to top |
|
|
BitJam Advocate
Joined: 12 Aug 2003 Posts: 2508 Location: Silver City, NM
|
Posted: Sat Dec 29, 2007 6:54 pm Post subject: |
|
|
I can't believe I missed remote-tab. Thanks for posting the correct solution. I will be using it. |
|
Back to top |
|
|
Sedrik l33t
Joined: 08 Apr 2005 Posts: 655 Location: Uppsala, Sweden
|
Posted: Fri Mar 07, 2008 1:23 pm Post subject: |
|
|
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 |
|
|
Sedrik l33t
Joined: 08 Apr 2005 Posts: 655 Location: Uppsala, Sweden
|
Posted: Wed Mar 19, 2008 11:39 am Post subject: |
|
|
I recently wrote this as a follow up of the G=gg tip that was posted.
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 |
|
|
|