I have been at this for like 3 hours, how the hell do i completely disable the information popup window thing in vim-lsp??? i made it not be floating, but thats about it.
Heres my options for vim-lsp:
let g:lsp_inlay_hints_mode = "curline"
let g:lsp_inlay_hints_delay = 100
let g:lsp_document_code_action_signs_delay = 100
let g:lsp_diagnostics_virtual_text_align = "after"
let g:lsp_diagnostics_virtual_text_padding_left = 3
let g:lsp_diagnostics_highlights_delay = 100
let g:lsp_diagnostics_highlights_insert_mode_enabled = 0
let g:lsp_diagnostics_float_mode_enabled = 0
let g:lsp_document_highlight = 0
let g:lsp_preview_float = 0
let g:lsp_preview_max_width = 0
let g:lsp_preview_max_height = 0
let g:lsp_completion_documentation_enabled = 0
let g:lsp_diagnostics_signs_enabled = 0
let g:lsp_diagnostics_float_cursor = 0
let g:lsp_diagnostics_echo_cursor = 0
highlight link LspErrorHighlight MessageWindow
highlight link LspInformationHighlight MessageWindow
highlight link LspWarningHighlight MoreMsg
(ik it's not well organised but im leaving that for later)
https://preview.redd.it/jdq8ge0kiqzf1.png?width=1920&format=png&auto=webp&s=dec0efa7871f136df41d41788e9b921723d49f10
https://redd.it/1oqgs1k
@r_vim
Heres my options for vim-lsp:
let g:lsp_inlay_hints_mode = "curline"
let g:lsp_inlay_hints_delay = 100
let g:lsp_document_code_action_signs_delay = 100
let g:lsp_diagnostics_virtual_text_align = "after"
let g:lsp_diagnostics_virtual_text_padding_left = 3
let g:lsp_diagnostics_highlights_delay = 100
let g:lsp_diagnostics_highlights_insert_mode_enabled = 0
let g:lsp_diagnostics_float_mode_enabled = 0
let g:lsp_document_highlight = 0
let g:lsp_preview_float = 0
let g:lsp_preview_max_width = 0
let g:lsp_preview_max_height = 0
let g:lsp_completion_documentation_enabled = 0
let g:lsp_diagnostics_signs_enabled = 0
let g:lsp_diagnostics_float_cursor = 0
let g:lsp_diagnostics_echo_cursor = 0
highlight link LspErrorHighlight MessageWindow
highlight link LspInformationHighlight MessageWindow
highlight link LspWarningHighlight MoreMsg
(ik it's not well organised but im leaving that for later)
https://preview.redd.it/jdq8ge0kiqzf1.png?width=1920&format=png&auto=webp&s=dec0efa7871f136df41d41788e9b921723d49f10
https://redd.it/1oqgs1k
@r_vim
NEOVIM devtheme in vim
is there a way to use nvims's default dev\theme in vim??
ive gone through the nvim's runtime directory but the colors arent explicitly mentioned as a .vim file (maybe because it is a default)
https://redd.it/1oq0omf
@r_vim
is there a way to use nvims's default dev\theme in vim??
ive gone through the nvim's runtime directory but the colors arent explicitly mentioned as a .vim file (maybe because it is a default)
https://redd.it/1oq0omf
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
What's the "better" way to close vim?
Recently, I got into a friendly discussion with a friend about whose way of closing Vim is superior.
He tends to use commands like
His argument is that my "hotkey" method doesn't support commands like
I know its a rather silly discussion, and it probably ultimately comes down to personal preference, but I'm curious what you guys think about it, and maybe your personal story about why you use one over the other.
Sidenote: Neither of us want to use custom remaps for it as we both agree that the minor efficiency gain isn't worth having our muscle memory fail us when working on remote machines. For context, we've both been using Vim/Neovim for over five years.
https://redd.it/1oqwdbo
@r_vim
Recently, I got into a friendly discussion with a friend about whose way of closing Vim is superior.
He tends to use commands like
:q, :q!, or :wq, while I prefer using "hotkeys" like Ctrl+wq, ZZ, or ZQ. In my opinion, the "hotkeys" are not only (arguably) easier to press, but also (definitely) faster and easier to repeat when closing multiple windows.His argument is that my "hotkey" method doesn't support commands like
:qa, :wqa, etc, which makes his approach better because it's more consistent with muscle memory. My counterpoint is that Ctrl+wq, ZZ, and ZQ cover like 99.9% of real-world use cases in a normal workflow, and for the rare situations that need :qa or :wqa, I don't mind typing them out. That said, I'll admit that whenever I do need to type a command to close windows/exit vim, it feels awkward. My muscle memory "hesitates" since I'm so used to closing Vim without entering command mode.I know its a rather silly discussion, and it probably ultimately comes down to personal preference, but I'm curious what you guys think about it, and maybe your personal story about why you use one over the other.
Sidenote: Neither of us want to use custom remaps for it as we both agree that the minor efficiency gain isn't worth having our muscle memory fail us when working on remote machines. For context, we've both been using Vim/Neovim for over five years.
https://redd.it/1oqwdbo
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
Versatile mapping: repeat last Ex command
I have this in my config and love it:
This mapping comes to to the rescue so often in different occasions.
- Navigating the quickfix last going to the next file with
- doing
- Scrolling sideways with
It shadows a builtin, but for me it's great. Hope it helps someone 😊
https://redd.it/1oru4j2
@r_vim
I have this in my config and love it:
" Repeat the last : command (warning: shadows builtin!)
nnoremap , @:
This mapping comes to to the rescue so often in different occasions.
- Navigating the quickfix last going to the next file with
:cnfile? Just repeat it again with ,! - doing
:normal! in my places? Repeat it! - Scrolling sideways with
40zr? Just do :norm! 40zr and continue scrolling conveniently with comma. 👌It shadows a builtin, but for me it's great. Hope it helps someone 😊
https://redd.it/1oru4j2
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
Did you know that you can move across windows as part of your vim macro ?
https://youtu.be/zqfPAY9lr4I
https://redd.it/1os8dwy
@r_vim
https://youtu.be/zqfPAY9lr4I
https://redd.it/1os8dwy
@r_vim
YouTube
Did you know you can move across windows in Vim Macros ?
This has saved me so much time so many times.
#vim #neovim #linux #nvim #workflow #optimization #privacy
#vim #neovim #linux #nvim #workflow #optimization #privacy
My vim just freezes then goes transparent and I can't quit it or anything
Using it on Linux Mint
was it a graphical issue related with compositing?
while editing a config file
I saved it then reloaded my DE
Then vim just freezed and went fully transparent or you could say dissapeared
https://redd.it/1os90ly
@r_vim
Using it on Linux Mint
was it a graphical issue related with compositing?
while editing a config file
I saved it then reloaded my DE
Then vim just freezed and went fully transparent or you could say dissapeared
https://redd.it/1os90ly
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
Vim for SQL lite
I am using tmux with one window opened
vim queries with :!sqlite3 mydb.db < %
And on other window sqlite3 opened
The problem with this is that I don't see the errors if I have them
Context : this is for college so I don't want any automation for complex setup just vim for queries,
if I messup I can change my queries without rewriting everything, everytime and see error messages
Thanks for your help in advance
https://redd.it/1osftsy
@r_vim
I am using tmux with one window opened
vim queries with :!sqlite3 mydb.db < %
And on other window sqlite3 opened
The problem with this is that I don't see the errors if I have them
Context : this is for college so I don't want any automation for complex setup just vim for queries,
if I messup I can change my queries without rewriting everything, everytime and see error messages
Thanks for your help in advance
https://redd.it/1osftsy
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
Can someone please help me fix any errors in this _vimrc file?
" --- Dvorak + QWERTY-friendly Vim config ---
" Make insert mode use Dvorak (normal typing)
set keymap=dvorak
set iminsert=0
set imsearch=0
" Ensure Vim knows when you're in insert mode
set noimdisable
" --- Movement keys behave like QWERTY ---
" (So hjkl etc. stay ergonomic)
set langmap=\
h,h,\
j,j,\
k,k,\
l,l,\
w,w,\
e,e,\
b,b,\
0,0,\
$, $
" --- Easier Esc alternative ---
inoremap jk <Esc>
" --- Optional quality-of-life tweaks ---
set number " line numbers
set relativenumber " relative line numbers for easy movement
set ignorecase " smarter searching
set smartcase
set incsearch
syntax on
filetype plugin indent on
I generated this using ChatGPT
https://redd.it/1osgdhq
@r_vim
" --- Dvorak + QWERTY-friendly Vim config ---
" Make insert mode use Dvorak (normal typing)
set keymap=dvorak
set iminsert=0
set imsearch=0
" Ensure Vim knows when you're in insert mode
set noimdisable
" --- Movement keys behave like QWERTY ---
" (So hjkl etc. stay ergonomic)
set langmap=\
h,h,\
j,j,\
k,k,\
l,l,\
w,w,\
e,e,\
b,b,\
0,0,\
$, $
" --- Easier Esc alternative ---
inoremap jk <Esc>
" --- Optional quality-of-life tweaks ---
set number " line numbers
set relativenumber " relative line numbers for easy movement
set ignorecase " smarter searching
set smartcase
set incsearch
syntax on
filetype plugin indent on
I generated this using ChatGPT
https://redd.it/1osgdhq
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
What happened to vim?
vim
Suddenly the upper window appears, and I am not able to type : or q or :wq anymore
https://redd.it/1ot1n4g
@r_vim
vim
Suddenly the upper window appears, and I am not able to type : or q or :wq anymore
https://redd.it/1ot1n4g
@r_vim
Skill issue? or vscode better for this specific task
vim json macro: https://imgur.com/N9qSVob
vscode equivalent: https://imgur.com/VrM4hoQ
I love vim, been using it for about 6 months, my only real gripe is I always end up going back to vscode to do any kind of complex macro equivalent thing?
I can get it done in vim but the mental overhead is just... higher, and i end up attempting it like 3 times. Is this something that comes in time or is it just difficult. Opening vscode and doing it there is almost always quicker i've found.
https://redd.it/1ot9ll7
@r_vim
vim json macro: https://imgur.com/N9qSVob
vscode equivalent: https://imgur.com/VrM4hoQ
I love vim, been using it for about 6 months, my only real gripe is I always end up going back to vscode to do any kind of complex macro equivalent thing?
I can get it done in vim but the mental overhead is just... higher, and i end up attempting it like 3 times. Is this something that comes in time or is it just difficult. Opening vscode and doing it there is almost always quicker i've found.
https://redd.it/1ot9ll7
@r_vim
Vim9 TeXpresso Integration?
Anyone have a solution for integrating TeXpresso into Vim9?
https://redd.it/1otug2q
@r_vim
Anyone have a solution for integrating TeXpresso into Vim9?
https://redd.it/1otug2q
@r_vim
GitHub
GitHub - let-def/texpresso: TeXpresso: live rendering and error reporting for LaTeX
TeXpresso: live rendering and error reporting for LaTeX - let-def/texpresso
A Python function I use to build project files from my Ultisnips snippets
I have a few noscripts I use for setting up projects different ways. This is the function I use to build project files from my Ultisnips snippets. Nothing ground breaking, but I've gotten a lot of use out of it.
import re
from pathlib import Path
def select_snippet(
snippet_file: Path, snippet_trigger: str, subs: dict[str, str] | None = None
) -> str:
"""Select a snippet file and fill in the template with substitutions.
:param snippet_file: Path to the file containing snippets.
:param snippet_trigger: The trigger for the snippet to select.
:param subs: Optional dictionary of substitutions to apply to the snippet.
:return: The formatted snippet as a string.
"""
pattern = re.compile(rf"snippet {snippet_trigger}(.*?)endsnippet", re.DOTALL)
with snippet_file.open() as f:
match = re.search(pattern, f.read())
if not match:
msg = f"Snippet {snippet_trigger} not found in {snippet_file}"
raise ValueError(msg)
match_str = "\n".join(match.group(1).split("\n")[1:])
for k, v in (subs or {}).items():
match_str = re.sub(k, v, match_str)
return match_str
# ===========================================================
# Example usage
# ===========================================================
SNIPPETS_DIR = Path.home() / "vimfiles" / "ultisnips"
PROJECT_ROOT = Path("to", "project", "root")
def write_pre_commit_config(python_min_version: str) -> None:
"""Write a pre-commit configuration file."""
yaml_snippets = SNIPPETS_DIR / "yaml.snippets"
subs = {r"\$1": python_min_version}
with (PROJECT_ROOT / ".pre-commit-config.yaml").open("w") as f:
_ = f.write(select_snippet(yaml_snippets, "pre-commit-config", subs))
https://redd.it/1ow5vr4
@r_vim
I have a few noscripts I use for setting up projects different ways. This is the function I use to build project files from my Ultisnips snippets. Nothing ground breaking, but I've gotten a lot of use out of it.
import re
from pathlib import Path
def select_snippet(
snippet_file: Path, snippet_trigger: str, subs: dict[str, str] | None = None
) -> str:
"""Select a snippet file and fill in the template with substitutions.
:param snippet_file: Path to the file containing snippets.
:param snippet_trigger: The trigger for the snippet to select.
:param subs: Optional dictionary of substitutions to apply to the snippet.
:return: The formatted snippet as a string.
"""
pattern = re.compile(rf"snippet {snippet_trigger}(.*?)endsnippet", re.DOTALL)
with snippet_file.open() as f:
match = re.search(pattern, f.read())
if not match:
msg = f"Snippet {snippet_trigger} not found in {snippet_file}"
raise ValueError(msg)
match_str = "\n".join(match.group(1).split("\n")[1:])
for k, v in (subs or {}).items():
match_str = re.sub(k, v, match_str)
return match_str
# ===========================================================
# Example usage
# ===========================================================
SNIPPETS_DIR = Path.home() / "vimfiles" / "ultisnips"
PROJECT_ROOT = Path("to", "project", "root")
def write_pre_commit_config(python_min_version: str) -> None:
"""Write a pre-commit configuration file."""
yaml_snippets = SNIPPETS_DIR / "yaml.snippets"
subs = {r"\$1": python_min_version}
with (PROJECT_ROOT / ".pre-commit-config.yaml").open("w") as f:
_ = f.write(select_snippet(yaml_snippets, "pre-commit-config", subs))
https://redd.it/1ow5vr4
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
How many of those are default Vim bindings?
Been using Vim for not too long and still haven't memorised all the wonderful keybinds.
Just found out that TIC80's code editor has a Vim mode. Can someone more experienced in Vim than me take a look at this and tell me how many of them are default/common Vim binds, and how many are "close approximations" or "cursed" even?
Keep in mind this is a tiny fantasy console with a very simple editor. So, of course, its Vim mode is very minimal.
The main thing I can see is that due to lack of motions, some stuff in N mode, such as delete or yank, just operate on the full line immediately.
The keybinds in question:
Motion Keys
Work in both normal and select mode.
Normal Mode
Select Mode
https://redd.it/1owmv4o
@r_vim
Been using Vim for not too long and still haven't memorised all the wonderful keybinds.
Just found out that TIC80's code editor has a Vim mode. Can someone more experienced in Vim than me take a look at this and tell me how many of them are default/common Vim binds, and how many are "close approximations" or "cursed" even?
Keep in mind this is a tiny fantasy console with a very simple editor. So, of course, its Vim mode is very minimal.
The main thing I can see is that due to lack of motions, some stuff in N mode, such as delete or yank, just operate on the full line immediately.
The keybinds in question:
Motion Keys
Work in both normal and select mode.
h - left one column
k - up one row
j - down one row
l - right one column
(arrow keys also work)
g - start of file
G - end of file
0,Home - start of line
$,End - end of line
ctrl+u,pageup - up one screen
ctrl+d,pagedown - down one screen
K - up half screen
J - down half screen
b - back one word
w - forward one word
^ - first non-whitespace character on line
{ - next empty line above current position
} - next empty line below current position
% - jump to matching delimiter
f - seek forward in line to next character typed
F - seek backward in line to next character typed
; - seek forward in line to next character under cursor
: - seek backwards in line to next character under cursor
Normal Mode
escape - exit editor to console
i - enter insert mode
a - move right one column and enter insert mode
o - insert a new line below current line and enter insert mode on that line
O - insert a new line above current line and enter insert mode on that line
space - create a new line under the current line
shift+space - create a new line above the current line
v - enter select mode (visual mode from vi)
/ - find
n - go to next occurance of found word
N - go to previous occurance of found word
# - go to next occurance of word under cursor
r - find and replace
u - undo
U - redo
p - paste, will place multi line blocks of code on line below
P - paste, will place multi line blocks of code above current line
1-9 - goto line, just type the line number and it will take you there
[ - go to function definition if it can be found
? - open code outline
m - mark current line
M - open bookmark list
, - goto previous bookmark
. - goto next bookmark
z - recenter screen
-(minus) - comment line
x - delete character under cursor
~ - toggle case of character under cursor
d - cut current line
y - copy current line
W - save project
R - run game
c - delete word under cursor and enter insert mode
if over a delimiter or quotation, delete contents contained and enter insert mode
C - delete until the end of the line and enter insert mode
> - indent line
< - dedent line
alt + f - toggle font size
alt + s - toggle font shadow
Select Mode
escape - switch to normal mode
-(minus) - comment block
y - copy block
d - cut block
p - paste over block
c - delete block and enter insert mode
> - indent block
< - dedent block
/ - find populating current selection
r - find and replace within block
~ - toggle case in block
https://redd.it/1owmv4o
@r_vim
Reddit
From the vim community on Reddit
Explore this post and more from the vim community
Cyclops.vim - a new approach for creating dot (or pair ; ,) repeatable operators
This is an idea I had a few years ago to enable dot repeat functionality to existing operators without requiring plugin-side changes. Configuration is minimal, just one line to define a new map:
nmap <expr> / dot#Noremap('/')
Or if the map already exists, there is a helper function to redefine it:
call dot#SetMaps('nmap', 'a')
Unlike other plugins, there is no plugin-side changes needed, and it doesn't constantly record macros. It works on operators that require input, as well ones that don't.
Cyclops.vim works via a REPL pattern, the plugin concatenates a probe character to the end of the managed operator to detect if input is required, then stores the input for later use when repeating. It makes use of the
Additionally, pair repeating with
cyclops.vim
https://redd.it/1oxxka3
@r_vim
This is an idea I had a few years ago to enable dot repeat functionality to existing operators without requiring plugin-side changes. Configuration is minimal, just one line to define a new map:
nmap <expr> / dot#Noremap('/')
Or if the map already exists, there is a helper function to redefine it:
call dot#SetMaps('nmap', 'a')
Unlike other plugins, there is no plugin-side changes needed, and it doesn't constantly record macros. It works on operators that require input, as well ones that don't.
Cyclops.vim works via a REPL pattern, the plugin concatenates a probe character to the end of the managed operator to detect if input is required, then stores the input for later use when repeating. It makes use of the
operatorfunc to not collide with the built in dot repeat behavior.Additionally, pair repeating with
; and , is also included. By default, f, F, t, T maps are provided to retain expected behavior. Pair repeating is configured similarly and uses the same machinery as dot repeating. Pair repeating does not impact dot repeating and vice versa.cyclops.vim
https://redd.it/1oxxka3
@r_vim
GitHub
GitHub - numEricL/cyclops.vim: The simplest method of adding repetition to your maps and operators
The simplest method of adding repetition to your maps and operators - numEricL/cyclops.vim