Vim commentary Plug In,
I have this in .vimrc
​
Plug 'tpope/vim-commentary'
andvnoremap <C-/> <Plug>Commentary
but I should press 2 times < Ctrl + / > to make comments / uncomments.
2times. :(
​
What did I do wrong?
​
https://redd.it/17bg6k3
@r_vim
Vimwiki for non-coding purposes, help with installation
Prefacing this by saying I have no coding experience other than light VBA and, if I'm glued to a help page, basic HTML. I generally pick up technology stuff and learn new softwares pretty quickly.
I have been researching different PKMS (personal knowledge management systems) to help me organize things both for my job and for my personal goals. The top contender for me is Vimwiki. The workflows I've seen on YouTube seem to be exactly what I'm looking for. One of my personal/career goals is to get into programming. I do operations management and I feel like it would be helpful to know how to engage with APIs or build scripts for reporting etc.
So the additional incentive to use VimWiki instead of like Logseq or Obsidian or something is that it would also train some coding muscles.
My concern is I'm having a hard time even getting to install VimWiki into Vim. I ran through the tutorial and tried looking up some stuff within Vim in the manual but I still don't understand how to edit the options I'm seeing on Github so when I tried a couple of the ways to add the plugin it wasn't working.
Can anyone guide me on the actual install for VimWiki? I'm not seeing anything on YouTube that doesn't just glaze over half of it.
I feel like once I'm actually in VimWiki and maybe with some extra training wheel plugins I'll start getting comfortable and figuring stuff out on my own. The entry and setup is really throwing me for a loop right now though.
​
I am going to start CS50x this week as well. Any help is appreciated, thanks.
https://redd.it/17aese9
@r_vim
HELP Perpetually stuck when typing /
My issue is simple, vim is completely stuck if I type "/" on an empty line.
I can insert / in middle of text, at the end of a sentence, but not in a empty line. That's not so practical to code in go
If anyone could hint something, here's my vimrc https://pastebin.com/BLQHcyPw
​
I've tried profiling, setting timeoutlen, could not find a workaround that works yet
https://redd.it/179htlu
@r_vim
when :q ask "close X buffers?" where X is the number of buffers
is there a script that does something like this? i accidentally closed many buffers thinking i had opened a single one. thanks
https://redd.it/1795juu
@r_vim
Anyone used alice layout with vim?
How does that work for you?
Currently using Logitech MX Keyboard, but am thinking of switching to a mechanical one, cause extensive typing cause my fingers to feel uncomfortable. Like hitting something hard for long periods.
So have been toying with the idea of split keyboard but the high ends ones like Moonlander will be too big an investment to make without trying.
So keychron has this alice layout - looking at the full q13 pro with numpad - that's split but has this weird layout. It's more affordable. Just wondering how vim users feel about it.
https://redd.it/178xe15
@r_vim
What do you use to return to normal mode, why do the different methods behave differently?
I personally prefer using Ctrl+C to undo bad commands i start or escape from the other modes because I can do it easily with my left hand alone, but I find it fascinating that Ctrl+C, Ctrl+[, and Esc all behave differently. For example, you can't use anything other than Esc if you want to do the trick of making a visual block selection, then apply a normal mode change to the rest of the lines you selected. Ctrl+C also seems to be the fastest, whereas Esc and Ctrl+[ are kinda slow.
Which of those three possibilities do you like, or do you have your own favorite mapping? How are the default methods different from each other? I had switching to normal mode mapped to `, but i got sick of that because it didn't make using vim any faster or easier.
https://redd.it/15hns85
@r_vim
Tips on Writing Vim Plugin using Vim9script
https://girishji.github.io/2023/08/03/vim-plugin-howto/
A collection of tips from my experience writing a few plugins in vim9script.
https://redd.it/15ha0nd
@r_vim
Any FZF.vim alternatives?
It feels like the plugin has stalled in development
https://redd.it/15h03h5
@r_vim
Running vim on small monochrome LCD that can't even do gray scale.
I am working with a Beepy and it is using a Pi Zero 2W and the display is a 240x400 monochrome LCD display. The pixels are only on and off so you don't even get gray scale. You don't really have enough pixels to dither. Does someone have a color scheme that will work with it? Invert to highlight things, even blink would be fine for highlighting misspelled words and stuff. It is a fun toy, just attempting to make it more useful.
https://redd.it/15gqkqb
@r_vim
Some final projects from my university Vim course
https://github.com/fmi/vim-projects/
https://redd.it/15ge5nf
@r_vim
VIMRC setup on Raspberry Pi: Copy defaults.vim to ~/.vimrc
If it helps folks, or needs correction, it took me nearly an hour to figure out how to setup my own .vimrc on Raspberry Pi OS 'Linux'
I copied the defaults.vim to my own home directory as .vimrc. For example:cp /usr/share/vim/vim82/defaults.vim ~/.vimrc
Then I gained all the default settings like syntax coloring, and made my own modifications in my own \~/.vimrc file. This worked well.
Copying /usr/share/vim/vimrc to my home directory did not work since it loads the defaults as noted within the file.
Hope that saves some users some time.
​
​
https://redd.it/15gcwke
@r_vim
Can you tell u/lmaotime to not fuck up VMs just because there's any other text editor than vim installed on the system?
https://redd.it/15g39q5
@r_vim
Automatically center the screen after moving with easymotion
I am using the Vim extension for VSCode. I like to keep my cursor aligned in the middle of the screen. It's why i remapped a few keys to perform automatically zz after the commands. How is it possible with the easymotion feature ? I would like to be directly centered whenever i move to another word. Thanks !
I tried to browse the internet but found nothing... I do not want to press zz after each move.
https://redd.it/15fja5o
@r_vim
Increasing productivity with efficient note taking and time management Help
I'm currently finishing my first year in university studying EE. The whole year was rough and i didn't have any workflow besides using Microsoft To-Do for assignments deadlines and using Notability on iPad for note-taking.
My biggest problem with my workflow in class is that i write somewhat slow and I focus more on writing down what the lecturer write in order to have it in my notes to go over later, instead of understanding key principles in class and engaging my brain.
However, I do type fast on a keyboard and I was wondering if is there anything worth learning on my summer break in order to take notes faster on a laptop.
I've tried obsidian, but the note system is too elementary. I've considered learning Latex and using vim but I write in Hebrew (RTL support is crucial) and most IDE don't support it.
I also considered trying to learn org mode in order to manage time and task more effectively.
What are your note taking, time management go to applications and how do you integrate them in your workflow?
https://redd.it/15fb82c
@r_vim
New Plugin Async autocompletion plugin for Vim's cmdline-mode (search and command execution)
https://github.com/girishji/autosuggest.vim
This unobtrusive plugin simply opens a popup menu and shows autocompletion options when you search (/, ?) or enter commands (:) in commandline-mode.
How it helps?
- Preview searchable words and commands (and their arguments).
- Search multiple words, even across line boundary; Fuzzy search.
- All Vim idioms work as before. No surprises.
- Fast, does not hang up when searching large files or expanding wildcards.
-------
Also, see https://github.com/girishji/vimcomplete for insert mode completion.
https://redd.it/15f7efc
@r_vim
global cmd with other separator than newline
I'm looking for basic building blocks to use vim for batch editing. Normal commands like ctrl-a are easy to remember and very convenient to use, they are however difficult to apply accept for on a per line basis since :global
(e.g. g/pattern/norm! ^A
) acts on lines.
But! Newlines are not that special. Can we achieve :g
per word/token/thing?
https://redd.it/17bgafa
@r_vim
How can I make my vim colors in one machine exactly mimic another?
I've always had a preferred colorscheme
in vim that I always use on all my machines. Now there's a new server that I need to work on and I wanna have vim looking the same there too. Problem is, despite me setting the colorscheme
the same as the other machines, the colors look very different.
I've read a bit and I guess this is because my palette is different? The thing is that, I don't know how to figure out the exact palette I'm using on the machines, much less how to define the same palette on the new server.
How can I do that?
And more generally: what things do I need to put on my `.vimrc` to make sure that vim always looks exactly the same?
https://redd.it/179ptnp
@r_vim
Imp: vim plugin to manage imports in many languages
Announcing Imp, a vim plugin to make it easy to add imports without breaking your flow. It currently supports Java, Kotlin, ES6 (JavaScript/TypeScript), Python, PHP, and Bazel; support for several other languages is planned. Imp is based on the assumption that the import you want probably exists elsewhere in your code base, so search around and suggest the most popular options for a symbol. The modular and plugin-based approach enables developers to add other languages, integrate with a private code search system, or otherwise extend the functionality without writing a complete import management plugin. The plugin uses some fancy regular expressions and does not require an LSP.
Java programmers will be familiar with the problem this plugin solves. You're writing some new code and declare a List
variable, but it won't compile until you add an import statement to declare which List
you mean. Jumping to the top of the file, typing out a whole import statement, and moving back to the code you were writing is disruptive, and you might not remember the fully qualified name anyway. So just type :ImpSuggest List
and Imp will present some options:
import java.util.List;
import java.awt.List;
import com.lowagie.text.List;
import com.example.api.MyService.Method.List;
:ImpFirst
to insert the most popular match automatically. There's lots more documentation at https://github.com/flwyd/vim-imp and :help imp-intro
.A red-on-white color scheme
I remember finding a light Vim color scheme that used only shades of black, white and red.
Did someone publish something like that online? Did I imagine it?
https://redd.it/178zp1u
@r_vim
A lot of you guys trying to emulate a vscode-like experience, especially with tabs and a persistent file tree, seem to not understand how vim works.
All of these mods/plugins are fine. I use a few plugins for work too. But reading some of the posts here, it seems like some people don’t really know how to take full advantage of vim. Don’t just blindly add plugins because they look nice. Learn how buffers work. Learn about netrw. I’m not saying don’t use cool plugins, but once you understand how you can take advantage of these built-in tools, you can then decide whether you really need those extra third party plugins. I keep seeing people just blindly copying dot files and adding stuff they don’t necessarily want/need then complaining about weird behavior. Just take the time to understand how vim works whether it’s through docs or videos or online guides. I’m sorry if this is coming across as a rant, but I truly think a good chunk of you guys, whether you’re an enthusiast or a professional, would benefit from actually taking the time to learn how some of the already provided tools work first.
https://redd.it/178xx2s
@r_vim
Hard wrap at breakat
I want to hard wrap (gww) at breakat. Or, to use an example, I have a looong line of comma separated values. The values contain spaces. I want to hard wrap the line to 80 characters. However, instead of inserting new lines at white spaces, I'd like to break each line after a comma only.
Is that easily doable?
https://redd.it/15heza2
@r_vim
My Favorite Vim Oneliners For Text Manipulation
https://muhammadraza.me/2023/vim-onliners/
https://redd.it/15h5dct
@r_vim
HJKL issue
Hey guys, I fell in love with how people use vim, and the idea of vim motions, being fast and not using the mouse . I also like the idea of vim as an editor and approaching things more from the terminal.
That's all cool, however, now that I started researching and actually learning vim, I'm having huge troubles with HJKL, which I guess is not ideal considering how fundamental these are. I can type 110-120WPM, which is not too slow, but my right-hand finger positioning is not standard and I do not keep them on hjkl. This is how I was typing for years and its second nature at this point. So now, whenever I try to use these keys to move around, I completely lose my orientation and straight up can't even type anymore, because my hand is not used to being there.
Do you guys have any suggestions on how to approach this?
\- Remap these keys somehow?
\- Use Arrows?
\- Hope that I will get used to hjkl specifically with time (it seems very hopeless at the moment)
\- Some other solution?
Really looking forward to learning this technology and perfecting it, but I want to start on the right foot by covering this very core issue I have. Hope you guys can help me. Thanks!
https://redd.it/15gz6ky
@r_vim
Coc-Nvim LSP Issue
I have been having this issue. I was making a project with SDL3, and I encountered this error in the coc-clangd lsp
https://preview.redd.it/pevdw9jnbqfb1.png?width=779&format=png&auto=webp&s=1eabcb1b02da03ec3e16efb90bd0d3e1008383d3
I went digging through the header files and figured out it had something to do with the stdint header file for some reason
https://preview.redd.it/4h1jmjngbqfb1.png?width=799&format=png&auto=webp&s=9a66f3c8ca337526269084701799756e8a42af98
The strange thing, is that it compiles without errors. I tried updating clangd and could not figure it out. Is this a common issue or is there something that I might be doing wrong?
​
​
https://preview.redd.it/gyixfim3cqfb1.png?width=528&format=png&auto=webp&s=51dce473d4bd330c0362f8ad52f1dba780f27b0e
It only seems to do it with stdint for some reason :\\
https://redd.it/15gemww
@r_vim
A bit curious
Hi, personal stories about why a tool has been used always fascinated me and I was wondering a few things about you as Vim users.
What got you started with Vim? When was it? What's your tech stack? And what thing do you do with it that you think is more different than what everyone else does?
I'll go first, I got started when I was trying to edit some files on my first Linux distro (Slackware), something like 18 years ago.
My tech stack rn is Python, Django, and some PySide2.
I write my notes in Vim also, I feel like I don't have other things I do differently, except for some keybind changes.
https://redd.it/15gbm1p
@r_vim
Where is Bram ?
No update for a month.
Is everything alright with him?
https://redd.it/15fxaex
@r_vim
Keybinding requires clicking to activate
I use the quickr-cscope plugin for navigating code, and recently I have discovered that I have to click a tag with the mouse after using the <leader>g binding. It didn't used to have this behaviour, and I'm not sure what vim or quickr-cscope option I can use to revert this. I use vim in tmux if that matters.
https://redd.it/15fhdtr
@r_vim
New Plugin Async Autocompletion plugin for Vim
https://github.com/girishji/vimcomplete
A lightweight async autocompletion plugin written entirely in vim9script.
- Code completion using yegappan LSP
- Snippet completion using vim-vsnip
- Buffer word completion (with timers)
- Dictionary completion
- Dictionary (and next-word) completion using ngrams
- Vimscript language completion (like LSP)
- Path completion
- Abbreviation completion
Completion items can be sorted based on:
- Recency
- Length of item
- Priority
- Locality of item (for buffer completion)
- Case match
--------
For cmdline-mode completion see https://github.com/girishji/autosuggest.vim.
https://redd.it/15f7dg7
@r_vim
State-of-art IDE features
Hello fellow Vim users,
I use the editor for years and comfortable with my current setup.
However, I do lack proper IDE setup. Currently using ALE for linting and Deoplete for completion.
It works, but seeing what modern NeoVim configurations can do makes me want to replicate some of the features.
In particular, I would like to have:
1. Signature hints when writing the function.
2. Advanced autocompletion with configurable amount of documentation showed in a floating window.
3. In-editor debugger and integration with build system (cargo
, etc).
4. Automatic braces closure, capable of deciphering complex nested structures.
For some reasons this one always failed me in the past.
:wq
https://redd.it/15f6ktc
@r_vim