Team Chat Logs

March 10, 2010

2010 2
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

[00:01:49]<nocturnus>do we have a vim latex package that does autocompletion on latex commands?
[00:07:12]<squisher>nocturnus, latex-suite
[00:07:31]<squisher>not sure if it has real autocomplete setup. But my guess is if one has it, it's this one
[00:07:37]<squisher>it has a lot of features
[00:07:47]<Zathrus>vimgor: latex-suite
[00:07:47]<vimgor>An slightly-maintained, buggy, over-complicated plugin intended to make it easier to author (La)Tex files. Often, this is better served by using a standalone snippets plugin (like snipMate) to define the snippets you actually find useful as well as using the command ':compiler tex' to allow using Vim's quickfix feature when compiling TeX to an output format.
[00:08:11]<Zathrus>vimgor: latex-suite ~= s/^An/A/
[00:08:11]<vimgor>Wish I knew!
[00:08:19]<Zathrus>vimgor: latex-suite =~ s/^An/A/
[00:08:20]<vimgor>Gotcha!
[00:08:42]<nocturnus>thanks
[00:10:15]<squisher>what's nice about latex suite is the included help on latex commands though
[00:10:47]<squisher>I think the reason why I originally installed it wasn't even solved by latex-suite, fwiw
[00:11:00]<rrix>win 13
[01:04:28]<nocturnus>when I type \ , something weird happens
[01:04:32]<nocturnus>What is it doing?
[01:04:49]<nocturnus>It seems to be initiating some sort of commands
[01:05:00]<frogonwheels>.. I just hate it when something weird happens..
[01:06:04]<Zathrus>nocturnus: yes. It's waiting for you to complete the command. :h :map :h <Leader>
[01:07:37]<nocturnus>is this a default command or did it come with one of the vim packages I installed?
[01:07:57]<Zathrus>the latter.
[01:08:11]<nocturnus>how do i find out which package it came with ?
[01:08:55]<Zathrus>:verbose map \ :verbose map! \
[01:09:33]*Zathrus!~tom@unaffiliated/zathrus is vaguely wondering why it matters
[01:12:23]<nocturnus>Zathrus: because its annoying and I want to remove the package since I'm probably not using it
[01:12:49]<Zathrus>pretty much all custom mappings start with <Leader>, which defaults to \
[01:13:11]<Zathrus>if they don't, then they're overriding a default key in vim, which is frequently bad
[01:15:47]<nocturnus>so do you have to escape the / character? or have to wait for the command request to expire
[01:19:51]<rainy-day>yes Esc
[01:20:00]<frogonwheels>nocturnus: is this in the middle of typing? insert mode? cmap?
[01:20:12]<nocturnus>Its in insert mode
[01:20:25]*frogonwheels!~michaelg@203.59.141.93 sighs.
[01:20:38]<nocturnus>Could that be any more cryptic?
[01:20:43]<frogonwheels>that's a different kettle of possion altogether
[01:20:54]<frogonwheels>I could say the same :)
[01:21:01]<nocturnus>Ah ok
[01:21:08]<frogonwheels>:verbose imap \
[01:21:21]<nocturnus>I would have said "press" instead of "type"
[01:21:36]<frogonwheels>would have been just as cryptic.
[01:21:43]<frogonwheels>'in insert mode' would have been better ..
[01:21:55]<frogonwheels>anyway.. :verbose imap \
[01:22:12]<nocturnus>there's about 50 definitions
[01:22:27]<frogonwheels>ooh. that's funky.
[01:22:36]<frogonwheels>nocturnus: where were they loaded from
[01:23:10]<nocturnus>r.vim
[01:23:29]<nocturnus>IIRC these commands are using to send commands to R via a buffer created with /usr/bin/screen
[01:23:48]<nocturnus>its cool though
[01:23:51]*frogonwheels!~michaelg@203.59.141.93 shrugs
[01:24:04]<nocturnus>I expected these commands only to work in a file created with .R extension
[01:24:06]<frogonwheels>maybe comment out those mappings then.. or choose a new leader
[01:24:19]<frogonwheels>nocturnus: they probably dont' have <buffer> qualifier
[01:24:30]<nocturnus>Its supose dto work only on R file as is the case with ,, commands in vimtouliner (works only on .otl) files
[01:24:33]<frogonwheels>:help map-<buffer>
[01:24:56]<nocturnus>what's <buffer> ?
[01:25:29]<Sagan>is it possible to have vim display File , Edit, Options, Buffers, Tools, MakeFile , Hel;p Menu?
[01:25:58]<frogonwheels>Sagan: :set wildmenu :emenu <TAB> <-- press the tab key
[01:25:58]<Exodist>I want to bind a key to find(backwords) a line with a keyword, run a regex (s///) on it, and then run another program using the result as an argument. Anyone have a tutorial they can point me to for similar functionality?
[01:26:12]<Sagan>frogonwheels: thanks mate.
[01:27:40]<nocturnus>how do you remove the first 10 characters of every line in vim?
[01:28:02]<frogonwheels>nocturnus: :%s/^.\{10}//
[01:28:23]<nocturnus>does vim call sed for its regex needs?
[01:28:30]<nocturnus>or are those builtin?
[01:28:33]<frogonwheels>nope. has it's own, more powerful regexp
[01:28:43]<nocturnus>does it have its own doc for its own regex too?
[01:28:49]<frogonwheels>:help regex
[01:29:22]<frogonwheels>nocturnus: you probably should start at :help and learn how to use it :)
[01:30:24]<amerigus>Hi
[01:31:04]<amerigus>I have a small problems with vim-scripts
[01:31:12]<amerigus>let a = 1
[01:31:19]<amerigus>let b = a + 1.0
[01:31:48]<amerigus>and I get "b = 20"!!!
[01:31:58]<amerigus>Who knows what is this?
[01:32:24]<deryni>How are you checking the value of b?
[01:32:28]<frogonwheels>amerigus: you mean :echo b gives you 20?
[01:32:36]<frogonwheels>amerigus: or are you doing something else?
[01:32:40]<amerigus>yes
[01:32:52]<amerigus>No
[01:32:59]<amerigus>I can write all my code
[01:33:22]<frogonwheels>amerigus: could be a version thing - looks like it's doing: :let b=(a+1).0
[01:33:29]<frogonwheels>amerigus: :version
[01:33:40]<amerigus>7.1
[01:33:48]<amerigus>version on Debian
[01:34:07]<frogonwheels>amerigus: well there you go. floating point not implemented yet in that version
[01:34:49]<frogonwheels>amerigus: :echo has('float')
[01:35:34]<amerigus>echo has("float") = 0
[01:35:45]<frogonwheels>confirmed. you don't have floating point support.
[01:36:14]<frogonwheels>so 1+1.0 is (1+1).0 which means concatenate '2' with '0'
[01:36:38]<amerigus>Oh! Thanks!!!!
[01:37:04]<snow_usa>thanks
[01:37:23]<frogonwheels>amerigus: debian should have a more up-to-date vim than that.
[01:37:31]<snow_usa>is there any "omnisense" plugin for vim when programming in C ?
[01:37:50]<frogonwheels>:help ft-c-omni
[01:37:54]<frogonwheels>snow_usa: ^^^
[01:40:36]<nocturnus>how do you run external commands again?
[01:40:39]<nocturnus>:! ?
[01:40:54]<nocturnus>I mean on the vim doc itself
[01:41:12]<nocturnus>trying to count lines in my file using wc
[01:41:18]<Raging_Hog>nocturnus: yes, :!wc %
[01:41:24]<nocturnus>what dos % mean?
[01:41:32]<progo>the buffer filename
[01:41:34]<Raging_Hog>the current file name
[01:41:37]<nocturnus>ah cool
[01:41:48]<nocturnus>I keep forgetting these things I wish there was a cheatsheet
[01:41:59]<nocturnus>like an index for vimtutor
[01:42:36]<Raging_Hog>nocturnus: If I forgot % I'd probably do :h current<C-d> and it is in the first match
[01:43:00]<nocturnus>how to remove duplicate lines in a file?
[01:43:50]<Raging_Hog>to run external programs you can also use :w !wc so you don't need to write the file
[01:44:07]<Raging_Hog>nocturnus: can you sort it?
[01:44:08]<progo>ggVG:!uniq
[01:44:14]<nocturnus>Raging_Hog: i have
[01:45:00]<nocturnus>progo: what does that do?
[01:45:17]<progo>selects the whole file to be put through "uniq"
[01:45:27]<progo>although, you have to sort the file first...
[01:45:28]<Raging_Hog>vim has a builtin for that :%sort u
[01:45:40]<nocturnus>thanks
[01:45:45]<nocturnus>progo: but what does each letter mean?
[01:45:49]<progo>ah, that's much easier :)
[01:46:17]<progo>nocturnus, gg: go top, V: visual mode by line, G: go end, : :begin ex command: !uniq: run external program uniq
[01:47:17]<xvit>hi guys
[01:47:26]<nocturnus>thanks
[01:47:48]<Exodist>how do I do a replace regex on a variable in vimscript?
[01:48:00]<Exodist>myvar s/a/b/g
[01:48:09]<Exodist>something liek that
[01:48:47]<xvit>how can I tell a buffer to be hidden? I mean I have some buffers for editing files, and some for shell in it, and when I :bnext or :bprevious, I see the shell buffer too. Is there a way to set the buffer hidden from list of buffers ?
[01:50:10]<nocturnus>why do yo ahve to place % before sort
[01:50:16]<nocturnus>in :%sort u
[01:50:22]<deryni>:help :range
[01:50:52]<Raging_Hog>nocturnus: you're right, you don't. :sort works by default with all lines
[02:08:55]<jorrit>Hi
[02:17:58]<elik>hi jorrit
[02:18:14]<jorrit>Hi el
[02:18:16]<jorrit>ik
[02:18:17]<jorrit>:-)
[02:18:52]<elik>jorrit, I always end up checking the channel a few minutes after you arrived
[02:27:39]<Exodist>how do I run a command form vim with a variable as argument? like !myprogram % -arg <VIM VARIABLE>
[02:29:53]<DHulme>Exodist: you need to use the :exe command, which runs the command given by a string expression
[02:59:34]<Exodist>How would I search current line as well as previous lines?
[03:00:50]<Exodist>I figured it out, the 'c' flag
[03:19:12]<nocturnus>frogonwheels: how do you use regex to add a character to the end of very line?
[03:25:15]<SuperFlo>lo!
[03:50:55]<aditya>hey, there is some problem with gvim, whenever I press backspace, non standard characters are output. Pressing 2 then backspace and 3 outputs 2/3
[03:51:13]<aditya>It is happening for many letters. How to turn it off?
[03:51:37]<aditya>it is happening in vim as well (not just gvim)
[03:55:42]<aditya>...
[03:59:00]<Soma_>I need to have vi find and replace every instance of ';' within a file with ';\n', ';\n' being a semicolon and a newline
[03:59:24]<Soma_>someone I'm working on a C++ project for school fucked up their code and has it all on one line
[03:59:32]<Soma_>apparently he sat there in vim and hit J repeatedly
[04:00:02]<Soma_>I figure it can be done, just vim isn't my strong suite at the moment
[04:00:19]<strull>try :%s/;/;\r/g
[04:00:44]<Soma_>I think I love you
[04:01:09]<Soma_>but crap, it seems he has ; within ""
[04:01:11]<SuperFlo>Soma_: he might have tried obfuscating his code, as a lot of ppl does with their javascript functions.
[04:01:20]<Soma_>SuperFlo: yes
[04:01:28]<Soma_>it was to make it 'hard'
[04:01:44]<SuperFlo>but that's just stupid, a vim/awk/sed one liner make it readable.
[04:01:53]<Soma_>like that
[04:01:58]<Soma_>thanks anyway
[04:02:24]<Soma_>oh
[04:02:29]<SuperFlo>why "anyway".
[04:02:39]<SuperFlo>just adapt the pattern to match your needs.
[04:02:40]<Soma_>well I'm actually editing someone else's js
[04:02:47]<Soma_>and they fucked up a lot of shit
[04:02:52]<Soma_>I'm venting general frustration
[04:02:55]<Soma_>sorry for the swearing
[04:03:40]<Soma_>so is \r a newline argument in vim?
[04:04:46]<SuperFlo>in unix.
[04:04:57]<Soma_>oh cool
[04:04:57]<SuperFlo>\r\n carriage return line feed.
[04:05:10]<Soma_>so \r isn't refresh
[04:05:11]<Soma_>like in C
[04:05:45]<Soma_>also SuperFlo I feel sorry for that guy asking how to check his email in #bash
[04:05:49]<Zathrus>it's not refresh in C.
[04:05:57]<Zathrus>it's carraige return.
[04:06:04]<SuperFlo>Soma_: :>
[04:06:13]<Soma_>I thought it was return to the first uh
[04:06:15]<Soma_>character
[04:06:19]<Soma_>in stdout
[04:06:23]<Zathrus>yes. Which is Carraige Return.
[04:06:23]<Soma_>'refresh' the line so to speak
[04:06:27]<Soma_>ah cool
[04:06:33]<Soma_>then I'm wrong in a totally new way
[04:06:34]<Soma_>lol
[04:10:32]<Soma_>Zathrus: thanks though
[04:10:49]<SuperFlo>:/
[04:11:08]<Soma_>why so :/
[04:13:47]<SuperFlo>you say thanks anyway or thanks though as if we didn't provided you the solution.
[04:13:47]<SuperFlo>no ? :p
[04:13:47]<Soma_>oh I mean you guys provided a great solution
[04:13:47]<Soma_>it's just not the uh
[04:13:47]<Soma_>biggest of my problems
[04:14:14]<Soma_>soryr
[04:14:18]<Soma_>I am very greatful for your help
[04:14:31]<Soma_>grateful*
[04:15:01]<SuperFlo>all I'm saying is that we can help you if you tell us what your vim problem is, otherwise, we can't, then we can't do anything about "thanks anyway"
[04:15:28]<Soma_>oh no
[04:15:35]<Soma_>the extent of my vim 'problems' had solutions
[04:15:41]<Soma_>I'm just concerned about a deadline
[04:15:41]<Soma_>lol
[04:16:01]<Soma_>sorry, I start to behave eradically when deadlines approach
[04:17:01]<Sacho>as in, you eradicate stuff?
[04:17:17]<Zathrus>Sacho: DUCK!
[04:17:24]<Soma_>lol
[04:21:17]*Sacho!~sacho@213.91.244.15 :q!
[04:26:31]<nocturnus>how do you remove the last 2 characters of every line?
[04:27:05]<Zathrus>nocturnus: :%s/..$//
[04:27:37]<nocturnus>how about any n characters
[04:27:44]<nocturnus>\{n} <-- how to implement this
[04:27:58]<Zathrus>uh, exactly like that. .\{n}$
[04:28:25]<nocturnus>thought i tried that
[04:28:31]<Zathrus>although you may want \{,n} if you want it to remove UP TO that many chars
[04:28:37]<Zathrus>otherwise it won't match short lines
[04:30:25]<Sacho>you need to escape only the {?
[04:30:39]*Sacho!~sacho@213.91.244.15 facepalms
[04:31:30]<Zathrus>yeah. More vi(m) weirdness.
[04:31:42]<Zathrus>it doesn't hurt to escape the } though
[04:32:10]<Zathrus>http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.5.b1/html/Technical_Notes/chap-Technical_Notes-_Technology_Previews_.html
[04:32:15]<Zathrus>oops
[05:10:44]<Soma_>hey
[05:10:47]<Soma_>is there a way to uh
[05:10:55]<Soma_>refine my filter
[05:11:10]<Soma_>to where if there is a open quote somewhere it'll ignore it
[05:11:36]<pattern>your filter? you mean your search?
[05:13:06]<Soma_>yeah
[05:13:20]<pattern>can you give an example of the text you're searching through, and what you want to search for?
[05:13:23]<Soma_>the %s/;/\r or whatever it is
[05:13:24]<Soma_>hold up
[05:13:46]<Soma_>:%s/;/;\r/g
[05:13:58]<Soma_>but I have a better fix going on imo
[05:14:06]<Soma_>because sometimes "; is at the end of a line
[05:14:07]<pattern>so you want to add a newline after every semicolon?
[05:14:53]<SuperFlo>Soma_: do you realize we have to question you to understand your problem ?
[05:15:16]<Zathrus>SuperFlo: it's 20 Guesses, vim style!
[05:16:13]<Soma_>yes SuperFlo it's okay
[05:16:14]<Soma_>lol
[05:16:46]<Soma_>lol when gcc is like
[05:16:49]<Soma_>error line: 1
[05:16:52]<Soma_>AND THE CODE IS ON ONE LINE
[05:16:59]<Zathrus>Soma_: *PLEASE* stop hitting enter so often.
[05:17:29]<Soma_>Zathrus: I will try in the future to hit the send key less, lest your firewall think I'm ddosing you
[05:18:08]<Zathrus>No, you just sound like William Shatner, and he's effing annoying to listen to.
[05:18:47]<pattern>sspock!
[05:20:37]<Soma_>Zathrus: you read really fast
[05:20:53]<Zathrus>don't.
[05:20:58]<Soma_>but I'm sorry for hitting enter like I'm going to go offline in 2 seconds.
[05:21:10]<pattern>just ask your question already
[05:23:48]<Soma_>pattern: I'm here as the result of a previous inquiry, which is why I'm here. Anyway, I'd like to filter for all semicolons who are not preceeded by <">s or <'>s
[05:24:14]<Zathrus>/[^"'];
[05:26:46]<Zathrus>actually, you probably wnat /[^'"]\zs;
[05:28:33]<Soma_>oh
[05:28:52]<Soma_>well thank you then, is the [] regex or some sort of vim thing
[05:29:01]<Zathrus>no
[05:29:21]<SuperFlo>usual regexp syntax
[05:29:28]<SuperFlo>[^pattern] excludes pattern.
[05:40:12]<saimon>Hi...vim newbie here....(week 3)...I've just noticed that whenever I save a file it switches the line endings to dos CR LF even though I'm using osx? I can set ff=unix but it seems to do this for every new file I edit. Is there some kind of setting to ensure all files are saved as unix-style LF?
[05:41:19]<Zathrus>vim isn't doing it
[05:41:25]<Zathrus>not if you have ff=unix
[05:42:30]<saimon>Zathrus: actually in my vimrc I don't have any ff setting. When I see it saving it to dos format, I then set ff in the command-line and resave. So I guess I can just set ff=unix in my vimrc and that should fix it right?
[05:43:36]<SuperFlo>I also run osx and my ff is set to unix but not by me :o