Questions tagged [vim]

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor.

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

Cannot use short cut key when current tab has a file opened in vim

My Windows Tabby terminal has the short cut keys Shift Left and Shift Right configured to go to the previous and next tabs. This works fine. Except when being on a tab that has a file opened under vim ...
user avatar
  • 163
0 votes
0 answers
14 views

Mac OS, How to run an executable that takes input in vim?

In competitive programming, we often have some small input we want to test our C++ program on. I already know of being able to remap some keys to make vim compile and run the executable. However, I am ...
user avatar
0 votes
0 answers
20 views

Vim Ex Command History Ctrl-F not working

I used to use Ctrl-F in my personal laptop to successfully get the command history pop-up in ex-mode but in my work PC, that no longer works. It just shows as ^F if I type Ctrl-F. Vim Version is 7.4....
user avatar
0 votes
1 answer
10 views

How to `Ctrl+C` copy to the system clipboard using vscodevim extension in vscode/codium without using the `v` mode's system clipboard register `"*y`?

I have already changed the Ctrl+Shift+C keybinding so that I do not enter a terminal when I press it, see Keybinding Ctrl + Shift + C opens a new external terminal in vscode/codium on Linux, how to ...
user avatar
0 votes
0 answers
16 views

How can I hide and show files easily in vim nerdtree?

I use vim for everything, and when in javascript, I want to ignore my node_modules directory, but reveal it when I need it. I've already applied the solution using NERDTreeIgnore, but that keeps it ...
user avatar
2 votes
0 answers
31 views

Odd characters typed when launching vi

On one of my WSL2 ubuntu 20.04 installations every time I launch vi/vim (vim.basic) I get extra characters :bfbf/bfbf/bfbf^G I have deleted my .vimrc, copied a .vimrc from another machine that works ...
user avatar
0 votes
1 answer
18 views

unix, vi editor, copy and paste, not pasting first lines

I am performing the below steps. Looks like I am not able to copy and paste into vi editor on unix with #!/bin/ksh as the first line. I pasted the code I need in but I do not see that in first line in ...
user avatar
  • 117
1 vote
1 answer
14 views

C-S-PageUp and C-S-PageDown keymappings stopped working in vim

I have these lines in my .vimrc which let me quickly move tabs around: nmap <C-S-PageUp> :-tabmove<CR> nmap <C-S-PageDown> :+tabmove<CR> I tested using other commands instead, ...
user avatar
  • 5,959
0 votes
1 answer
53 views

Why can't I find dart2native in the dart-sdk?

Some existing dart package documentation, such as dart_ctags, call on the flutter/dart developer to employ dart2native, but it's no where in current dart or flutter sdks.
user avatar
1 vote
0 answers
22 views

Avoid indenting the next line of a list in a markdown file

NVIM version v0.6.1 Suppose I am writing a list in markdown and let's say that the cursor is on the item3. Now, doing o in normal mode or Enter in insert mode automatically indents the next line. + ...
user avatar
  • 143
1 vote
1 answer
20 views

Treat file as a different file type for syntax linting color purposes in Vim

I know there's a command to treat your current file as a different file type for linting / color purposes. Something like :set SomethingICantRemember='python' And it will change the colors of the ...
user avatar
  • 113
0 votes
1 answer
20 views

Running "zt" directly after opening a file in Vim

When opening a file from the command line while simultaneously specifying a line to jump to, e.g. like this: vim ./myfile +34 I also need to automatically scroll to the top as in doing zt command. I ...
user avatar
  • 103
0 votes
0 answers
32 views

vim-enhanced is install but visualextra is disabled?

env : centos7 installed vim : vim-filesystem-7.4.160-6.el7_6.x86_64 vim-minimal-7.4.160-6.el7_6.x86_64 vim-common-7.4.160-6.el7_6.x86_64 vim-enhanced-7.4.160-6.el7_6.x86_64 I wanted to use multi ...
user avatar
  • 117
0 votes
1 answer
50 views

Change Window Frame Color For Regedit, GVim, and other windows

I have been able to change many of the Window Frame colors to black using the following key: Computer\HKEY_CURRENT_USER\Control Panel\Colors and setting: WindowFrame 1 0 0 However, this does not ...
user avatar
1 vote
1 answer
99 views

How to start tmux without a status bar, and without modifying the config file?

Ordinarily, I like tmux with its status bar. However in vim with :term tmux I would like it to be started without. Hence, keeping the same config file, can some args could be used so tmux starts ...
user avatar
0 votes
1 answer
33 views

vim -- search and replace function call with type field

I have a tricky one. I have a bunch of function calls in my code, i.e. getproperty(mytype). I want to replace all of these with mytype.property A well crafted %s would make life easier. Many thanks. ...
user avatar
0 votes
0 answers
34 views

How to install gVim with GTK3, and fixing "gdk-frame-clock: layout continuously requested"

I tried to install gVim in my WSL 2 environment using sudo apt install vim-gtk3. Everything works well, but the following gdk-warning occurs when I resize a gVim window: I haven't seen any questions ...
user avatar
0 votes
0 answers
24 views

Neovim - gf equivalent but for an adjacent, existing split

My typical workflow involves having a large "main" split, with a smaller split below for a terminal. When I get a stack trace, I'd like to be able to use gf to go to that location in the ...
user avatar
0 votes
1 answer
109 views

How can I use vim editor to write email in Alpine email program?

I am using the classic CLI Alpine email program, which by default uses the Pico editor for composing emails. Is there any way to use vim as editor?
user avatar
0 votes
1 answer
255 views

Ctrl+c/Ctrl+v/Ctrl+p not working on vim

I'm trying to make Ctrl+c, Ctrl+v and Ctrl+p work on vim, but it doesn't work as properly. I'm using Linux (Debian) My config files (.vimrc): ... map <C-p> "+P vnoremap <C-c> "+y ...
user avatar
1 vote
1 answer
146 views

Open text file on click in vim on windows terminal

I want to use Vim as my default text editor on Windows 10 (not gVim but the terminal version I installed on wsl). I already made the following setting via cmd.exe: >ftype txtfile txtfile=wt ...
user avatar
  • 113
0 votes
1 answer
158 views

How can I configure shortcut keys in all modes of vim?

I want to configure a shortcut key that can be used in both edit mode and normal mode, usually two commands are required: :nnoremap <C-s> :w<cr> :inoremap <C-s> <esc>:w<cr&...
user avatar
  • 101
0 votes
1 answer
25 views

vim: disable multi-line command input

When using vim, sometimes I end up in a state where entered commands (ones which are preceded by a : colon) are put in some kind of secondary buffer instead of being executed, and I have to exit from ...
user avatar
  • 131
0 votes
0 answers
61 views

How does vim set indentation for json files?

Other files, like .c, .cpp, .java, etc., I like to indent 4 spaces, but with only .json files, I like to indent 2 spaces. How can I configure vim for this purpose? I know it's possible to do :!%jq . ...
user avatar
  • 101
0 votes
0 answers
94 views

How to collapse all folders in netrw

I know I can collapse an individual folder in netrw file explorer by pressing enter but is there a shortcut to collapse all the folders at once? My vimrc settings for netrw currently looks like this: ...
user avatar
  • 1
0 votes
0 answers
46 views

Vim/Gvim is no more indenting XML (when entering text) in the way I want

Given a file with extension .xml, I used to indent my content as follows: <?xml version="1.0" encoding="UTF-8"?> <root> <p>This is a text containing <i&...
user avatar
1 vote
1 answer
150 views

Can I get sudo privilege while using vim? [duplicate]

So this happened a lot to me. I try to write a file that needs sudo privilege, but I didn't add sudo beforehand. For example, this time, the file is located in /Library/Google/Chrome/...
user avatar
  • 399
1 vote
1 answer
140 views

How can I write vim mappings to stdout?

I would like to write the output of :map to stdout from the vim cli so I can read my vim keymaps from a script and do something with them. How can I accomplish this? I've tried vim -c map > out.txt ...
user avatar
  • 1,191
0 votes
1 answer
127 views

Using vim to force write a file that has been modified on the file system

After interactively rebasing with git, I frequently find that a file I have open in vim has been modified on the file system. When I go to write the file with :w or :w!, I get the prompt WARNING: The ...
user avatar
0 votes
1 answer
227 views

Alt + arrow keys executing odd actions in vim, only in tmux

I recently noticed Alt (meta) + arrow keys in my vim executes certain actions, but only if in tmux for some reason. Alt+Left: Deletes 3 lines. Equivalent to vim d3d but works in INSERT mode. Alt+...
user avatar
  • 1
1 vote
0 answers
81 views

Moving the mouse cursor (not just screen) in vim

With my .vimrc under Linux I can scroll using my mouse wheel and the cursor itself goes up and down, shifting the lines shown on the screen if necessary. Using the same .vimrc and vim installed from ...
user avatar
  • 135
11 votes
1 answer
4k views

WSL issue, vi, vim and nano are unusable (empty terminal screen) (same isue with ubuntu 20 or debian on wsl)

I get a strange issue with ubuntu on wsl. When I want to modify a txt file on Ubuntu or Debian (via WSL in Windows), the content of the terminal empties and I see nothing (the content of the text file ...
user avatar
1 vote
0 answers
37 views

Is there a way to this unix Vim task in less than 10 keypresses(inlcuding ZZ)? [closed]

Task: In it your task is to change the text that gets opened in Vim to the following: // comments // yay comments // so informative, the information is really yes // wowowowowow // wel well // and ...
user avatar
  • 11
1 vote
1 answer
26 views

How to copy from vim in putty on windows (SSHed into a debian)

I am using vim on windows and I would like to copy text from a file. Nothing seems to work, not: selecting text ctrl + c ctrl + shift + c right click
user avatar
0 votes
1 answer
97 views

Vim config file empty

I want to permanently display line numbers so when i type: vim ~/.vimrc the config file is empty and it is marked as 'new'. I already tested vim it works perfectly but i don't know why the config ...
user avatar
0 votes
1 answer
58 views

Can't convert vim macro text to normal characters

I'm trying to save a vim macro that I wrote into my .vimrc file. I successfully recorded the macro into register s, the contents of which display as: .,.s/S:/\&AHOMW€kbW€kbE/:.,.s/\\/\//g'€kb0 I ...
user avatar
  • 315
0 votes
1 answer
41 views

Does Systemverilog color work for vi?

I've added the correct $display in Systemverilog to use colors in my log file. Looks great when I use 'more' but vi doesn't show the color. Is there a .vimrc setup file I need to define. I don't have ...
user avatar
0 votes
0 answers
24 views

can macros be recorded and executed in the vim terminal while showing output immediately?

Macro's recorded in the terminal don't seem to show output without (manually, not as part of the macro) doing something else in the terminal first. Take the macro resulting from typing qq i ls .[RET] [...
user avatar
0 votes
0 answers
108 views

Why does GNU Screen cause me to have to press Esc twice in Vim?

When I launch GNU Screen and then open Vim, to get out of "insert mode", I have to press the Escape key twice, whereas in Vim outside of Screen I only have to press it once. Why does this ...
user avatar
4 votes
2 answers
59 views

Is there a simple equivalent of :g/PATTERN/m0 that doesn't reverse the matched lines?

Occasionally I want to move all lines in a file to the top of that file. :g/PATTERN/m0 almost does what I want, but because :g operates one line at a time in order, it will also reverse the affected ...
user avatar
  • 498
0 votes
1 answer
221 views

Remove inoremap and cnoremap in Vim

I was trying to map key jk to Esc key in Vim. I didn't know about .vimrc at first. So I pasted these commands in vim in command mode as: :inoremap jk <Esc> :cnoremap jk <Esc> Then ...
user avatar
0 votes
0 answers
88 views

Is there a way to use RipGrep (or a similar tool) et all to search for a pattern, *but ignore results inside comments?*

I'm a regular user of RipGrep rg, but one thing I can never figure out, and regularly find myself wanting, is to search only in lines that aren't comments. Unfortunately, It doesn't look like that's ...
user avatar
  • 1,965
0 votes
0 answers
99 views

How to fix this screen tearing in Vim

I've been seeing this kind of screen tearing with Vim and some other programs. It's intermittent and I'm pretty sure it only happens when a program puts \r on it's stdout, I'm not sure if there's a ...
user avatar
  • 1
0 votes
0 answers
33 views

vim transplant color scheme from one host to another

I mostly use Vim on CentOS, but recently I have to use it on Ubuntu. Ubuntu Vim's default colorscheme is very different from that on CentOS. Besides, I customized a little color in CentOS Vim too. Now ...
user avatar
  • 2,546
2 votes
1 answer
91 views

Vim: z+enter does not bring the current line to the top, instead it's moved 5 lines from top

In VIM, normally, z+Enter will scroll the current line the cursor is on to the top of the screen (call it line 0). On RHEL8.4 z+Enter only brings the line close (to line 5) but not to the top. ...
user avatar
  • 21
0 votes
0 answers
41 views

gvim's backup setting not working

I installed gvim on win10 in D:\Vim. And I added the following set config in D:\Vim\_vimrc: set noundofile set nobackup nowritebackup And then :wq. However, this saved nobackup config still not ...
user avatar
  • 101
2 votes
1 answer
417 views

Windows cmd prompt and powershell have scrolling problems with vi editor when connecting by ssh to Linux system

I am trying to connect from my Windows laptop to a Linux system via ssh in the command prompt. (Tried powershell too.) If I try to use the vi editor, the screen cannot scroll properly. Many lines ...
user avatar
0 votes
0 answers
559 views

Image preview in vim

Is there a way to preview images in neovim? There is a feature like this in ranger (im using alacritty btw). I want to preview the image in vim insted of showing the text version of it. I think ranger ...
user avatar
  • 21
0 votes
0 answers
42 views

CTRL does not work in Konsole after upgrade to Debian 11

I've recently upgraded from Debian 10 to Debian 11. Everything mostly worked fine, but now the Konsole does forward any CTRL-key to the applications running anymore. I first thought it was a problem ...
user avatar
0 votes
1 answer
280 views

Mouse doesn't work on splits in Vim for WSL

I'm using Ubuntu on a Windows machine via WSL and Vim as my editor. I have set mouse=a active which works fine normally. However, when I do a :vsplit, the mouse isn't able to select the second split. ...
user avatar
  • 1

1
2 3 4 5
73