r_vim | Unsorted

Telegram-канал r_vim - r_vim

-

@r_channels

Subscribe to a channel

r_vim

Am I the only one to which this is happening?

Sometimes when I move to the right (example using arrows) the cursor doesn't move and then I press again and it moves two spaces. Is this normal? Am I supposed to worry? Sometimes it also happens when pressing backspace, it doesn't delete the first character when I press it again it deletes two instantly.

Please re assure me this is normal :)

(Yeah I know it's not my laptop because 1. Is new and 2. I have written essays with non of this happening)

Extra info:
OS: Ubuntu 20.10
Vim: latest version

Thanks in advance!

https://redd.it/kwlub0
@r_vim

Читать полностью…

r_vim

Skip spaces by the value of your tabstop

Hi, I am really new to vim and I would really like to see if I can skip spaces by the value of my tabstop.

https://redd.it/kwi09l
@r_vim

Читать полностью…

r_vim

No, I most certainly did not.
https://redd.it/kwhlp8
@r_vim

Читать полностью…

r_vim

Okay, so can Vim auto-detect the background color of my terminal emulator, or not?

No matter what my terminal background color is, black or white, this

vi -u NONE +'if &background == "dark" | echom "dark" |
elseif &background == "light" | echom "light" | else | echom "what" | endif'

always returns 'light', and I can't set different colorschemes based on the 'background' option.

And yes, :help 'background' says it defaults to 'light' in Unix unless some corner cases. But is there any way to focrce the auto-detection in the config? (No, playing with env vars won't help me.)

https://redd.it/kwf6pb
@r_vim

Читать полностью…

r_vim

Opening specific file types changes shiftwidth and softtabstop

After upgrading to 8.2 on Windows, when I open ruby files, the shiftwidth and softtabstop settings are changed to their default(2). In my vimrc they are set to 3. This does not happen when I edit C files, only ruby files. It was not a problem before I upgraded. Anyone know what the problem is and how to fix/debug it?

BTW: I do not use gVim.

https://redd.it/kwdlme
@r_vim

Читать полностью…

r_vim

Ultisnips: Placeholders that disappear if not used

So this is not really a vim question, but I'm not sure where else to put it. It doesn't seem like UltiSnips issues on github has a lot of traffic.

This is a common pattern I'd like to use in UltiSnips:

When, for example, defining a class in C++, I'd like a tab stop to inherit. However, if it inherits nothing, then the colon should disappear. For example:

// Cursor is represented by $
// type:
class$

// Press tab. Expands to:
class $ : {
// etc
}

// Type class name. Press tab.
class Foo : $ {
// etc
}

// At this point, I can type what it inherits, then press tab.
class Foo : public Bar {
$
// etc
}

// However, if I pressed tab without typing anything, it should expand to this:
class Foo {
$
// etc
}

This is a common pattern. Change the existing text depending on what's typed in to the tab stop.

https://redd.it/kw7cha
@r_vim

Читать полностью…

r_vim

Vimwiki <Leader>whh doesn't work :(

It's my first time trying out Vimwiki and I can't open my notes in the browser, running :Vimwiki2HTMLBrowse doesn't show any error messages, but doesn't open anything either... Any ideas of what might be causing this?

https://redd.it/kvzsib
@r_vim

Читать полностью…

r_vim

How the heck do Vim colors chemes work

I've been tinkering with this for two days now and I can't get it right.

I used terminal.sexy to make a color scheme for iTerm2, and Vim seems to be inheriting that color scheme, which is exactly what I want, but the colors are wrong.

Here is what I should be getting: https://ibb.co/XX5XBPL


And here is what I'm getting in Vim: https://ibb.co/8gDY34S

I have iTerm2 set to xterm-256color and the only color related setting in my .vimrc is syntax. If I look in the ANSI colors section in the iTerm2 Profiles tab, I can see that the colors there ARE correct from what I see on terminal.sexy, so I really don't know what's going wrong. It's like Vim is putting the colors in the wrong places? Like, on terminal.sexy the comments are a dark gray color, but on Vim it's using cyan.

Thanks in advance.

https://redd.it/kvvc7y
@r_vim

Читать полностью…

r_vim

hhow do i make my vim better i literally dont understand any yt tutorials

&#x200B;

i just want my vim to have different background color and the :set number command to always stay there whenever i open a vim file and not to have write it again everytime i open a vim file

https://redd.it/kvobd2
@r_vim

Читать полностью…

r_vim

Some front-end developers here?

Hello people, I'm curious if you are reading this and you are also a front-end can you share some tips or your vimrc? I'm in the mood of adding new things to my workflow :)
thanks a lot!

https://redd.it/kvlp56
@r_vim

Читать полностью…

r_vim

VIM Daily Tips on LinkedIn??

hey guys , linkedin has been improving alot and been getting alot of attention. Henceforth i have decided to put daily vim tips and tricks content on linkedin.




https://preview.redd.it/6un8ab4gxsa61.png?width=552&amp;format=png&amp;auto=webp&amp;s=f7b1c436d4eb87647339d1926145629c68942a36




https://preview.redd.it/aqejp1whxsa61.png?width=552&amp;format=png&amp;auto=webp&amp;s=e11700a83a9b257b279509eb038c5a65dc76877c

&#x200B;

i know alot of us check linkedin alot hence why not learn something while ur checking your stuff on linkedin :>

&#x200B;

here is my linkedin : https://www.linkedin.com/in/mnkhod/

&#x200B;

oh and if u believe there is anything to fix in this post please feel free to criticize

https://redd.it/kvgv4s
@r_vim

Читать полностью…

r_vim

Vim has been bugging and I don't know what is causing it.

Everything started when I installed Ale (plugging) in order to solve some issues with the coc.vim linter (it worked!), but with Ale, after I tried to change the diagnostics' icons, vim started bugging and now it freezes randomly when I type, for a few milliseconds. for example, imaging you pressed three times the right arrow to move and it only moves 2 spaces but after 0.5 seconds it moved the missing one. The issues are not only with the arrows but when typing the letters also get stuck, etc... I've tried using again coc.vim and even reinstalling vim 2 times (purging it two times and removing both the \~/.vim and \~/.vimrc) but with no avail. Vim is still bugging me.

Since this is so frustrating I've been thinking about using NeoVim to see if this solves the stupid issue, but for the next couple of hours, I will stick around with vim.

&#x200B;

Any ideas of what might be causing this?

&#x200B;

Thanks in advance!

&#x200B;

Extra info:

\+ OS: Ubuntu 20.10

\+ Vim: Vi IMproved 8.2

\+ My .vimrc: https://pastebin.com/faEmxtce

https://redd.it/kve1c9
@r_vim

Читать полностью…

r_vim

Using R Markdown with vimwiki?

I know it's possible to use markdown with vimwiki but what about R markdown?

https://redd.it/kv90i2
@r_vim

Читать полностью…

r_vim

spelllang not always working

Hello, haven't been using vim in a while but last night I had to write something in latex (which, even thought I'm a complete noob, with a wiki it still does get the job done), and time ago I set up a nice vim environment to ease the work and blah blah, not really the point.

So yesterday night I wanted to enable spellcheck to make sure I didn't make any too obviously stupid mistake, the procedure I follow is:

:set spelllang=it
:set spell

Now, I have vim ariline installed, which is pretty useful and goes on to display something along the lines of "SPELL[IT\]", yesterday it worked like a charm.

Today however, for whatever reason this same exact procedure does not work, what I get is just "SPELL", however it does nothing.

I haven't installed any spellfile, and I'm pretty sure that vim just downloads the file when I set the spelllang or when I turn spell on, maybe there is something wrong with that? I do not get any error, not sure if I'm supposed to either.

https://redd.it/kv4pkp
@r_vim

Читать полностью…

r_vim

Determining Which Program is Running :Terminal

I would like to customize a few key binds when I open a :terminal buffer. For example, I'd like to have <ESC> continue to return me from insert to normal mode. However, I'm also using terminal programs like fzf for which I would do not want to customize the <ESC> key behavior.

Does anyone know how to determine which program a :terminal buffer is interacting with?

https://redd.it/kv386x
@r_vim

Читать полностью…

r_vim

Opening split without changing :pw

Hey Vimmers.

I'm pretty new to vim, but trying to make the switch permanent.

I am not sure if this is possible, but i'd like to use splits without having to then manually change the pwd back with `:cd ...`. At the moment when I open a split, it changes the `pw` to that of the file i just opened, rather than the directory that i opened vim in - I find this really frustating.

Thanks. :)

https://redd.it/kwm3ou
@r_vim

Читать полностью…

r_vim

Looking for a video of a VIM expert at full speed?

Is there any videos of a VIM expert using VIM at full speed? Not a tutorial, but just someone live coding/editing at full speed in VIM.

I just think it would be neat to watch an expert at full speed using VIM for like 10 minutes.

https://redd.it/kwjxp4
@r_vim

Читать полностью…

r_vim

Language Server | Seeking help before I spend nights digging.

Hello,

I have been using different language server protocol clients and plugins for different languages, recently I tried to configure vim lsp for Java and found out I was using too many different plugins that implement lsp/ide features; as listed in [https://github.com/dense-analysis/ale](https://github.com/dense-analysis/ale)


1. [Linting](https://github.com/dense-analysis/ale#usage-linting)
2. [Fixing](https://github.com/dense-analysis/ale#usage-fixing)
3. [Completion](https://github.com/dense-analysis/ale#usage-completion)
4. [Go To Definition](https://github.com/dense-analysis/ale#usage-go-to-definition)
5. [Find References](https://github.com/dense-analysis/ale#usage-find-references)
6. [Hovering](https://github.com/dense-analysis/ale#usage-hover)
7. [Symbol Search](https://github.com/dense-analysis/ale#usage-symbol-search)

I am currently mixing:

* [https://github.com/dense-analysis/ale](https://github.com/dense-analysis/ale) for linting and fixing python/javascript/golang/terraform/ansible
* [https://github.com/natebosch/vim-lsc](https://github.com/natebosch/vim-lsc) for autocompleting on Java
* [https://github.com/prabirshrestha/vim-lsp](https://github.com/prabirshrestha/vim-lsp) and its tools [https://github.com/prabirshrestha/asyncomplete-lsp.vim](https://github.com/prabirshrestha/asyncomplete-lsp.vim) and [https://github.com/mattn/vim-lsp-settings](https://github.com/mattn/vim-lsp-settings) for autocompleting on python, terraform, ansible, jsonnet and toggling help.

I tried coc and found it way too complicated to get started with, if you have any links or personal experience of easily configurable lsp for vim.

I would like to keep it tidy and as such I am wondering how did you end up configuring for different languages, and tools.

https://redd.it/kwgz9c
@r_vim

Читать полностью…

r_vim

How to map command based on whether dir is a Git dir or not

So I want <Leader>e to run :GFiles if the working dir is git-tracked, or else run :Files. How can I achieve this?

https://redd.it/kwexwg
@r_vim

Читать полностью…

r_vim

Vim-Block-Paste: Insert visual-block to anywhere!

&#x200B;

You can insert visual-block to anywhere!

https://github.com/Rasukarusan/vim-block-paste

https://redd.it/kwdzd8
@r_vim

Читать полностью…

r_vim

Paste from Terminal-Normal

When I first started using :terminal, I found it awkward because it was so unvimlike. I couldn't manipulate text or other things that I find useful in repl environments. All text manipulation must be done in Terminal-Job mode (akin to insert mode) and vim commands are invoked through a Ctrl-W leader that makes it feel more like emacs than vim.

Being able to paste text to the command line was my first major step toward comfort in :terminal. In short, it's like so:

function! s:SendRegisterToTerm()
call term_sendkeys('', getreg(v:register))

" UNFORTUNATELY: Vim doesn't update from job when in Terminal-Normal, so
" we won't see our paste until we enter Terminal-Job to see our pasted
" text. Unfortunately, we can't just feedkeys("A\<C-w>N") to do that,
" because vim needs to do an update in Terminal-Job.
endf

augroup dddbbb_terminal
au!
au TerminalWinOpen * nnoremap <buffer> p :<C-u>call <sid>SendRegisterToTerm()<CR>
augroup END


[More flexible and backwards-compatible version here](https://github.com/idbrii/daveconfig/blob/840f1d3/multi/vim/plugin/config_terminal.vim#L11-L55).

This mapping differs from solutions like [reply.vim](https://github.com/rhysd/reply.vim) because I feel like having two buffers increases the mental overhead: selecting text in the scratch buffer and sending it to the job buffer is a different paradigm but pasting in a buffer is old hat. Of course, repl plugins can be very useful for more interactive situations. I use this put method mostly to grab some long text that I don't want to type.

What changes have you made to make Terminal-Normal feel more like home?

https://redd.it/kw51ah
@r_vim

Читать полностью…

r_vim

.ini~ and .ini.un~

Whenever I edit a file and save with :wq, two files are produced, [filename\].ini\~, and [filename\].ini.un\~. Why is this, and how can I stop it?

https://redd.it/kvv24o
@r_vim

Читать полностью…

r_vim

How I can hide content of function(like arrow down and right) with no plugin ?

&#x200B;

https://preview.redd.it/t9pp8dpscwa61.png?width=1920&amp;format=png&amp;auto=webp&amp;s=74a8a9609e8cef09f0e08009b46bf9d328d5aa32

https://redd.it/kvqxzx
@r_vim

Читать полностью…

r_vim

Why does my `errorfmt` doesn’t jump to erroneous line?

Hello! I hope it’s the right place to ask questions.

The `flex` version I’m using has error messages that look like this:

calc.y:93.7-10: error: symbol ‘name’ is used, but is not defined as a token and has no rules

So I created the following `errorformat` (set via an `autocommand`):

set errorformat+=%f:%l.%v-%*\\d:\ %t%s:\ %m

It looks like it’s correctly working, since when I do `:make`, then `:copen` correctly displays (with `calc.y` in blue, `93 col 7` in yellow and `error` in red).

calc.y|93 col 7 error| symbol ‘name’ is used, but is not defined as a token and has no rules

However, `:cnext` will **not** jump to the right line (only to the top of `calc.y`).

https://redd.it/kvook2
@r_vim

Читать полностью…

r_vim

Tricks

Hey guys. I've recently gotten into vim and I've really liked the versatility of it. I'm trying to learn all the little shortcuts and mappings the best I can. What are some of the shortcuts or tricks that are most helpful for you guys?

https://redd.it/kvjp3j
@r_vim

Читать полностью…

r_vim

Tips for using Vim for Python development

I usually do web development (primarily fullstack node apps) and have more recently become more interested in doing more with Python and I am really enjoying it. Right now I am trying out Jedi-vim and polyglot for syntax highlighting and they both seem to be working fairly well for me, but I was wondering if anyone had any tips or tricks for using vim to work with Python?

https://redd.it/kvcj4b
@r_vim

Читать полностью…

r_vim

xml schema (xsd) autocomplete/validation?

hello,
I've unfortunately found myself coding in xml. If I have an xsd file -- is there a way I can incorporate it into deoplete/ale for autocomplete/validation? I'm willing to switch to other plugins if necessary!

google seems to be failing me here... lots of options for ides but not much for vim.

thanks!

https://redd.it/kvck5f
@r_vim

Читать полностью…

r_vim

Why my buffers aren't sort in numerical order ?

Just like the title says. Every video/article I see explaining buffers, they always have the buffers in ascendant numerical order. For me the buffers just get assigned random numbers!! WHY?

https://preview.redd.it/ow95jt8i1ra61.png?width=445&amp;format=png&amp;auto=webp&amp;s=0361cd06d297a879189948c764a16f75a0eafe65

There's an example. My buffers go from 3 to 8 and then from 8 to 11. This makes buffer management super hard because they have random numbers and not a numerical order.

Does anyone know why this is happening ? Any idea to solve this ?

https://redd.it/kv95zw
@r_vim

Читать полностью…

r_vim

Arch TTY custom color scheme problem

Hey! So, I have an old thinkpad. Long story short, I've installed Arch on a flash drive and that's how I use it for now, and because the flash drive is only 4gB in size, I've made some compromises on things I've Installed, so I don't have Xorg at all. I run everything on the TTY, and have been configuring it the past year or so, making it comfy, efficient and as pretty as it can be. I mainly use tmux, vim and nnn.

I recently started creating some plugins for vim, and one of them is a very simple statusline. It's only 2.6kB in size. I'm almost done with it, but I have an issue. See, I'm trying to make it as nice looking as I can, trying to choose the best color combinations I can(from the 16 colors the 'linux' terminal supports) for each mode etc. My problem is, that for some reason, the "ctermbg" argument, doesnt use the "bright" colors of the TTY.

Now, I know that in the help pages, this is referenced (:h E421, 4946:52). But I find it weird, as I can use "echo -e '\e5;42m'" to achieve a bright background colour in the command line, and tmux also supports bright background colors for it's statusline, with no extra hassle. This proves to me that the 'linux' terminal supports bright background colors. My question is, do you guys know how I could achieve the bright background colors I want in vim in some way?

Any help is appreciated, and thanks in advance!

[
https://redd.it/kv4x8i
@r_vim

Читать полностью…

r_vim

Include default mappings in fzf.vim's fuzzy mapping search and default ex commands in :Commands

fzf.vim has a command which can be used to get a window in which you can fuzzy search for mappings:
`fzf#vim#maps({string})` where `{string}` represents a mode such as `"n"` or `"i"`. Unfortunately this doesn't include default mappings such as found in `:h index`. Which is a shame given that it would be really nice to be able to search for some mapping by description for instance when you know of the verb inner and a specific mappings which uses it such as inner quotes `i"` and you'd like to know if there's another inner command for the text object you're currently editing.

The same goes for fzf-vim's `:Commands` which only includes non-standard commands such as user defined commands and commands from plugins. But the weird thing is that fzf-vim does seem to parse these default commands:

function! s:format_cmd(line)
return substitute(a:line, '\C \([A-Z]\S*\) ',
\ '\=s:nbs.s:yellow(submatch(1), "Function").s:nbs', '')
endfunction

Of importance here is the `'\C \([A-Z]\S*\) '` regex, if you replace this with `'\C \([A-Za-z]\S*\) '` default commands are already included although not formatted properly which I unfortunately couldn't figure out how to. The `format_cmd` function is used in the following command (which is what the ex-command `:Commands` calls):


function! fzf#vim#commands(...)
redir => cout
silent command
redir END
let list = split(cout, "\n")
return s:fzf('commands', {
\ 'source': extend(extend(list[0:0], map(list[1:], 's:format_cmd(v:val)')), s:excmds()),
\ 'sink*': s:function('s:command_sink'),
\ 'options': '--ansi --expect '.get(g:, 'fzf_commands_expect', 'ctrl-x').
\ ' --tiebreak=index --header-lines 1 -x --prompt "Commands> " -n2,3,2..3 -d'.s:nbs}, a:000)
endfunction

Does anybody have any idea how to properly parse these help files and includes them in the default `fzf#vim#maps` and `fzf#vim#commands` functions or in a new custom command? My knowledge of fzf itself and the connection with vim is really lacking here.

For the mappings part it would be nice to be able to search for either the mapping itself (e.g. I know of some mappings using `g` and like to know more) or the description of a mapping (e.g. I'd like to extend something a highlighted area in visual mode).

Obviously you can just find all of this in `:h index` itself but I'd like to have this be as friction less as possible.

Thanks!

https://redd.it/kv0r1a
@r_vim

Читать полностью…
Subscribe to a channel