VIM + FZF + Rg in native Windows 11
Is anyone using VIM + FZF + Rg in native Windows 11? I don't have any other options but to use Windows 11 unfortunately and I want to make this work. Unfortunately Rg plugin using FZF does not seem to show the preview window properly. Has anyone updated their path to point to git-bash and got it working.
Note: WSL or Cygwin currently is not an option for me.
https://redd.it/1axwso5
@r_vim
vim-lsp sees tab as indentation as error
I use tab to indent in python, and the code runs without any issue, but vim-lsp sees that as an error, and shows "W191 indentation contains tabs".
Is it possible to configure it so that it accepts tabs as indentation?
https://redd.it/1axvch5
@r_vim
Does Terminal matter ? when using NVIM ?
Hi, so i am switching from vscode to nvim chad and problem i encounter is the default terminal in Xubuntu minimal always opens as this size.
so do i have to change terminal or its fine ?
https://preview.redd.it/pdq2n9dz45kc1.png?width=1368&format=png&auto=webp&s=0a22c30c5d2dfe3d205c6ef9da97b4434ef17319
https://redd.it/1ax6qb5
@r_vim
Vim 9.1 feels "snappier"
There you have it, feels a smidge faster when it comes to screen updating, so I have absolutely no regrets building it. I'm glad I did! :)
It's probably all the bug fixed that does it.
https://redd.it/1ax0rse
@r_vim
Vim-specific kind-of shebang?
Hi! I've seen these comments that tell vim to set a specific indentation style, tab size, etc. I wondered whether there is a feature/agreed-upon way to achieve something alike for a custom per-file command to execute a file from within vim.
I currently have a vim mapping to execute the current file (as in writing ./file.sh in the shell), but I'd like to evolve that idea into something more extensible which I can easily change as I work, as needed. Picture:
- Running a main.py while in a child class' file
- Running any executables through ROS (or even launch files)
- Running some docker container that somehow uses my current file
I do not think this would be too hard to implement, but is there already a standard or "good" way to do it?
Cheers
https://redd.it/1awqzkv
@r_vim
Trying to create a List with the filenames of each tab opened
Hi there
I am trying to get into an array the filenames of the buffers opened in each tab opened for a certain vim instance.
Assuming that the instance is made of More than one tab , opened with just one buffer opened in each. This will cicle through each tab grabbing the expand("%")
" Create tabToFn array if it doesnt exists
if (exists('g:tabToFn'))
else
let g:tabToFn = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
endif
" Reference to current filename
let currentFn = expand("%")
" Iterate through each tab and get its filename , base 0
for i in range(tabpagenr("$"))
echo i
exec "tabn" . i + 1
let g:tabToFn[i] = expand("%")
endfor
" Go back to previous filename tab
exec "tabn" . index(g:tabToFn , currentFn) + 1
for element in g:tabToFn
echo element
endfor
exec "tabn" . i + 1
, should work , I dont get what can it be the problem.Need help setting up a Python environment in Vim
I've been tasked to code in Python for my work. I'm new to the Python syntax and my current Vim work flow is setup for Unix/Bash/Tcl ie non object/class coding. I'm feeling very uncomfortable and awkward with the Python scripts and code base navigation using Vim out of the box.
Can anyone offer me any tips to get going and setting up Vim towards an IDE or keyboard mappings. If there is a way to display class and functions of an object by keyboard mappings that would be a great help.
Unfortunately my work environment does not permit me to use plugins so everything is almost vanilla. But I do have access to ctags but have never used it and don't know how.
Thank you in advance.
https://redd.it/1awcicp
@r_vim
Expression register can't do math (no decimals)
Why cant it do math? is there a way to fix it? For example if I do 60/16 it gives me 3, or if I do 10/3 it gives me 3 as well, no decimals, how do you enable them?
https://redd.it/1av1seo
@r_vim
How to define a highlight group that is "stronger" than all the others?
Let's say I have some syntax defined for a local file format.
It has these two groups:
syn match groupA / patternA /
syn match groupB / patterB / contains=groupA
hi! def link groupA Title
hi! def link groupB String
I.e., in a line like this:
patternA some text patternB some text patternB
...the patternA
is highlighted as Title
, both some text
entries are highlighted as Normal
, and both patternB
entries are highlighted as String
Now, I want to add some groupC
by matching patternC
(and link it to Comment
), so that a line like this:
patternA some text patternB patternC patternB
...would be whole highlighted as Comment
, overriding all my other groups.
How can it be done?
https://redd.it/1aujpif
@r_vim
Plugin for jump labels during search?
flash.nvim extends regular search mode by placing jump labels next to on-screen search results which are guaranteed to not conflict with possible pattern continuations.
This is similar to Sneak/Leap but it allows me to retain the muscle memory for /
for when I'm working on remote servers where no custom configs are allowed.
I was wondering if a similar plugin exists for Vim 9.
https://redd.it/1atraz9
@r_vim
Best way to setup VIM for working on a JAVA codebase?
I've used VIM for a fairly long time on a variety of codebases, but never a JAVA codebase before. Now I have to work in JAVA though, so looking for tips on the best plugins/way to set up for JAVA. Thanks
https://redd.it/1at9pu1
@r_vim
Do you use .editorconfig over .vimrc
with editorconfig you can configure for many other editors though with vimrc it's just vim.
so I'm curious, do you do one or the other or a mix or both and why?
https://redd.it/1asgwmj
@r_vim
Best way to navigate large code base in vim
I've been using vim for about 5 years now. I absolutely hate using anything else. IDEs seem so over-complicated and full of distractions. Hate em. One thing that something like vscode has over vim is the mouse-over function signatures and ctrl+click to instantly navigate to definitions. Especially in large projects with dozens or even hundreds of files. My first thought to counter this advantage with vim is to just use grep to find the function or class that I'm looking for and pull it up in another tab. Is this what a "pro" vim user would do? What do you guys usually do for this sort of thing?
https://redd.it/1asapnf
@r_vim
Is it possible to pipe last command's output to a different command / function?
I use vim-fugitive
a lot so all my interactions with git
are pretty much always happening via the:G
command. Sometimesgit
commands will output something useful I would then want to do something about (e.g., git push
might output a URL I could use to open a pull request; or git rebase --update-refs
will list all the additional heads there were updated during the process). Now, is there a way to grab the last command output, and pipe it into another command / function?
I am aware of g<
and I thought I could just :redir
it to a file/register, but unfortunately that is not possible -- from :help g<
:
> The "g<" output is not redirected.
Thanks.
https://redd.it/1axwt6j
@r_vim
vim vs system clipboard
I have been using vim for about 3 months now.It's been an overall great choice that meets all my needs in a far more efficient way.
The only problem that I haven't figured out yet is how to integrate vim's built in registers (yank stuff) with my system's clipboard.
The reason why I want to do that is simple.Sometimes I copy things from the browser and I want to paste/put them in my vim buffers, and inversely, I sometimes like to copy text from files that I opened with my default text editor (obviously vim).
The only way that I found to work in my case is to use the mouse ( right click) to copy from vim and use Ctr+shift+v to paste into vim.(btw this last part only works in insert mode). As a keyboard user, you can only imagine how frustrating that can get :)
I appreciate any help I can get :)
PS: my system setup is as follows: arch linux with qtile as my window manager and clipmenu/clipmenud as my clipboard manager (I use it through dmenu of course).
https://redd.it/1ax1if8
@r_vim
Stupid Question
This might be a stupid question but how to show keystrokes
https://redd.it/1awv53m
@r_vim
My first vim plugin - a code assistant with local LLMs
Hello everyone!
I know that probably there are a thousand of similar plugins, but I did this to start learning about vim plugins.
I created a vim plugin that works as a code assistant, and currently works in two modes: comment mode (adds documentation to the code), and autocomplete mode (Given a comment with instructions, it implements the code).
Do you have any feedback to improve it, to make it cooler, or to make me learn more fancy stuff?
Here's the link: https://github.com/leocus/codeassistant.vim
https://redd.it/1awpkpn
@r_vim
What is the Ex-command that opens multiple files at the same time in tabs?
Is there an Ex-command that does the same work as vim -p file1 file2 ... fileN
?
I'm using gVim in a Windows environment, so if possible, I'd like to open multiple files in tabs at the same time while Vim is open.
Sorry for my poor English. Thanks.
https://redd.it/1aweqcz
@r_vim
Any tips for jumping over parens in a vim-supported environment like leetcode?
In my config, I have <C-l> mapped to the right arrow key in insert mode. Obviously, I can't do that in environments like leetcode that support vim motions but not remapping keys. Any suggestions for quickly moving right in insert mode? The arrow key is a pain in the ass.
https://redd.it/1av50n9
@r_vim
Ultimate Vim Vue Setup
https://pragmaticpineapple.com/ultimate-vim-vue-setup/
https://redd.it/1auo8n6
@r_vim
input() in a popup?
Is it possible to construct such a popup that it would ask a user to enter a value, assigning then this value to some var?
Not like popup_menu()
, where a user selects something from a predefined list, but more like input()
somehow wrapped in a popup?
Would be grateful for an example :) (Can't spot anything like this in :h popup
...)
Thanks.
https://redd.it/1augzi8
@r_vim
YouCompleteMe problems with vim9.1 and Python 3.11
So, virtual text, like the attribute descriptor of the completion hints for functions, are left in my code, and its almost impossible to remove it, because every time I hit Esc
, it returns back as long as I am on the same line.
but if I do move down by arrow keys, or soon to be mapped back again Emacs
keys, I can hit Esc
at another line to circumvent the problem.
I wonder whether you guys think this is a Python problem, or a Vim 9.1 problem.
Thanks.
https://redd.it/1aua2cu
@r_vim
declare multiple fold syntax'es in modeline
lets say we want to fold all text between{{{
and }}}
we also want to fold text between#ifdef
and #endif
we want to declare it in modeline (within a file), somehow like this:
// vim: foldmethod=marker:foldmarker={{{,}}} + #ifdef,#endif
problem is that we cant define multiple syntax'es like this. foldmarker
only allows 1 syntax
we can try foldsyntax
like this:
:set foldmethod=syntax
:set foldmethod=foldsyntax
:syntax region defFold1 start="#ifdef" end="#endif" fold transparent
:syntax region defFold2 start="{{{" end="}}}" fold transparent
problem is we cant use it in modeline, because it should start with :set
normally
there is also foldexpr
problem is that i do not understand it, the syntax is very confusing to me.
what do?
https://redd.it/1ata4z2
@r_vim
What is the best way to rapidly create repeating text with slight differences?
So if I want to have say, have a list containing the integers 1 up to 50, specified in type ([int(1), int(2), ..., int(50)]
) is there an efficient way to type this?
I know I could use 50a int() followed by f( a and then my number, but this is more manual then I'd like it to be.
The same question for if my changing data doesn't follow an easy pattern, so let's say I don't want to do ints, but some structure taking a string which changes. Is there a way to kind of write the encapsulating code a lot of times and quickly define the text inside of the encapsulating code (without having to depend on nice hooks within your code, like the opening bracket in my example above)
https://redd.it/1asmlwz
@r_vim
Weird gvim behaviour on wayland in Fedora
Sometimes, randomly, when I resize gvim in Fedora with wayland, those weird blue borders show up, does anyone has any idea why?
https://preview.redd.it/08mot6ilqzic1.png?width=1054&format=png&auto=webp&s=7d88d5e883ace8da901b42dcf0e7565b17eb4693
https://redd.it/1asfsy5
@r_vim
What is wrong with my tags? can navigate if I :tselect <tab> select it , otherwise not
So I have a big documentation file , that has some tags on it an an Index in the first lines, so by Pressing Ctrl + ] will access the tag.
(I have reassigned Ctrl + ] to search for the tag that matches the whole line)
It doesnt work , it says it doesnt find the tag.
But If I navigate to the tag file , the tag is there.
Also if I :tselect <tab>
I can select it this way , and go to that tag.
By If I do :tselect myTagName , it doesnt seem to get the tag.
Please check the video
https://asciinema.org/a/kM9vQlnNbQlSY9SJNcf7q40iC
Any ideas?
https://redd.it/1asbv4b
@r_vim