50 Vim-Mode Tips for IDE Users
https://sebastiancarlos.com/50-vim-mode-tips-for-ide-users-f7b525a794b3?sk=2d9858b7876d63e1efee15b2cf648412
https://redd.it/119zlu6
@r_vim
am i stupid for trying this?
I am thinking of trying to run a vim environment as I go into a more intense year in my degree where the other students will be running visual studio and vs code. I haven't done much with vim yet and technically have a couple months to prepare...but I am just worried I will fall behind the others being slow with vim. Thoughts?
https://redd.it/119oq87
@r_vim
What are some good ways to expand your vim knowledge
So vim is my text editor of choice but i am not super experienced with it. I'm very comfortable with it but i don't know how to do advanced stuff. What are some ways i could expand my knowledge and learn more complex stuff
https://redd.it/118x1c3
@r_vim
How to scroll back a verbose bang output?
Sometimes the displayed output in response to a bang commands is very long and I fail to scroll back for reading the first lines. All I can do is to Press ENTER or type a command to continue
. How to scroll back?
https://redd.it/118t8f3
@r_vim
There must be a better way (that doesn’t involve a plugin)
I’m doing some light reformatting of some JSON for readability and think there must be a better way. I have a snippet that looks this:
"style": {
"bg": {
"type": "transparent"
},
"fg": {
"type": "color",
"value": "#28333C"
},
"padding": [
0,
20,
0,
20
]
},
va{J
or v%J
for each of these small inner blocks, preferably in a .
repeatable way. I used a macro (not repeatable; calling it for each block manually), but I can’t help but think that there must be a better way. Does anyone have any thoughts on this? I’d rather not have plugin suggestions; unless it’s incredibly useful, it isn’t getting added to my config. I don’t even currently load the plugins I’ve found useful in the past. I’m not likely to add any just for this.The Vundle github repo seems to have disappeared
https://github.com/VundleVim/Vundle.vim
I'm still able to update my other packgaes via the vundle I already have installed, but this is a little concerning going forward.
https://redd.it/11890p5
@r_vim
Is it possible to fetch the text under cursor when executing Ex command?
Usecase example: I have a list of git commit hashes in my editor:
pick AAAAAAA Banana
pick BBBBBBB Ananas
:!git show <c-r><c-w>
I can inspect the git hash under my cursor. But if I want to repeat this action for the next commit, I have to retype the has part because the <c-r><c-w>
already expanded to what was under my cursor.Favorite vimrc configs for coding?
New here. I mainly code C, py. Curious what the vim community's favourite vimrc configs/commands are.
https://redd.it/117wefv
@r_vim
How to invoke an external, **interactive** shell command, and capture its output?
**What am I really trying to do**
* We have an in house interactive script
* You invoke the script, choose an option, script does something behind the scenes, and then returns the file name that got affected
When I hit a key, I want to call this script in vim, type in my option, hit enter, then open the affected file in vim
**Problem**
I know that `system` is the command you typically use to run external shell commands, but the documentation (`help system`) explicitly says do not use it for interactive commands.
fzf does something similar to this that I want -
* You run `:FZF`
* You type in stuff to get to the file you wanna open, hit enter
* Then that file is opened in vim
How do you actually do this though? Googling around I found:
* https://stackoverflow.com/questions/24299155/capture-the-output-of-an-interactive-script-in-vim
* https://vi.stackexchange.com/questions/510/can-i-issue-an-interactive-shell-in-vim-window
but I don't want to install some plugin to do this, and would prefer for it to be as simple as possible
https://redd.it/117r938
@r_vim
Is it worth learning Vim for programming for Data Analysis?
I have started learning Python and SQL for learning Data analysis. Now I am considering whether I should use Vim for data analysis and whether it would be worth learning. Do I really need it? Would it increase my workflow in this specific area? I use VSCode for now and probably will use Jupyter notebook to do data-analysis with Python. What is your opinion?
https://redd.it/117bvgj
@r_vim
Papyrus: Compile Markdown notes into Latex PDFs in Vim!
https://github.com/abeleinin/papyrus
https://redd.it/11782pw
@r_vim
On why vim should be extended in c
One of the primary arguments for why emacs users town emax is that it's written in the general purpose language emacs lisp.
vim script is not a general purpose language mint for writing large code bases.
some of the gurus in the vim IRC channel assure me that vim can be extended in c.
she is a general purpose language that is suitable for large code bases, with the right experienced hands.
c is a language that has stood the test of time and is much better renowned than vimscript. c has earned its place in history whereas vimscript lives in the shadow of vim.
VIM script could one day be proven to be a language as robust and useful as c, but this seems unlikely.
the suckless project which is a minimal software project has made some progress in terms of making c work more like an extension language. Rob Landley who works on toybox and who used to be to maintainer of busy box has developed a style which allows c files to work as if they were a package in a package management system.
so I argue that there is a lot of room for growth with c as the primary extension language for vim whereas vim script is really just more of a platform that Vim has been using to achieve its goals.
people like to argue that c++ has defeated c and that is very true if you work in the industry, but if you work in the industry you are probably developing proprietary software that will never see the light of day and will die with the company that created it.
when it comes to open source software, especially critical system software, nearly everything under the sun is written in c.
these are the best arguments I can give for why c is a more glorious extension language than vim script is.
https://redd.it/116zywk
@r_vim
Earlier... i noticed that when i'm typing in text within Gmail, (after using Vim just prior) i'd press ESC
and this erased everything that i typed in. ..... but a few days ago.....
- several months ago... i noticed that when i'm typing in text within Gmail, (after using Vim just prior) i'd press ESC
and this erased everything that i typed in.
# Did others notice this too???
- A few days ago, i noticed that pressing ESC
within Gmail no longer does this.
https://old.reddit.com/r/FreeCAD/comments/10my1zp/extremelyfrustratedwithlosingmyworkoverand/
> Extremely frustrated with losing my work over and over in Freecad. Hitting escape destroys all your work. Here are 2 pics before and after. All this damage is done by pressing ESC twice.
- ( i think... pressing ESC
within Paint.net has a similar effect.)
https://redd.it/116yha7
@r_vim
Editing in Vim
https://youtu.be/BWkfblUfMKA
https://redd.it/116hkrm
@r_vim
panvimdoc - Write documentation in markdown, generate documentation in vimdoc automatically
https://github.com/kdheepak/panvimdoc
https://redd.it/11638rp
@r_vim
People who use VIM/NVIM extensively, What's your typing speed, and do you touch type?
I'm asking because I want to know if using VIM and getting the most out of it is relative to being a fast typer !
Myself, I just started to learn touch typing and I average around 70 wpm, I use VIM for all my scripting/coding and I still feel like I'm not getting the best out it especially when watching some VIM superstars like ThePrimeagen
https://redd.it/119sn91
@r_vim
Opening symlinks in Netrw
For that to work, you have to get out of 'tree-mode' by pressing 'i', it does work from list-mode.
https://redd.it/119kxss
@r_vim
Do you use the "%" motion? Do you feel it has "quirks"?
From what I understand, this motion has some quirks that make it behave quite differently from what I would intuitively expect, so I'm wondering if the community has similar feelings and therefore avoids "%" most of the time or if I'm just missing something from my standpoint as a proud and privileged IDE kid.
Which quirks do I mean? Well, everything works fine when pressing "%" when the cursor is already over a parenthesis or bracket, but if not, it will find the next one forward on the line and jump to its match. What I would expect is for it to automagically find the parenthesis closest to the cursor (even if not on the current line) and jump to it, leaving it to me to press "%" again if I then want to jump to its match. Am I the only one who would prefer that behavior? Am I missing something because my Vim brain is not developed enough yet?
Thanks!
https://redd.it/118sphy
@r_vim
Vim (newish) feature 'smoothscrool' lets you handle wrapped text much better
https://redd.it/118kioh
@r_vim
xkbswitch.nvim - Smart automatic keyboard layout switching in 120 LOC
​
https://preview.redd.it/aizevoovekja1.png?width=500&format=png&auto=webp&v=enabled&s=6172d39fb31a55e89923620495a01591107e1ac0
Do you have more than one keyboard layout and constantly switching back to English just to be able to move?
Stop it, get some help!
With xkbswitch.nvim you can write comments/notes/documents in your language of choice, press Esc
to enter Normal mode and instantly be ready to make your next move.
Plugin saves your actual layout before switching to English. The next time you enter Insert mode you will have your last saved layout.
It also works with focus. When Neovim loses focus plugin switches your layout to the last saved one. When Neovim gets focus plugin saves your layout, which you could've changed in another window and switches to English only if you need it.
Now you need to switch your layout only when you need to type something in a different language! That's the way it always should have been.
https://redd.it/1187jf9
@r_vim
how to map these keys in vim
they work in neovim, just need the equivalent in vim.
nnoremap <Space> <C-f>
nnoremap q :q<cr>
https://redd.it/1185o5u
@r_vim
Is there a way to center rendered text, with a method close to :hi?
I'd like to center some rendered text if it contains a regex.
I've already found that you can highlight a regex-matched text with a `syn` and then a `hi`, but I can't find any way to do what I want.
I don't want to use :center as that means actually having spaces in front of the text when saving the document.
Is there a way to do that in vimscript?
https://redd.it/117zfp2
@r_vim
Using second vimrc file
I am using vim on an Ubuntu VM and wanted to have a second .vimrc file for occasional use.
To open vim using this file I have been using the command "vim -u .vimrc2". I have noticed that when doing this backspace in insert mode doesn't immediately delete characters. I need to hit escape in order for the deletions to take effect. Thinking this was due to a setting in the new file, I copied my exact default .vimrc file (runs without issues) to the secondary file, retested, and had the same issue.
Any idea what is happening here?
https://redd.it/117v3rk
@r_vim
How can I programmatically determine how many valid commands ran when passing a series of key presses to Vim?
I'm working on a project that requires me to pass a series of keys to Vim and check how many valid commands ran. For example, I need to know that the keys "da(" produced one command, "hhhlll" produced six commands, and "ihello" produced zero (as no <esc> key was provided at the end.)
Ideally, this should be context independent: For the "da(" example, it doesn't matter if the cursor was within parentheses. The question is whether it would be a valid command in ideal circumstances.
So far, I considered checking Vim's log files or monitoring the input buffer that appears on the status bar after each key press. But I'm open to other ideas. Thank you for your help!
https://redd.it/117g8jy
@r_vim
Are there any Vim C# Azure DevOps/TFVC plugins?
I previously asked if there were Vim plugins for C# project management. I was surprised that no one mentioned any. Some told me to give up and fall back on an IDE.
My next question is related: Are there any plugins for C# that enable source control integration for Azure DevOps with TFVC (not Git)? Here are some features that such a plugin might provide.
1. Adding, removing, editing, checking in, and checking out projects, solutions, files, and folders.
2. Controlling when changes made to the solution (*.sln) file, the project (*.csproj) file, and the file system should carry over to source control.
3. Synchronizing a project to source control, so that a compiling project guarantees a compiling changeset.
Azure DevOps provides a REST API, so doing this in Vim should be possible, if not easy.
https://redd.it/1177073
@r_vim
Minimal config (55 lines) for web development & general purpose programming
I got sick of having to maintain long configs, or having my setup break because of some update just before I need to start working. After a few months of trial and error, I'm now at peace with this [minimal config](https://github.com/kiwphi/dotfiles/blob/master/init.vim).
It does everything I need my editor to do: fuzzy-finding, autocomplete, syntax highlighting, auto-comment, pair completion, code formatting, jump to definition etc...
Some notes:
* Rename to .vimrc to use with vim. I'm currently using it with neovim, but it's fully compatible with vim
* I don't like file trees, I've bound "-" to open netrw in the current directory to browse for files (similar behaviour to tpope's vim-vinegar). Press "-" again to jump up one directory
* Additional language support can be added by adding the appropriate language server to coc\_global\_extensions. [List of language servers](https://github.com/neoclide/coc.nvim/wiki/Language-servers)
https://redd.it/1176eln
@r_vim
Outdated tutorials
Hey, started using vim yesterday. Mostly for C and python.
A lot of my problems on stackoverflow, esp the ones regarding changing vimrc were answered 10-12 yrs ago and most of them suggest adding some vimscript lines while the more recent answers recommend installing plugins.
For example, to compile py code directly in vim someone recommended I add this :
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '!python3' shellescape(@%, 1)<CR>
While someone else said this was outdated and recommended I install a plugin.
I understand I should use what works best for me, but as a beginner I want to keep best practices in mind and would like a second opinion on all this.
https://redd.it/116yc5v
@r_vim
VIM for remote server file editing
Hi guys, this is my first time posting. I have a very robust vim setup that can do almost everything I want. However, I'm running into issues where I working on several (10 or more) headless servers where someone else is the admin. It is tedious to keep setting up and updating the vim setup for each server separately. Can vim edit files remotely, so i need only to set up once?
Thank you so much
https://redd.it/116k13c
@r_vim
enter key different - normal vs num pad
when i want to exit vim, i do :q! and enter, but if i press the num pad enter, it goes to --INSERT--.
what can i do to make both enter key the same? thx
https://redd.it/116e4tc
@r_vim
vim randomly opening and closing my folds on my desktop. no idea why.
https://redd.it/115unmq
@r_vim