News for hackers. Stuff that matters.
Re:Vim 8.0 is coming by dockerlocker on Wednesday April 13, 2016 @06:24AM (#11487021)
Is there a way how I can copy blocks of code outside the vim window to another application without also copying the line numbers?

Also is there one simple key combination to [un]comment a line or a selected block?

I found out how to do many simple operations with this ancient tool, what can be really fun if you have nothing else funny in life (too many people have no other sources of fun, really) - but I am still not convinced. Many operations that are a no-brainer in e.g. geany take serious planning and studying in vim - this is absurd.

I fear that we are wasting many potentially good programmers because they accept the primitivism and stupid limitations of vim as something "cool" and will never again in their lives be able to program a user-friendly GUI because their brain is "vimed out". Maybe that is one of the reasons why we still have so much really bad software.

Once I was totally impressed by programmers, they were the wizards of today, superbrains, uber-humans. Then I learned programming and understood how many uncreative and cognitively limited people are just repeating stuff that somebody else has told them, without ever asking. Basically the typical obey-guy, the perfect follower who never questions any order will be that kind of a good programmer, reading manuals and getting happy that he is able to reproduce - there is no creative moment here. Only very few of them are part of a creative elite that actually brings new ideas to life - most of them are totally dumb rat soldiers just following the orders. This is the reason why such ultra-primitive tools like vim still exist.

Re:Vim 8.0 is coming by yoo1I on Wednesday April 13, 2016 @07:14AM (#11487209)
If vim causes you to write comments that go from "How to I copy and paste correctly?" to the last 3/4th of it being "Programmers are fucking stupid" ... it might not be the tool for you.
Re:Vim 8.0 is coming by hudibras on Wednesday April 13, 2016 @08:55AM (#11487696)
Ctrl-V to turn on rectangular visual mode, select the area you want to copy (presumably you understand to not select the line numbers), then "*y to copy it to the system clipboard. Once it's on the system clipboard, you can then paste it into another application; generally this is done with Ctrl-v or something similar, but you should check your operating system's user manual to verify this.
Re:Vim 8.0 is coming by Syssiphus on Wednesday April 13, 2016 @08:54AM (#11487691)
Normally you should be able to yank the lines you want to copy to the * register (check :registers). The * register is basically the clipboard. You can use it to copy stuff from and to Vim. It does not necessarily work under every OS, but so far in Windows and OSX it worked fine on console and GUI.

For commenting and uncommenting you can check the NerdCommenter plugin.

Re:Vim 8.0 is coming by JetSpiegel on Wednesday April 13, 2016 @06:32AM (#11487053)
There are plugins for that. Check out vim-easyclip, and for comments theres vim-commentary(barebones) or nerdcommenter(loads of advanced features).
Re:Vim 8.0 is coming by dockerlocker on Wednesday April 13, 2016 @06:47AM (#11487110)
too many keystrokes, checked that.
Re:Vim 8.0 is coming by majewsky on Wednesday April 13, 2016 @01:23PM (#11490199)
:help :map
Re:Vim 8.0 is coming by justusw on Wednesday April 13, 2016 @06:29AM (#11487043)
> Is there a way how I can copy blocks of code outside the vim window to another application without also copying the line numbers?

If you're running vim in a terminal, there is an option to add native clipboard support to your yank registers. If you use vim under OS X and have installed it with brew, it will be added automatically. To check whether your current vim installation has clipboard support, try running `vim --version | grep +clipboard`.

You might also find this to be helpful: http://vimcasts.org/blog/2013/11/getting-vim-with-clipboard-...

Re:Vim 8.0 is coming by dockerlocker on Wednesday April 13, 2016 @06:52AM (#11487135)
a good example for a stupid limitation and the enprmous waste of brian power just for a very simple thing. Have to start studying and doing real research for the most simple features. Waste!
Re:Vim 8.0 is coming by robenkleene on Wednesday April 13, 2016 @08:36AM (#11487593)
Ideally, Vim is a tool you'll be able to use for the rest of your life, so an upfront cost in learning it is a cost that becomes small when measured against the time scale of your career.

Furthermore, Vim needs to be setup and is configurable because it existed before many computer usage patterns had been standardized that we take for granted now (e.g., Vim's cut and paste system is different than any current big name operating systems).

But the very fact that Vim pre-dates these paradigms, and continues to be used despite the extra work it requires to get past that, this very fact is what makes it more likely that you'll be able to continue using it indefinitely. I.e., Vim will survive the next paradigm shift, because it survived the last one.

If you really want to be careful about investing in learning a tool, the ones you should be careful about are the ones that have not survived a paradigm shift yet.

(Photoshop is great example of a dangerous skill investment in my opinion, Photoshop takes an extraordinary amount of muscle memory to use effectively and it hasn't yet survived a paradigm shift. Those skills look poised to become completely obselete by touch-based design tools soon, 5-10 years from now. Not saying I have an better idea, because Photoshop is still probably the best tool for doing that type of work, but just plan on throwing everything you learn away.)

Re:Vim 8.0 is coming by mturmon on Wednesday April 13, 2016 @12:12PM (#11489480)
Very true. I hand-compiled and memorized my own vi cheat sheet decades ago, and it has paid off very well. It's systematic, as many tutorials point out, which helps a lot.
Re:Vim 8.0 is coming by jqm on Wednesday April 13, 2016 @09:10AM (#11487800)
Agreed. Vim is one of the best investments in learning I've made to date.
Re:Vim 8.0 is coming by mbrock on Wednesday April 13, 2016 @07:34AM (#11487288)
So fix it permanently or stop complaining?
Re:Vim 8.0 is coming by elaufer on Wednesday April 13, 2016 @09:38AM (#11488005)
Perhaps you should try watching some screencasts with experienced vim users editing text, the speed they can achieve and the level of precision is almost impossible in any other editor.

It is true that vim is not optimized for ease of use, especially for newcomers, and also has some problems that are considered to be solved for any decent GUI framework. But I don't see how this can affect creativity. Does carbon fiber guitar somehow magically make you more creative? Similarly, does plain old guitar made of wood hinder your creativity? I don't think so.

Re:Vim 8.0 is coming by wildmusings on Thursday April 14, 2016 @12:08AM (#11494235)
>Is there a way how I can copy blocks of code outside the vim window to another application without also copying the line numbers?

    set clipboard=unnamed
On Windows at least, that will make Vim use the system clipboard as its default register (the one you yank or paste from when you don't explicitly specify a register). Alternatively, you can yank and paste from the system clipboard like you would from any other register:

    "*y<movement>
    "*p
Re:Vim 8.0 is coming by pyre on Wednesday April 13, 2016 @09:57AM (#11488160)
Your comment is nothing but a rant. There is no constructive criticism, only you venting your frustration and anger while calling names and lashing out at anyone within reaching distance. This is not an effective form of communication. I would suggest that you figure out a better way to deal with people if you want them to help you figure something out.

[And not all programmers use Vim or Emacs. Programmers are people, and like all people have differing opinions.]

Re:Vim 8.0 is coming by hueving on Wednesday April 13, 2016 @06:51AM (#11487131)
>Is there a way how I can copy blocks of code outside the vim window to another application without also copying the line numbers?

:set nonumber

Re:Vim 8.0 is coming by codingmonkey23 on Wednesday April 13, 2016 @06:32AM (#11487051)
most terminals support "rectangle copy" - just keep ctrl pressed and you can select a rectangle from whatever top-left starting point - easy way to copy only content without deactivating line numbering.
Re:Vim 8.0 is coming by kh_hk on Wednesday April 13, 2016 @07:47AM (#11487341)

    vnoremap <C-c> "+y
Re:Vim 8.0 is coming by Watabou on Wednesday April 13, 2016 @02:37PM (#11490963)
Just a minor nitpick, vnoremap creates a mapping for select and visual modes. You should use xnoremap as that's restricted to visual mode only.

Select mode is used by snippet engines mostly, and you don't want this mapping to affect select mode.

Re:Vim 8.0 is coming by kh_hk on Thursday April 14, 2016 @07:17AM (#11495667)
will update my .vimrc to reflect that, thanks! nitpick appreciated
Re:Vim 8.0 is coming by apers on Wednesday April 13, 2016 @06:29AM (#11487041)
:set nonumber removes the line numbers so you can copy without them
Re:Vim 8.0 is coming by dockerlocker on Wednesday April 13, 2016 @06:48AM (#11487116)
no, i do not want to disable line numbering. I want to avoid to copy them. I do not want to switch line numbering on off for every copy process. Absurd idea.
Re:Vim 8.0 is coming by mgreenly on Wednesday April 13, 2016 @07:49AM (#11487355)
A better option would be to use a plugin that yanks text to the system clipboard.
Re:Vim 8.0 is coming by saturn_vk on Wednesday April 13, 2016 @08:57AM (#11487707)
You don't need a plugin for that. Just set the 'clipboard' option.
Re:Vim 8.0 is coming by Watabou on Wednesday April 13, 2016 @02:38PM (#11490977)
Note that you need Vim compiled with +clipboard for this to work (or +xterm_clipboard if you are using X11)