@normalmode@mastodon.social avatar

normalmode

@normalmode@mastodon.social

Don't Stop BelieVim

This profile is from a federated server and may be incomplete. Browse more on the original instance.

scy, to vim
@scy@chaos.social avatar

(and ) will trigger au FileType netrw autocommands, as well as commands in after/ftplugin/netrw.vim when

• selecting a directory in a buffer
• selecting a file in a Netrw buffer (i.e. when leaving Netrw)

but not when first entering Netrw, e.g. by calling :Explore

Even though :set ft? will display 'netrw' no problem.

What the fuck?! I'm at a loss here, any hints greatly appreciated. :BoostOK:

Reproduce by doing

• nvim --clean
• :au FileType netrw echo 'netrw'
• :e .

normalmode,
@normalmode@mastodon.social avatar

@scy Sidenote: you could also use :echom, which saves everything it writes into :messages.

ctietze, to neovim
@ctietze@mastodon.social avatar

Recently picked up that an "IDE" is a largely uncustomized, out-of-the-box experience, and that (Neovimmers) call the result of their customizations a "PDE", a "Personal Development Environment" instead.

Made me wonder:

Is the notion that IDE's are what they are, mostly unchangable, a common one?

normalmode,
@normalmode@mastodon.social avatar

@ctietze I’m not sure if that’s an accurate way to describe IDEs. Xcode, perhaps, but while Visual Studio is no Emacs, it allows you to configure the UI elements, the colourscheme, the key bindings, set up custom commands, install plugins, etc. I don’t know how common it is to use all these features (I, for one, have barely scratched the surface), but there’s a lot in there.

RL_Dane, to vim
@RL_Dane@fosstodon.org avatar

Hey / gurus,

Is there any way to make the spelling checker ignore words with numbers in them?

Couldn't find a good answer online.

normalmode,
@normalmode@mastodon.social avatar

@RL_Dane Kind of. You can do this:

:syntax match WordsWithNumbers /\w*\d\w*/ containedin=ALL contains=@NoSpell

...but that will also prevent other highlighting from starting inside those words, which may or may not be an issue for you.

If it is an issue, you might be able to get around it by tacking on an extra contains=ALL, but it really depends on the rest of your syntax highlighting as to whether that will improve things or make it worse!

normalmode, to vim
@normalmode@mastodon.social avatar
scy, to neovim
@scy@chaos.social avatar

Wait, why is loading .vim/after/plugin/foo.vim if the foo plugin isn't installed at all?

(Sharing dotfiles across machines, and I was hoping that /after/ made sure that it's only sourced when the plugin itself is installed on that particular machine.)

I know that I can use exists() to check for a plugin command or whatever to conditionally do things, I was just hoping I didn't have to.

normalmode,
@normalmode@mastodon.social avatar

@scy Minor clarification: it’s not exactly skipping the after/ directories: they’re just not inside plugin/.

Meant to reply to your original query but got sidetracked and then you answered it yourself. Sorry!

normalmode,
@normalmode@mastodon.social avatar

@scy You are 100% correct and I am an idiot. Thanks for the correction and apologies for the misinformation!

tartley, to random
@tartley@mastodon.social avatar

I was today years old when I learned that I can just type the plain small integers when referencing a git stash. For over a decade I've been typing out "stash@{2}" every time. Jeeeeeezuuuusssss.

normalmode,
@normalmode@mastodon.social avatar

@tartley WHAT

scy, to vim
@scy@chaos.social avatar

I think the default style of folds is pretty ugly and distracting. How do your folds look? I'd like some inspiration :)

normalmode, (edited )
@normalmode@mastodon.social avatar
normalmode,
@normalmode@mastodon.social avatar

@scy I also remove their background colour and give them a fairly dim foreground colour in my colorscheme to make them less distracting.

selzero, to random
@selzero@syzito.xyz avatar

Aww look they have these cute little What Would Janeway Do bracelets for Voyager fans.

normalmode,
@normalmode@mastodon.social avatar

@scy tempted to make this into a VimGolf challenge.

atoponce, to markdown
@atoponce@fosstodon.org avatar

I've been hearing so much about , I decided to give it a try. I always keep my notes in , so an editor that visually renders Markdown as I type it is fantastic.

But is there no way to disable line wrap? I already have "Settings -> Editor -> Display -> Readable line length" toggled off. But long lines still wrap. I'm not seeing any other option that would affect line wrapping.

normalmode,
@normalmode@mastodon.social avatar

@atoponce If we’re splitting hairs, it accepts :q! as “correct” but that command will only quit Vim if you only have one window/tab open* AND don’t have any unsaved hidden buffers.

  • ignoring the help window
ekis, to vim
@ekis@mastodon.social avatar

I see a lot of people switching their CapLock key with Esc key to make a more ergonomic to exit interactive mode. But CTRL+C is built-in to both vim (and neovim) to exit interactive

And if you use CTRL+Z to throw vim into the background and the fg command to bring it forward like a professional then it should feel natural

Also stop using arrow keys ❤️

Using hjkl for that matter should be rare, needing to move 1 position should be a rare event

normalmode,
@normalmode@mastodon.social avatar

@infektor @ekis it’s because they don’t always do the same thing.

:help i_CTRL-C says, “Do not check for abbreviations. Does not trigger the InsertLeave autocommand event.” Depends on your configuration and habits as to whether the difference is significant.

normalmode,
@normalmode@mastodon.social avatar

@ekis @infektor Good point! I should’ve mentioned that too. Behaviour is also subtly different exiting visual mode with CTRL-C. I agree CTRL-[ is the best substitute without config.

Personally (if you’re interested) I remap single taps of Caps Lock to Esc and holding it down with another key as Ctrl as popularised (invented?) by Steve Losh. Takes me a while to get used to computers without that mapping though whenever I have to use them!

livingcoder, to vim

VIM is great in many ways but why is the default behavior of "paste" to overwrite the register? This seems like a huge problem that I'm always fighting, every... single... day...
Is there some ancient reason why this was a great default behavior?

normalmode,
@normalmode@mastodon.social avatar

@livingcoder Not sure of the original reasoning for it. It’s occasionally useful if you then want to immediately paste the text you just replaced somewhere else. But otherwise, in recent versions of Vim, paste with capital P to do it without overwriting the register.

briandesmond, to random

Who's using #Obsidian for notes? I keep hearing about it, what's the deal?

normalmode,
@normalmode@mastodon.social avatar

@sergio_101 @ellane Would you mind if I asked what inspired you to try out Obsidian when you were already a (happy?) user of Org Mode? Will you be going back to Org now, or sticking with Obsidian for a bit?

normalmode, to vim
@normalmode@mastodon.social avatar

It probably goes without saying that is a huge part of my life, so I'm deeply saddened to learn of Bram Moolenaar's passing. I use Vim pretty much every day and on every computing device I own—at work and outside it—and it has given me a tremendous amount of joy over many years. It saves me time with its editing model and features and then immediately takes that time right back again with the desire it brings out in me for tinkering. Thank you, Bram.

https://groups.google.com/d/msgid/vim_announce/20230805121930.4AA8F1C0A68%40moolenaar.net

normalmode,
@normalmode@mastodon.social avatar

I’d probably only been using a year or two when I felt compelled to write this Stack Overflow answer explaining why I thought it was worth learning:

https://stackoverflow.com/a/2781607/328936

It’s still very much true for me today.

R.I.P.

normalmode,
@normalmode@mastodon.social avatar

If you use Vim but have never made a donation to ICCF Holland (and if you have the means), then now might be a nice time to do so:

https://iccf-holland.org/

b0rk, (edited ) to random
@b0rk@jvns.ca avatar

what's a popular command line tool (other than git) that you wish had a clearer / more intuitive UI? I'm thinking of tools like dig which has this IMO pretty arcane output format

normalmode,
@normalmode@mastodon.social avatar

@b0rk find

normalmode, to vim
@normalmode@mastodon.social avatar

@scy wrote about how to use a macro to "surround" words/phrases with some text in vanilla . Here's an alternative technique for their specific example of changing:

foo bar and .com → \texttt{foo bar} and \texttt{.com}

https://chaos.social/@scy/110606736247071173

1/3

normalmode,
@normalmode@mastodon.social avatar
  1. Enter insert mode with c to change the first phrase: c2w
  2. Type the first part of the surrounding. \texttt{
  3. Paste from the small delete register to enter the deleted text: ^R- (hit CTRL-R and then minus)
  4. Enter the closing surround and exit insert mode: }<Esc>
  5. Move to the next location and re-enter insert mode with c again: 2wcW
  6. Hit CTRL-A

2/3

normalmode,
@normalmode@mastodon.social avatar

@scy Sorry, should have mentioned in the toot itself (there’s details in the vi.sr answer I linked to): this technique requires 8.2.2189.

scy, (edited ) to vim
@scy@chaos.social avatar

Today I wanted to surround different words/phrases in with formatting, e.g.

foo bar and .com → \texttt{foo bar} and \texttt{.com}

The “targets” are pretty irregular, the text to surround them with stays the same. What I did was:

  1. Highlight the first target in visual mode, e.g. ^v2e
  2. Start macro recording: qq
  3. Replace the text, utilizing :h i_CTRL-R to paste the original: c\texttt{<Ctrl-R>"}<Esc>
  4. Stop macro: q
  5. Select next text, apply macro: $viW@q

normalmode,
@normalmode@mastodon.social avatar

@scy 🤦 I just realised for this specific example, there's an even quicker method:

  1. c2w
  2. \texttt{
  3. <C-R>-
  4. }<Esc>
  5. 2w.

Of course, the dot operator only works when the same motion can be used and as you said originally, your "targets" were actually irregular.

benjaminhollon, to random
@benjaminhollon@fosstodon.org avatar

Okay, Fedi, can you help me find a brilliant solution to my conundrum?

I take notes in plain-text markdown. Is there a good way to sync those to my iOS device and edit them? So far I’ve come up short.

Ideally the solution should be FOSS.

normalmode,
@normalmode@mastodon.social avatar

@benjaminhollon @Anachron iVim has Git built in as an IAP. I haven’t tried it. a-shell & iSH both allow you to mount folders from other apps (e.g. iVim) and allow use of lg2 (a-shell) or git (iSH) (plus they have Vim built in). IIRC all the above is OSS.

normalmode,
@normalmode@mastodon.social avatar

@benjaminhollon Feel free to give me a shout if you want more details on any of my suggestions. I wouldn’t classify any of them as “brilliant” (possible exception of Byword, but I don’t think that works for you).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • everett
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • normalnudes
  • Youngstown
  • Durango
  • slotface
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • tester
  • InstantRegret
  • ethstaker
  • GTA5RPClips
  • tacticalgear
  • Leos
  • anitta
  • modclub
  • khanakhh
  • cubers
  • cisconetworking
  • megavids
  • provamag3
  • lostlight
  • All magazines