r_vim | Unsorted

Telegram-канал r_vim - r_vim

-

@r_channels

Subscribe to a channel

r_vim

How do you :cbelow + :cnext as one mapping?

:cbelow / :cafter is useful because you can hop directly to the closest quickfix entry to your cursor. But repeating :cbelow / :cafter will stop advancing when it reaches the end of the current file, even if there are more quickfix entries, which drastically limits its usefulness. When I'm at the end of the entries for a specific file, I'd like to effectively :cnext to go to the next item so I can repeat the process. How can I do this? Plugin suggestions are welcome, in case someone has written this before as I'm guessing it has.

https://redd.it/17yrf0o
@r_vim

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

r_vim

tree-sitter highlighting in Vim and NeoVim

I'm thrilled to share that the latest vim-clap has now integrated the tree-sitter highlighting into Vim and NeoVim. It's a PoC implementation and not extensively tested though, bugs are expected. Some early feedback is highly appreciated, and read more in this post!

https://redd.it/17y2l2u
@r_vim

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

r_vim

How well versed are you in vimscript?

I've been studying vimscript through "Learn Vimscript the Hard Way" and although I know Lua and nVim are around I feel it's been a great choice. Lots to discover of the full potential to Vim and I'm slowly feeling more and more comfortable with it.

I want to know about your experience with it, do you feel it's still really useful to know it?

View Poll

https://redd.it/17xp074
@r_vim

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

r_vim

aVimUserWalkedIntoABar
https://redd.it/17xfh6a
@r_vim

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

r_vim

Control in Vimgolf

Everytime I use control in Vimgolf with another letter, it is counted as 2 keystrokes, for instance in my submission Ctrl A will appear as :

<C->A...

And in other solutions it appears as

<C-A>...

Making me lose one precious keystroke.

I couldn't find this issue anywhere else, is anyone having similar problems ?

https://redd.it/17xfid0
@r_vim

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

r_vim

command-complete where completion is the current buffer contents?

Hi,

I have a vimscript command whose arguments I'd like to tab complete from the tokens in the current buffer ...

E.g., ":DD num", followed by tab, would complete to ":DD numpy", where numpy is present in the buffer.

I've looked in :h command-complete, but the correct completion list isn't obvious to me.

&#x200B;

Any help, would be super appreciated.

&#x200B;

https://redd.it/17xc1c0
@r_vim

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

r_vim

If I use hotkeys around other IDE's, doesn't that break the "speed" argument around Vim?

Before anything else I want to make it clear that I am a learner of Vim as of this moment, and I am a guy super focused on hotkeys and productivity all around my workflow. (Ex Starcraft player too, so I know my shit around hotkeys, I guess)

As of right now, I see that one of the reasons that you would use vim is speed and accessibility to common movements that your cursor do around the code that you are editing, AKA Vim motions.

So one of the benchmarks that I was thinking of is assuming that a key press takes x seconds, and that is linear accross the number of keys that I press, how much keystrokes takes me to do X task using hotkeys on an editor like VSCode vs Vim.

And I do not see myself slow or using the mouse to often whenever I'm in any other development IDE, since I'm always into looking how can I maximize this task and do not use inconsistence mouse movements.

And usually people that use Vim compared to a guy that does not know any hotkeys on their IDE, uses the scrollbar on the right side to get down the page, does not know cmd + p, clicks all the time he needs to jump between files and the terminal and the file tree, he will obviusly be MUCH slower overall.

Again, for me the selling point of having vim goes beyond your editor, and knowing more your OS more intricately, and it's tools. That alone it's a great learning experience and well worth for you to customize things the way that you want.

Hey you might have 9 fingers in your hand so you need your own remaps of hotkeys because the left shift it's to hard to reach, or anything related to that, that's power.

But that benchmark of keypresses to action it's not compeling enought at this moment that I'm going though my learning proccess. (That I did solelly on my head, and estimations are rought enought so I can favor to NOT learn any new hotkeys, being lazy at the end of the day, but with a fair point)

The sweet spot for me would be a conjuncting of Vim motions and my current setup.

I do prefer the search functionality inside vim, but going forward or backwards between words using f F t T looks so unnecessary, instead a cmd or \^ + right, left arrow should do the trick. It's not like it would matter to end up exactly on a character that I need to ( at least I do not see it that way), because if my screen is where I want to, clicking right there seems the same amount of time, as of pressing 3 keys to get to my word.

&#x200B;

Hope this generates a good discussion around this topic!

stay safe

https://redd.it/17wsji3
@r_vim

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

r_vim

insert meme flair
https://redd.it/17wsl0a
@r_vim

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

r_vim

Is There a Way to Access the Value Of a Bound Mapping?

Take for instance, the binding

&nbsp;

nnoremap e0 :call EDefine()<CR>

&nbsp;

I would like to use a "get" function in this manner:

&nbsp;

return s:get('e0')
" the return value is a string of the command:
"nnoremap e0 :call EDefine()<CR>"

https://redd.it/17wolz3
@r_vim

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

r_vim

How to go back to insert mode after a custom :command

So, this is my code, what I want to achieve is basically the second line. So, having all the code written, then go back to normal mode, go back of 1 char and then go to insert mode. The problem with the second like is that it doesn't actually behaves like a normal command. So I tried with the first line of code, but when I do so, I don't go back to insert mode for some reason. It writes everything as expected and goes back 1 char as well, but doesn't go back to insert mode. How do I fix it?

command! VimwikiImage execute "normal! a{{file:./images/}}<Esc>hi"
" :nmap :VimwikiImage <Esc>i{{file:./images/}}<Esc>hi

https://redd.it/17vosem
@r_vim

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

r_vim

Moving one word further using own vim function

What method should I use to create the function that would do the same thing as pressing the 'w' key in normal mode?

function MoveOneWord()
" what should I call here?
endfunction

Can the next word be captured from the cursor position using own vim function?

https://redd.it/17vp220
@r_vim

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

r_vim

Send iMessage via android devices!!!
https://sunbirdapp.com/?r=tingje481W

https://redd.it/17vnl01
@r_vim

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

r_vim

Vim theme: tomorrow-night-deepblue, a refreshing deep blue variant of the Tomorrow Night colorscheme

The Vim color scheme **Tomorrow Night Deepblue** is a beautiful deep blue variant of the Tomorrow Night color scheme. It is pleasing to the eyes and is easy to read.

The Tomorrow Night Deepblue colorscheme features a deep blue background color that creates a calming atmosphere. It is also a great choice for software developers who miss the blue themes that were trendy a few years ago.

https://preview.redd.it/qojjdj094c0c1.png?width=1421&amp;format=png&amp;auto=webp&amp;s=029025f26224eb0658771b6521e4bc8aaa018f28

https://redd.it/17v54q7
@r_vim

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

r_vim

Quick question about Vimium C (newbie)

I started using Vimium C. Sometimes I go into command mode by accident and can`t type on the textbox anymore without using my mouse to click on it again. Could someone tell me how to do this with the keyboard? I'm trying to avoid using the mouse

https://redd.it/17ulz1a
@r_vim

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

r_vim

Goyo plugin showing EOB symbols ~

Right now I'm on the last stages of my "DIY Freewrite project": a single-purpose device for creative writing. For that I'm using a Waveshare eink screen and a Raspberry Pi 3B+ with Raspbian OS installed (with Desktop interface and LXTerminal). Of course, I'm using vim as my writing interface, with Goyo, vim-pencil and vim-fountain installed. The other plugin I'm using is gruvbox as a theme.

However, when starting Goyo I get this view from my eink screen:

https://preview.redd.it/4joff7bu740c1.jpg?width=4032&amp;format=pjpg&amp;auto=webp&amp;s=d95d4fb80d142afa0d6a36e64fb0f21e9a949e62

I've managed to take the carots (\^'s) symbols changing the color to the highlight group StatusLineNC to white but I can't manage to do the same with the EOB's tildes or \~'s. Did someone have a similar problem?

Thank you,

https://redd.it/17uaf92
@r_vim

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

r_vim

Extract code to function (inside class, in global scope, or in inner function)

I use Vim for about 10 years for all my coding.

For refactoring, VSCode does this "Extract feature" where you can automatically extract some code into new functions, inside the current class, ...

Is there anything that does the same feature (to let you choose the scope in which you want to put your function), from inside VIM for Javascript ?

I've looked at YCM but it seems to not support this refactoring for Javascript, and I'm not sure whether it is possible to configure ts-server to do so ?

What are the best resources to setup your vim to do that ?

&#x200B;

https://redd.it/17y5f7l
@r_vim

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

r_vim

Display foldcolumn to the right of line number column

Pretty much what the title says; is there a way to have the line number column be the leftmost?

https://redd.it/17xzeba
@r_vim

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

r_vim

Why the colorscheme Cobaltish is showed like cobalt?

Hi. I installed 3 colorschemes: cobalt, cobalto & cobaltish

screenshot of colors installed:

https://imgbox.com/HDmCxZFq

when I set cobaltish in vimrc and do the command :colo <enter> Vim shows cobalt

screenshot about vimrc showing colo: cobalt insted cobaltish-

https://imgbox.com/IEZelpDS

any help?

Thank you and regards!

https://redd.it/17xo14t
@r_vim

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

r_vim

ALE virtualtext format

i'm using vim-lsp with ale. i did not really want to use ale but i just could not make vim-lsp show eslint errors on my project.

But ale's virtual text error messages are very cluttered. How do i format this to show just the error message? i don't need the error codes or linter name

https://preview.redd.it/47b16dq79x0c1.png?width=1282&amp;format=png&amp;auto=webp&amp;s=e9386c6f6bf45583574d84cbf07cbf0d7aa495e9

https://redd.it/17xgt1o
@r_vim

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

r_vim

Is There a Way to Access the Value Of a Bound Mapping?

Take for instance, the bindings

&nbsp;

nnoremap e0 :call EDefine()<CR>

nnoremap <buffer> e0 :call EDefineBuffer()<CR>

&nbsp;

I would like to use a "get" function in this manner:

&nbsp;

return s:get('e0')

" the return value is a string repr of the command:

"nnoremap e0 :call EDefine()<CR>"

https://redd.it/17wolxv
@r_vim

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

r_vim

How to populate the quickfix window

I'm trying to play with the quickfix window. I'm trying to populate it with external commands. Currently I'm just trying ls but I get spurious characters. Depending on the command, even weird things happen such as new buffers are created (with names that resemble the content of the lines in the quickfix), a random item in the quickfix window is selected, etc.

So to simplify, just by running :cexpr system("ls") | copen I get the result:

|| file1
|| file2


Note those || characters. Where do they come from?

https://redd.it/17xb3zq
@r_vim

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

r_vim

what happened to vimcompletesme?

the github seems to be deleted. there's an old version here still.

anyone know what happened, and whether development is continuing elsewhere?

https://redd.it/17wucn8
@r_vim

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

r_vim

Escaping tab in the string when writing Vimscript

I'm trying to execute such grep using scripting in vim:

"grep! --directories=recurse path/to/dir -e "\tsearchedWord"

However it puts a literal tab in there because when I print an executed command, there is a ^I sign instead of \t.

Escaping it with additional backlash doesn't help.


https://redd.it/17wp3e5
@r_vim

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

r_vim

Weird netrw splitting

Yet another hour of battles with netrw.

Here is all of my netrw configs:
```
" " Netrw
"
" set tree view and human-readable size style with 1024 base, turn off help banner
let g:netrw_liststyle = 3
let g:netrw_sizestyle = "H"
let g:netrw_banner = 0
" set vertical splitting for preview window ('p')
" set vertical splitting for previous window ('P') if there is only one window
let g:netrw_preview = 1
" set right splitting instead of left for ('v')
let g:netrw_altv = 1
" set below splitting instead of above for ('o')
let g:netrw_alto = 1
```

And I also use
```
set splitright
set splitbelow
```

netrw_v and netrw_o work fine (splitting to the right). The problem is with preview and previous window commands. **I suppose that 'p' and 'P' should split to the right. But they split to the left.**

help for g:netrw_preview:

```
*g:netrw_preview* =0 (default) preview window shown in a horizontally
split window
=1 preview window shown in a vertically split window.
Also affects the "previous window" (see |netrw-P|)
in the same way.
The |g:netrw_alto| variable may be used to provide
additional splitting control:
g:netrw_preview g:netrw_alto result
0 0 |:aboveleft|
0 1 |:belowright|
1 0 |:topleft|
1 1 |:botright|
To control sizing, see |g:netrw_winsize|
```

What does it mean 'result'? Result for netrw-P or p? My variables correspond to the last row (1&1). So why does it split to the left?

https://redd.it/17w1hbl
@r_vim

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

r_vim

Where do the "Fugitive:" folders come from, and how to prevent them from appearing?

Every now and then a "Fugitive:" folder appears in my repository. I use Fugitive for Git integration with Vim, but have no idea why these folders sometimes appear, nor do they contain anything useful. Any idea?

https://redd.it/17vpwyw
@r_vim

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

r_vim

Typing 'xxx' in insert mode makes my neovim freeze-crash

I use vim to write academic papers in LaTex. Out of habit, I use xxx as a placeholder. This makes neovim freeze.

I could post my config of course, but I wonder whether maybe someone has a general idea why this happens or a way to stop this behavior without going into the mess of my config. After all it happens in insert mode without any fancy stuff going on... Thanks

https://redd.it/17vnkc4
@r_vim

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

r_vim

RE Denote for Vim: Fine—I'll make a crappy version myself

Hey all. A few days ago I asked if there were a Vim port of Emacs' Denote package. No one answered, so I used ChatGPT to help me sling together a Vim plugin.

Here it is: https://git.sr.ht/~ashton314/vim-denote

Is it awful? Yes. Do you have a suggestion? Fork the repo, make a better one, and never speak of this abomination that I have created ever again.

Thank you for your time.

https://redd.it/17vm4i8
@r_vim

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

r_vim

Rate My VIMRC

Also any advice is appreciated!

https://github.com/jpjacobpadilla/.vimrc

https://redd.it/17v28e9
@r_vim

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

r_vim

An odd issue with original vi (mark and jump to mark don't work in the same macro)

As the title says. I've tried to make a simple macro that inserts a word, places a mark after that word, inserts another word and jumps back to the previous mark.
Can anyone tell me why this doesn't work? It seems to work in vim compatible mode.
My macro:

afoo^[maabar^[`a


https://redd.it/17uhtju
@r_vim

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

r_vim

The Beginner's Guide

https://redd.it/17uay7l
@r_vim

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