Posts filter


Is vim for me?

I am a guy from the health sciences field that codes and plays around with linux in the free time. I nowadays use atom mainly, am i losing something by not using vim? My guess is that im losing PC speed and i am losing the chance to use more programs that use vim keybinds, such as ranger, but i am not really sure what are the benefits of migrating to vim.

https://redd.it/hlz97a
@r_vim


Is it possible to combine these three batch rename commands into a single command?

I have just started renaming a bunch of photos on my computer. They are currently named however my phone's camera chooses to do so, but I am trying to convert them all to the following format: date(number)location.jpg. They are already sorted into folders by location. I'm using the following three batch rename commands to do so, but was wondering if I can combine them into a single command to make it faster and easier. Thanks!

Goal: convert 20200130_123456.jpg to 2020-01-30(1)New_York.jpg

%s/.*/2020-01-30(/

%s/$/\=line('.')/

%s/$/)New_York.jpg/

https://redd.it/hlvox2
@r_vim


Is there a 'hierarchy' to vim key-bindings?

I'm trying to understand precisely if/how key-bindings get overwritten/prioritized in vim.

Let's say I want to bind L (= ) in normal mode to moving the cursor to the right x3 faster than just plain old single 'l'. So I can create a key binding as follows:

`nmap L lll`

Now, by default, there is a key binding for L that sends the cursor to the bottom of the screen. So my questions are as follows:

1. Does my custom key binding effectively eliminate the default key binding? (Or, put another way, is there a way to use the default key binding instead of the custom version, a bit like `command [alias]` in linux?
2. A follow-up question I have is what sort of ordering vim uses to decide what the effective/final key bindings will be; is there a hierarchy like default > plugins > custom? Do plugin-defined bindings always come in the middle, or does it depend on placement in .vimrc?

Thanks for clarification!

https://redd.it/hlq1f4
@r_vim




Created my first plugin! It's for session management. Feedback please?

Here is link: https://github.com/ydhamija96/uss-sessions.vim

Not really super proficient with vim or anything, but I had this in my vimrc for a long while, so figured it's good to share.

Thanks, all!

https://redd.it/hlrxt3
@r_vim




How to fix "E342: Out of memory!" error?

I'm doing a project where I'm collecting a very large list of words, each on a new line. I add to the list and use vim to sort and remove duplicates with !wq. Now that it's reached 243MB in size I now get "E342: Out of memory! (allocating 538435488 bytes)" in red at the bottom.

How do I fix this to continue my project? I have 16GB of DDR3 RAM.

https://redd.it/hlpb3f
@r_vim


Question about a Key Binding

Hi guys! Right now I'm making a key binding that copies the entire program onto the clipboard. So the keyboarding would be ggVG "+y. How do I map this to a binding, such as C-x? Ive tries imap but it only does the first part. Thank you in advance :)

https://redd.it/hlowal
@r_vim


Need help with autocmd/function/command

Hello everybody,

I am have troubles debugging why this autocmd isn't working as I expect. The goal is when making a new shellscript to prompt the user for which shell they want and then insert the correct shebang.

**autoload/shebung.vim**

function shebung#shellbang()
let options = [
\ 'ash',
\ 'bash',
\ 'csh',
\ 'dash',
\ 'fish',
\ 'ksh',
\ 'ion',
\ 'mksh',
\ 'pdksh',
\ 'sh',
\ 'tcsh',
\ 'zsh',
\ 'none'
\ ]
let choice = inputlist([ 'Select your shell:' ]
\ + map(copy(options), '"[".(v:key+1)."] ".v:val'))
if choice >= 1 && choice


I never really understood the pull of Vim, until now.

Hey, /r/vim.

I've heard of Vim since my second semester in my undergraduate CS major (I'm entering my third year this August), when one of the modules I had to take, mandated the use of Vim. I *thoroughly* disliked it, and I was like what, no mouse allowed? Why can't I type anything? Oh, wait, I have to type `i` before I can enter text, and press `Esc` to move things around? You know, the usual Vim newbie's complaints. I moved to VS Code, and never looked back.

The key idea of Vim, that *everything* can be done on the keyboard, was never really a big draw for me, because, here's the catch: I've been using notebooks almost *exclusively*, and the keyboards that come with said notebooks. I have become rather adept at using the trackpad, and the various tap-to-click, and multi-touch gestures. I can scroll, switch programs and desktops at the swipe of a few fingers The best thing is that said trackpads are directly beneath the keyboard, so I didn't understand the 'need to lift hand from keyboard to mouse, scroll and move back' idea that Vim wizards always complained about.

Now, given this whole COVID-19 hullabaloo, I've been working from home a lot, and have moved to a docked notebook setup, with a monitor, a new mechanical keyboard, and a mouse. Typing (and gaming) on the mechanical is glorious, but I *absolutely* notice a huge increase in overall typing speed. Selecting, scrolling, moving the cursor in general require me to move my hand something like 20-30 times as far as I had to with my notebook keyboard and trackpad. The lag adds up, and despite the improved typing experience, I can feel the drop in speed versus my laptop-only setup.

Given this, I've given Vim a second shot—at least somewhat indirectly—by using the VS Code Vim extension. It's slow, and I forgot practically everything but the very basics, but I plan to build it up slowly. I type plenty of LaTeX code, so the various Vim + (La)TeX extensions are going to come in handy. The best thing would be the portability of my vimrc, so I can bring my keybindings wherever I want.

https://redd.it/hllg9u
@r_vim


Hey guys new Vim initiate here, is it possible for us to compile all notes with a specific tag like #science?

What I'm looking for is a way for me to pull out all the files in a folder with a specific tag like #science \*\*using Vim scripts\*\* and compile them all into a pdf using pandoc or latex. Is this possible and if so, how? If any of you already have created something like this, mind sharing your codes/scripts and tips? Thank you very much


[Meta] Should this subreddit ban stupid joke posts?



[View Poll](https://www.reddit.com/poll/hlj3ha)

https://redd.it/hlj3ha
@r_vim


Vim forte - cleans, scrubs, polishes 💪😉
https://redd.it/hlhwpf
@r_vim


Help needed: Implementing websocket communication for DevTools protocol

I'm trying to create Vim plugin that can communicate with Node.js debugging inspector that uses DevTools Protocol (it can be started with `node --inspect`), but I'm stuck on sending and receiving proper websocket messages (the only message I get is in node CLI `Debugger attached.`, which is good first step). Maybe someone can help to create Proof of Concept?

https://github.com/sheerun/vim-inspect

https://redd.it/hlbof4
@r_vim


Having trouble understanding when to use `` instead of . Help?

I know that \`\` is a motion and is buffer local, but that's about it. I did not understand the documentation

https://redd.it/hlapfz
@r_vim


:vert term opens terminal fullscreen

I want to make a vertical split with the terminal. A question search brought the command :vertical term. However, it just opens the terminal fullscreen (the same as :term).

https://redd.it/hl86ax
@r_vim


Somehow I broke Ctrl+i

I don't know how, but as said in the title I broke Ctrl+i, now only Ctrl+o works. I checked the mappings with :map to be sure that I didn't made any mess but it is normal, nothing appears, so I don't think this it is due to bad mappings.
Can anyone help me to find out how to fix this?

https://redd.it/hl8id8
@r_vim


Why does execute :e and not :b

Why does `` execute `:e #` and not `:b #`? That resets the `‘readonly’` option, rarely what I want...

https://redd.it/hl5u9d
@r_vim


There's any way to reload all files after loading a session?

Unless i manually write :e when I load a session on every file, vim doesn't highlight the sintax of my vim-notes files. There's any way to achieve this automatically? Thank you.

https://redd.it/hl62ec
@r_vim


Autocompletion Plugin

I'm a pretty new vimmer (around 3-4 months now), and I've been looking for a good autocompletion plugin for Python for around a month now. I've tried both YCM and coc.vim, and they have been quite good. I've also heard about [Kite](https://kite.com/integrations/vim/) which has vim support. I used to have it when I used Atom as my editor, and uninstalled it when my system ran low on memory (128 GB storage problems xD).

How do the three compare for vim, keeping in mind their storage requirements (Kite takes about 500Mb if I remember correctly), their autocomplete suggestions, and overall ease of setup and maintenance.

[View Poll](https://www.reddit.com/poll/hl47r8)

https://redd.it/hl47r8
@r_vim

20 last posts shown.

57

subscribers
Channel statistics