r_vim
70 subscribers
1.25K photos
60 videos
1 file
19.6K links
Download Telegram
Disabling annoying highlight of "note" in scm files?

Hi Vimers, I recently upgraded my computer (MacOS) and suddenly vim syntax highlighting for scheme source files is highliting the word "note" in bright yellow. On my previous install this was not the case and I have not done anything custom with regard to .scm syntax highlighting.

It's making me crazy because I'm writing music software, so "note" appears a LOT.

If anyone can help, that would be lovely as so far my google searching has not helped!

thanks

https://redd.it/1rfdw13
@r_vim
:sleep VS termwait()

Can someone explain me, possibly with a couple of examples that I can reproduce, the difference between :sleep and term\
wait()?

https://redd.it/1re5fto
@r_vim
This media is not supported in your browser
VIEW IN TELEGRAM
I built a Vim plugin to run Claude CLI directly via :Claude — would love feedback
https://redd.it/1rdqg7o
@r_vim
Get netrw to group/sort by extension first, then filename second?





Is there any way to get the netrw plugin to sort/group by filename extension, then by filename within each group of extensions?

Setting g:netrw_sort_by='exten' sorts files by extension, but within each group of extensions, it doesn't necessarily sort by filename.


https://redd.it/1rcryth
@r_vim
Newbie .vimrc question

I'm using fedora linux less than a month and I have a modest .vimrc file. When I am in my Konsole Terminal and use vim to open a file I have no problem. But, when i want to say edit a etc or boot file and i use sudo vim the .vimrc file is not loaded or read. What should I be doing?

https://redd.it/1rh1ysn
@r_vim
Some question about colorscheme.

syntax on
colorscheme ...
highlight Comment ...
highlight LineNr ...

If I don’t use colorscheme, the Comment color won’t apply. but the LineNr color works fine. I don't know what's different.
How can I use highlight without colorscheme?

https://redd.it/1rhl2sk
@r_vim
View class type hierarchy in c++ project?

When I'm on a class name, I want to be able to see a list of all classes that derive from it. Or a list of all classes that it derives from, going all the way up to the first base class.

I have cscope and tags available, so it can use that if it helps.

I'm on vim 8.0 something, and I also use gvim and neovim depending on how I'm logging in, so something that works for all would be ideal. If something dead simple to setup works for only 1 of these, that is also ok.


It seems like a basic requirement, and i suppose it should be easy to get from cscope/tags, but I haven't found any plugin that provides this info.


Thanks for the help!

https://redd.it/1rm7ky2
@r_vim
View class type hierarchy in c++ project?

When I'm on a class name, I want to be able to see a list of all classes that derive from it. Or a list of all classes that it derives from, going all the way up to the first base class.

I have cscope and tags available, so it can use that if it helps.

I'm on vim 8.0 something, and I also use gvim and neovim depending on how I'm logging in, so something that works for all would be ideal. If something dead simple to setup works for only 1 of these, that is also ok.


It seems like a basic requirement, and i suppose it should be easy to get from cscope/tags, but I haven't found any plugin that provides this info.


Thanks for the help!

https://redd.it/1rm7ky2
@r_vim
Vim -c

Just learned about the -c argument when launching vim. Pretty neat tool. Not everyone on my team is as vim happy so I made a alias for our .profiles to run my vim -c regex to add displays to our cobol programs.

example.
vim -c "%s/^\d\{3,4\}/Display &/" file.txt

It does seem like vim special things like <C-R> get lost in translation from shell to vim. So I used non special vim case regex. Always more things to learn.

The -c argument runs command mode arguments after file load. So in my above example it would open file txt look for lines starting with 3-4 digits and add Display at the start.

https://redd.it/1rlnmj7
@r_vim
Vim -c

Just learned about the -c argument when launching vim. Pretty neat tool. Not everyone on my team is as vim happy so I made a alias for our .profiles to run my vim -c regex to add displays to our cobol programs.

example.
vim -c "%s/^\d\{3,4\}/Display &/" file.txt

It does seem like vim special things like <C-R> get lost in translation from shell to vim. So I used non special vim case regex. Always more things to learn.

The -c argument runs command mode arguments after file load. So in my above example it would open file txt look for lines starting with 3-4 digits and add Display at the start.

https://redd.it/1rlnmj7
@r_vim
Vim -c

Just learned about the -c argument when launching vim. Pretty neat tool. Not everyone on my team is as vim happy so I made a alias for our .profiles to run my vim -c regex to add displays to our cobol programs.

example.
vim -c "%s/^\d\{3,4\}/Display &/" file.txt

It does seem like vim special things like <C-R> get lost in translation from shell to vim. So I used non special vim case regex. Always more things to learn.

The -c argument runs command mode arguments after file load. So in my above example it would open file txt look for lines starting with 3-4 digits and add Display at the start.

https://redd.it/1rlnmj7
@r_vim
This media is not supported in your browser
VIEW IN TELEGRAM
Learning to program Vim textbuffers and made this LLM Plugin for Ollama
https://redd.it/1rkq7m6
@r_vim
This media is not supported in your browser
VIEW IN TELEGRAM
Learning to program Vim textbuffers and made this LLM Plugin for Ollama
https://redd.it/1rkq7m6
@r_vim
Question about vim behavior with hard linked files?

I have an include file that is hard linked, "ln <target> <link>" several times, 10+. The links are all on the same drive and file tree, /opt. A link on one of the files was reset to one. How does this happen?

Google search shows that if an editor uses a temp file for edit and then moves the temp file to the named file the link is often broken when the file is saved. Does the vim9 do this?

I use the cntl-z to stop programs when I'm editing. I have done this since the mid-1980s and had no problem. However, I've noticed that stopping a vim session often does not update the save disk files timestamp when I write the file before I cntl-Z. The ":w cntl-Z" is in muscle memory and happens very fast. A "sync" does flush for a while. It seems the save times kept in file buffers aren't connected to the real time on the disk???

Any ideas?

I have vim 9.198. The ":help version9" doesn't report compile libraries.

I'm on a ubuntu debian, POP!_OS 22.04 LTS on a System76 box that is kept up to date.

https://redd.it/1rl7vgr
@r_vim
I see different color when I type ":colorscheme default" INSIDE vim

Hello everyone, I'm very new to vim and need you guys' help.

I want to change the vim appearance to default, and this is what I wrote on \~/.vimrc

colorscheme default

But the color showing on vim is different from the color when I type ":colorscheme default" on vim. Here are the screenshots.

1. this is the color that applied after I wrote \\"colorscheme default\\" on \~\/.vimrc which is not what I expected

2. when I command \\":colorscheme default\\" on vim, it shows the following color, which is the appearance I want

Is something overriding the color or have I set the file wrong?

This is the \~/.vimrc file just in case if needed.

https://preview.redd.it/fuvmzt8lokmg1.png?width=649&format=png&auto=webp&s=268ffd3f41e00990b2ceca42e46e3ad2e564339b




https://redd.it/1rikzty
@r_vim
I want to improve my config

I have a pretty basic VIM configuration. I'm not the kind of person who likes updating Vim every day, I prefer a stable config. Recently I ran into a bit of a dilemma. I updated my config from Vimscript to Vim9, and during the process I added some settings.

The main thing I want to ask is: are there any modifications or additions you’d recommend for my config?

Another question is about plugins. I’ve never really used Vim plugins and I’m not sure if I need them. I’ve always felt that plugins like LSPs, advanced autocomplete, or surrounding features aren’t really my thing. But I might use something like a faster `:find`, or something similar to Emacs’ quickrun.

.vimrc:

vim9script
# =========================
# Theme
# =========================
colorscheme lain
set listchars=tab:·\ ,trail:·,nbsp:␣
set laststatus=2
g:cwd_tail = fnamemodify(getcwd(), ':t')
autocmd DirChanged * let g:cwd_tail = fnamemodify(getcwd(), ':t')
set statusline=%#StatusLine#\ %f\ %m%r%=%{g:cwd_tail}\ %L\ %l:%c\
# =========================
# General Settings
# =========================
set path=.,**
set wildignore+=*.exe,*.dll,*.pdb,*.class,*.o,*.d
set wildignore+=*/.git/*,*/node_modules/*,*/dist/*,*/build/*,*/target/*
set wildignorecase
set splitbelow splitright
set shortmess+=IcC
set ttimeout ttimeoutlen=25
set updatetime=300 redrawtime=1500
set hidden confirm lazyredraw
set backspace=indent,eol,start
set tabstop=4 shiftwidth=4 expandtab
set autoindent softtabstop=-1
set hlsearch incsearch ignorecase smartcase
set clipboard=unnamedplus
set nowrap
set breakindent breakindentopt=sbr,list:-1
set linebreak
set nojoinspaces
set display=lastline
set smoothscroll
set sidescroll=1 sidescrolloff=3
set fileformat=unix
set fileformats=unix,dos
set nrformats=bin,hex,unsigned
set completeopt=menu,popup
set complete=o^10,.^10,w^5,b^5,u^3,t^3
set virtualedit=block nostartofline
set switchbuf=useopen
filetype plugin indent on
# =========================
# NetRW / Tree Settings
# =========================
g:netrw_banner = 0
g:netrw_keepdir = 0
g:netrw_winsize = 17
g:netrw_liststyle = 3
g:netrw_localcopydircmd = 'cp -r'
# =========================
# Keymaps
# =========================
g:mapleader = ' '
nnoremap <leader>f :find<Space>
nnoremap <silent> <leader>q :copen<CR>
nnoremap <silent> <leader>n :cnext<CR>
nnoremap <silent> <leader>p :cprev<CR>
nnoremap <silent> <leader>e :Lexplore<CR>
nnoremap <silent> <Tab> :bnext<CR>
nnoremap <silent> <S-Tab> :bprevious<CR>
nnoremap <silent> <leader>/ :nohlsearch<CR>

Color-scheme:

vim9script
# Base
set termguicolors
syntax on
set background=dark
hi Normal guifg=#ffffff guibg=#000000 ctermfg=15 ctermbg=0
hi CursorLine guibg=#000000 ctermbg=0
hi LineNr guifg=#ffffff ctermfg=15
hi StatusLine guifg=#ffffff guibg=#000000 ctermfg=15 ctermbg=0
hi VertSplit guifg=#ffffff guibg=#000000 ctermfg=15 ctermbg=0
# All gropus
const groups = [
\ "Constant", "String", "Character", "Number", "Boolean", "Float",
\ "Identifier", "Function",
\ "Statement", "Conditional", "Repeat", "Label", "Operator", "Keyword", "Exception",
\ "PreProc", "Include", "Define", "Macro", "PreCondit",
\ "Type", "StorageClass", "Structure", "Typedef",
\ "Special", "SpecialChar", "Tag", "Delimiter", "SpecialComment", "Debug",
\ "Underlined", "Ignore", "Error", "Todo"
\ ]
for g in groups
exec $"hi {g} guifg=#ffffff ctermfg=15"
endfor
hi Comment guifg=#7d7d7d ctermfg=8
hi String guifg=#8a8a8a ctermfg=8
hi StatusLine guifg=#cccccc ctermfg=8
hi StatusLineNC guifg=#cccccc ctermfg=8
hi EndOfBuffer guifg=#000000 ctermfg=15
hi NonText guifg=#555555 ctermfg=15
hi Pmenu guifg=#ffffff guibg=#0f0f0f ctermfg=15 ctermbg=0
hi
PmenuSel guifg=#000000 guibg=#cccccc ctermfg=0 ctermbg=8
hi PmenuSbar guifg=#ffffff guibg=#555555 ctermfg=15 ctermbg=8
hi PmenuThumb guifg=#ffffff guibg=#aaaaaa ctermfg=15 ctermbg=7
hi WildMenu guifg=#ffffff guibg=#0f0f0f ctermfg=0 ctermbg=8
hi VertSplit guifg=#000000 guibg=#ffffff ctermfg=15 ctermbg=0
hi WinSeparator guifg=#000000 guibg=#ffffff ctermfg=7 ctermbg=0

https://redd.it/1rr434b
@r_vim
Change locale for one mapping in .vimrc only

Hello,

I have the following lines in my \~/.vimrc

" map timestamp in RFC822 format to F9 key

nnoremap <F9> "=strftime("%a, %d %b %Y %H:%M:%S %z")<CR>P

inoremap <F9> <C-R>=strftime("%a, %d %b %Y %H:%M:%S %z")<CR>

The mapping works, but as I have set my locales in my operating system (Debian GNU/Linux 13 Trixie) to German

(de_DE.UTF-8), the created timestamp uses German names for days and months. Is it possible to use the locale en_US.UTF-8 only for the mapping in Vim? I would like to have the timestamp in English.

https://redd.it/1rqvpnr
@r_vim
Tips on taking note in Vim

Hi everyone, I been using Vim for a while but mainly for coding. This is the first time I use Vim to take note for a course. Any advice is appreciated :)) I only use raw Vim with no plugins btw.

https://redd.it/1rp35da
@r_vim