Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

04-04-2018 , 08:42 PM
Quote:
Originally Posted by jmakin
Things I’m really liking about UNIX: never having to take my hands off the keyboard
FYP

Quote:
Originally Posted by jmakin
Things i’m hating about vim/linux: copy pasting large chunks of code, especially from windows over to the terminal I’m using is a humongous pain in the ass
What are you doing exactly? Are using windows vim and/or cygwin?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 08:54 PM
Yeah, I know I've copied/pasted 1000s of lines of code into a vim terminal window with OSX and am pretty sure I've done it using putty on Windows.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 09:21 PM
it's whenever i copy something from windows, paste it into putty, i lose the first 2-6 characters from whatever i pasted.

something really stupid about this 5 line limit I'm starting to notice is it really encourages me to write a lot of functions that have side effects. this is a really stupid way to program.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2018 , 11:18 PM
Are you making sure you're in insert mode before pasting? If not it will drop everything before it finds an i,I or one of the other insert mode keys in what you're pasting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 02:42 AM
In addition to making sure you're in insert mode, you may also need execute `:set paste` in vim to make sure auto indent doesn't kick in.

Still not sure what you're doing, but I'd imagine using git would be easier than copying/pasting code.

I'm interested in seeing some code adhering to the 5 line limit. Sounds like an awful rule, unless the problems are designed such that the "correct" solution can be done in 5 lines.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 06:45 AM
Quote:
Originally Posted by jmakin
it's whenever i copy something from windows, paste it into putty, i lose the first 2-6 characters from whatever i pasted.
Quote:
Originally Posted by kerowo
Are you making sure you're in insert mode before pasting? If not it will drop everything before it finds an i,I or one of the other insert mode keys in what you're pasting.
Quote:
Originally Posted by :::grimReaper:::
In addition to making sure you're in insert mode, you may also need execute `:set paste` in vim to make sure auto indent doesn't kick in.
I love vim, but I vividly remember going through these hurdles for the first time, and its kinda funny/sad what we're willing to put up with to use it.

Last edited by Wolfram; 04-05-2018 at 06:52 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 07:56 AM
Quote:
Originally Posted by kerowo
Are you making sure you're in insert mode before pasting? If not it will drop everything before it finds an i,I or one of the other insert mode keys in what you're pasting.
Quote:
Originally Posted by :::grimReaper:::
In addition to making sure you're in insert mode, you may also need execute `:set paste` in vim to make sure auto indent doesn't kick in.

Still not sure what you're doing, but I'd imagine using git would be easier than copying/pasting code.

I'm interested in seeing some code adhering to the 5 line limit. Sounds like an awful rule, unless the problems are designed such that the "correct" solution can be done in 5 lines.
Is this a Putty issue? Again, I copy/paste all the time with no problem. I'm on Linux now (if you'll remember from recent discussion), but it always worked fine for me with Windows/gvim as well. (and I always paste in normal mode, dunno wtf this insert nonsense is)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 08:05 AM
Quote:
Originally Posted by kerowo
Are you making sure you're in insert mode before pasting? If not it will drop everything before it finds an i,I or one of the other insert mode keys in what you're pasting.
Thanks i think this was the issue.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 08:56 AM
Now that i have that worked out, probably just gonna write everything in notepad++ and transfer it over, this is just way too different for me and not idiot proof enough
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 09:08 AM
Open the terminal and type "vim tutor" and do it everyday until all the steps are like muscle memory.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 10:38 AM
I've shown hardcore VIM enthusiasts all the global search and replace I do in Sublime and there's always a few things where they're like "yeah VIM can't do that".
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 10:45 AM
that's what sed is for
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 10:47 AM
Or, hear me out, you could use one tool that does both things and doesn't require a ton of memorization or muscle memory practice.

Sorry, I couldn't resist. No desire for VIM wars. I respect VIM, I just don't think it's optimal for the kind of coding I do now as a lead/architect where I'm constantly having to scan/learn a brand new code base to tweak something or become familiar.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:05 AM
Quote:
Originally Posted by suzzer99
Or, hear me out, you could use one tool that does both things and doesn't require a ton of memorization or muscle memory practice.
You can use one tool that does everything, sure... or you can use multiple tools that focus one doing one thing, and do it well, and then combine the results.

If you were a professional builder, would you rather use this:



or these:



?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:07 AM
Yeah if that one thing worked just as well for all tasks - of course. I can do most other things in Sublime just as fast - as long as I'm willing to touch my mouse - which doesn't bother me. I even have hotkeys mapped to various mouse buttons.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:09 AM
Quote:
Originally Posted by suzzer99
I even have hotkeys mapped to various mouse buttons.
Which is just as much effort as learning to use sed
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:13 AM
VIM aside, i do love bash. can't believe I've been ignoring this for so long.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:14 AM
Quote:
Originally Posted by Larry Legend
Open the terminal and type "vim tutor" and do it everyday until all the steps are like muscle memory.
there's a really cool game called "vim adventures" but it's $25 for the full version

wait did they teach you vim at your coding school or did you just pick it up? 5 years as a CS student and this is my first exposure to it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:16 AM
sorry to triple post but soon I'll show you guys some really great example of terrible functions i wrote that have side effects just because it fits the 5 line paradigm better

we're allowed to have 2 functions in the program that can go up to 7 lines, and up til week 6, we can have one 9 line exemption.

on this project i need to implement a binary search on some strings that ignores case, no idea how one could possibly do that in 5 lines in C but I'm sure i'll find a way

and the proff is for sure an arrogant doofus. we were supposed to have a quiz in a 4pm meeting and he just doesn't show up and emails the class a day later saying "sorry I forgot."

yea i waited around at school all day for your dumb ass, jerk.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:17 AM
I use the vim extension/plugin in Sublime.

I think vim as a way of typing is amazing. But I don't really think the VIM editor itself is the ideal coding environment for most people in most cases.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:25 AM
I learned the vim keys because I played nethack on a laptop

To be fair, vim is not my main editor/ide at work because I work in java and it's pretty hard to set up all the automatic compilation/dependency crap in vim. And I definitely think vim isn't for everyone. Every tool has some pros and cons and usually its best to use whatever you like best rather than try to force it.

But I do use the posix toolchain a lot at work, and it's way more powerful than any ide's search/replace functionality.

Two examples that come to mind:
1. I had a huge (multiple gigabites) svn repository that I needed to search for every text file that was encoded in the iso-8859-1 and convert them to utf-8. I have no idea how you would accomplish that on windows without writing custom software.

It was 4 lines of bash scripting using find, grep, cut and iconv. All small tools that do one thing and do it well

2. I needed to find all files that contained a tab character in my repo.

Code:
grep -lRP "\t"
did the trick. I knew what -R did but not the other flags but it took me 5 seconds to google it. I'm sure you can do this as well in an editor, but then you'd probably need to import all the files into a new throwaway project.

Then I hit a snag. It was returning a lot of binary files which I didn't want. So I piped it into another grep and got what I wanted:
Code:
grep -lRP "\t" | grep -E "js|html|css"

Last edited by Wolfram; 04-05-2018 at 11:34 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:32 AM
CLI nerds ITT
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 11:54 AM
Quote:
Originally Posted by Wolfram
I learned the vim keys because I played nethack on a laptop

To be fair, vim is not my main editor/ide at work because I work in java and it's pretty hard to set up all the automatic compilation/dependency crap in vim.

Ive been using IntelliJ recently and it has a really good vim plugin.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 04:38 PM
My first serious computing was Unix on Silicon Graphics boxes and SPARC workstations. When I first used Windows 3.0, it felt like cruel and unusual punishment.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-05-2018 , 06:34 PM
Quote:
Originally Posted by jmakin
there's a really cool game called "vim adventures" but it's $25 for the full version

wait did they teach you vim at your coding school or did you just pick it up? 5 years as a CS student and this is my first exposure to it.
No, they didn't teach us vim and were very very light on command line stuff in general.

I use atom for 90% of stuff but would like to be better with vim. I only really use it to edit config files and such where I just need to make a very quick immediate fix.

A goal of mine is to get good with it tho because it seems like it will make me so much faster if I used it all the time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m