Colors – Solarized, with red marks remaining at the end of the lines in vim

I use vim with the solarized dark color scheme in the Windows subsystem for Linux. Solarized looks great except for a weird feature. When I scroll down and then up again in a VIM file, the blank area at the ends of the lines that were hidden when scrolling down is highlighted in a distracting red color.

image

I have an incomplete workaround. Run through :set background=dark The red mark disappears temporarily in Vim, but I'm looking for a more permanent solution.

Here is the relevant section from me .vimrc File:

 syntax enable
 set background=dark
 let g:solarized_termcolors=256
 colorscheme solarized 

I installed vim from the dispute repository / vim color solarization using manual installation. Any help would be appreciated.

linux – Get a flag from vim commands by reading the strace output [CTF]

For clarification, I am currently working on a CTF challenge, which is to run a strash for a bash script that executes vim commands with commands such as vim -c ":! Cat flag.txt" in a bash script. For the sake of clarity, this idea was heavily inspired by a CTF that I did recently. Here's a description of what she looked like and what you did if you want to see what I'm really up to (https://github.com/Dvd848) /CTFs/blob/master/2019_36C3_Junior/tracer.md). I'm not quite sure how to get the correct output of the vim commands to obscure the flag. I want every keystroke to be recognized as read and write, but I haven't found a solid approach to do it properly. Any suggestions would be greatly appreciated. Essentially, there would be a strace output where the flag could be written with vim. I am not 100% sure that this can be done correctly by bash at all, so any suggestions would be very helpful!

VIM is missing something – ask Ubuntu

I am new to VIM. When I start it from the terminal, the following error message is displayed:
Error processing /home/Rob/.vimrc detected:
Line 28:
E492: No editor command: Plugin & # 39; vim-pandoc / vim-rmarkdown & # 39;
vim-llp: Python required

It still seems to be running, but I don't really do much with it, so I'm sure that I don't yet come across the error. What should I repair and how?

Thanks a lot!

vimscript – Vim. Show the contents of the register in a sidebar

I wrote a Vimscript for learning purposes. The script shows the content of tabs in a sidebar by querying all tabs regularly and redrawing the sidebar when changes occur. I would like to receive an evaluation.

My Vim Version is 8.0,

I know the latest version and some features that can be useful in this script, such as deletebufline (), but I decided to stick to a more general version.

At this moment I am using this script as follows:

  1. Open source file show_regs.vim,
  2. Do a :so % | Showreg Command.

It can also be converted to a plugin and put in an autoload directory, I think.

The script can execute three commands:

  1. Showreg – Creates the sidebar
  2. Unshowreg – Removes the side bar
  3. Cleanregs – cleans all numbered and labeled registers.

function! s:Update_reg_dict(timer)
    " If the register's bar was deleted manually,
    " stop update function's timer and remove all script's variables 
    if !buflisted(s:buf_name)
        call s:Unshow_reg_bar()
        return
    endif

    let l:flag = 0
    " The previous highlight dictionary should be discarded every time
    let s:highlght = {}

    " Comparison of current register values with stored in the dictionary
    for (l:key, l:val) in items(s:reg_dict)
        let l:new_val = strtrans(getreg(l:key))
        if l:val !=# l:new_val
            let s:reg_dict(l:key) = l:new_val
            " Adds a changed register to the highlight dictionary
            let s:highlght(l:key) = '*'
            let l:flag = 1
        endif
    endfor
    " if any register was changed, rewrite a bar
    if l:flag
        call s:Write_reg_dict_to_bar()
    endif
endfunction

function! s:Create_reg_bar()
    " if the register's bar doesn't exist
    if buflisted(s:buf_name)
        return
    endif

    execute 'rightbelow ' s:reg_bar_size.'vnew' s:buf_name

    set winfixwidth
    set nonu
    set nowrap

    " A changed registers highlight color
    highlight MyGroup ctermbg=green
    " Special characters colorizing
    highlight Escaped_chars ctermfg=blue

    call matchadd('MyGroup', '^*".')
    call matchadd('Escaped_chars', '^((ICWLPMV@H)')

    execute 'wincmd p'
endfunction

function! s:Write_reg_dict_to_bar()
    let l:num = 1
    for l:key in split(s:reg_names, 'zs')
        let l:val = s:reg_dict(l:key)
        if l:val != ''
            " If a register was changed, then put a mark '*' to the beginning of line
            let l:mark = get(s:highlght, l:key, ' ')
            call setbufline(s:buf_name, l:num, printf('%s"%s| %s', l:mark, l:key, l:val))
            let l:num += 1
        endif
    endfor
    " Clean up all unneeded lines, which are left from the previous update
    " vim 8.1 has a special delete function 'deletebufline()', but I use vim 8.0
    while l:num < len(s:reg_dict)
        call setbufline(s:buf_name, l:num, '')
        let l:num += 1
    endwhile

endfunction

function! s:Create_reg_dict()
    if exists('s:reg_dict')
        return
    endif

    let s:reg_dict = {}

    for l:char in split(s:reg_names(1:), 'zs')
        " 'strtrans' is used to make register content printable
        let s:reg_dict(l:char) = strtrans(getreg(l:char))
    endfor
    " Unnamed register should be treated separately
    let s:reg_dict('"') = strtrans(getreg(''))
endfunction

function! s:Unshow_reg_bar()
    if !exists('s:reg_dict')
        return
    endif

    if buflisted(s:buf_name)
        execute 'bdelete!' s:buf_name
    endif

    call s:Timer_stop()
    " Cleaning up of script's variables scope
    for l:variable in keys(s:)
        execute 'unlet s:'.l:variable
    endfor

" Other way to clean
"       unlet s:buf_name
"       unlet s:reg_names
"       unlet s:reg_dict
"       unlet s:highlght
"       unlet s:timer
"       unlet s:reg_bar_size
"       unlet s:update_time
endfunction

function! s:Timer_start()
    let s:timer = timer_start(s:update_time, function('s:Update_reg_dict'), {'repeat': -1})
endfunction

function! s:Timer_stop()
    call timer_stop(s:timer)
endfunction

function! s:Clean_regs()
    if !exists('s:reg_dict')
        return
    endif

    " Only numbered and lettered registers are cleaned
    for l:char in split(s:reg_names(1:-7), 'zs')
        call setreg(l:char, '')
    endfor
endfunction

" Main function
function! s:Show_reg_bar(...)
    if exists('s:reg_dict')
        return
    endif

    let s:reg_bar_size = a:0 >= 1 ? a:1 : 30
    let s:update_time = 100
    let s:buf_name = 'reg_bar'
    let s:reg_names = '"0123456789abcdefghijklmnopqrstuvwxyz-.:%#/='
    let s:highlght = {}
    let s:timer = ''

    call s:Create_reg_bar()
    call s:Create_reg_dict()
    call s:Write_reg_dict_to_bar()
    call s:Timer_start()

endfunction

command! -nargs=* Showreg call s:Show_reg_bar()
command! Unshowreg call s:Unshow_reg_bar()
command! Cleanregs call s:Clean_regs()

demonstration

Enter the image description here

Package management – vim cannot be installed after upgrading from 04/16 to 04/18

Vim cannot be (re) installed after the upgrade due to some incompatibilities with the Python library:

(~) dave -> sudo apt install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 vim : Depends: libpython3.6 (>= 3.6.5) but it is not going to be installed
 E: Unable to correct problems, you have held broken packages.

How can I diagnose and correct the damaged packages?

I can see this version of libpython3.6 as a problem:

(~) dave-> sudo apt install libpython3.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpython3.6 : Depends: libpython3.6-stdlib (= 3.6.9-1~18.04) but 3.6.10-1+xenial1 is to be installed
E: Unable to correct problems, you have held broken packages.

But I don't know how to clean it up.

Running "Fix broken packages" in Synaptic didn't seem to do anything.

Vim cannot be used

I downloaded the latest version of Vim (which I use for Python programming) from their website. When I try to run it in the terminal, I get the following message:

vim: Error loading shared libraries: liblua5.2.so.0: Cannot open file with shared objects: No such file or directory

Any suggestions?

vim – Windows Ubuntu and Zathura

I am trying to set up Zathura on Windows 10 using Ubuntu as it is available in the Microsoft Store. I want to use Zathura as a PDF viewer when writing with vim / vimtex and am currently facing the problem:

Server cannot be initialized: Connection could not be established: Connection refused

(zathura: 10420): Gtk-WARNING **: 15: 58: 19.628: display cannot be opened: 0

This happens when I type zathura into an Ubuntu terminal. I am new to Ubuntu (and I am struggling with Ubuntu) and (only) did the following.

1) Download Ubuntu from the Microsoft Store

2) Open the terminal, enter vim and start vim successfully.

3) Get sudo-apt update

4) Sudo-Apt get Zathura

5) If you enter zathura, the error mentioned above is output.

I've been searching on Google for a few days, but I think my lack of knowledge of this technology has made it difficult to find a suitable solution.

terminal – Catalina: vim ignores highlighting vimrc syntax

I had a ~/.vimrc This worked fine with some basic syntax highlighting until I switched to Catalina. To run vim -V I see it loads my vimrc, but it totally ignores everything in it. When I run :so ~/.vimrc it also ignores it in vim, but when I execute vimrc's commands one by one, it accepts them.

How can I get vim to get my vimrc again?