2 questions related to :set relativenumber
(why 11?) (Do people often use 200-, 300-character Lines?)
This guy's Vim screen shows Yellow Numbers (at Left) going from 1, 2, ... 10 (upwards) ------- :set relativenumber
is Freaky --- I like it!!!
https://www.youtube.com/watch?v=i-LnVkujDcY
2+ questions related to :set relativenumber
# 1 (why 11?)
This Youtuber is entering text at Line numbered 11
but when i simulate what he's doing, i'm entering text at Line numbered 0
.
------- What's the answer to this puzzle ? ( ---> i got the answer right away... Thanks!)
# [2] (do people often use 200-, or 300-character (over even Longer) Lines within Vim ?)
Does he (or other people) often use LONG, 200-, or 300-character (over even Longer) Lines? (within Vim)
i rarely do it.
# 3 Where did he get the Lorem Ipsum text? -- Can Vim auto-generate it ?
> Some versions of Microsoft Word also generate the text using the =lorem() function. Just type it in your Word document and you will get this paragraph: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.............
https://redd.it/115j407
@r_vim
Setting two different registers
Hello, I have +clipboard enabled
​
I would like to have one general register where I would just copy stuff to like CTRL+C and be able to paste just from that register
​
Another one would be the vim register for yanking the stuff I delete just in vim
​
I have made progress in getting to copy stuff from vim to system clipboard but the problem is when I need something to be always copied to a register and I go on and delete certain lines to enter the one I need it will just copy the previously cut line again.
​
How would I achieve this the best way?
https://redd.it/115fg8o
@r_vim
First timer just looking into vim (neovim). Why use it over GitHub copilot or other ai?
Hey I've mostly been a keyboard user. That meaning keyboard shortcuts, window managers all that fun stuff to optimize my experience for keyboard use as i just fine it way more comfy and relaxing. Especially since I swapped to colemak as my main layout for typing. Everyone touts vim to be this great amazing tool for keyboard users like me and explains how its so fast and allows you to navigate everything with a click of a button. All that fun jazz. but for me I tend to spend most of my time thinking when i program or write. (mostly program) and I'm wondering what the benefits of learning vim would be outside of the "speed" that you get. As with tools like copilot; chatgpt etc. You can write more now faster then ever before and i don't really see the speed increase as something that's necessary. As for me i do most of my typing in applications; say like the reddit webpage; or the discord app; or an IRC channel etc etc. So i'm not really sure if its something i should spend time and effort to pursue. Does anyone have some thoughts on this?
TLDR: What benefits can/does vim provide other than the speed and keyboarded focus. As i personally don't see the speed as very important due to new advancements in ai like copilot and chatgpt. Alongside most day-to-day typing being in some external app like discord or a web browser.
https://redd.it/115a9ak
@r_vim
This guy's Vim screen shows Yellow Numbers (at Left) going from 1, 2, ... 10 (upwards) ------- What are these ?
This guy's screen shows Yellow Numbers (at Left) going from 1, 2, ... 10 (upwards) ------- What are these ?
https://www.youtube.com/watch?v=i-LnVkujDcY
Other good (or great) Youtube Channels for Vim tips ?
https://redd.it/114zj15
@r_vim
Awkwardness when typing in '\n' or '\t' or (...) ... etc. -- (Have others noticed this too?) -- (is there a better way?)
when i'm writing Python code...
and when i type in '\n' or '\t' ------- i almost always DO THIS:
1. i type in the quote mark twice -- as: ''
2. then i hit ESC, and go back
3. then i hit i
to insert \n
# (Have others noticed this too?) -- is there a better way?
i think i do this with [...]
and (...)
etc.
https://redd.it/114u49n
@r_vim
'termguicolors' in Windows Terminal unexpected behaviour while using a background image.
I am using the Windows Terminal, in which you can change the background image of a terminal, simply by passing in the path to the image in the settings file.
​
When running:
vim --clean
The terminal looks like the following:
https://preview.redd.it/zzkgmk3dbdb61.png?width=1268&format=png&auto=webp&s=5778df39e50bcdcbbbb443e03523c558dbc1d1e1
When I do either of the two
:set termguicolors
:set t_Co=256
This happens: (which I don't want it to, of course.)
​
https://preview.redd.it/0h3r172ibdb61.png?width=1247&format=png&auto=webp&s=bb83209c37f96ab1b8f6d8b4584a5138dbf8f25e
As you can see, the ability for the terminal to display a transparent background is there, just not when either of these variables are set. Running commands like
:hi Normal ctermbg=NONE guibg=NONE
does not work as it should. (It removes the black characters(?) for a split-second, though).
If any of you know a solution to this problem, I would be most grateful for your help.
https://redd.it/kxfnpm
@r_vim
What's a good way to visualize long (not necessarily large in memory) files in Vim
I have used Vi/Vim for years and, while I love the power, flexibility, lightweightness, etc. of Vim, I'm also growing tired of some of the visual limitations that come with working with it.
So I'd like to ask the community about visualization in Vim. Pretty much 99.9% of the files I edit in Vim have way more lines than what my monitor can display (which is around 50 lines). While these files are not necessarily large in memory, it's easy to get lost in a file that's 1000+ lines.
I'd like to know if there are good ways to make visualization of these files easier.
- I'm talking about things like collapsing some chunks of the file, or even displaying a version of the file with very small font on one of the sides of the screen, for example.
- I'm not talking about navigation commands such as described here. I know those already :)
https://redd.it/kxdcgz
@r_vim
A problem with jk for use as escape.
In insert mode, I have mapped jk
to escape. It does escapes, but even when you type word like "joker" It still escapes, ignoring the middle o.
This does not happen with other keys. Why does it happen with jk
keys?inoremap jk <Esc>l
I add l
cause, after esacping, cursor moves 1 character to left.
https://redd.it/kx98li
@r_vim
Is there a way to automate my notetaking system?
TL;DR: Can I sent text from Vim to Notion without copy and paste?
So, I just got into Vim and its crazy how good it is for writing, but it certainly lacks in visual for reading afterwards (when it comes to text that isn't code). I use Notion for notetaking and I want to know if there's a way to send my texts written in Vim to Notion without copying and pasting. Or maybe access Notion files in Vim
If you have a different workflow for notetaking that has "visual appeal" please recommend. I tried VimWiki but it doesn't feel as nice, also no access to the text on mobile or just can't share links like in Notion.
https://redd.it/kx69y1
@r_vim
vim-swoop / coc-search alternative
I'm looking for a plugin that does what vim-swoop or cocsearch are doing.
Searching a text, creating a buffer, putting all opened buffers with matched string in it, so you can edit and save all buffers at once.
I would like to have what vim-swoop does, but for ALL my files, instead of my opened buffers, like a global search & replace.
https://redd.it/kx2pz1
@r_vim
How to automatically enable semantics for .py files?
I am an extremely new aspiring python developer and just began using vim as my text editor and IDE a few days ago, already in love with the workflow and efficiency, especially compared to the previous text editors and IDEs I've tried to learn and use. I do have one issue, though; is it possible to automatically input text when you open a new file? I use TabNine semantic completion when writing python and everytime I open up a .py file, whether it's a new one or not, I have to type TabNine::sem
before semantics work, and then delete it. Is there a way to have this automatically enable everytime I open a .py file?
https://redd.it/kwzyob
@r_vim
Can't get syntax folding to work
I'm trying to use syntax folding for a language I use that doesn't have the proper syntax file and I can't get a really simple folding region to actually fold
I tried syn region testFold start="{" end="}" transparent fold
and it never folds, Vim just complains that there isn't a region. Am I missing something? The docs were pretty scarce
https://redd.it/kwvs7a
@r_vim
I've been using YCM with Vim for a while now and today the server crashed. Does anyone know how to debug these errors?
https://www.reddit.com/gallery/kwsggf
https://redd.it/kwsggf
@r_vim
Statusline help
Hi,
As part of my statusline, I have the following:
if &mod == 1
let statusline .= "%#GruvboxAqua#\ " . left
let statusline .= "%#DiffChange#%.20f"
let statusline .= "%#GruvboxAqua#" . right . "\ "
else
if &readonly == 1
let statusline .= "%#GruvboxRed#\ " . left
let statusline .= "%#DiffDelete#%.20f"
let statusline .= "%#GruvboxRed#" . right . "\ "
else
let statusline .= "%#GruvboxBg4#\ " . left
let statusline .= "%#PmenuThumb#%.20f"
let statusline .= "%#GruvboxBg4#" . right . "\ "
endif
endif
Plugins to have VS code tools
Hello guys. I moved recently from Visual Studio Code. Prefering vim because is faster, and i prefer the use of commands over mouse. Also is more customizable.
Still have some problems, so im asking for suggestions:
-Closing buffers with bd closes also vertical/horizontal views, unless i use a long command
-I would like to be able to select a variable, and also highlight the same variable on other parts of the code.
-I have to change the name of a variable manualy (change every time i mention a variable). In VS code you can in the searcher replace every mentioning of a text for other one.
-Dont have "suggestions" to python and php. (In vs code yo can see the avaliable commands while writting)
-I would like to see the inner methods of a module or library im importing in the suggestions.
-A syntax error marker
Really those are details, but have big weight in the coding process. If you know some plug ins, scripts or commands that do that, i would be grateful.
https://redd.it/115hv0j
@r_vim
Any idea why the word Linux might be highlighted yellow?
It's not a big deal and seems like it's an easy fix but it's so bizarre. And it seems to be the only word that gets highlighted yellow.
https://redd.it/115du8q
@r_vim
Script to launch vim to edit textboxes in GUI apps
I couldn't find anything that would allow me to edit LibreOffice docs with Vim mode, so i wrote a simple script to edit the currently selected text in any app via copying the selection, launching terminal window with vim, pasting selection inside and then replacing the selection with edited text, or pasting the newly written text if the selection was empty. Wanna share it, maybe someone will find it useful e.g. for writing Markdown posts on Reddit.
Here is the link to github repo. It uses Neovim and Kitty terminal but it can be easily changed. There are also some vim keymaps and settings that may be useful with the script.
https://redd.it/1151001
@r_vim
Re-indenting Lisp code is `=%` -- Can i do that for Python code ?
Re-indenting Lisp code is `=%` ------ Can i do that for Python code ?
(define (foo x)
(dotimes (i 100)
(bar bar x)))
________________
# (how) Can i do that for Python code ?
for c in string.ascii_lowercase:
for x in Dict[tuple(sorted(cw))] :
print(cw, x , end=' ')
print('other stuff', x , end=' ')
PRSW=True
https://stackoverflow.com/questions/8388607/is-there-a-way-to-make-work-in-vim-to-reindent-python-code
https://redd.it/114zqb7
@r_vim
Vimtex and Zathura Setup on macOS M2 - brew services start dbus error
I was following the instructions in :help vimtex-faq-zathura-macos and then later https://github.com/zegervdv/homebrew-zathura/issues/99,
but while following both instructions, everytime I run brew services start dbus, this is what I get:
sun@Tonys-MacBook-Air ~ % brew services start dbus
Error: Formula dbus
has not implemented #plist, #service or installed a locatable service file
I tried running brew services and I get this:
sun@Tonys-MacBook-Air ~ % brew services
Name Status User File
dbus none
mysql@5.7 none
I also tried brew reinstall dbus and I get the same error.
I'm on macOS Monterey with an M2 chip. I'm pretty new to this and I wasn't able to find a solution on Google so I was wondering if anyone here could lend some help. I'm happy to send more info if you need it.
https://redd.it/114rpha
@r_vim
Vim burping slurping
Hi,
I have been using spacemacs learning clojure.
I love the burping (SPC-k-s) and slurping (SPC-k-b) capability in emacs.
But now I am giving spacevim a go. But... How do I burp and slurp in spacevim?
Thanks
https://redd.it/kxdaew
@r_vim
Interfacing between vim and tiling window manager
A thing that anoys me is the inconsistency that appears when using vim in a tiling window manager. Essentially if you make a split in vim for some reason, it will of course not be a new window in the window manager, but it will just split the first window.
This is not a huge deal, but just looks and feels inconsistent, so if there is a simple way to fix it, i would. It seems pretty hard though, one could just open a new window and open vim, but you would then be running multiple vim instances, which is both ineffective, but more importantly messes up your copy paste registers etc. So my question is, does there exist some solution where you can make vim work across window manager windows?
https://redd.it/kxdbt4
@r_vim
move function arguments on multiple lines
Hi,
I would like to know if it was possible to change
fun(aaa, xxx)
fun(bbb, xxx)
fun(ccc, xxx)
into
fun(xxx, aaa)
fun(xxx, bbb)
fun(xxx, ccc)
With default commands and visual block selection.
I tried to mess with C-v
jjx
(on the comma), then C-v
jjb
d
to cut the first arguments, then e
C-v
jj
S-a
,
to write the comma, then C-v
again witj jjp
to finally paste the arguments.
(well I'm not sure I correctly reported the exact command)
Is there a simpler way to run the full x d b e i , Esc p
on multiple lines ?
Thank you
https://redd.it/kx8odn
@r_vim
How to get the IntelliJ-like feature of showing the function's parameters in a little box before the actual values?
This is what my vim looks like when I call a function in any programming language, in this case, Kotlin:
​
calling function replace\(\)
this function receives two string parameters. This is okay but I've noticed that in other IDEs like Intellij or VSCode when calling a funcion it looks like this:
calling same replace\(\) func in Intellij Idea
as you can see the parameters passed have these little boxes before them specifying which parameter is.
​
Question: How can I do the same in Vim?
https://redd.it/kx7zr9
@r_vim
Making vim my new Javascript ide
Vim noob here. I'm currently using vscode where I have been making use of auto completion and multiple cursors etc.
I'd like make my vim as efficient as possible so I have no reason to build apps in vscode anymore.
What plugins and configurations should I add to achieve this as a javascript developer? I see so many options but I have no idea what is best
https://redd.it/kx1do1
@r_vim
Vim takes time in moving the cursor to end during large copy paste like 1.3 MB size of text
I don't know how to solve this issue, but sublime text can do it within a second, but vim takes long time. Anybody know why does this happen, and how to prevent this happening.
https://redd.it/kx1tkq
@r_vim
Tab Search
For Example:
You have n Tabs open with various files and you want to jump to a particular file which you know that you have open, but you dont have the number off the tab.
Is there a way to search for the filename and jump to the tab if there is a open tab found with the file?
https://redd.it/kwg7ck
@r_vim
Is there a use case where mouse can be faster than a Vim way of achieving it?))))))))))))))))
Resizing windows, imo.
https://redd.it/kwrq1c
@r_vim
Setting :vertical term as default :term
Hello everybody,
I am new to vim, I was wondering if there is a way to set as default :ter
the :vert ter
, it takes too much time to write it each time i need one (i usually execute one command, see the output, then i close it to fully see the code). Or at least, how could I create a command alias for :vert ter
as :vt
to spawn a vertical terminal window.
I'm using vim 8.2 with patch 1-1989
https://redd.it/kwl20f
@r_vim