07 May, 2009, JohnnyStarr wrote in the 21st comment:
Votes: 0
Nice…

David, what version of Linux are you using?
07 May, 2009, David Haley wrote in the 22nd comment:
Votes: 0
At home I use Ubuntu 9.04 running the Gnome window manager. The screenshot is taken from work, where I run the Ion3 window manager on top of the Solaris OS on the box.

Ion3 is a window manager that works very well if all you do is work with text; basically it doesn't let windows overlap, instead it creates frames on your screen and you can have tabs in the frames. Windows are tabs in frames. If you google for it you'll find plenty of screenshots. I like it (and ones like it) in particular for the ability to navigate windows "spatially" using only the keyboard. You can say things like "go to the window to the left of this one", which is nice when you're working with more windows than practical to navigate with alt-tab.
08 May, 2009, Rojan QDel wrote in the 23rd comment:
Votes: 0
I have VMWare Workstation, running Ubuntu 9.04 on a virtual machine. I am trying out gcc, gdb, and Eclipse CDT w/ CVS. So far, I like it quite a bit.
09 May, 2009, JohnnyStarr wrote in the 24th comment:
Votes: 0
Anyone know how to load VIM with syntax on? do you have to change the vim load file or something?

I'm also trying to figure out how to customize other things, but the documentation online stinks.
09 May, 2009, David Haley wrote in the 25th comment:
Votes: 0
In your .vimrc file, add:

syntax enable
11 May, 2009, JohnnyStarr wrote in the 26th comment:
Votes: 0
:biggrin:
thanks, oh, i think the reason i had an issue is that i'm using ubuntu, well, i think its called kubuntu, i dont remember. you install it IN windows as an application and it takes care of your partition and boot screen. but the problem is that i cant figure out how to login as root. it says i cant login as admin through the startup screen. and unless i'm root i cant change my .vimrc file because only the admin has those permissions.

any thoughts?
11 May, 2009, David Haley wrote in the 27th comment:
Votes: 0
Well for starters, you can always change your own .vimrc file – you shouldn't be editing the system-wide files just for yourself. Your own file is in your home directory, e.g. /home/me/.vimrc for username 'me'.

That said in Ubuntu you don't log in as root, instead you log in as yourself (normally the first user is set up to be privileged) and then you issue root-level commands using 'sudo', or you can enter a root shell by doing something like 'sudo bash'. Again, though, you shouldn't be doing that to configure vim.
11 May, 2009, JohnnyStarr wrote in the 28th comment:
Votes: 0
Cool beans!

David, do you mind uploading your .vimrc file? (just a thought)
I remember you meantioned you might upload your settings, i think you could even start your own thread about it, i'm willing to bet theres other developers that would want to know optimal settings.

also, i tried to figure out how to get that cppOmniComplete to work, but i'm having some trouble installing it.
11 May, 2009, David Haley wrote in the 29th comment:
Votes: 0
Sure, although I wouldn't call them "optimal" :wink:

my .vimrc file (put in your home directory)
my colorscheme (put in ~/.vim/colors)

As for omniCppComplete, I just followed the instructions and then generated a tags file using exuberant ctags. My tags generation command is:
ctags –c++-kinds=+cdefgmnpstuv –fields=+iaS –extra=+q *.c(N) *.cpp(N) *.h(N) *.hpp(N)
(note that that is zsh syntax, the (N) tells it to not complain about empty expansions)
11 May, 2009, JohnnyStarr wrote in the 30th comment:
Votes: 0
Quote
ctags –c++-kinds=+cdefgmnpstuv –fields=+iaS –extra=+q *.c(N) *.cpp(N) *.h(N) *.hpp(N)
(note that that is zsh syntax, the (N) tells it to not complain about empty expansions)


is this command line in bash or in vim? sorry for my linux ignorance, what can i say, i'm trying to learn :redface:
11 May, 2009, David Haley wrote in the 31st comment:
Votes: 0
That's command-line; you generate the tags separately from vim, but vim will look at the tags file in the current directory if there is one. You can also tell it to load specific tag files, as you can see in my .vimrc file.

To keep tags up to date, I added that command to my makefile so that every time I compile the tag file gets updated.
11 May, 2009, JohnnyStarr wrote in the 32nd comment:
Votes: 0
Oh nice, so will i be able to add that line to my stock makefile for quickmud?

Also, when i run that command, will i have to have a certain folder opened in bash? say my mud/src directory? or can it just be entered anywhere?

Thanks for all the tips, i cant wait to get home from work and fire it up!
:cool:
11 May, 2009, David Haley wrote in the 33rd comment:
Votes: 0
Well, you need to run the command such that it can read the files, and then output the tags file to a place that vim is aware of. Vim will load tags from the current directory, or you can tell it where to get tags (see my .vimrc). I usually output the tags to my src directory as that is where I open the editor from.
11 May, 2009, JohnnyStarr wrote in the 34th comment:
Votes: 0
i get it :rolleyes:
So the tags are made from the actual source files, thats how it will know CHAR_DATA and stuff.
I get it now.
11 May, 2009, David Haley wrote in the 35th comment:
Votes: 0
Yes, what programs like ctags do is to generate a list of symbols (basically) that other programs can read to find out what lives where inside the source files. Vim doesn't try to be an IDE and hence doesn't generate the tags itself, however it does know how to work with other programs to get IDE-like functionality.
11 May, 2009, JohnnyStarr wrote in the 36th comment:
Votes: 0
One final question (for now)

I'm planning on running an older computer as a linux box. I'm going to have ubuntu on it, and ideally i would
like to host my project on it and have it set up to host SSH as well so i can access it anywhere. Pretty much what
i have with my hosted shell account. only i would have the ability to customize vim and not have to worry about memory
usage / hardrive space, etc.

So, since i will be hosting my own box, i'm wondering, will these settings be available from remote login through ssh?
would something like putty be able to use all these features on a windows box?
11 May, 2009, David Haley wrote in the 37th comment:
Votes: 0
Sure. Since the software is running on the box, as long as you're connecting into the box it will work (more or less) the same way from everywhere. The exceptions are things like different terminals sending different key combinations: you might note that my .vimrc defines things at a fairly low-level to deal with different terminals behaving differently.

Remember, putty is just a terminal, it doesn't actually implement any of this functionality. The program is still running on the Linux box, even if you're connecting from Windows. It's just the, err, "window" (as it were) that displays the application's output.
13 May, 2009, JohnnyStarr wrote in the 38th comment:
Votes: 0
David, i have a question.

I got everything to work with omnicppComplete, but one or two of my source files
in vim have a ^M character after each line ending?

its only one file: act_move.c, i have no idea what this is.

any thoughts?
13 May, 2009, elanthis wrote in the 39th comment:
Votes: 0
Stary, to answer your question fully, I'll give a bit of exposition. :)

In the UNIX world, text files are terminated with a single \n (0x0A). In the DOS/Windows world, text files are terminated with the \r\n (0x0D 0x0A) pair, much like most Internet protocols. Other OSes have used just a single \r (0x0D) for line endings. What this ends up meaning is that text files are non-portable between certain OSes. Try opening a UNIX text file (say, a source file from your MUD) in Windows Notepad and you'll see that it looks like everything is jammed onto one line, because Notepad is looking for \r\n between each line and not finding it.

Vim has built-in support for detecting the different line ending formats. You can open a DOS/Windows formatted file in Vim on Linux and it'll look right and it'll even save in the same format. Usually. Sometimes the line ending detection in Vim doesn't work, usually because the file actually ends up with a mix of line endings, which can happen in various ways.

What is happening for you is that the files in question are mostly in the UNIX line ending format, so each line has only a single \n at the end. However, some files have the DOS \r\n endings for whatever reason but Vim isn't detecting them like it usually will. Because Vim is reading the file in UNIX mode, it's seeing that extra \r as a distinct character instead of as part of the line ending, so it's displaying it as part of the line. However, \r is not a regular character – if Vim just printed it to the screen, the editor display would get mucked up and it would be very hard to even see what's going on. For this reason, all control characters in Vim are displayed using the ^ escape sequence format. \r gets rendered as ^M.

You can safely delete the character. One easy way to do that in Vim is to do the following

type :%s/
press ctrl-v then enter
type //
press enter

In Vim, ctrl-v is sort of like \ in C. It means that instead of the next key press meaning what it usually means (e.g., enter meaning "run the command I typed in") that instead it should be inserted into the text being typed. When you do the ctrl-v enter bit, you will see ^M show up in the command entry. The whole command above then just replaces any stray ^M with nothing using the substitution feature of Vim.

There are also various tools and probably some Vim scripts to do it as well, but I've always found that to be the quickest and easiest way to clean up a file like that.
13 May, 2009, Davion wrote in the 40th comment:
Votes: 0
elanthis said:
In the UNIX world, text files are terminated with a single \n (0x0A). In the DOS/Windows world, text files are terminated with the \r\n (0x0D 0x0A) pair, much like most Internet protocols.


I really hope that text files aren't terminated with a \n :P.
20.0/45