View previous topic :: View next topic |
Author |
Message |
Dr.Willy Guru

Joined: 15 Jul 2007 Posts: 435 Location: NRW, Germany
|
Posted: Wed Oct 31, 2012 12:28 am Post subject: |
|
|
I generally respect vi(m) for chosing a different approach to editing. After all thinking outside the box is what generates true progress.
I just don't think the modal concept works out and I see no reason to stick to (or jump on) a failed attempt.
It can be used keyboard only? Well that's nice but also true for many editors.
Commands like '5dd' to delete 5 lines seems gimmicky to me: Either I can catch the number of lines (words, …) in one glimpse, then I don't win much by such a command or I have to start counting which is more effort than deleting lines one by one. If I'm editing something and want to jump to the next word, how is <ESC>wa shorter than <CTRL>RightArrow?
And then there's the issue of the hotkeys. To most vim-users I talked to this is the greatest thing since sliced bread. In reality it's just trying to make QWERTY usable. But why would you build on a broken design in the first place? |
|
Back to top |
|
 |
ppurka Advocate

Joined: 26 Dec 2004 Posts: 3247
|
Posted: Wed Oct 31, 2012 2:54 am Post subject: |
|
|
5dd kind of stuff is less usefull unless you don't have to count, that is, you want to modify a small number of lines. But this is speaking of vim as vi from 20y ago. In current vim, you use v (select by characters) or ctrl-v (select by blocks) or V (select by lines) to select what you want to modify and then you modify. For instance you can select a block of text and apply the find and replace to this block of text only. It helps if you can write basic regex, since you can do more complicated find and replace. You can change the selection between these three options v/ctrl-v/V mid-way, i.e., you starting selecting by using v, but you changed your mind and wanted ctrl-v, then just press ctrl-v and the selection mode will change. This is just one small example of what an editor should be able to do with ease and save you time by allowing you do handle this kind of repetitive stuff.
If you just want to write text (and not do advanced editing), you might as well just start vim in easy mode (view or gview) and type away.
One thing that is lacking in vim is a good IDE mode. Some other IDEs are filling in this gap, by having a vim mode instead. Then, it is the best of both worlds. _________________ emerge --quiet redefined | E17 vids: I, II | Now using e from git | e18, e19, and kde4 sucks :-/ |
|
Back to top |
|
 |
dmitchell Veteran


Joined: 17 May 2003 Posts: 1159 Location: Austin, Texas
|
Posted: Wed Oct 31, 2012 3:01 am Post subject: |
|
|
Another approach is ':M,Nd', which deletes lines M through N. You do display line numbers, don't you? You can omit either M or N, and the current line will be used in its place. _________________ Your argument is invalid. |
|
Back to top |
|
 |
pjp Administrator


Joined: 16 Apr 2002 Posts: 17130
|
Posted: Wed Oct 31, 2012 3:11 am Post subject: |
|
|
I thought :M,Nd was something everyone knew who actually tried to use vi*.
I generally have trouble remembering the syntax for search & replace. I can do the basic stuff, can't think of exact situations that are difficult.
I've tried to make note of some useful stuff, but I just don't need most of it very often, so I never remember it. _________________ I can saw a woman in two, but you won't want to look in the box when I'm through.
For my next trick, I'll need a volunteer. |
|
Back to top |
|
 |
jonnevers Veteran


Joined: 02 Jan 2003 Posts: 1594 Location: Gentoo64 land
|
Posted: Wed Oct 31, 2012 3:16 am Post subject: |
|
|
dmitchell wrote: | Another approach is ':M,Nd', which deletes lines M through N. You do display line numbers, don't you? You can omit either M or N, and the current line will be used in its place. |
yes, line # turned on in all editors. i use this .vimrc with a couple small tweaks. http://amix.dk/vim/vimrc.html
a coworker recently introduced me to the :M,N command modifiers, after using vi for well over a decade i never got involved in this sort of file modification. i use the regex find/replace constantly though.
i can't stand when colleagues show code and they have line numbers turned off, in IDEs like eclipse and intellij. it really makes me question their sanity. to review the code, if i need to start with 'please turn on line numbers so we can talk coherently' there's a problem. |
|
Back to top |
|
 |
ppurka Advocate

Joined: 26 Dec 2004 Posts: 3247
|
Posted: Wed Oct 31, 2012 6:25 am Post subject: |
|
|
Nope. Line #s are turned off in mine. And I typically use gvim, and it looks like this.  _________________ emerge --quiet redefined | E17 vids: I, II | Now using e from git | e18, e19, and kde4 sucks :-/ |
|
Back to top |
|
 |
py-ro Veteran


Joined: 24 Sep 2002 Posts: 1733 Location: St. Wendel
|
Posted: Wed Oct 31, 2012 10:01 am Post subject: |
|
|
What about:
no more counting |
|
Back to top |
|
 |
marens Apprentice


Joined: 05 Aug 2004 Posts: 173
|
Posted: Wed Oct 31, 2012 9:34 pm Post subject: |
|
|
py-ro wrote: | What about:
no more counting |
excellent, didn't know that one _________________ If English was good enough for Jesus, then it's good enough for you! |
|
Back to top |
|
 |
Bones McCracker Veteran


Joined: 14 Mar 2006 Posts: 1605 Location: U.S.A.
|
Posted: Wed Oct 31, 2012 9:55 pm Post subject: |
|
|
Ever try using ed? It's a fun exercise. See 'info ed'.
Good way to polish your regex skills. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
 |
ichbinsisyphos Guru


Joined: 08 Dec 2006 Posts: 547
|
Posted: Wed Nov 14, 2012 7:15 pm Post subject: |
|
|
jonnevers wrote: | sublime text | Give this a try if you haven't already. I'm addicted to it
It is nagware, though, reminds you to purchase and register repeatedly after a certain number of saves.
I'm not sure if it is worth the $59 to me, but I'm considering it. |
|
Back to top |
|
 |
McGruff Tux's lil' helper


Joined: 28 Dec 2004 Posts: 148
|
Posted: Wed Nov 14, 2012 7:50 pm Post subject: |
|
|
Will check that out. |
|
Back to top |
|
 |
Bones McCracker Veteran


Joined: 14 Mar 2006 Posts: 1605 Location: U.S.A.
|
Posted: Wed Nov 14, 2012 10:16 pm Post subject: |
|
|
If anybody is looking for an editor that's a light compromise between a bare-bones editor and a graphical IDE, SciTE is nice. Very easy on the eyes, gtk+, Scintilla-based (fast, pretty, syntax highlighting for about 80 or 90 languages, well-documented API), dozens of configurable key-bindings, set up to plug in your build system, so you can build and run without leaving the editor.
Fast. Worth looking at. Fits a niche. _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
 |
wildhorse Tux's lil' helper


Joined: 16 Mar 2006 Posts: 149 Location: Estados Unidos De América
|
Posted: Wed Nov 14, 2012 10:47 pm Post subject: |
|
|
Alright, let's see what you folks had for dinner: Edlin (another Microsoft product) |
|
Back to top |
|
 |
piedar Tux's lil' helper

Joined: 09 Aug 2010 Posts: 81
|
Posted: Wed Nov 14, 2012 11:28 pm Post subject: |
|
|
I'll throw Geany into the mix. It's a lightweight hybrid somewhere between text editor and IDE with tabbed editing and sessions. It's GTK2-based and looks nice in GNOME or XFCE. Synatax highlighting, symbol listing, some basic file management, nice options for auto-indentation, lots of plugins including spell check, GDB support, etc. It has some support for builds and make, though I don't use it - just give me the embedded terminal and I'm happy. I use it for almost all my writing (txt, latex) and coding (Java, bash, Python, C). |
|
Back to top |
|
 |
Bones McCracker Veteran


Joined: 14 Mar 2006 Posts: 1605 Location: U.S.A.
|
Posted: Thu Nov 15, 2012 2:39 am Post subject: |
|
|
wildhorse wrote: | Alright, let's see what you folks had for dinner: Edlin (another Microsoft product) |
I remember that fucker.  _________________
patrix_neo wrote: | The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it. |
|
|
Back to top |
|
 |
Shadow Skill Veteran

Joined: 04 Dec 2004 Posts: 1023
|
Posted: Thu Nov 15, 2012 8:06 am Post subject: |
|
|
Emacs. Not perfect but better than most of the so-called editors out there. Which is sad since Emacs is a REPL rather than an editor.[/b]
One really neat feature that I need to remind myself to use more often is Narrowing. In Emacs you can select a block of text and make the buffer only show the selected text, with the added benefit that while narrowed all of the text manipulation functions will only apply to the visible text. This kind of thing really shines with languages where functions can get really long or the file very long like the various lisp dialects and Javascript. This particular function is named narrow-to-region. A name that is memorable even if the default binding is not, this is a pattern with Emacs. (That isn't to say that they don't have some ridiculous names for functions in there like hippie-expand.)
I don't bother with trying to remember the bindings for commands I use with frequency beyond the basic stuff like saving files and splitting windows, I can just memorize the whole or a part of the name of a function and move on from there. If I use a given function often enough the binding for it will eventually sink in. If you can't be bothered with the rather odd keybindings you could try something like Ergoemacs which is a set of less weird keybindings for Emacs. If you use Emacs definitely install autocomplete it doesn't analyze code but it provides a convenient interface for word completion based on open files. It is capable of displaying Emacs lisp (and probably other modes with the right configuration) docstrings as a tooltip.
One place where I do think that Emacs really falls down is with editing files that have sections with multiple programming languages in them. Probably the single best plugin available for Emacs that handles a host of these types of things reasonably well is nxhtml but it doesn't have html5 support and it ends up being a sort of omnipresent mode that while not interfering with modes that don't use it, it will slow down Emacs' startup time. It is still significantly faster to startup even with the added load of nxhtml than pretty much every Java IDE I have ever used and Visual Studio which I use frequently.
Go on give it a try, you know you want to. _________________ Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.
"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it." |
|
Back to top |
|
 |
avx Advocate


Joined: 21 Jun 2004 Posts: 2150
|
Posted: Sat Nov 17, 2012 12:43 am Post subject: |
|
|
As for Sublime Text 2, here is an online video course (downloadable) for free.
Topics:
Code: | Hello; Installation and Base Settings; Services and Opening Sublime From the Terminal ; Multiple Cursors and Incremental Search; The Command Palette; Instant File Changing; Symbols; Key Bindings; Installing Plugins Without Package Control; Package Control; Snippets; Your First Snippet; Adding Snippets Through Package Control; Easier Testing With Snippets; Essential Plugins; Zen Coding; Emmet; Cross-Browser CSS With Prefixr; Fetch Files With Ease; Lightning Fast Folder and File Creation; Sidebar Enhancements; Sublime Linter; Sexy Code Snippet Management With Gists; DocBlockr; Pretty Task Management; HTTP Requests Within Sublime; LiveReload; Tips, Techniques and Modifications; Regular Expressions in Sublime; Vintage Mode; Quicker Stylesheet References; Joining Lines; Sublime and Markdown with Marked; All About Projects; Configuring and Mastering Split Windows; Custom Builds | https://tutsplus.com/course/improve-workflow-in-sublime-text-2/ _________________ ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>. |
|
Back to top |
|
 |
Prenj n00b


Joined: 20 Nov 2011 Posts: 16
|
Posted: Sat Nov 17, 2012 1:10 am Post subject: |
|
|
Back in the days I coded in anjuta/kate, with all other panels/views closed. Just code view, and terminal for compiling/running stuff. Never saw any reason to distract myself with a fancy/gimmicky editor. Just interrupts the flow of transfering abstracts into code, and you spend lot of time fiddling.
I mean the only thing that is useful in a fancy editor is debugger/trace stuff, and being able to jump to definitions of classes and stuff. Autocomplete is ok, if it works properly, I thought anjuta did it nice.
Last edited by Prenj on Sat Nov 17, 2012 1:50 am; edited 1 time in total |
|
Back to top |
|
 |
szczerb Veteran

Joined: 24 Feb 2007 Posts: 1693 Location: Poland => Lodz
|
Posted: Sat Nov 17, 2012 1:34 am Post subject: |
|
|
Prenj wrote: | I mean the only thing that is useful in a fancy editor is debugger/trace stuff, and being able to jump to definitions of classes and stuff. Autocomplete is ok, if it works properly, I thought anjuta did it nice. | There one more good feature in those-big-IDEs (especially with a large codebase). The call hierarchy of a method/function/variable. (Yeah, using Eclipse at work...) |
|
Back to top |
|
 |
Prenj n00b


Joined: 20 Nov 2011 Posts: 16
|
Posted: Sat Nov 17, 2012 1:49 am Post subject: |
|
|
szczerb wrote: | Prenj wrote: | I mean the only thing that is useful in a fancy editor is debugger/trace stuff, and being able to jump to definitions of classes and stuff. Autocomplete is ok, if it works properly, I thought anjuta did it nice. | There one more good feature in those-big-IDEs (especially with a large codebase). The call hierarchy of a method/function/variable. (Yeah, using Eclipse at work...) |
True I guess, I was never bothered with it, cos I worked in small team of 3 coders, where each of us had responsibility of our own modules, and we only shared "core" part, which lived different lifestyle of its own
But I guess in larger environment where you work with other people's code, it's pretty damn useful. |
|
Back to top |
|
 |
ichbinsisyphos Guru


Joined: 08 Dec 2006 Posts: 547
|
Posted: Tue Nov 27, 2012 11:40 am Post subject: |
|
|
I'm working on a more complex fun project right now and I am beginning to lose oversight again
I just thought what would be great is an editor that splits up the source into classes and functions and presents them in a way similar to a good documentation program, like doxygen or something, where you see what each class, function does, what output it produces, what input it requires and how they interact and where you could then try to find the most effective and readable implementation for each task.
I think this would be pretty much perfect for me. |
|
Back to top |
|
 |
Prenj n00b


Joined: 20 Nov 2011 Posts: 16
|
Posted: Tue Nov 27, 2012 12:13 pm Post subject: |
|
|
I think there are IDE's with good class browsers out there, but I can't come up with a name. Google class browser editor? |
|
Back to top |
|
 |
Crooksey Apprentice


Joined: 26 Apr 2006 Posts: 239 Location: Vatican City
|
Posted: Tue Nov 27, 2012 12:32 pm Post subject: |
|
|
My 6 year old thinkpad runs Eclipse/PyDev with no problems at all, so why people maon about bulky IDE's I have no idea.
I now use Aptana Studio (python web dev)
Its opensource and works great.
If you want to look at another python IDE, everyone always raves about PyCharm, but I refuse to pay for software. |
|
Back to top |
|
 |
Dr.Willy Guru

Joined: 15 Jul 2007 Posts: 435 Location: NRW, Germany
|
Posted: Tue Nov 27, 2012 12:42 pm Post subject: |
|
|
ichbinsisyphos wrote: | I'm working on a more complex fun project right now and I am beginning to lose oversight again
I just thought what would be great is an editor that splits up the source into classes and functions and presents them in a way similar to a good documentation program, like doxygen or something, where you see what each class, function does, what output it produces, what input it requires and how they interact and where you could then try to find the most effective and readable implementation for each task.
I think this would be pretty much perfect for me. |
If we're talking java, then eclipse does that. |
|
Back to top |
|
 |
juniper l33t


Joined: 22 Oct 2004 Posts: 763 Location: EU
|
Posted: Wed Nov 28, 2012 2:30 pm Post subject: |
|
|
ichbinsisyphos wrote: | Sublime Text looks good. It's not opensource, though.
Btw, I'm already over Vim again, what a stupid idea  |
vim is addictive. It's the only editor i use. once you get the hang of it everything else will piss you off. I used to use emacs years ago, but there was this one machine I had to use and the only editor on it of substance was vim. but then I got so used to using vim I ditched emacs. |
|
Back to top |
|
 |
|