Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gnubison
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
23 ms
·
211.
▲
by
gnubison
5y ago
> How do you find where the script itself is? No program can do this portably.
212.
▲
by
gnubison
5y ago
Those work in any POSIX shell, and also zsh.
213.
▲
by
gnubison
5y ago
Except for some extra trivialities, like everything that isn't an ex command (and some that are).
214.
▲
by
gnubison
5y ago
Thanks for the tip about zap-up-to-char. > 'd/something' is doable with C-s something RET C-w Doesn't this need to be C-s something C-r RET C-w? Because C-s positions the cursor at the end of the search match.
215.
▲
by
gnubison
5y ago
> it just gives you some ad-hoc shortcuts Give me M-q any day over gqap (or, if you're inside a multiline comment, 3gqq; or, if you're inside a multiline comment starting on the same line as code, just giving up). Edit: though
216.
▲
by
gnubison
5y ago
OTOH, Neovim lets you edit the ex command line; e.g. '!}' might expand to ':.,.+5!', which lets you execute any other ex command simply by deleting the '!'. They both have advantages, and I'm certainly no
217.
▲
by
gnubison
5y ago
The Bourne shell certainly has problems, but IMHO fish should have stuck with POSIX syntax when it's "good enough" (TM). Stuff like $(code) vs (code) makes Fish feel like it just wants to be different. Things I think are big
218.
▲
by
gnubison
5y ago
> The C-ecosystem build tools you refer to are pretty far behind those of pretty much every other langauge. For developers, maybe. But as a user, I love compiling and installing Autoconf software (compared to the alternatives).
219.
▲
InspiroBot
(inspirobot.me)
2 points
by
gnubison
5y ago
|
0 comments
220.
▲
by
gnubison
6y ago
> Alternatively you can use the newer (and highly recommended) bash syntax that is also quote safe Well, mostly: $ a=1; b='*'; c='!'; d='*' $ [[ $a = $b && $c = $d ]] && echo true tru
221.
▲
by
gnubison
6y ago
> Posix 2008 does have fmemopen(), but it's unsuitable, as it is buffer with specified size (which would need to be calculated, as in the MS case), rather than not worried about until a NUL byte is reached. With fmemopen(), you only
222.
▲
by
gnubison
6y ago
This is not an answer to your first question, but I find that Ctrl-O and Ctrl-I are much more useful for getting back to your previous location -- which is normally what I want.
223.
▲
by
gnubison
6y ago
On the other hand, the :! and ! commands are Vi compatible (though, as you say, you wouldn't get the additional features of :sort). So you get to pick who you're going to be compatible with: vi or Windows?
224.
▲
by
gnubison
6y ago
Woah, I just looked at the Vim help page for 'timeoutlen' and the fact that it's in milliseconds is only mentioned below, under 'ttimeoutlen'. The Neovim help page specifies that it's in milliseconds. I think
225.
▲
by
gnubison
6y ago
c<num>l is equivalent to <num>s (unless you've installed a plugin that binds s to something else).
226.
▲
by
gnubison
6y ago
What does "proprietary query language" mean in this context? jq is open source, right?
227.
▲
by
gnubison
6y ago
Vim does a similar thing to Emacs here: the `:sp` and `:vs` commands take an optional argument that, if given, loads a file in the new window. Otherwise the new window just contains the same buffer.
228.
▲
by
gnubison
6y ago
I like the awesome-algorithms link, but some of the code linked is definitely not perfect. A few questionable things from one of the header files [0] in https://github.com/TheAlgorithms/C : - Defines a macro with no pa
229.
▲
by
gnubison
6y ago
I believe that this is just an arbitrary choice that doesn't collide with other keys and is fairly consistent with the other keybindings — cs for changing delimiters, ds for deleting delimiters, and ys for creating delimiters.
230.
▲
by
gnubison
6y ago
Playing around with this, [count]iw seems to have some really strange behavior — I need to do 3iw to select two words, 5iw to select three words, etc.? I'm not sure if I'm missing something. (I normally don't use many text
231.
▲
by
gnubison
6y ago
Sorry — I never know when to assume a large amount of knowledge or a small amount of knowledge. The worst for me is "ctrl-w" to delete a word backward in Insert mode, and to delete a tab in the web browser :) Vim is in my muscle
232.
▲
by
gnubison
6y ago
Implementing a full vi clone seems like a nightmare — the POSIX specification makes me lose hope in humanity :) For instance, what does :delep parse to? I would never have guessed that it was the :delete command with the "p" fla
233.
▲
by
gnubison
6y ago
If you deal with many machines, it's very possible that they don't all have your preferred editor (unless it's vi). vi is on every POSIX system.
234.
▲
by
gnubison
6y ago
In vim, most commands take the form "[count] operator [count] motion". When you learn a new operator, you can use it with any motion that you know and vice versa; and you can add a count to either. To give a few examples: - gqip
235.
▲
by
gnubison
6y ago
There's a 2004 article about this by Joel Spolsky that can be found here[0]. Obviously it is a "tad" out of date (and I don't work on Windows so I can't comment on the situation right now), but it seems that at so
236.
▲
by
gnubison
6y ago
I haven't used i3 in a while, but you might be able to use stacking/tabbed containers to accomplish what you've outlined above. It doesn't have the advantage that you can see part of the window, though.
237.
▲
by
gnubison
6y ago
> Especially with something like `grep` or `sed` that have 1,000 flags each. Sometimes I actually read the POSIX man pages instead of the standard ones — they are sometimes more useful because they have fewer features. Sometimes they ar
238.
▲
by
gnubison
6y ago
Hmmm. I hadn't thought about being able to yank output from a command... That's a really good point. (Honestly I would probably use 'xsel -bi' and ':r !xsel -bo', but that's pretty ugly.)
239.
▲
by
gnubison
6y ago
Perhaps short options are unreadable. But if I see a shell script that contains a long option with only one dash, I will definitely be confused... I don't think that saving a dash makes a shell script more readable. It definitely
240.
▲
by
gnubison
6y ago
I don't use it that often (I just open up another terminal), but you can also use ^Z to put vi in the background. It would be more useful if I didn't always forget and open up a new vi which would refuse to write to the file :)
More ›