r_vim | Unsorted

Telegram-канал r_vim - r_vim

-

@r_channels

Subscribe to a channel

r_vim

vim calendar for 2024?

For obvious reasons, there won't be a 2024 calendar version by Bram Molenaar (RIP). Link to 2023 version

Is someone from the community continuing this tradition, maybe in memoriam Bram Molenaar? I have grown quite attached to this calendar over the years.

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

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

r_vim

missing function "indexof" when moving cursor through parenthesis

vim on windows
when i move my cursor through parenthesis it stops and show this error

this only happen when syntax is on

help plz


https://preview.redd.it/azuhzta1gwzb1.jpg?width=1536&format=pjpg&auto=webp&s=b885e4f1dde242310be048366bd058118db32c82

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

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

r_vim

Does vimwiki support alias to notes titles?

Wondering if it support or at least there are some plugging to make this happens

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

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

r_vim

can I put digraphs into an abbreviation on vimrc?

Hi geniuses, can you say me what will be the abbreviation for paste in vimrc for get a square title using the digraphs respective, for example this abbr recua and get this
┌─┐
│ │
└─┘
so I can write after that something into

┌────────────────┐
│ title-note-txt │
└────────────────┘

the sintax for vimrc will be something that....

iab: recuad
enter tab Ctrolk+dr ctrol+hh ctrol+ dl enter
tab ctrolk+vv ctrolkvv enter
tab ctrolk+ud ctrolk+hh ctrlk ul enter
enter

will be possible an abbr using whiting abbr CtrolK digraphs?

Thank you and regards!

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

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

r_vim

classic vim + python + ruff + autocompletion

Hi there,

I am building my own config for classic Vim and have encountered a problem.

So I decided to use coc.nvim + ruff extension (fixing/linting) + ale (for autocompletion)

However, I believe this is causing conflicts between these tools.

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

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

r_vim

How to configure spell check highlighting in nvim lua?

I'm trying to modify the highlighting colors for nvim's spell check, but I can't seem to get it to work. I've tried in my options.lua file as a test `vim.cmd("highlight SpellBad cterm=bold gui=bold guisp=Red")`, as well as with other error types like SpellLocal, SpellRare, and SpellCap.

I'm not sure whether the command is correct, or if I'm placing it in the correct place. In the end, I'd like for all error types to be bolded and highlighted with red, orange, cyan and yellow respectively. Any help

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

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

r_vim

TIL "vim" in English means energy or enthusiasm

​

https://preview.redd.it/iaciqll9j6xb1.png?width=928&format=png&auto=webp&s=563f3a2d57a6bbf2dc511528e28b6dc8470380e4

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

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

r_vim

New to vim, how do I get started and what are the benefits of using vim?

I took a linux foundation course and in that they introduced me to vim and to me , it seemed like a pretty good way to get good at syntax because I have to do all of the hard work rather than relying on intellisense.

I tried to install linux for using vim but my pc has some bitlocker bullshit so I couldn't install it so I downloaded vim on windows

So far I'm only aware of writing files and exiting vim. The course did tell me some vim commands but there were too many of them.

So how do I get started?

Is Vim suitable for large scale development or only for C?

and What other benefits do I get by using vim?

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

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

r_vim

Is There a Way to Choose Completions by Pressing Number Keys?

For example, the vim completion list will show 5 options. Rather than pressing down 5 times to get the 5th option, I'd like to just press '5' and have it be chosen. I've been tinkering around with feedkeys(), but nothing I am doing is working.

 

Do you guys have any suggestions on what I could try?

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

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

r_vim

Question: What is the full list of state that is or is not saved between Vim sessions?

Features like marks, command history, registers, set commands, search history or anything else you are aware of.

If I close Vim and reopen, what history do I have to work with to get right back into what I was working on? Specifically state that is saved automatically by default.

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

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

r_vim

How to "cgn" with word under cursor?

For example, let's say I have this code:

const array = ;
^
console.log(array)

const array = ;
console.log(array)

const array = ;
console.log(array)

const array = ;
console.log(array)

And my cursor is at the first word array. What I want to do is to change the word "array" to something else and do the same for "array" on the line below it. Then, do the same proecess for every other one of them, so I get something like this

const names = ;
console.log(names)

const people = ;
console.log(people)

const list = ;
console.log(list)

const idk = ;
console.log(idk)

What's the best way to do this? What I've done is ciw names jll. and did the same thing for every other paragraph. In this case it's not a huge problem because it's just a few lines. I know I can do something like *cgn<Word-to-type>. but it doesn't really fit my needs because if I did that on the first code it would look something a bit like this

const array = ;
console.log(changed)

const changed = ;
console.log(array)

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

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

r_vim

Would just like your feedback.

Hi, i have a problem.

I have been using vim for some time and i have become one with it (maybe not fully yet, more like 0.7 with it). But the problem i keep having is that im so adapted to vim, that i cant type normally anymore. For example every time i write in Apple notes or even here, i would love the ability to use vim commands.

Why stop at using vim only in the terminal?

Im thinking about creating an app that allows the use of vim controls in every textfield on mac.

My only question to you is - would an app that does the appeal to you?

are you in?

Thanks!

View Poll

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

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

r_vim

The color scheme for red sunglasses is needed...

My eye balls hurt...

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

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

r_vim

Hi sweetie

Eyez lovez you Bebe 💋

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

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

r_vim

Big Pile of Vim-like
https://vim.reversed.top

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

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

r_vim

Can folks recommend vim training courses?

Something that doesn’t just teach you the keybindings, but helps you practice using them in a useful way?

Thanks.

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

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

r_vim

Copy to clipboard with motions!


-- kickstart.nvim starts you with this.
-- But it constantly clobbers your system clipboard whenever you delete anything.

-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See :help 'clipboard'
-- vim.o.clipboard = 'unnamedplus'

-- So, meet clippy.lua

-- a collection of mappings to allow you to yank to clipboard using <leader>y
-- as well as a few nice paste options, and ctrl+a
-- in normal mode, it accepts motions as well.
vim.cmd([
function! Yank_to_clipboard(type)
silent exec 'normal! `[v`"+y'
silent exec 'let @/=@"'
endfunction
" Im using nvim but I made this vimscript just for you.
nmap <silent> <leader>y :set opfunc=Yanktoclipboard<CR>g@
vnoremap <silent> <leader>y "+y
xnoremap <silent> <leader>y "+y
nnoremap <silent> <leader>yy "+yy
vnoremap <silent> <leader>yy "+yy
xnoremap <silent> <leader>yy "+yy
nnoremap <silent> <leader>Y "+yy
vnoremap <silent> <leader>Y "+yy
xnoremap <silent> <leader>Y "+yy
nnoremap <silent> <C-a> gg0vG$
vnoremap <silent> <C-a> gg0vG$
xnoremap <silent> <C-a> gg0vG$
nnoremap <silent> <leader>p "+p
inoremap <silent> <C-p> <C-r>+
xnoremap <silent> <leader>P "dP
]])
-- vim.keymap.set("n", '<leader>y', [[:set opfunc=Yank
toclipboard<CR>g@]], { silent = true, desc = 'Yank to clipboard (accepts motions)' })
-- vim.keymap.set({"v", "x"}, '<leader>y', '"+y', { noremap = true, silent = true, desc = 'Yank to clipboard' })
-- vim.keymap.set({"n", "v", "x"}, '<leader>yy', '"+yy', { noremap = true, silent = true, desc = 'Yank line to clipboard' })
-- vim.keymap.set({"n", "v", "x"}, '<leader>Y', '"+yy', { noremap = true, silent = true, desc = 'Yank line to clipboard' })
-- vim.keymap.set({"n", "v", "x"}, '<C-a>', 'gg0vG$', { noremap = true, silent = true, desc = 'Select all' })
-- vim.keymap.set('n', '<leader>p', '"+p', { noremap = true, silent = true, desc = 'Paste from clipboard' })
-- vim.keymap.set('i', '<C-p>', '<C-r>+', { noremap = true, silent = true, desc = 'Paste from clipboard from within insert mode' })
-- vim.keymap.set("x", "<leader>P", '"
dP', { noremap = true, silent = true, desc = 'Paste over selection without erasing unnamed register' })



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

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

r_vim

Navigate to function definition

Like in the VScode, if we do CMD+click over a function in a file ( ctrl + click in windows), then it navigates to the root definition function. Can we have same functionality in the vim too? Also, is this possible without any plugins?

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

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

r_vim

i, but inclusive?

In other editors, I have set up keyboard shortcuts that allow me to copy/cut/paste-over everything inside the closest surrounding ()s, including the ()s themselves—ditto for other punctuation like “”s. It seems like it should be easy to do something similar in vim, but I’m very new and haven’t figured it out. I can do:

di{

and this cuts everything inside the closest surrounding {}s, but it doesn’t touch the {}s themselves. In fact, it leaves a newline between them.

So I’m wondering if there’s an inclusive form of di{, or some other straightforward approach for doing this.

Thanks, and apologies if there’s an obvious answer here.

(Bonus question: Is there something like dt} that works across newlines?)

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

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

r_vim

Make man pages (keywordprg) behave sanely in full screen mode on large monitor

So, I had a few issues with the man program while I code in C.

Problem:

1.) I kind of hate having the man page render in full screen window.
2.) I have no interest in viewing a page concerning some shell utility with the same name.

Solution:

1.) Set the $COLUMNS variable before the man command.
2.) I specified the ordering I wanted the man pages to appear in.

setlocal keywordprg=COLUMNS=135\ man\ -s\ 3,2,7,5,1

And I wrote this in my ~/.vim/after/ftplugin/c.vim file, and I executed
:set ft=c in a "c" buffer to activate the changes. Still I feel comfortable with switching from full screen to half screen window, but at least the text are formatted as they should be now, and I get to the correct manual section.

Here are a great Reddit post with keywordprg snippets

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

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

r_vim

How to get c++20 support in YCM?

YCM doesn't recognize any c++20 code. How do I change the C++ version support for YCM?

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

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

r_vim

Best place to learn advance vim?

What are the resources?
And if you don't mind how to fold a code?

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

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

r_vim

Checklists

Hi Everyone,

Preface: I am a Vim using on my Linux box. I recently found an app that lets me run a stripped down Linux on my iPhone, which allows me access to Vim. Productivity type activities, example: lists and checklists are a pain without a proper keyboard.

Question: Anyone recommend any checklist mods? I see a number of GitHub projects. Curious to hear people’s experiences.

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

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

r_vim

Anyone know how to change the character between splits at the statusline?
https://redd.it/17it8ce
@r_vim

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

r_vim

Script editing an HTML file

I have a HTML file that sorts images in a gallery format. In order to add images I have to go in and edit all the different fields for the details of each image which is very time consuming.

Is it possible to write a script with VIM that will ask for inputs and then automatically combine them with html code and insert it into the website html? Are there any resources on how to do this? Thanks in advance.

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

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

r_vim

what are your favorite vim motions?

mine is vi(

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

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

r_vim

how to get Tmuxifier session editor to open nvim instead of nano?

how to get Tmuxifier session editor to open nvim instead of nano?

ps: i wanted to post in r/tmux but it said i can't post

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

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

r_vim

why does my syntax highlight goes crazy if i reorder my statements

working

https://preview.redd.it/qaxpkr011kwb1.png?width=562&amp;format=png&amp;auto=webp&amp;s=b59a75eebfd52c87ea4b39f1b77fda312042f713

not working

&#x200B;

https://preview.redd.it/c0tex5i41kwb1.png?width=635&amp;format=png&amp;auto=webp&amp;s=0bf02a3be0f6bc1ec34c8cdbfab119e0b762d1d2

&#x200B;

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

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

r_vim

Using SonarLint language server in Vim?

Has anybody managed or got an idea how to make [SonarLint Language Server](https://github.com/SonarSource/sonarlint-language-server) work with e.g. [vim-lsp](https://github.com/prabirshrestha/vim-lsp)?

There's flag `-stdio`, so it should be now possible - as proven by Neovim plugin [sonarlint.nvim](https://gitlab.com/schrieveslaach/sonarlint.nvim).

So taking that plugin as an example, I've extracted the server from [SonarLint for Visual Studio Code](https://github.com/SonarSource/sonarlint-vscode), created myself a wrapper:

#!/usr/bin/env sh
DIR=/path/to/extracted/extension
java -jar "$DIR"/server/sonarlint-ls.jar \
-analyzers "$DIR"/analyzers/* \
"$@"

And registered server in _vimrc_:

if executable("sonarlint-ls")
au User lsp_setup call lsp#register_server(#{
\ name: "SonarLint",
\ cmd: [ "sonarlint-ls", "-stdio" ],
\ root_uri: {-> lsp#utils#path_to_uri(
\ lsp#utils#find_nearest_parent_file_directory(
\ lsp#utils#get_buffer_path(),
\ [ ".git/" ]
\ )
\ )},
\ allowlist: [ "python" ],
\ })
endif

So according to promo video [SonarLint for Python: How to Get Started](https://www.youtube.com/watch?v=pAz9O_N1Vs8) when opening Python file:

def foo():
a = 10
b = 10
print(a is b)

I should get a hint to replace `is` with `==`, but nothing happens, despite server running.

Fresh log from vim-lsp is quite empty:

Thu 26 Oct 2023 03:31:25 CEST:["lsp#register_server","server registered","SonarLint"]
Thu 26 Oct 2023 03:31:25 CEST:["s:on_text_document_did_open()",1,"python","/home/user/repo","file:///home/user/repo/foo.py"]
Thu 26 Oct 2023 03:31:25 CEST:["Starting server","SonarLint",["sonarlint-ls","-stdio"]]
Thu 26 Oct 2023 03:31:25 CEST:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":1,"server_name":"SonarLint"},"message":"started lsp server successfully"}}]
Thu 26 Oct 2023 03:31:26 CEST:["s:update_file_content()",1]
Thu 26 Oct 2023 03:31:26 CEST:[{"response":{"data":{"path":"file:///home/user/repo/foo.py","__data__":"vim-lsp","filetype":"python","server_name":"SonarLint"},"message":"textDocument/open sent"}}]
Thu 26 Oct 2023 03:31:29 CEST:["lsp#register_server","server registered","SonarLint"]
Thu 26 Oct 2023 03:31:29 CEST:["s:on_text_document_did_open()",1,"","/home/user/.local/state/vim","file:///home/user/.local/state/vim/lsp.log"]
Thu 26 Oct 2023 03:31:31 CEST:["s:on_text_document_did_save()",1]
Thu 26 Oct 2023 03:31:31 CEST:[{"response":{"data":{"path":"file:///home/user/repo/foo.py","__data__":"vim-lsp","server_name":"SonarLint"},"message":"---> ignoring textDocument/didSave. not supported by server"}}]
Thu 26 Oct 2023 03:31:33 CEST:["s:on_text_document_did_open()",1,"","/home/user/.local/state/vim","file:///home/user/.local/state/vim/lsp.log"]
Thu 26 Oct 2023 03:31:39 CEST:["s:on_text_document_did_close()",1]

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

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

r_vim

All numbers reduced by 1

I was editing a file in Vim and then noticed that all the numbers in the file had been reduced by one. So, 1000 was 999, and 2 was 1, 0 was -1, etc.

I want to know what I did wrong to make that happen, and I know that I had redone something with control-r, so it probably has something to do with that.

When I look at the Vim history (using : and up arrow, and also in the .viminfo file) it is missing all the commands I executed on that day, so I can't find it there.

I found this online How to perform arithmetic manipulations on numbers in Vim? - Stack Overflow , and I may have done something similar to that, but I can't replicate those instructions.

Does anyone know what I may have pressed to reduce all numbers by 1?

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

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