rstats.me is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for the #RStats community to gather on the fediverse

Administered by:

Server stats:

17
active users

#vim

5 posts5 participants0 posts today

On my adventure learning #vim proper, I found few ways to go about it:

✅ built-in vim tutor (:Tutor command) -> hardly exciting, very effective

✅ "Vim adventures" game -> fun, effective but also paid

✅ VimHero (below) -> somewhat fun, appears effective

✅ Vim plugin for your IDE (e.g. vscode) -> not exactly fun but so far the best way to do practical learning while still being productive in a familiar environment

What else have I missed?

Replied in thread

@nixCraft Really?

😔

OK, my take: if I edit a simple config file in the shell, I'm using #vim as it is a decent simple text editor. It's also my default for writing emails or Usenet postings.

For almost anything else outside of the web browser, I'm working in #Emacs - which is not per se a text editor (alone).

karl-voit.at/2015/10/23/Emacs-

public voit - Web-page of Karl Voit · Emacs is Not Just An EditorEmacs is Not Just An Editor
Replied in thread

@lindamciver - it's ongoing trauma.. every &*(ing time on a PC in a shell you wonder if ctrl-C, or enter or simply highlighting is going to copy text, or execute something or kill a job. #onenote has its own drama going on where it just refuses to copy plain text sometimes, instead preferring to deliver an image of the text at the other end. I use #vim sometimes as a mediator because you can't f&*(ing paste an image into #vim no matter how hard you try...

Replied in thread

@nixCraft I'm 100% sure NOBODY is attracted to #vim because it's easy.

Vim forces the user get over a steep learning curve, so they can then reap the benefit of being the most productive they will ever be. Effort --> Reward.

Continued thread

But what I originally went into the manual for:

You might know that you can open multiple files in split windows, using something like

vim -o file1 file2 file3

But if you forgot the -o and would like to do it after #Vim is already open, the :all command is what you're looking for.

(There's also -O for vertical splits, equivalent to :vert all, and -p, equivalent to :tab all.)

TIL: #Vim can do

:w >> filename

to _append_ to a file.

(You can omit "filename" to append to the current file.)

Also, :w accepts a range, so if you want to append only a few lines from the current buffer (e.g. by selecting them in visual mode), you can do that.

And :w also accepts a range when _not_ appending, allowing you to save only a selection of lines in the current buffer to the current file. (You might need to use :w! if it's an existing file, to protect you from fuckups.)

I have been tinkering with ALE in #vim since the codebase I work in uses #Python typing, and it has proven to be useful. The surprising part is how much there is to it.

Either way, one of things that was nice with VSCode was the type-hinting support, but I missed working in vim. I get that back with ale

github.com/dense-analysis/ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support - dense-analysis/ale
GitHubGitHub - dense-analysis/ale: Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) supportCheck syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support - dense-analysis/ale

Did you know that you can replace a regex with unicode character in Vim? When is it useful?
When mass formatting a text. Such as replacing all instances of {...} with {…}. Or all dashes with en-dash or em-dash.

:%s/\.\.\./\=nr2char(0x2026)/gc

nr2char() replaces the matched regex with the character represented by its unicode value.