Vim

vjousse, French
@vjousse@mamot.fr avatar

After the French version, I've updated the English version of my book about too.
You can find it here: https://vimebook.com/en

The github code is here https://github.com/vjousse/vim-for-humans-book/ and the tagged release here https://github.com/vjousse/vim-for-humans-book/releases/tag/v2.0
Don't hesitate if you have any feedback!

And of course, share the love ❤️

mattwilcox, (edited )
@mattwilcox@mstdn.social avatar

Ok, / and Telescope... I find it bizarre how it auto-ignores anything listed in a .gitignore file.

I still want to find and edit things like .env files, they just shouldn't be in Version Control.

And editing Telescope to explicitly allow certain file names even if they're listed in .gitignore seems to be impossible. Which leaves you choosing to show all hidden files, which I absolutely don't want because node_modules etc I never want.

Is there a neater way I've missed?

elroyjetson,
@elroyjetson@fosstodon.org avatar

@mattwilcox it looks like you can set up a separate keybinding to override the default behavior of fd to use the -no-ignore flag:

-- Custom function to find files ignoring .gitignore
local function find_files_ignore_gitignore()
telescope.builtin.find_files({
find_command = { 'fd', '--type', 'f', '--no-ignore' }
})
end

-- Bind the custom function to a key
vim.api.nvim_set_keymap('n', '<leader>fg', "<cmd>lua find_files_ignore_gitignore()<CR>", { noremap = true, silent = true })

mattwilcox,
@mattwilcox@mstdn.social avatar

@elroyjetson Hmm, I'll have a play with that thanks. Still find it a bit weird you cant just pass it a lits of files like the content of the gitignore already works. Or point to a file such as .telescopeignore while telling it to not parse gitignore

nithinbekal,
@nithinbekal@ruby.social avatar

As of this month, it's been 10 years since I switched to vim. Some reflections on what has changed in how I use vim over the decade:

https://nithinbekal.com/posts/decade-of-vim/

VimLinks,
@VimLinks@hachyderm.io avatar

When doing an interactive rebase in git, it can be very convenient to see the contents of the individual commits: https://github.com/hotwatermorning/auto-git-diff

video/mp4

vpavlyshyn,
@vpavlyshyn@fosstodon.org avatar

I don’t think will replace they have different models and vim is religion . Also luck a lot of out of box ide features like import fix or linter auto fixes and suggestions etc. but I like editor . I am happy to learn how to add missed features !

whynothugo,
@whynothugo@fosstodon.org avatar

@vpavlyshyn As a Vim user, I tried Helix several times, but the way selection and action are two distinct steps just seems a lot less flexible. Even with fluency, actions would always be slower.

However, the way it comes with batteries included is pretty neat, and if you don't have a working Vim setup, Helix allows you to start coding immediately with much less hassle.

vpavlyshyn,
@vpavlyshyn@fosstodon.org avatar

@whynothugo I have same impression I am more user

fabi1cazenave, French
@fabi1cazenave@mastodon.social avatar

Ce samedi 25 mai je proposerai deux interventions sur (et , , …) aux @jdll :

• de 10h à 11h, une conférence « ergonomie vimiste » pour découvrir ou approfondir l’ergonomie des éditeurs modaux (tous niveaux) ;
• de 16h à 18h, un atelier « tupperVim » pour partager des connaissances sur nos éditeurs préférés (niveaux débrouillés / confirmés / experts).

Ça se passe à l’ENS Lyon, viendez nombreuses et nombreux !
https://pretalx.jdll.org/jdll2024/talk/NM7E3T/

fabi1cazenave,
@fabi1cazenave@mastodon.social avatar

@jdll Le dimanche 26 mai à 13h, dans le cadre des , je vous propose un atelier consacré à l’ergonomie des claviers où l’on mettra en œuvre deux types d’outils :

, pour créer ou modifier sa disposition de clavier préférée ;
et , pour émuler des fonctionnalités de claviers programmables sur son clavier de laptop.

Parce que oui, on peut avoir une ergo qui déglingue sans changer de clavier ni de disposition. Qu’on se le dise !
https://pretalx.jdll.org/jdll2024/talk/EWE3LW/

fabi1cazenave,
@fabi1cazenave@mastodon.social avatar

@jdll Tout le weekend des , on tiendra avec la communauté des un stand dédié aux claviers ergonomiques. Il y aura plein de claviers à essayer : Ferris, Atreus, Model01, Planck, Preonic, Iris…

Ça va être l’occasion de fêter la publication de la version finale d’ 1.0, présentée en grandes pompes par @NuclearSquid le dimanche à 14h. The place to be ! :-)
https://pretalx.jdll.org/jdll2024/talk/QT7JBD/

vjousse, French
@vjousse@mamot.fr avatar

Aussi improbable que cela puisse paraître, j'ai mis à jour mon livre sur 12 ans après 😅 https://vimebook.com/fr
Le contenu reste sensiblement le même, j'ai juste refait tous les screenshots, vérifié tous les liens, utilisé vim-plug au lieu de pathogen, fzf au lieu de ctrlp, vim-fern au lieu de TheNerdTree. Bref, c'est pareil, mais en mieux. Reste la version anglaise à mettre à jour, puis passer à l'écriture du prochain sur !
Merci pour tous les retours que j'ai eu ici ❤️

scy,
@scy@chaos.social avatar

There are days when I'd like to throw Vim at the wall.

:set stl=%f%{&modified?'\ •':''}

will have a status line like

README.md •

with the bullet point (•) if the file is modified.

:set stl=%{fnamemodify(expand('%%:p'),':~:.')}%{&modified?'\ •':''}

will eat the space before the bullet point for some reason.

All I did is replace %f with the %{…} expression.

This happens both in 9.0.1378 and 0.7.2, and also if I replace • with any other character.

Ideas, anyone?

scy,
@scy@chaos.social avatar

@deoxys314 I don't think this matters, even setting

:set stl=%{''}%{&modified?'\ M':''}

will result in the status line being just

M

without a leading space, but the second expression is clearly returning one.

scy,
@scy@chaos.social avatar

Okay, I did not move on, I've opened https://github.com/neovim/neovim/issues/28918 in Neovim, maybe they're willing to break compatibility here to make it more consistent.

shalien, French
@shalien@projetretro.io avatar

If you think using / is a required skill for being a we can't be friend.

shalien,
@shalien@projetretro.io avatar

@kirby serious question, could you point me to any POSIX compliant systems that don't make it possible to use a modern keyboard and text editor ?

shalien,
@shalien@projetretro.io avatar

@kirby So being curious is aggression now ?

And here I was trying to improve myself.

annika, (edited )
@annika@xoxo.zone avatar

I'm playing around with and a clean config. Not sure if this is a LazyVim question, or a question, or an question, but what are the keyboard shortcuts for these autocomplete dropdowns? Is this "omni" completion?

<c-n> for next item, <c-p> for previous, enter to accept the suggestion? Is there anything else? I'm not sure where to find these in the help

Edit: Thanks @dpom, I think all the bindings I care about are indeed within nvim-cmp https://www.lazyvim.org/plugins/coding#nvim-cmp

dpom,
@dpom@fosstodon.org avatar

@annika Typically <c-y> will accept . Many of the autocompletions are probably provided by nvim-cmp, rather than native. I don't personally use Lazyvim so I'm not sure how it's divided up.

annika,
@annika@xoxo.zone avatar

@dpom I think the autocompletions themselves are coming from Intelephense via the LSP, but I do see a lot of nvim-cmp bindings in :imap. Thank you for the pointer, I'll see how much more I can tease out based on this

scy,
@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.

scy,
@scy@chaos.social avatar

@normalmode I've tried that and didn't see them show up either, but I can't entirely rule out that I did something wrong.

scy,
@scy@chaos.social avatar

With the minus key being the default (and oil.nvim) shortcut for "change into parent directory", TJ DeVries suggested to globally (i.e. in normal edit buffers) map minus to "open Netrw (or oil) in the current window", and I think that's really clever.

Like, <CR> moves down into a directory or file, and - moves up into the parent directory – either of the directory you're currently browsing, or the file you're currently editing. Like a global "zoom out" key.

scy,
@scy@chaos.social avatar

In addition of using the minus key to open for the current file's parent directory, I've now added some logic to Netrw buffers in my config that will try to position the cursor on the file that you've just edited, for additional continuity.

It's not perfect, but it's a start.

https://codeberg.org/scy/dotfiles/src/commit/f154f9604f3f8d66bd6bfa2854613e34b0c1f5ce/.vim/after/ftplugin/netrw.vim#L19-L37

aburka,
@aburka@hachyderm.io avatar

and chose opposite conventions for the meaning of "vertical" and "horizontal" splits and it will be the death of me

awoodsnet,
@awoodsnet@phpc.social avatar

@aburka The solution is to pick one, and stick with it. I chose to only split with tmux. The different panes let me see the forest. When i need to see the trees, I’ll zoom the window so that it’s full screen.

The only time i split with vim nowadays, is if I need to copy from one part of a file to another part of the file.

if you need to use both equally, I’d suggest you update your leader / prefix bindings to make splits predictable.

thet,
@thet@graz.social avatar

tip of the day: to replace text wrapping around some other, you can use regex groups and backreferences like this:

:%s/some(.*)text/other\1string/gc

For example:

Screencast of a regex replacement in vim with groups and backreferences.

tshirtman,
@tshirtman@mas.to avatar

@thet i do have hls set, but it only does the first part of that, not the replacement preview, that’s apparently a neovim feature (inccommand), and it’s quite enticing, there are apparently some old plugins in the same directions for vim for it, i’ll probably give them a shot, but i might also try (again) to move to neovim in the near future. My config is large and depends on many plugins, so it feels like it’ll be a whole project 😅 .

tshirtman, (edited )
@tshirtman@mas.to avatar

@thet I can confirm that the traces.vim plugin https://github.com/markonm/traces.vim/ works great :)

al3x,
@al3x@hachyderm.io avatar

Productivity increases with the level of customization you are making in the tools you are using most often.

The downside is that the more used to these customizations you get, the more lost you'll feel when
using a system that is not configured as yours.

Simple example: create a new binding in or . This is not only very common but
also very encouraged. After getting used to that, connect to a remote server.

withoutclass,
@withoutclass@mastodon.sdf.org avatar

@al3x No problem, I'll use TRAMP :)

nemo,
@nemo@mas.to avatar
VimLinks,
@VimLinks@hachyderm.io avatar

Vim has a lot of modes, probably more than you thought. Here's a diagram you could explore to maybe learn a new keymap or command: https://gist.github.com/kennypete/1fae2e48f5b0577f9b7b10712cec3212

sqrtminusone,
@sqrtminusone@emacs.ch avatar

Google Books Ngram Viewer is a lot of fun, but... Who the heck was using in 1800? And what's that uptick in around 1880?

At least no one cared about in the 19th century.

Edit: now I know more about old English.

sqrtminusone,
@sqrtminusone@emacs.ch avatar

@karthink Ah, interesting.

The only instance of non-editor "vim" I've seen was in a piece by Dennett arguing against the existence of qualia. The argument was something like: 'Imagine the property of a dollar that gives it meaning. Let's call it "vim".'

I was sure he made it up.

ctietze,
@ctietze@mastodon.social avatar

@sqrtminusone @karthink 🤯 I never bothered to check!

With that, this passage makes so much more immediate sense

scy,
@scy@chaos.social avatar

ughhh, is such a mess.

But it comes with every installation of and , so as someone who enjoys minimalism and likes to keep the number of additional plugins to a minimum, I feel like I should learn to use it and integrate it into my workflow.

But I've just used :Rexplore on a dirty file with 'nohidden' and it simply replaced my file's contents with the directory listing 😬

Also, don't make the mistake of looking at its source, or visiting the maintainer's "website" …

gnadenelfmeter,
@gnadenelfmeter@chaos.social avatar

@scy I have simply deactivated unneeded plugins in my options.

-- Disable bloated stuff
local disabled_built_ins = {
"2html_plugin",
"getscript",
"getscriptPlugin",
"gzip",
"matchit",
"netrw",
"netrwPlugin",
"rplugin",
"spellfile_plugin",
"tar",
"tarPlugin",
"tohtml",
"tutor",
"vimballPlugin",
"zip",
"zipPlugin",
}

for , plugin in pairs(disabled_built_ins) do
vim.g["loaded
" .. plugin] = 1
end

gnadenelfmeter,
@gnadenelfmeter@chaos.social avatar

@scy One of my essential plugins is actually https://github.com/stevearc/oil.nvim

scy,
@scy@chaos.social avatar

Instead of simply failing, my will now ask to create parent directories, if they don't exist, before saving a file.

https://codeberg.org/scy/dotfiles/src/commit/d3f843e5f674cef8572c51d45c41c3ec1f2f7b6c/.vim/plugin/mkdir-on-save.vim

amatan,
@amatan@mastodon.social avatar

@scy @normalmode Neovim has ++p. Vim should have that too (but I don’t recall it does)…

scy,
@scy@chaos.social avatar

@amatan @normalmode ++p only exists in more recent versions of Neovim, and it's still something manual that I have to add to the :w command.

scy,
@scy@chaos.social avatar
slothrop,
@slothrop@chaos.social avatar

@scy Torn between “neat” and “this has to be a sacrilege in some religion I’m not familiar with” 😂

scy,
@scy@chaos.social avatar

To be honest, I don't care that much for the splits to be equal in size. But I am using a tiling window manager, and whenever I'm opening a new terminal on the screen Vim is on, it will result in what was a 50:50 window split in Vim now being one window that's almost the same size as before and the other one being 1 row high, and that's unacceptable.

My favorite solution would be Vim tracking window sizes in percentages of the terminal, and trying to keep these constant, but this works too.

RL_Dane,
@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!

RL_Dane,
@RL_Dane@fosstodon.org avatar

@normalmode

Ah, that sounds kinda dodgy. I guess I'll leave it as is.

Thanks for the info, though!

RL_Dane,
@RL_Dane@fosstodon.org avatar

When you're in a web browser and and end an input form with [Esc]:wq

;)

gershman,
@gershman@mastodon.acm.org avatar

@RL_Dane

Same, but C-xC-c.

mykhaylo,
@mykhaylo@fosstodon.org avatar

@gershman @RL_Dane check out emacs-everywhere package

seve_py,
@seve_py@fosstodon.org avatar

Curious about how many Vim/Neovim plugins you’re rocking? 🤔 Jump into your terminal, navigate to your Vim or Neovim configuration directory, and run this command: ls -alp | wc -l. I currently have 41 plugins, but I’m aiming to slim down to 30-35. How about you? Share your plugin count below!

dabe,
@dabe@freeradical.zone avatar

@seve_py @tartley When I redid my config of about 6 months from scratch, I ended up with way fewer plugins than before. There truly were a good amount that I just installed for fun or that I quickly got used to not having (sometimes leading me to use more idiomatic practices). It’s a good thing to try every now and then, free time permitting. But there’s also no harm in having a bunch of plugins you like!

tartley,
@tartley@mastodon.social avatar

@dabe @seve_py Yeah, that is very understandable, I think you're right that there's value in shaking things up from time to time.

vinib,
@vinib@fosstodon.org avatar

users: do you use the editor for project-wide find and replace or just regular shell?

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