r_vim | Unsorted

Telegram-канал r_vim - r_vim

65

@r_channels

Subscribe to a channel

r_vim

Random orange arrow in vim
https://redd.it/1x3ktjf
@r_vim

Читать полностью…

r_vim

-sound -X11
-dnd +mouse_dec +spell +xattr
-ebcdic +mouse_gpm +startuptime -xfontset
+emacs_tags -mouse_jsbterm +statusline -xim
+eval +mouse_netterm -sun_workshop -xpm
+ex_extra +mouse_sgr +syntax -xsmp
+extra_search -mouse_sysmouse +tabpanel -xterm_clipboard
-farsi +mouse_urxvt -tag_any_white -xterm_save
+file_in_path +mouse_xterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
3rd user vimrc file: "$XDG_CONFIG_HOME/vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/vim/src=/usr/src/debug/vim -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.42/core_perl/CORE -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -L/usr/local/lib -o vim -lcairo -lz -lpangocairo-1.0 -lpango-1.0 -lcairo -lharfbuzz -lgobject-2.0 -lglib-2.0 -lm -ltinfo -lnsl -lacl -lattr -lgpm -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

I'm pretty sure I must have altered how the cursor displays in visual mode, but I'm not sure how, I have looked around to no avail for a solution here, any pointers?

https://redd.it/1x1jijo
@r_vim

Читать полностью…

r_vim

Monthly Thread: Tools with Vim-like Keybindings

We regularly remove standalone posts about tools that use vim-inspired keybindings. There are too many of them, and individually they dilute the subreddit.
But the content is valuable, and many of you want to know about these tools.

So here's the place for it.

Share any tool that uses vim-like keybindings, whether it's a browser extension, terminal emulator, IDE plugin, note-taking app, PDF reader, or anything else. If it has hjkl navigation, modal editing, or vim-inspired controls, it belongs here.

For each tool you share, try to include:
- What it is and what problem it solves
- Which vim features it supports (navigation, modal editing, text objects, etc.)
- A link to the project

This thread is posted monthly. If you find something mid-month, save it for here rather than posting a standalone thread (which will be removed).

https://redd.it/1x0chro
@r_vim

Читать полностью…

r_vim

How to set tab while branching in vim?

Hello guys! Lately I've often been using vim instead of VS code. But my habits didn't disappear: As you know, in VS code when you go to the next line, while you write conditionals or functions, IDE set
x number of tabs for you. For me it's pretty cool feature and vim doesn't have it natively. What can I write in \~/.vimrc or maybe download smth to enable this feature on vim?

https://redd.it/1wy2btu
@r_vim

Читать полностью…

r_vim

It doesn't seem that bad?

I avoided vim for years, from the way people talked about it, sounded like it would be too much to learn programming and at the same time learn modal editing...but I've started using it now because I a course I started on C programming insists that people completing the course use a barebones text editor, no IDE or anything IDE-like with plugins.


Decided why not, this is my chance to learn vim. I've discovered that it behaves like a regular text editor in insert mode, then if I want to practice vim motions I can go into normal mode and practice, adding 1 or 2 new keys or combos every week or two...


Am I missing something or doing it wrong? Other than remembering to change modes this doesn't seem that difficult? I don't know most of the keys or combos but that's not a pain as I don't need to use them?


I feel like people shouldn't be talking about vim like it's this super hard thing with a steep learning curve. So far it has seemed easy to learn at a pace I have control over?

https://redd.it/1wxio04
@r_vim

Читать полностью…

r_vim

vim-pi-chat: pi (the coding agent) embedded in a split window, plain Vim 9
https://github.com/galeone/vim-pi-chat/

https://redd.it/1wwdltn
@r_vim

Читать полностью…

r_vim

cursor color manipulation on open

vimgang,

I have vim set to open nerdtree automatically on open and shift focus to whatever file im editing. My issue is my cursor highlight stays in nerdtree and doesnt follow the file focus : /

My current .vimrc invocation:

au VimEnter * NERDTree | wincmd p

Any ideas are appreciated!

https://redd.it/1wvs2b9
@r_vim

Читать полностью…

r_vim

vim9ls -- language server for vim9
https://github.com/h-east/vim9ls

https://redd.it/1wusryy
@r_vim

Читать полностью…

r_vim

python-syntax-enhanced: Python syntax for Vim that highlights type annotations

https://redd.it/1wqomav
@r_vim

Читать полностью…

r_vim

Are you able to use vim professionally, in massive codebases that you don't have a good mental model of?

Vim is fun and cool for me when I know where things are/don't have to hold a lot of repo context in my head (where files are, where to look for things, what a file I need is called, which file I need, etc.) but at work where I'm working in multiple large repos that I understand less than 1% of, it seems impractical. Like I need a GUI to even begin navigating and searching for what I need, or when I'm trying to get a lay of the land.


Is this an issue with my abilities/tools/knowledge (i.e. I could lack knowledge on a useful way to browse a file tree in vim or something) or is this an area where vim isn't really the best choice?

https://redd.it/1wmetux
@r_vim

Читать полностью…

r_vim

Plugin to yank context for agents

This is quite a small function, but it's made a big difference for me, especially when pointing to something outside my project.

Yank file location references to the system clipboard, ready to paste into an AI agent prompt.

When working with an AI coding agent, you often need to tell it where to look. This plugin lets you grab a precise file reference.

Try it with "Focus on <paste>" or "see <paste>" in your prompt.

# What gets yanked

|Mode|Yanked|
|:-|:-|
|Normal|path/to/file.py|
|Visual (single line)|path/to/file.py#L42|
|Visual (range)|path/to/file.py#L42-L57|

Paths are relative to the current working directory when beneath the cwd, absolute otherwise.

The default mapping is <Leader>a in both normal and visual mode.

https://github.com/ShayHill/vim9-agent-context

"Quieter" and I think faster than pasting code and waiting for the agent to find it.

https://redd.it/1wlwegu
@r_vim

Читать полностью…

r_vim

How do I delete current word and previous word?

Given the following two lines:

.row.mb-5.justify-content-evenly

.col-md-5.detail-grid

If my cursor is at the y in justify-content-evenly, how can I delete that word, plus the cursor before it without losing the newline at the end?

https://redd.it/1wittwe
@r_vim

Читать полностью…

r_vim

Minor "loadview" behavior change when upgrading to VIM-9.1

This might save someone a search. I upgraded VIM-8.1 to VIM-9.1 (I know,
I'm slow) and ran into a minor problem with my .vimrc file.

When scrolling through colon-command history using ": CTRL-F", "loadview"
would send an error message before showing the history. It would disappear
fairly quickly, but it was annoying. The old .vimrc:

" Save and restore edit sessions in directory $HOME/.vim/view (created
" for you if it doesn't already exist). We test with expand because
" running 'vim' with no arguments throws a 'no filename' error.
" See ':h views-sessions' for more info.

if has("autocmd")
if len(expand('%')) > 0
au BufWinLeave mkview
au BufWinEnter
silent loadview
endif
endif

The fix was using "silent!" to disable the E11 error message:

if has("autocmd")
if len(expand('%')) > 0
au BufWinLeave mkview
au BufWinEnter
silent! loadview
endif
endif

No problems so far. Hope someone finds this useful.

https://redd.it/1wf4lzf
@r_vim

Читать полностью…

r_vim

I think rebinding j to up and k to down is a really good rebind, hear me out.

I'd like to preface this by saying this is NOT an argument to convince people to switch after already building muscle memory, I'm just trying to say why I believe these binds could be an option for new vim users at least. My argument is only trying to prove why these binds could be marginally better, not significantly.

Also sorry for making this really long, I just wanted to get my entire argument out there.





How this all began was I first was configuring hyprland and was deciding on what to bind my switch window focus to. I naively decided to bind left to j, up to k, down to l, and right to ;. I used these binds for a little bit, and they honestly work perfectly for hyprland, and so I thought I would just do the same for vim. As I was using vim with these binds, I did a little research and found a compelling case to use hjkl instead of jkl;, the reason being having up and down on stronger keys then left and right is better for experienced vim usage, as there are usually other better hotkeys to use such as f, t, w, e, and all the rest.

One detail I omitted was I had been using hjkl with the traditional bindings for a while before switching to the worse jkl;, and when I was using them I found them wildly un-intuitive. My main annoyance wasn't that the keys were seemingly shifted to the side, it was that j was the down key, and k was up. I've researched a little bit, and I found that the reason it was originally made that way was the creator of vim had a specific keyboard back in the 80's or something that made it better for him to do it that way.

My question is, why can't we ditch these old binds and instead use j as up, and k as down? And let me tell you exactly why we should.

I will bring up two arguments to account for both views that I think people have to deter them from using these binds.



The first argument I will attempt to disprove is that the down action is apparently more valuable, therefore it should be on a better and easier to access key then up.

Firstly, I'd like to say that I don't even agree with this point, but I will argue from the perspective of agreeing with it. (see below for me attempting to disprove that the down action is more valuable)

There's one key factor that makes this point actually support my jk binds, and it's that the middle finger is just.. stronger then the pointer finger. That's it. Can't really say much to that, so if you were to put the stronger key on supposedly the "more valuable action," that must mean they're good binds, right?



The second argument I have as to why rebinding j to up and k to down is good is: the down action isn't even more valuable than the up action.

I'm bringing this up because even if you disagree with my last point that you disagree somehow with the middle finger being stronger then the index finger, then you can see that the down action isn't even more valuable than the up action.

To try to disprove this claim, I'll first provide why people believe it to be true. The argument that I have seen is that in vim you're usually starting from the top of a file, and typing while working down. This is absolutely true, but why would this be a plus? I'll explain in a second, but I don't know maybe I'm missing something because I genuinely don't understand how this is a plus.

The reason why I think this isn't that good of an argument is, well, the enter key.

Really one of the only times you're actually going to be going down with the key in normal mode is when you need to go down either from text that was already there, which is already deviating from the point of you being in an empty file and working down.

And the other time is when you would be going down in normal mode is well when you've just gone up. Huh, the only time in the actual scenario when you'd be going down, is, correct me if I'm wrong, when you've gone up. That would actually suggest the conclusion that down really isn't actually "more valuable" as people say, and rather how valuable it

Читать полностью…

r_vim

Daily Vim Tip
https://redd.it/1wbh5ae
@r_vim

Читать полностью…

r_vim

A Bash-based Vim configuration manager (Plugin, CoC, Theme management)

Hi r/vim,

I got tired of manually editing my   .vimrc   just to add a single plugin and then having to deal with updates, so I built a Vim configuration manager written entirely in Bash.

This tool helps you easily manage:

1. Plugins (search, add, remove, update, and list)

2. CoC extensions (add, remove, list)

3. Themes (add from available color schemes)

4. And much more

It fully supports both Linux and Termux (Android).

Reddit's spam filter is a bit too strict for new accounts, so I can't post a direct GitHub link here. However, you can easily find the repository by searching for: "aidomx vimx"

The   README.md   is quite comprehensive and covers the initial installation guide for   vimx  , whether you prefer cloning the source or installing via curl.

Hope you find it useful! Happy Vimming.

https://redd.it/1x2yrr5
@r_vim

Читать полностью…

r_vim

Cursor not displaying as a block when in visual mode

When entering visual mode the cursor isn't actually shown as a block, see the below screenshots to see what I mean. Below is what I expect when in visual mode, whereby the cursor remains as a white block on the letter "a",

https://preview.redd.it/0zlz0mg3lfuh1.png?width=676&amp;format=png&amp;auto=webp&amp;s=1f40c43e882bba3ed70357593fcf575e182f1f81

However, what I get is this, whereby the letter "a" is highlighted in a faint grey, and the cursor itself doesn't actually appear,

https://preview.redd.it/vvr92pr7lfuh1.png?width=676&amp;format=png&amp;auto=webp&amp;s=6edff56bd6621b392da2d3b208df23d28ba4be5e

Here is my full `.vimrc` file,

execute pathogen#infect()

let g:NERDTreeNodeDelimiter = "\u00a0"

set background=dark
set number

syntax on

nmap <C-a> :tabp<CR>
nmap <C-d> :tabn<CR>
nmap <C-t> :NERDTreeToggle<CR>

au FileType gitcommit setlocal tw=72
au FileType gitcommit setlocal colorcolumn=72

au FileType go setlocal colorcolumn=100 ts=4

au FileType c setlocal ts=4 colorcolumn=120
au FileType css setlocal ts=4
au FileType javascript setlocal ts=4
au FileType lua setlocal ts=2 sts=2 sw=2 expandtab
au FileType sh setlocal ts=4
au FileType xml setlocal ts=2 sts=2 sw=2 expandtab
au FileType yaml setlocal ts=2 sts=2 sw=2 expandtab

au BufEnter *.md setlocal colorcolumn=80 ts=4 tw=80 expandtab
au BufEnter *.templ setlocal ts=4

au BufEnter *.py setlocal ts=4 expandtab
au BufEnter *.html setlocal ts=4
au BufEnter *.tmpl setlocal ts=4

if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif

I'm currently running on Vim 9.2, which I recently upgrade too after doing a system upgrade. Full version info below,

[~]$ vim --version
VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Oct 05 2026 22:08:46)
Included patches: 1-1164
Compiled by Arch Linux
Huge version without GUI. Features included (+) or not (-):
+acl +find_in_path -mouseshape -tag_old_static
+arabic +float +multi_byte +tcl/dyn
+autochdir +folding +multi_lang +termguicolors
+autocmd -footer -mzscheme +terminal
-autoservername +fork() +netbeans_intg +terminfo
-balloon_eval +gettext +num64 +termresponse
+balloon_eval_term -hangul_input +packages +textobjects
-browse +iconv -pango +textprop
++builtin_terms -image +path_extra +timers
+byte_offset -image_popup +perl/dyn +title
+channel +insert_expand +persistent_undo -toolbar
+cindent +ipv6 +popupwin +user_commands
+clientserver +job +postscript +vartabs
-clipboard +jumplist +printer +vertsplit
+clipboard_provider +keymap +profile +vim9script
+cmdline_compl +lambda -python +viminfo
+cmdline_hist +langmap +python3/dyn +virtualedit
+cmdline_info +libcall +quickfix +visual
+comments +linebreak +reltime +visualextra
+conceal +lispindent +rightleft +vreplace
+cryptv +listcmds +ruby/dyn -wayland
+cscope +localmap +scrollbind -wayland_clipboard
+cursorbind +lua/dyn +signs +wildignore
+cursorshape +menu +smartindent +wildmenu
+dialog_con +mksession +socketserver +windows
+diff +modify_fname -sodium +writebackup
+digraphs +mouse

Читать полностью…

r_vim

Vim Resources - Guides, documentation, tutorials, forums...
https://www.jamescherti.com/resources/vim/

https://redd.it/1wy81cd
@r_vim

Читать полностью…

r_vim

How to get past skipped lines?

I've been getting good with vim but every now and then when I want to access a certain line, I can't move the cursor into it, it just jumps over. What I usually do it move the cursor a line above it and (number)+w a few times. Any advice for this small problem I'd be grateful.

https://redd.it/1wxxdig
@r_vim

Читать полностью…

r_vim

Stuck on thehelp – keyboard shortcuts

Hi,

I have a Linux VPS and I'm currently struggling with vim... As soon as I type `:help`, the help page appears. The following shortcut is located there:


"Jump to a subject: Position the cursor on a tag (e.g. bars) and hit CTRL-\]"


1.) I haven't seen a keyboard shortcut yet that had a minus sign between the keys. It’s always Ctrl+C, for example. What is the minus sign supposed to indicate?

2.) "Ctrl + closing square" bracket doesn't do anything either. I can jump to the subject by clicking the mouse or by pressing Ctrl + I. This might be due to the keyboard layout, or does "\]" actually refer to the letter I?


Greetings






https://redd.it/1wwi3h1
@r_vim

Читать полностью…

r_vim

VIM Motions in IDEs, how do you grapple with them?

I don't know if this is the best sub to ask this since it's not related to VIM, the text editor, but rather the VIM Motions.

I believe most programmers who like VIM, can't use it for everything because sometimes you need the power of an IDE, and pretty much every IDE out there has some kind of VIM integration, either official or via extention.

My question is, how do you grapple with VIM shortcuts conflicting with the IDE shortcuts? Do you replace all conflicting shortcuts with VIM or just some of them? If so, which? One I always set is to keep <C-c> for the VIM extention, is a bit weird having to copy using Insert, but I'm too used to exiting Insert Mode using <C-c>. It's hard trying to find a balance between them.

If there's a better sub to ask this question, please tell me so I can move my post there.

https://redd.it/1wvx0d2
@r_vim

Читать полностью…

r_vim

Introduction to NetRw as a modern terminal file browser.
https://3hy.online/post/10

https://redd.it/1wvruoz
@r_vim

Читать полностью…

r_vim

I forked iamcco/markdown-preview (unmaintained since 2024) - works in Vim 8.1+

TLDR; I forked and fixed a few bugs from the original iamcco/markdown-preview.

markdown-preview.nvim is a vim & nvim plugin that lets you preview markdown files in the browser and automatically reloads when you make changes.

**What’s different**

* **No Node.js.** The server is a single binary: no `npm install`, no `yarn`, nothing in the plugin directory to build. Pre-built for macOS (x64/arm64), Linux (x64/arm64), Windows x64 and FreeBSD x64.
* **Vim fixes:** `g:mkdp_auto_close` works in Vim now (it used to miss that Vim unloads the buffer on leave), and the commands exist in the first buffer even when the plugin is loaded on filetype.
* **WSL works:** the browser opens with `wslview`, `cmd.exe` or `xdg-open`, whichever you have.
* `g:mkdp_browser` **takes a list**, run as a command with the URL appended: `let g:mkdp_browser = ['firefox', '-P', 'work']`.
* **Links between markdown files work:** clicking `[guide](docs/guide.md)` in the preview opens that file, and the URL is the file’s path, e.g. `/files/docs/guide.md`.
* **Security:** other web sites can no longer read your buffer through the local WebSocket, and `g:mkdp_open_to_the_world` now needs a token in the URL.
* **New in the page:** GitHub alerts (`> [!NOTE]`), a front matter panel, a full-screen Mermaid viewer (zoom, pan, save as SVG), diagrams that follow the dark theme, and themes from [shadcn](https://ui.shadcn.com/themes) via `g:mkdp_theme_css`.

Everything else works as before: live updates, synced scrolling, KaTeX, Mermaid, PlantUML, Graphviz, Chart.js, footnotes, table of contents, local images, custom CSS. Your existing `g:mkdp_*` settings keep working.

Plug 'sammaji/markdown-preview.nvim', { 'do': { -> mkdp#util#install_sync() }, 'for': ['markdown', 'vim-plug'] }


Repo: [https://github.com/sammaji/markdown-preview.nvim](https://github.com/sammaji/markdown-preview.nvim)
Docs: [https://mkdp.sammaji.com](https://mkdp.sammaji.com/)

Full credit to [u/iamcco](https://github.com/iamcco) for the original.

https://redd.it/1wri5h1
@r_vim

Читать полностью…

r_vim

Is there a way to edit bidirectional text on vim or even gvim?

There's Arabic mode in vim but it only good if your editing only Arabic text. Is there a way to edit bidirectional text? Both LTR & RTL in the same file?

https://redd.it/1wnq79n
@r_vim

Читать полностью…

r_vim

What drew you to vim?

I've been using vim now for the same amount of time I've been using Arch Linux pretty much.

What drew me to it was after installing Arch, I started watching different Linux videos and a lot of the config files were being edited with vim. And I was watching 3 or 4 content creators and they all, for the most part, were using vim to edit those config files. One guy would switch to something different like a GUI text editor like Geany, gedit, and kate. But vim was the one they all used.

So, watching these videos and editing my config files along with them, I was pretty much using vim as well.

I've been using Doom Emacs (most of the key bindings in Doom Emacs are the same as vim key bindings) a lot lately but for quick things, especially if I'm already in a terminal, vim is what I use.

What brought you to vim and do you use other text editors as well?

https://redd.it/1wmbj4r
@r_vim

Читать полностью…

r_vim

Planning to (try to) do a plugin, if anyone want to share a few tips

So far, I've made my custom color scheme thanks to color template and solarized8, but I wanted to try to do something more complicated

I'm going to try making an "animated color pack" (fancy word for saying that i'll try to make the colors in my scheme go from a first color, to a second, to a third and so on)

I don't even know if that's doable, but I think it might be possible if I try playing around with functions (especially if i try doing that by editing code from other people to understand how plugin making works)

Sorry if I write things weirdly, I'm bad at words

Also I wasn't sure whether to post this in help, discussion or tips and tricks, so sorry if i should've posted it elsewhere

https://redd.it/1wjll6h
@r_vim

Читать полностью…

r_vim

Who created the spell files automatically downloaded by Vim and how can I report errors?

They come from https://ftp.nluug.nl/pub/vim/runtime/spell/ but I can't find much information about who put them there and where they got them from. The esperanto one seems to have typos.

https://redd.it/1wftgj0
@r_vim

Читать полностью…

r_vim

is, is tied with the up action.

https://redd.it/1wc1odt
@r_vim

Читать полностью…

r_vim

Is elixir mode working for you guys?

Yes, I have ftplugin on. Yes, vim detects the .exs file as elixir filetype. But neither the syntax highlighting nor the indentation work for it. Yall dont really need to discuss it extensively. I can just install a filetype plugin of off github or somethin but I just wanted to know if it works for yall. Much love to my felloe vimmers.

https://redd.it/1wbt4qz
@r_vim

Читать полностью…

r_vim

Monthly Thread: Tools with Vim-like Keybindings

We regularly remove standalone posts about tools that use vim-inspired keybindings. There are too many of them, and individually they dilute the subreddit.
But the content is valuable, and many of you want to know about these tools.

So here's the place for it.

Share any tool that uses vim-like keybindings, whether it's a browser extension, terminal emulator, IDE plugin, note-taking app, PDF reader, or anything else. If it has hjkl navigation, modal editing, or vim-inspired controls, it belongs here.

For each tool you share, try to include:
- What it is and what problem it solves
- Which vim features it supports (navigation, modal editing, text objects, etc.)
- A link to the project

This thread is posted monthly. If you find something mid-month, save it for here rather than posting a standalone thread (which will be removed).

https://redd.it/1wa8rp4
@r_vim

Читать полностью…
Subscribe to a channel