All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

GoToDefinition used to show result in a split window, but now uses buffer

I have this mapping in my .vimrc: nnoremap gd :YcmCompleter GoToDefinitionElseDeclaration nnoremap gf :tab split \| YcmCompleter GoToDefinition<CR> When I press gd, it writes the command :...
0
votes
0answers
7 views

how to mkview *.cpp file if and only if a fold is made within the file?

My init.vim code cd ~/Documents/cp set backupdir=~/Documents/cp/vimtmp// set directory=~/Documents/cp/vimtmp// set undodir=~/Documents/cp/vimtmp// set viewdir=~/Documents/cp/vimtmp// augroup ...
0
votes
1answer
11 views

Run another command if first command fails on keypress

Is it possible to combine the two commands map <F5> :w<CR>:exec '!python' shellescape(@%, 1)<CR> map <F6> :w<CR>:exec '!poetry run'<CR> so that when I press F5, it ...
0
votes
1answer
21 views

How to set a keybinding in Insert mode

I'm new to Vim, and I've read that a best practice in Vim is to begin a new Append with each line. In other words, instead of pressing <Enter>, it is more advisable to leave Insert mode, and ...
0
votes
0answers
13 views

How can I make vim recognize when to <Enter> on autocomplete?

Im using TabNine YCM fork vim plugin. I'm getting cool suggestions and all, but it's super annoying that it doesn't <Enter> when it should, instead, outputs NULL ASCII Code ^@ Is this related ...
0
votes
1answer
20 views

How can I open a split terminal with :term and then run a command in that terminal?

I'm trying to write a function to open a split terminal in Vim and then run the current file in that terminal. A non-working example trying to explain what I'm trying to do is function! Foo() :bel ...
0
votes
1answer
15 views

Cannot find implementation or library stub for module named “flask”

In a Python file, my first line is: from flask import Flask Which triggers an error in the gutter that shows the following message when I drag the cursor over that line: Cannot find implementation or ...
1
vote
0answers
12 views

Why does folding does't work for all perl files

I have 2 perl files opened in vim. A test file test.pl and another perl file Cbonusstat_TEC_bearb.pl. I made a session to save the environment. If I open vim with the session, the two files are loaded....
-3
votes
1answer
39 views

How to replace *_Apple to Apple using VI?

I need to replace multiple lines using vi. For example, any numbers_Apple to Apple 0001_Apple 0010_Apple 1021_Apple … 8383_Apple to Apple
1
vote
1answer
16 views

Wrapping text in environment vimtex

I use vimtex although I am by no means an expert in Vim, so it may be that I'm missing something obvious. Anyway, I am looking for functionality similar to that of 'cse, csc, csd' (which change the ...
0
votes
0answers
13 views

How to select a python interpreter in vim

I have multiple versions of python on my ubuntu system, python2.7 which is default one and i have installed python3.8. I have a python module installed in python3.8 which is not installed in python2.7....
0
votes
1answer
16 views

^G appears on my NERDTree

I am building my personal and little distro of vim. I've just installed few plugins using this installer: The vimrc file " encoding set encoding=utf-8 " Tabs and spaces set expandtab set ...
0
votes
1answer
12 views

YouCompleteMe doesn't complete functions from headers

After downloading YouCompleteMe from ubuntu repositories and installing it I have used this script as extra config. I suppose this config may help me with in-headers functions auto-completion. :...
0
votes
1answer
24 views

Why does the cursor advance to the next character?

I have nnoremap Y y$ in my .vimrc. If I type "*y$, my cursor stays in the same spot on a word. However if I type, "*Y, the cursor is advanced one character. Why is that?
0
votes
2answers
43 views

Function-local inner functions

These exist with lambdas function A() let B = { -> 'thing' } endfunction // B does no exist But the lambda returns a value and not a sequence of commands. (I know I could put execute("..&...
0
votes
1answer
12 views

How can I start a :terminal in terminal-normal mode?

I want to run an async command and when it completes open a terminal window. Since the opening is delayed, I don't want it to steal input from me, so the new window should be in Terminal-Normal mode. ...
0
votes
0answers
15 views

How to keep auto-indent after going to a newline [duplicate]

I have set autoindent in my vimrc at the moment, and it's working how I wanted. However, if I skip over a line that it has auto-indented, the indents are removed after I hit enter or move with the ...
0
votes
0answers
35 views

How can I automate closing empty buffers after opening a new file using nvim-tree?

When I open neovim, an empty buffer is shown with nvim-tree to the right. When I open any file, whether it's with :e or nvim-tree's mappings, the empty buffer remains open and a new one is opened with ...
0
votes
0answers
39 views

Neovim vs Emacs [closed]

Today I shared my screen with my teacher and she saw me using neovim to edit text and for programming. The exact time she saw I ran the neovim command to open a file, she immediately facepalmmed (she ...
0
votes
0answers
21 views

How to setup file tree icons

I wanted to add vim devicons support to Spacevim. I have installed nerdfonts by cloning the git repo and running ./install.sh. I am stuck at actually configuring the nerdfonts in spacevim. In the ...
1
vote
0answers
19 views

Stop vim triggering activity when swapping tmux windows

In my tmux config I have focus-events and monitor-activity enabled to detect any changes that occur in other windows. When I open a vim session in one window and switch to another window, a focus ...
0
votes
1answer
31 views

How to execute a macro until we encounter a character

How can I repeat the execution of a macro until a character is encountered? For example (just an example, it's not the original problem I want you to solve) I want to convert a CAPITAL_CAMEL_CASE to ...
1
vote
0answers
23 views

Neovim rplugin: why does vim.async_call(print, “msg”) not echo?

In a traditional :python3 plugin, I can call print("msg") to echo a message. In a remote plugin function, I expect that calling vim.async_call(print, "msg") would do this same ...
0
votes
2answers
59 views

How to uninstall a plugin in Vim 8?

On Linux, how to uninstall a plugin in Vim 8 other than removing the plugin code using a Linux command line rm command? That is to say, is there a way to remove a plugin while in a Vim 8 session and (...
1
vote
1answer
157 views

Why does this vim command fail?

I'm trying to process large error logs and part of that is filtering out lines I don't need to see. Here's what I'm running in vim: :g/.*rsync: stat.*/d | %s/\(.*mkstemp "\)\(.* \/\)\(.*$\)/\2/ | ...
1
vote
2answers
43 views

Piping buffer through a command, handling failure gracefully

I want to be able to lint my code from within vim, using tools like clang-format and yapf and I'd rather do this without installing a more complex plugin. I can pipe the current buffer through a text ...
1
vote
1answer
24 views

how to tabdo all the visible buffers without changing the current tab?

My init.vim code: cd ~/Documents/cp nnoremap <leader>lcd :tabdo lcd %:p:h<cr> suppose, i have 4 tabs opened in nvim via using nvim -p A.cpp B.cpp C.cpp D.cpp A.cpp B.cpp C.cpp D.cpp ...
1
vote
2answers
36 views

How to syntax-highlight part of a file in a foreign language?

Using set syntax=lang we can override syntax highlighting of current buffer with lang. Suppose we're editing a Bash script and some string variables are actually HTML code. How to force vim to use ...
1
vote
1answer
50 views

Neovim: How to start developing python plugins which run long-blocking code?

EDIT2: A user suggested that I may be going about this in a fundamentally wrong way, in particular in that I am not using remote (new-style) plugins and am trying to use async python code where it ...
0
votes
0answers
24 views

Joining lines on Vim removes random characters [duplicate]

I have just noticed on my version of Vim (vim-tiny package on FreeBSD) VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul 5 2021 16:53:06) Included patches: 1-3081 Compiled by root@130amd64-quarterly-...
0
votes
1answer
43 views

Always show top bar with files names

When I open more than one tab, in the top appears a bar with the names of the focused files: but when I close the second tab the bar disappears: How can I keep that top bar always open? I also want ...
1
vote
1answer
62 views

Replace two forward slashes with one using escape? [duplicate]

I am new to VI. How do you replace two forward slashes with one globally? I did: :%s/\// and :%/\//\/g Those don't work as desired. Example or Goal //This is good//because it//works; //on every//...
1
vote
0answers
66 views

Using Vim as a syntax highlighting tool - Python and TeX interface

I am trying to modify Vim's syntax highlighting rules for Python to suit specific needs : in particular, I need to capture all the line after some regexps (^Out [.*]: and ^\h\w*Error:). After some ...
0
votes
0answers
33 views

How do I make sure terminal vim has syntax highlighting with 'cursorline' and 'termguicolors'?

I searched this issue on the web to no avail and it's most likely not here too. The issue I'm facing goes like this I am trying to switch to vim since I find it cool. I was writing my vimrc and ...
1
vote
3answers
190 views

Can I open a file using the index shown by “:scriptnames”?

I am wondering how to open a file or load it into a buffer using the index shown by :scriptnames? 23: /usr/share/vim/vim80/plugin/tarPlugin.vim 24: /usr/share/vim/vim80/plugin/tohtml.vim 25: /usr/...
-1
votes
1answer
87 views

How can i write the keymap by lua table with simple function

the simple why to remap key in lua is: vim.api.nvim_set_keymap('n', 'foo', 'bar', { noremap = true, silent = true }) but i want a simple syntax like vimScript: nnoremap foo bar n_keymap('foo','bar') ...
0
votes
1answer
23 views

set a default value to a command that acccepts two arguments?

I often need to delineate "sections" of source code files using a comment character to create horizontal lines. For example if I wanted to draw such a line in a python file I could do :Hline ...
0
votes
2answers
29 views

using EasyAlign in a function

I frequently use EasyAlign in my tex files to align tables around the $ delimiter such that this header1 & header2 & header3 \\ data1 & data2 & data3 \\ becomes this header1 & ...
0
votes
1answer
32 views

Vim locks up completely when pressing `ctrl+w` while using tmux + vim

I have a tmux + vim setup in which I use split panes. Every time I press ctrl+w to move between the vim panes, my vim instance becomes completely unresponsive. At first I thought this was a tmux issue ...
1
vote
1answer
49 views

How to pass a shell command to a vim function and execute it in the neovim terminal?

I've recently switched to neovim (NVIM v0.4.4) from vim. Previously in my .vimrc file I had these two mappings that allowed me to run javascript and c++ files inside vim. nnoremap <f4> :!node %&...
1
vote
1answer
48 views

Redirect output to a persistent window that respect window layout

So this is a continuation of my adventures into creating my first plugin ;-) Today's issue is that I want to execute some shell command, and redirect the output to a separate window that respects my ...
1
vote
1answer
37 views

Character level buffer modification

It is possible to modify buffer at the line granularity. E.g. :py3 vim.current.buffer[0] = "abc". But it deletes the attached marks even if a single character is replaced. Is it possible to ...
0
votes
1answer
50 views

smart single or multiple character deletion of x

I want vim to ignore whitespace copy Default cut x will work same but When i cut one whitespace character or a visual block of whitespaces with x, vim register won't copy like this thread, Vim ...
-1
votes
0answers
23 views

To show in vim, which lines of working file are changed on disk

related to this thread, How can vim tell me which buffer is changed on disk among multiple buffers? My vimrc code set autoread autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | ...
0
votes
0answers
17 views

Use vim locally to access GNU R in docker-container

Disclaimer: I posted part of this question here with a focus on how to use Emacs+ESS, but a solution with vim or neovim is also of interest to me. I'm using Debian Stable (currently Buster) to do my ...
0
votes
0answers
17 views

Does vim have support for processing its comma-separated options?

Vim has comma-separated dictionary options like 'comments' and 'listchars': :set comments? comments=s:--[[,m: ,e:]],:-- :set listchars? listchars=tab:⇥ ,trail:␣,extends:⇉,precedes:⇇,nbsp:⚭ Commas ...
1
vote
0answers
41 views

Cricle through brackets mapping

I'm using bracket a lot and I'm trying to quickly circle through the bracket in both back and forth with the following mapping: nnoremap 0 f) nnoremap 9 F( Unfortunately, it does not work. Any ...
2
votes
1answer
60 views

remove from comma-separated option (listchars)?

I don't do tabs, so usually my listchars=tab:▸ ,nbsp:␠,trail:·,precedes:«,extends:» But it gets annoying with some sources. I'd like to subtract tab: from lcs in some filetypes. I've tried setlocal ...
2
votes
4answers
68 views

How to open current directory in File Explorer by vim?

The problem is solved My purpose is that: I use vim to edit my m-file and debug it in Matlab. There is no easy-to-use interface plugin between vim and Matlab in Win10. So I just edit m-file in vim ...
0
votes
0answers
18 views

how can i define g:errorMessageString as a List?

related to this thread Multiple error messages in vim message history How can i define g:errorMessageString as a List? Can anyone help me fix this? i am using this code in my vimrc but i don't know ...

15 30 50 per page
1
2 3 4 5
225